# Export from ParametricPlot3D to 3D file formats

I would like to export this parametrization from ParametricPlot3D in a 3D format such as .obj or .stl. All the exports I have made show an ugly mesh. Is there a way to export the mesh as you see it on Mathematica?

param[a_, g_][u_, v_] :=
{50*(a + Cos[u/2]*g*Sin[v] - Sin[u/2]*Sin[2 v]) Cos[u],
50*(a + Cos[u/2]*g*Sin[v]- Sin[u/2]*Sin[2 v]) Sin[u],
50*(Sin[u/2]*g*Sin[v] + Cos[u/2]*Sin[2 v])}

ParametricPlot3D[param[2, 1][u, v] // Evaluate, {u, 0, 2 Pi}, {v, 0, 2*Pi},
PlotPoints -> {50, 50}, Axes -> None, Boxed -> False]


## 1 Answer

The "ugly" mesh is indeed what makes up the surface - even in Mathematica. The lines that you see in the Mathematica plot are extra Lines that are controlled with the Mesh option. These get also exported to obj. In order to render the surface appropriately, you have to tell the renderer to use the .mtl file that is exported along with the .obj file. It's the .mtl file that has to tell the renderer not to render the "ugly mesh".

• Thank you so much for your answer. However I am not sure I understand the .mtl. Do you have a line of code to export .mtl ? The only files I can have do not include .mtl. Thank you for your great support. Marc – M. Joe Oct 20 '17 at 6:43
• Mathematica creates a file with ending .obj.mtl automatically on export in the same folder as the .obj file. Maybe you have to change the file end from .obj.mtl to .mtl, since that is the standard: External renderers will look for the same file name but with ending .mtl. Generally, I cannot tell how far the export filter in Mathematic is conform to the obj standard. E.g., I cannot open your model in GLC_Player when exported by Mathematica... Moreover, the export filter is slow and ineffiecient in the sense that it creates way too large obj files. – Henrik Schumacher Oct 20 '17 at 9:50