2
$\begingroup$

I get errors if I try to Printout3D[ ] or Export[ ] to an .stl file an object containing either an ellipsoid or prisms with any complexity. For example, neither:

testError = Graphics3D[{Tube[{{0, 0, 0}, {1, 1, 1}}, .1], 
  Ellipsoid[{1, 1, .5}, {1, 1, .1}]}]

... nor

pos=20; top=.9; bottom=.1
testError=Graphics3D[
  Table[Prism[{{0, 0, top}, {1.2 Cos@x, 1.2 Sin@x,top},
 {1.2 Cos[x + 2 Pi/pos], 1.2 Sin[x + 2 Pi/pos], top}, {0, 0, bottom}, {1.2 Cos@x, 1.2 Sin@x,bottom}, {1.2 Cos[x + 2 Pi/pos], 1.2 Sin[x + 2 Pi/pos],bottom}}],
 {x, 0, 2 \[Pi] - 2 \[Pi]/pos, 5 2 \[Pi]/pos}]]

... produce the expected results with either Export["test.stl",testError] or Pintout3D[testError,"test.stl"]. What am I doing wrong? Using 12.1.

$\endgroup$
  • $\begingroup$ In the second one, the problem is you can't discretize a table of prisms inside a graphics. Instead, get rid of the Graphics3D and just have the table. You can display it later with Graphics3D[testError] and export / printout each one separately. $\endgroup$ – flinty Sep 29 at 12:51
  • $\begingroup$ In the first one, you need to discretize it like this: mesh = DiscretizeGraphics@ Graphics3D[{Tube[{{0, 0, 0}, {1, 1, 1}}, .1], Ellipsoid[{1, 1, .5}, {1, 1, .1}]}] but the tube will go missing. $\endgroup$ – flinty Sep 29 at 12:54
3
$\begingroup$

Just as @flinty mention,here we using DiscretizeGraphics and increasing the MaxCellMeasure for nonlinear model such Tube and BezierSurface.

mesh1 = DiscretizeGraphics[
  Graphics3D[Tube[{{0, 0, 0}, {1, 1, 1}}, .1]], 
  MaxCellMeasure -> {"Length" -> 0.01}]
mesh2 = 
  DiscretizeGraphics@Graphics3D[Ellipsoid[{1, 1, .5}, {1, 1, .1}]]
RegionUnion[mesh1, mesh2]
Export["combine.stl", %]
Import["combine.stl"]
| improve this answer | |
$\endgroup$
  • $\begingroup$ Many thanks, this works with Export[ ] and successfully solves my problem. Printout3D[ ] continues to produce the same errors it did, but I now have a workaround. I don't understand why the plain solids do not work. Shouldn't they? $\endgroup$ – Nicholas G Sep 29 at 19:50

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.