1

I know for surfaces Mathematica 11 has thickening options for 3D printing. See here for example.

If I have an explicit parametrization of a spatial curve, like the twisted cubic, I can create a tube like this and export to stl:

Export["twistedcubictube.stl" , ParametricPlot3D[{Sin[t] + x, Cos[t] + x^2, x^3}, {x, -2, 2}, {t, 0, 2*Pi}]]

However, I do not see how to create such a tube if my curve(s) are obtained implicitly through ContourPlot (in the plane).

Anyone have any ideas?

As a test case, I would like to create small tubes around these curves:

ContourPlot[{-2 + y^2 - z, 1 - 2 y^2 + y^2 z + z - z^2}, {y, -5, 5}, {z, -5, 5}]

and 3D Print them.

UPDATE: I just did this which seems to be working (3D printer is trying to print as I type...might still need to play with the thicknesses to get it to actually print):

Export["test.stl", ContourPlot3D[{-2 + y^2 - z, 1 - 2 y^2 + y^2 z + z - z^2}, {x,  0, .1}, {y, -5, 5}, {z, -5, 5}, Extrusion -> 0.05]]

But that solves the problem by turning the curves into a thin surface and then thickening up that thin surface. That should work in general, but I would still like to know how to create a tubular neighborhood around an implicitly defined curve in Mathematica (in the plane or in space).

J. M.'s missing motivation
  • 124,525
  • 11
  • 401
  • 574
Sean Lawton
  • 183
  • 7

1 Answers1

3
Cases[Normal @ ContourPlot[{-2 + y^2 - z, 1 - 2 y^2 + y^2 z + z - z^2},
   {y, -5, 5}, {z, -5, 5}], Line[x_] :> 
  Tube[x /. {a_?NumericQ, b_?NumericQ} :> {a,0,b}, .05], Infinity] // 
 Graphics3D[#, Boxed -> False] & 

enter image description here

kglr
  • 394,356
  • 18
  • 477
  • 896