# ParametricPlot3D does not export with the specified PlotRange?

I am trying to plot a function with ParametricPlot3D with a specified plot range to export as an stl file, however when exporting the graphic mathematica ignores the PlotRange and exports the whole function, is there a way to make this work or some sort of intersection command to work around this?

• Could you include the code you used for exporting to STL? – MarcoB Apr 18 '16 at 4:00
• I have the same problem when you cannot simply replace the PlotRange by restricting the parameter domain. – user39553 Apr 19 '16 at 5:54
• This does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. You can also add a bounty to draw more attention to this question once you have enough reputation. - From Review – Yves Klett Apr 19 '16 at 6:57

As pointed out by Ivan Sterling, you cannot simply restrict the PlotRange, as this will not be respected when exporting to "STL". Take Louis's example,

ParametricPlot3D[{(2 + Cos[v]) Cos[u], (2 + Cos[v]) Sin[u],
Sin[v]}, {u, 0, 2 Pi}, {v, 0, 2 Pi},
PlotRange -> {{0, π}, {0, π}, All}]
Export["test.stl", %] // Import


One method to make sure that you only get the plot you want is to restrict the parameter values, only plotting over the relevant values of u and v. But another option is to supply a RegionFunction

pp1 = ParametricPlot3D[{(2 + Cos[v]) Cos[u], (2 + Cos[v]) Sin[u],
Sin[v]}, {u, 0, 2 Pi}, {v, 0, 2 Pi},
RegionFunction ->
Function[{x, y, z, u, v}, 0 <= x <= π && 0 <= y <= π]]
Export["test.stl", %] // Import


• Nice example +1 – user9660 Apr 19 '16 at 10:49

Works as intended on 10.0 for Mac OS X x86 (64-bit) (December 4, 2014), see also STL (.stl)

pp1 = ParametricPlot3D[{(2 + Cos[v]) Cos[u], (2 + Cos[v]) Sin[u],
Sin[v]}, {u, 0, 2 Pi}, {v, 0, 2 Pi}]

Export["MathematicaParametricSurface.stl", pp1]


pp1 = ParametricPlot3D[{(2 + Cos[v]) Cos[u], (2 + Cos[v]) Sin[u],
Sin[v]}, {u, 0, 1 Pi}, {v, 0, 1 Pi}]

Export["MathematicaParametricSurface.stl", pp1]


Import["MathematicaParametricSurface.stl"]