Message Boards Message Boards

Exporting cuboids to .STL format.

Posted 4 years ago

I have some code which takes a number of points generated by an iterated function and plots a cuboid. Is there a way to have these cuboids exported in an .stl file fit to 3D print? Here is the line which creates the cuboids.

Graphics3D[
 Map[ {Hue[.5], EdgeForm[Thickness[0]], Opacity[.75], 
    Cuboid[(#), (# + {ht, ht, ht})]} &, test ], Axes -> True]

Many thanks!

POSTED BY: Brian Stephenson

You can use Printout3D or Export to make the STL file from your graphics. I have never used Printout3D so can't say anything other than read its documentation. If you use Export, there is probably less checking on whether the object is printable, but you will be able to visualize it, as below.

ht = .5;
test = Table[{RandomReal[], RandomReal[], RandomReal[]}, {1000}];
Export["boxes.stl", 
  Graphics3D[Map[{ Cuboid[(#), (# + {ht, ht, ht})]} &, test]]] ;
Import["boxes.stl"]

enter image description here

Notice I removed the options you used, that would not print.

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