HOME | DD

MathMod — Straw Torus

#mathematics #mathmod
Published: 2015-12-22 02:37:19 +0000 UTC; Views: 336; Favourites: 3; Downloads: 0
Redirect to original
Description

 

Mesh Torus (implicit surface)
This mathematical object (generated with MathMod), was inspired by some  integrated math functions in POV-Ray:  www.povray.org/
See also:  www.econym.demon.co.uk/isotut/…
Here it is the script of this object for MathMod 3.1 .
It has five parameters to configure the density of the mesh and it's composition.
The attached picture is for (A,B,C,D,E)= (.5, .3, 1, .1, 1)
MathMod script:
{
"Iso3D": {
"Description": ["Mesh Torus_01 by Abderrahman Taha 22/12/2015 . 
The mesh formula is from the PovRay team:  www.povray.org/"],
"Name": ["Mesh Torus_01"],
"Component": ["Mesh Torus"],
"Const": ["A = .5",
"B = .3",
"C = 1",
"D = .1",
"E = 1",
"th = pi / A",
"ph = pi/ B"],
"Funct": ["r = (x % (A * 2))",
"r = abs( if (r(x,y,z,t) < 0, r(x,y,z,t) + A, r(x,y,z,t) - A)) * C",
"r2 = (y - cos(z * ph) * D) * E",
"temp = -sqrt(r2(x,y,z,t) * r2(x,y,z,t) + r(x,y,z,t) * r(x,y,z,t))",
"r = ((x - A) % (A * 2))",
"r = abs(if (r(x,y,z,t) < 0, r(x,y,z,t) + A, r(x,y,z,t) - A)) * C",
"r2 = (y + cos(z * ph) * D) * E",
"temp = max(-sqrt(r2(x,y,z,t) * r2(x,y,z,t) + r(x,y,z,t) * r(x,y,z,t)), temp(x,y,z,t))",
"r = (z % (B * 2))",
"r = abs(if (r(x,y,z,t) < 0, r(x,y,z,t) + B, r(x,y,z,t) - B)) * C",
"r2 = (y + cos(x * th) * D) * E",
"temp = max(-sqrt(r2(x,y,z,t) * r2(x,y,z,t) + r(x,y,z,t) * r(x,y,z,t)), temp(x,y,z,t))",
"r = ((z- B) % (B * 2))",
"r = abs(if (r(x,y,z,t) < 0, r(x,y,z,t) + B, r(x,y,z,t) - B)) * C",
"r2 = (y - cos(x * th) * D) * E",
"fmesh0 = (-max(-sqrt(r2(x,y,z,t) * r2(x,y,z,t) + r(x,y,z,t) * r(x,y,z,t)), temp(x,y,z,t)))",
"fmesh1= -fmesh0(atan2(y,x),sqrt(x*x+y*y)-4,z,t) +0.08",
"fmesh2= fmesh1(sqrt(x*x+z*z)-7,y,2*atan2(z,x),t)"],
"Fxyz": [" fmesh2(x,y,z,t)"],
"Xmax": ["12"],
"Xmin": ["-12"],
"Ymax": ["5"],
"Ymin": ["-5"],
"Zmax": ["12"],
"Zmin": ["-12"]
}
}

Related content
Comments: 3

Schmiegel [2015-12-22 09:50:24 +0000 UTC]

Cool! Wouldn't believe it's an isosurface!
(The iso surface feature of POVRay is extremely powerful having that easy to use scriptability ...)

👍: 0 ⏩: 1

MathMod In reply to Schmiegel [2015-12-22 20:09:36 +0000 UTC]

I've just updated the description to include the script for MathMod 3.1
The next MathMod version will have this function as a predefined internal function, which make it far faster to render

👍: 0 ⏩: 1

Schmiegel In reply to MathMod [2015-12-23 13:04:00 +0000 UTC]

Thank you! Looking forward to the next release!

👍: 0 ⏩: 0