# ParametricPlot3D line not smooth

Multivariate parameters appear to present a jagged appearance of integrands (using default Runge-Kutta ODE integration intervals?) in ParametricPlot3D plotting on a single argument.

Higher Mesh.. ing to 200 improves sectors' jagging (large step secants appearing instead of tangent) somewhat, but still color from PlotStyle for lines does not come through, e.g., like in case of the straight computed helical lines shown. How to get PlotStyle line colors with smoother lines?

thmax=6Pi ;
EQU={SI'[th]==Sin[PH[th]],SI[0]==.123,
PH'[th]==Cos[th],PH[0]==-1.234,
Z'[th]==2 Cos[PH[th]]Cos[SI[th]],
R'[th]==3 Sin[PH[th]] Cos[SI[th]],
R[0]==1.321,Z[0]==0.};
NDSolve[EQU,{SI,PH,R,Z},
{th,0,thmax}];
{ph[u_],si[u_],
r[u_],z[u_]}={PH[u],
SI[u],R[u],Z[u]}/.First[%];
ParametricPlot[{z[th],r[th]},{th,0,thmax},
AspectRatio->Automatic,PlotLabel->MERIDIAN_,PlotStyle->{Thick,Magenta}]
ParametricPlot3D[{r[th] Cos[th+t],z[th],r[th] Sin[th+t]},{t,0,2 Pi},
{th,0,thmax},PlotLabel->SURFACE_]
SpC1=ParametricPlot3D[{r[th] Cos[th],z[th],r[th] Sin[th]},{t,0,2 Pi},
{th,0,thmax},PlotStyle->{Thick,Magenta},PlotLabel->SPACE_CURVE,Mesh->20];
SpC2=ParametricPlot3D[{2 Sin[th],th,1.8 Cos[th]},{th,0,thmax/3},
PlotLabel->HELIX_,PlotStyle->{Thick,Magenta}];
Show[SpC1,SpC2]

• Please format your code by selecting it and pressing the code button ({}) in the toolbar. Right now it is difficult to read.
– user484
Nov 8, 2014 at 10:06
• Thanks Rahulji, will format it hereafter. Nov 10, 2014 at 8:41

Remove {t, 0, 2 Pi} from your SpC1 to get a 3D parametrized line

SpC1b = ParametricPlot3D[{r[th] Cos[th], z[th], r[th] Sin[th]}, {th, 0, thmax},
PlotStyle -> {Thick, Magenta}, PlotLabel -> "SPACE_CURVE"];
Show[SpC1b, SpC2]


Or, to get fancier,

Show[SpC1b /. {Magenta -> Orange, Line -> (Tube[#, .1] &)},
SpC2 /. Line -> (Tube[#, .1] &), Background -> Black, Boxed -> False, Lighting -> "Neutral"]


and, increasing thmax to 36 Pi,

Note: As is, your code for SpC1produces a 3D surface parametrized by t and th. That is, it produces polygons. So, you can change the setting for PlotStyle in your code to PlotStyle -> EdgeForm[{Thick, Magenta}] to make the polygons "look like" a Magenta-colored line. However, this approach is both unnecessary and slow because of the number of polygons produced: In your original version with Mesh->20 it produces

Total@Cases[SpC1[[1]], Polygon[x_] :> Length[x], {0, Infinity}]
(* 10 471 *)


of them. Changing to Mesh->200 produces 90 643 polygons; and using the options settings Mesh -> 100, PlotPoints -> 200, MaxRecursion -> 1 produces 485 208 tiny polygons. Since each polygon is small, together they appear as a Line.

• I like the like the fancy Part, +1.
– user9660
Nov 8, 2014 at 17:45

I´m not quite sure whether I understood your problem right, but I increased the Mesh, set the PlotPoints higher (I just choose a higher number) and MaxRecursion to 1, i.e.:

SpC1 = ParametricPlot3D[{r[th] Cos[th], z[th], r[th] Sin[th]}, {t, 0,
2 Pi}, {th, 0, thmax}, PlotStyle -> {Thick, Magenta},
PlotLabel -> SPACE_CURVE, Mesh -> 100, PlotPoints -> 200,
MaxRecursion -> 1]


and

SpC2 = ParametricPlot3D[{2 Sin[th], th, 1.8 Cos[th]}, {th, 0,
thmax/3}, PlotLabel -> HELIX_, PlotStyle -> {Thick, Magenta},
PlotPoints -> 200, MaxRecursion -> 1]


the result was than quite different