How to approximate a surface that was cut using a condition function

Questions and answers regarding MathMod scripts basics
Post Reply
mathmod
Posts: 20
Joined: Mon Mar 25, 2019 9:06 am

How to approximate a surface that was cut using a condition function

Post by mathmod » Wed Jan 08, 2020 5:59 pm

The first script is for a Clebsch surface that was cut using a condition (sphere). The second script shows how you can export a mesh (volume) that approximate the surface generated by the first script.

Code: Select all

{
"Iso3D": {
"Cnd": [
"x*x+y*y+z*z-1<(0) "
],
"Component": [
"Clebsch"
],
"Fxyz": [
"81*(x^3+y^3+z^3)-189*(x^2*y+x^2*z+y^2*x+y^2*z+z^2*x+z^2*y) +54*x*y*z+126*(x*y+x*z+y*z)-9*(x^2+y^2+z^2)-9*(x+y+z)+1"
],
"Name": [
"Clebsch"
],
"Xmax": [
" 1"
],
"Xmin": [
"-1"
],
"Ymax": [
" 1"
],
"Ymin": [
"-1"
],
"Zmax": [
" 1"
],
"Zmin": [
"-1"
]
}
}

Code: Select all

{
"Iso3D": {
"Description": [
"Clebsch surface by Abderrahman Taha 18/05/2019"
],
"Name": [
"Clebsch_01"
],
"Component": [
"Clebsch"
],
"Const": [
"X=1",
"Y=1",
"Z=1",
"T=1/100",
"c=1/1000"
],
"Funct": [
"Clebsch =81*(x^3+y^3+z^3)-189*(x^2*y+x^2*z+y^2*x+y^2*z+z^2*x+z^2*y) +54*x*y*z+126*(x*y+x*z+y*z)-9*(x^2+y^2+z^2)-9*(x+y+z)+1 ",
"Condition = x*x+y*y+z*z-1<(0) ",
"DFx=((Clebsch(x+c,y,z,t)-Clebsch(x,y,z,t))/c)",
"DFy=((Clebsch(x,y+c,z,t)-Clebsch(x,y,z,t))/c)",
"DFz=((Clebsch(x,y,z+c,t)-Clebsch(x,y,z,t))/c)",
"Rapp=(x/sqrt(x*x+y*y+z*z))",
"Iso=Clebsch(x-t*Rapp(DFx(x,y,z,t),DFy(x,y,z,t),DFz(x,y,z,t),t) ,y-t*Rapp(DFy(x,y,z,t),DFx(x,y,z,t),DFz(x,y,z,t),t) ,z-t*Rapp(DFz(x,y,z,t),DFx(x,y,z,t),DFy(x,y,z,t),t) ,t)",
"Iso=if( Condition(x,y,z,t), Iso(x,y,z,T)*Iso(x,y,z,-T) , (1/2)*exp(Condition(x,y,z,t))) "
],
"Fxyz": [
"-Iso(x,y,z,t)"
],
"Xmax": [
" X"
],
"Xmin": [
"-X"
],
"Ymax": [
" Y"
],
"Ymin": [
"-Y"
],
"Zmax": [
" Z"
],
"Zmin": [
"-Z"
]
}
}
Attachments
2.jpg
2.jpg (253.11 KiB) Viewed 385 times
thumbnail.jpg
thumbnail.jpg (214.69 KiB) Viewed 385 times

Post Reply