1
$\begingroup$

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?

$\endgroup$
4
  • $\begingroup$ Hard to say without any example code... $\endgroup$ Apr 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 s
    Apr 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$
    – george2079
    Apr 23, 2018 at 16:09
  • $\begingroup$ Thank You , i will try that ,Appreciate it $\endgroup$
    – Faith
    Apr 23, 2018 at 21:38

1 Answer 1

1
$\begingroup$
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 all Dynamic 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"
]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.