|
|
problems withn 3d models
Posted:
Aug 10, 2012 2:41 AM
|
|
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]
|
|