Modélisé implicitement (la forme est complètement décrite par une équation) via Mathematica en utilisant des géométries de base et des opérations booléennes. Travail d'école pour la classe ME480 CAD 3DP de l'Université de Washington sur l'utilisation avancée de la modélisation 3D et de l'impression 3D.
La majeure partie du modèle est créée par une addition booléenne d'un ruban de Möbius à une sphère.
Le code du modèle utilisé dans Mathematica.
Le code de base est fourni avec l'aimable autorisation du professeur Mark Ganter.
(<)Joindre des valeurs booléennes.)
rejoignez-nous !, g] := Min[f, g]
(<)Coupe booléenne.)
coupé [f, g] := Max[f, -g]
(<)Traductions)
transX [f, s] := f /. x -> (x - s)
transY [f], s] := f /. y -> (y - s)
transZ[f, s] := f /. z -> (z - s)
(<)Roter.)
RotateRZ[f <-- Ça ne marche pas !], un] := f /. {x -> x}Cos[a] + ySin[a], y -> -xSin[a] + yCos[a}
RotateZ[f <], un] := rotateRZ[f, d2R[a]]
(<)Déclarer une géométrie primitive : Sphère.)
sphere[rad_] := x^2 + y^2 + z^2 - rad^2
(<)Déclarer une géométrie primitive : le ruban de Möbius -http://www.wolframalpha.com/input/?i=mobius+strip+Cartesian+equation)
Mobius[a_] := -a^2 y - 2 a x z + x^2 y - 2 x^2 z + y^3 - 2 y^2 z +
y z^2
(<)Création d'une géométrie : muckabout3)
muckabout3 = coupe[sphère[2.75], mobius[3]]
(<)Créer une géométrie : trasn2rotatma3)
rotatemuckabout3 = rotateZ[muckabout3, 180]
transrotatema3 = transY[rotatemuckabout3, -0.5]
trans2rotatema3 = transX[transrotatema3, 0.5]
(<)Création d'une géométrie : trans2rotatma13)
transrotatema13 = transY[muckabout3, 0.5]
trans2rotatema13 = transX[transrotatema13, -0.5]
(<)Réunir deux géométries ensemble.)
joinedmuckabout3 = join[trans2rotatema13, trans2rotatema3]
(<)Créer une géométrie : transrttma32)
muckabout32 = coupe[sphère[6], mobius[3]]
rotatemuckabout32 = rotateZ[muckabout32, 180]
transrotatema32 = transX[rotatemuckabout32, 3]
transrtransma32 = transY[transrotatema32, 1]
transrttma32 = transZ[transrtransma32, -2.75]
(<)Réunir deux géométries ensemble.)
joinmuck3s = join[joinedmuckabout3, transrttma32]
(<)Tracer le modèle pour une prévisualisation.)
plt = ContourPlot3D[joinmuck3s == 0, {x, -10, 10}, {y, -10, 10}, {z, -10, 10}
(<)Exportez votre modèle sous forme de fichier STL.)
Export ["ISMmodel1.stl", plt, "STL"]
L'équation ISM qui en résulte.
Max[-7.5625 + x^2 + y^2 + z^2, 9 y - x^2 y - y^3 + 6 x z + 2 x^2 z + 2 y^2 z - y z^2]
Max[-7.5625 + x^2 + y^2 + z^2, -9 y + x^2 y + y^3 - 6 x z + 2 x^2 z + 2 y^2 z + y z^2]
Max[-7.5625 + x^2 + (0.5 + y)^2 + z^2, -9 (0.5 + y) + x^2 (0.5 + y) + (0.5 + y)^3 - 6 x z + 2 x^2 z + 2 (0.5 + y)^2 z + (0.5 + y) z^2]
Max[-7.5625 + (-0.5 + x)^2 + (0.5 + y)^2 + z^2, -9 (0.5 + y) + (-0.5 + x)^2 (0.5 + y) + (0.5 + y)^3 - 6 (-0.5 + x) z + 2 (-0.5 + x)^2 z + 2 (0.5 + y)^2 z + (0.5 + y) z^2]
Max[-7.5625 + (0.5 + x)^2 + (-0.5 + y)^2 + z^2, 9 (-0.5 + y) - (0.5 + x)^2 (-0.5 + y) - (-0.5 + y)^3 + 6 (0.5 + x) z + 2 (0.5 + x)^2 z + 2 (-0.5 + y)^2 z - (-0.5 + y) z^2]
Min[Max[-7.5625 + (0.5 + x)^2 + (-0.5 + y)^2 + z^2, 9 (-0.5 + y) - (0.5 + x)^2 (-0.5 + y) - (-0.5 + y)^3 + 6 (0.5 + x) z + 2 (0.5 + x)^2 z - (-0.5 + y) z^2], Max[-7.5625 + (-0.5 + x)^2 + (0.5 + y)^2 + z^2, -9 (0.5 + y) + (-0.5 + x)^2 (0.5 + y) + (0.5 + y)^3 - 6
Max[-36 + (-3 + x)^2 + y^2 + z^2, -9 y + (-3 + x)^2 y + y^3 - 6 (-3 + x) z + 2 (-3 + x)^2 z + 2 y^2 z + y z^2]
Min[Max[-7.5625 + (0.5 + x)^2 + (-0.5 + y)^2 + z^2, 9 (-0.5 + y) - (0.5 + x)^2 (-0.5 + y) - (-0.5 + y)^3 + 6 (0.5 + x) z + 2 (0.5 + x)^2 z + 2 (-0.5 + y)^2 z - (-0.5 + y) z^2], Max[-7.5625 + (-0.5 + x)^2 + (0.5 + y)^2 + z^2, -9 (0.5 + y) + (-0.5 + x)^2 (0.5 + y)
Modellquelle
