# 3D Printing 1D Contour Plot

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).

• 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, b, 0}, .2], Infinity] // Graphics3D[#, Boxed -> False] &? – kglr Mar 16 '18 at 23:47
• That looks good! I am trying it now. – Sean Lawton Mar 17 '18 at 0:10
• You could combine the methods of this answer with the methods of this answer to get your 3D-printable tubes. – J. M.'s technical difficulties Mar 17 '18 at 0:13

Cases[Normal @ ContourPlot[{-2 + y^2 - z, 1 - 2 y^2 + y^2 z + z - z^2}, 