I have the CDF version of the file that i need to 3D print, and because it wont let me convert to an STL format the normal way, how can i convert it.Is there a format i can convert it to, then open it in another software and 3D print from there?
-
$\begingroup$ Hard to say without any example code... $\endgroup$– Henrik SchumacherApr 22, 2018 at 20:41
-
3$\begingroup$ CDF is a format that includes executable Mathematica code, STL is a graphics format -- so you cannot straightforwardly convert from one to the other. Probably the thing to do is to draw the 3D object in the CDF and then export that object to the STL file. $\endgroup$– bill sApr 22, 2018 at 22:02
-
$\begingroup$ I think the question is "how to export an object in a CFD to stl". @Faith maybe want to edit the title and explain if you only have the free viewer to work with. $\endgroup$– george2079Apr 23, 2018 at 16:09
-
$\begingroup$ Thank You , i will try that ,Appreciate it $\endgroup$– FaithApr 23, 2018 at 21:38
1 Answer
SetDirectory @ $TemporaryDirectory;
CDFDeploy[
"test.cdf"
, Manipulate[
Column@List@Graphics3D[{ Cuboid[], Sphere[{2, 2, Dynamic[x]}]}]
, {x, 0, 1}
]
];
You need to:
extract content of
BoxData
.use
Setting
to convert allDynamic
to literal values.strip everything that wraps
Graphics3D
.
Maybe there is something more that I've missed but it is hard to say without examples.
Export[
"my2.stl"
, Cases[
Setting @ ToExpression @ Import["test.cdf"][[1, 1, 1, 1]]
, _Graphics3D
, \[Infinity]
]
, "STL"
]