HOME | DD
#3d #mathematics #mathmod
Published: 2015-08-25 01:59:37 +0000 UTC; Views: 653; Favourites: 1; Downloads: 2
Redirect to original
Description
Another result from the "Thickness generator" script and MathMod-3.1Related content
Comments: 9
Schmiegel [2015-08-25 08:17:27 +0000 UTC]
Just out of curiosity (and limited math skills):
Given the gyroid surface fills 3D space infinitely -
This seems to be a stack of gyroid surfaces that's limited by a torus. I'd be curious about a gyroid surface that's limited by a cylinder and that's bent to a torus then after clipping. Could MathMod do that?
👍: 0 ⏩: 3
MathMod In reply to Schmiegel [2015-11-23 01:00:31 +0000 UTC]
Hi,
Is this what you were looking for ? mathmod.deviantart.com/art/Gyr…
👍: 0 ⏩: 0
MathMod In reply to Schmiegel [2015-08-28 14:48:33 +0000 UTC]
OK, Maybe you're looking for something like this.
There is however a catch: when bending the cylinder to a Torus, the stretch function is not uniform and you can see this at the extreme positions along the y axis...
Maybe there is a better solution than mine...
{
"Iso3D": {
"Component": [
"PrettyBall_1",
"PrettyBall_2",
"PrettyBall_3"
],
"Const": [
"cx=0.0000000000001",
"cy=0.0000000000001",
"cz=0.0000000000001",
"xmax=8",
"xmin=-8",
"ymax=8",
"ymin=-8",
"zmax=8",
"zmin=-8"
],
"Description": [
"TicknessGenerator-1.0 by Abderrahman Taha 24/08/2015"
],
"Funct": [
"Iso=cos(x)*sin(y)+cos(y)*sin(z)+cos(z)*sin(x)",
"Tickness= (.9)",
"Tickness2= (.4)",
"DFx= ((Iso(x,y,z,t)-Iso(x+cx,y,z,t))/cx)",
"DFy= ((Iso(x,y,z,t)-Iso(x,y+cy,z,t))/cy)",
"DFz= ((Iso(x,y,z,t)-Iso(x,y,z+cz,t))/cz)",
"Rapport= (sqrt(DFx(x,y,z,t)*DFx(x,y,z,t)+DFy(x,y,z,t)*DFy(x,y,z,t)+DFz(x,y,z,t)*DFz(x,y,z,t)))",
"Iso3= (Iso(x-DFx(x,y,z,t)*Tickness(x,y,z,t)/Rapport(x,y,z,t),y-DFy(x,y,z,t)*Tickness(x,y,z,t)/Rapport(x,y,z,t),z-DFz(x,y,z,t)*Tickness(x,y,z,t)/Rapport(x,y,z,t),t))",
"Iso2= (Iso(x+DFx(x,y,z,t)*Tickness(x,y,z,t)/Rapport(x,y,z,t),y+DFy(x,y,z,t)*Tickness(x,y,z,t)/Rapport(x,y,z,t),z+DFz(x,y,z,t)*Tickness(x,y,z,t)/Rapport(x,y,z,t),t))",
"Iso4= (Iso(x-DFx(x,y,z,t)*Tickness2(x,y,z,t)/Rapport(x,y,z,t),y-DFy(x,y,z,t)*Tickness2(x,y,z,t)/Rapport(x,y,z,t),z-DFz(x,y,z,t)*Tickness2(x,y,z,t)/Rapport(x,y,z,t),t))",
"Iso5= (Iso(x+DFx(x,y,z,t)*Tickness2(x,y,z,t)/Rapport(x,y,z,t),y+DFy(x,y,z,t)*Tickness2(x,y,z,t)/Rapport(x,y,z,t),z+DFz(x,y,z,t)*Tickness2(x,y,z,t)/Rapport(x,y,z,t),t))",
"TickIso2= (Iso4(x,y,z,t)*Iso5(x,y,z,t))",
"isoCondition= (x^2+z^2-16)*(abs(y)<16)",
"isoTransform_1=if(isoCondition(x,y,z,t)<0,TickIso2(x,y,z,t),1)+exp(isoCondition(x,y,z,t)/3)",
"isoTransform_2=if(isoCondition(x,y,z,t)<0,Iso3(x,y,z,t),1)+exp(isoCondition(x,y,z,t)/3)",
"isoTransform_3=if(isoCondition(x,y,z,t)<0,-Iso2(x,y,z,t),1)+exp(isoCondition(x,y,z,t)/3)"
],
"Fxyz": [
"isoTransform_1((sqrt(x*x+y*y)-8),y,z,t)",
"isoTransform_2((sqrt(x*x+y*y)-8),y,z,t)",
"isoTransform_3((sqrt(x*x+y*y)-8),y,z,t)"
],
"Name": [
"TicknessGenerator"
],
"Xmax": [
"16",
"16",
"16"
],
"Xmin": [
"-16",
"-16",
"-16"
],
"Ymax": [
"16",
"16",
"16"
],
"Ymin": [
"-16",
"-16",
"-16"
],
"Zmax": [
"8",
"8",
"8"
],
"Zmin": [
"-8",
"-8",
"-8"
]
}
}
👍: 0 ⏩: 1
Schmiegel In reply to MathMod [2015-08-29 21:35:26 +0000 UTC]
Sorry for the late reply and thank you so much - I must give that a shot!
Unfortunately this is some kind of 'heavy meal' so that I didn't run it yet. Bear with me!
I'm willing to face the challenge soon!
👍: 0 ⏩: 0
MathMod In reply to Schmiegel [2015-08-25 19:20:15 +0000 UTC]
Thanks for pointing me to the mistake I made in the name of this object: It's a Gyroidal Torus not a Gyroidal Cylinder
Good question, I was also thinking how to achieve something similar.
The transformation you're looking for can be achieved with proper function.
This is a good starting point to achieve the transformation of bending a cylinder to Torus (and many other transformations)
this part of the script :
"isoTransform_*(x,y,z,t)"
should be converted to something like :
"isoTransform_*(tr1(x,y,z) ,tr2(x,y,z), tr3(x,y,z),t)"
for example, to scale the object along the axe x with a scale factor 9:
tr1(x,y,z) = x/9
tr2(x,y,z) = y
tr3(x,y,z) = z
I'll look for the proper transformation of binding a cylinder to Torus later.
{
"Iso3D": {
"Component": [
"PrettyBall_1",
"PrettyBall_2",
"PrettyBall_3"
],
"Const": [
"cx=0.0000000000001",
"cy=0.0000000000001",
"cz=0.0000000000001",
"xmax=8",
"xmin=-8",
"ymax=8",
"ymin=-8",
"zmax=8",
"zmin=-8"
],
"Description": [
"TicknessGenerator-1.0 by Abderrahman Taha 24/08/2015"
],
"Funct": [
"Iso=cos(x)*sin(y)+cos(y)*sin(z)+cos(z)*sin(x)",
"Tickness= (.9)",
"Tickness2= (.4)",
"DFx= ((Iso(x,y,z,t)-Iso(x+cx,y,z,t))/cx)",
"DFy= ((Iso(x,y,z,t)-Iso(x,y+cy,z,t))/cy)",
"DFz= ((Iso(x,y,z,t)-Iso(x,y,z+cz,t))/cz)",
"Rapport= (sqrt(DFx(x,y,z,t)*DFx(x,y,z,t)+DFy(x,y,z,t)*DFy(x,y,z,t)+DFz(x,y,z,t)*DFz(x,y,z,t)))",
"Iso3= (Iso(x-DFx(x,y,z,t)*Tickness(x,y,z,t)/Rapport(x,y,z,t),y-DFy(x,y,z,t)*Tickness(x,y,z,t)/Rapport(x,y,z,t),z-DFz(x,y,z,t)*Tickness(x,y,z,t)/Rapport(x,y,z,t),t))",
"Iso2= (Iso(x+DFx(x,y,z,t)*Tickness(x,y,z,t)/Rapport(x,y,z,t),y+DFy(x,y,z,t)*Tickness(x,y,z,t)/Rapport(x,y,z,t),z+DFz(x,y,z,t)*Tickness(x,y,z,t)/Rapport(x,y,z,t),t))",
"Iso4= (Iso(x-DFx(x,y,z,t)*Tickness2(x,y,z,t)/Rapport(x,y,z,t),y-DFy(x,y,z,t)*Tickness2(x,y,z,t)/Rapport(x,y,z,t),z-DFz(x,y,z,t)*Tickness2(x,y,z,t)/Rapport(x,y,z,t),t))",
"Iso5= (Iso(x+DFx(x,y,z,t)*Tickness2(x,y,z,t)/Rapport(x,y,z,t),y+DFy(x,y,z,t)*Tickness2(x,y,z,t)/Rapport(x,y,z,t),z+DFz(x,y,z,t)*Tickness2(x,y,z,t)/Rapport(x,y,z,t),t))",
"TickIso2= (Iso4(x,y,z,t)*Iso5(x,y,z,t))",
"isoCondition= (x^2+z^2-16)",
"isoTransform_1=if(isoCondition(x,y,z,t)<0,TickIso2(x,y,z,t),1)+exp(isoCondition(x,y,z,t)/3)",
"isoTransform_2=if(isoCondition(x,y,z,t)<0,Iso3(x,y,z,t),1)+exp(isoCondition(x,y,z,t)/3)",
"isoTransform_3=if(isoCondition(x,y,z,t)<0,-Iso2(x,y,z,t),1)+exp(isoCondition(x,y,z,t)/3)"
],
"Fxyz": [
"isoTransform_1(x,y,z,t)",
"isoTransform_2(x,y,z,t)",
"isoTransform_3(x,y,z,t)"
],
"Name": [
"TicknessGenerator"
],
"Xmax": [
"8",
"8",
"8"
],
"Xmin": [
"-8",
"-8",
"-8"
],
"Ymax": [
"8",
"8",
"8"
],
"Ymin": [
"-8",
"-8",
"-8"
],
"Zmax": [
"8",
"8",
"8"
],
"Zmin": [
"-8",
"-8",
"-8"
]
}
}
👍: 0 ⏩: 1
Schmiegel In reply to MathMod [2015-09-23 21:38:46 +0000 UTC]
Finally I found some tome to play with MathMod. Here's my first simple steps - I knew that K3DSurf could animate isosurfaces so I tried to recreate this Povray animation in MathMod. Here you go - hope you enjoy the show :
{
"Iso3D": {
"Component": [
" Animated Gyroid"
],
"Fxyz": [
"((cos(x + pi*t)*sin(y + pi*t)+cos(y + pi*t)*sin(z + pi*t)+cos(z + pi*t)*sin(x + pi*t))*(cos(x + pi*t)*sin(y + pi*t)+cos(y + pi*t)*sin(z + pi*t)+cos(z + pi*t)*sin(x + pi*t))) - 1 + 0.022 * (x*x + y*y + z*z)"
],
"Name": [
"GyroidAnim"
],
"Xmax": [
"7"
],
"Xmin": [
"-7"
],
"Ymax": [
"7"
],
"Ymin": [
"-7"
],
"Zmax": [
"7"
],
"Zmin": [
"-7"
]
}
}
Needs the grid to be increased a bit. Just using F(xyz)^2-d to generate thickness d - worked always for me.
Think clicking Anim plus Morph gives the best result.
👍: 0 ⏩: 1
MathMod In reply to Schmiegel [2015-09-24 00:21:51 +0000 UTC]
Very beautiful animation! Thanks
You can speed up the morph effect by making some variable changes and increase the grid to 50/60. I use this process a lot when playing with the morph effect. Here you have cos, sin functions that you can define as new variables parameters like this:
"Varu": [
"Cos=cos(u+pi*tm)",
"Sin=sin(u+pi*tm)",
"pw=u*u"
],
You can then change : "cos(x + pi*t)" by "Cosx" , "cos(y + pi*t)" by "Cosy"....
The complete modified script:
{
"Iso3D": {
"Component": [" Animated Gyroid"],
"Fxyz": ["((Cosx*Siny+Cosy*Sinz+Cosz*Sinx)*(Cosx*Siny+Cosy*Sinz+Cosz*Sinx))-1+0.022*(pwx+pwy+pwz)"],
"Name": ["GyroidAnim"],
"Varu": ["Cos=cos(u+pi*tm)",
"Sin=sin(u+pi*tm)",
"pw=u*u"],
"Xmax": ["7"],
"Xmin": ["-7"],
"Ymax": ["7"],
"Ymin": ["-7"],
"Zmax": ["7"],
"Zmin": ["-7"]
}
}
NB: when using new defined parameters, if you increase/decrease the grid resolution remember to always hit the "Run" button before lunching the morph effect
👍: 0 ⏩: 1
Schmiegel In reply to MathMod [2015-09-24 07:06:51 +0000 UTC]
Amazing - this appears to be even faster than my attempt!
👍: 0 ⏩: 0
























