Message Boards Message Boards

Failure to export Graphics3D object to 3DS, OBJ, DAE, STL

Posted 1 year ago

Dear Colleagues,

I am generating Graphics3D objects in a simulation and I have a requirement to export them to a file format that can be imported by other programs. Accepted formats are 3DFS, OBJ, DAE, STL and a few others.

The Graphics3D object has the internal structure shown below.

In[364]:= b1SimGraphics[[1, 1]]

Out[364]= {Translate[
  GeometricTransformation[{RGBColor[0., 0.494949494949495, 1.], 
    Specularity[6., 40], 
    Translate[
     GeometricTransformation[
      Scale[Cuboid[{-(1/2), -(1/2), -(1/2)}], {0.06, 0.06, 0.5}], {{0,
         0, 1}, {-1, 0, 0}, {0, 1, 0}}], {0.25, 0, 0}]}, {{1., 0., 
     0.}, {0., 1., 0.}, {0., 0., 1.}}], {0., 0., 0.}]}

All my tries to export SimGraphics[[1, 1]] have ended up in failure. "Normification" of the Graphics3D object as shown in an older community post gives

In[365]:= b1N[[1, 1]]

Out[365]= {GeometricTransformation[{RGBColor[
   0., 0.494949494949495, 1.], 
   Specularity[6., 
    40], {GeometricTransformation[
     Scale[Cuboid[{-(1/2), -(1/2), -(1/2)}], {0.06, 0.06, 0.5}], {{0, 
       0, 1}, {-1, 0, 0}, {0, 1, 0}}]}}, {{1., 0., 0.}, {0., 1., 
    0.}, {0., 0., 1.}}]}

and I assume the export chokes at GeometryTransformation[Scale[]].

I am writing to ask if anyone has found a workaround to this problem. It seems that somehow I should be able to "perform" the internal transformation of the Cuboid and export but I haven't been able to do it on my own. I wonder if this is a bug; I am using Mathematica 13.1

Thank you.

BU

POSTED BY: Bogdan Udrea
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract