Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: problems withn 3d models
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
Roger Bagula

Posts: 101
Registered: 7/12/09
problems withn 3d models
Posted: Aug 10, 2012 2:41 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

The first problem is the 3ds files comes out invalid.
The second problem is that in obj files a phantom triangle
shows up.
And lastly the stl file appears to be empty.
It might just be my machine with an over worked
version 8 Mathematica,
but it might also be something wrong with my code?


Clear[x, y, z, f, g]
f[t_] = Sqrt[Abs[Sin[t]]]*Cos[t]^2;
g[t_] = Sqrt[Abs[Sin[t]]]*Sin[t]*Cos[t];
x = (1 - f[t]^2)/(1 + f[t]^2);
y = 2 f[t]/(1 + f[t]^2);
z = 2 g[t]/(1 + f[t]^2);
w = {x*(10 + Cos[p]), y*(10 + Cos[p + 2*Pi/3]),
z*(10 + Cos[p + 2*Pi/3])}
g1 = ParametricPlot3D[w, {t, 0, 2*Pi}, {p, 0, 2*Pi}, Axes -> None,
Boxed -> False, ViewPoint -> {10, 0, 0}, PlotPoints -> {64, 16},
Mesh -> False, ColorFunction -> "Rainbow"]
g2 = ParametricPlot3D[{-w[[1]], w[[2]], -w[[3]]} + {20, 0, 0}, {t, 0,
2*Pi}, {p, 0, 2*Pi}, Axes -> None, Boxed -> False,
ViewPoint -> {10, 0, 0}, PlotPoints -> {64, 16}, Mesh -> False,
ColorFunction -> "Rainbow", PlotRange -> All]
Show[{g1, g2}, PlotRange -> All]
b = Reverse[
Union[Flatten[
Table[{Blue,
Cylinder[{10*{x, y, z} /.
t -> 2*Pi*n/128, (10*{-x, y, -z} + {20, 0, 0}) /.
t -> 2*Pi*n/128}, 1/40]}, {n, 0, 127}]]]];
g3 = Show[Graphics3D[b], Boxed -> False, PlotRange -> All]
gw = Show[{g1, g2, g3}, PlotRange -> All]
Export["BB_strings.3ds", gw]
Export["BB_strings.obj", gw]
Export["BB_strings.stl", gw]




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.