2
$\begingroup$

The following is in the documentation (MMA 10) under ParametricPlot3D -> Options -> Mesh :

ParametricPlot3D[{(2 + Cos[v]) Cos[u], (2 + Cos[v]) Sin[u], 
  Sin[v]}, {u, 0, 2 Pi}, {v, 0, 2 Pi}, Mesh -> 10]

You'll see that the lines for u=0 and for v=0 are missing. These can be restored by using Mesh->Full, but then the number of lines will be the default, 15. I'd also like to have the number of lines be different in the two directions, with each one containing 0, but Mesh->{Full,10}, e.g., gives an error. Here is the image in the documentation:

missing mesh lines

Update: While the answer below works as requested, it does not work for tubes. See this example:

ParametricPlot3D[{(2 + Cos[v]) Cos[u], (2 + Cos[v]) Sin[u], 
  Sin[v]}, {u, 0, 2 Pi}, {v, 0, 2 Pi}, Mesh -> 10, 
 BoundaryStyle -> Tube[.03], MeshStyle -> Tube[.03]]

enter image description here

$\endgroup$
  • $\begingroup$ Russ, thanks for the accept. Regarding Tube issue, your code works as expected in Version 9.0.1.0 but not in Version 10. Please see the update to my answer for a suggestion to get the same result in Version 10. $\endgroup$ – kglr Jul 15 '14 at 17:57
3
$\begingroup$

You need to use BoundaryStyle -> ... (because 0 lies at the boundary of u and v ranges:

ParametricPlot3D[{(2 + Cos[v]) Cos[u], (2 + Cos[v]) Sin[u],  Sin[v]},
       {u, 0, 2 Pi}, {v, 0, 2 Pi}, ImageSize->500,
       Mesh -> 10, BoundaryStyle ->Directive[Thick, Red]]

enter image description here

Update: Rendering mesh lines as Tubes

In Version 9.0.1.0

 ParametricPlot3D[{(2 + Cos[v]) Cos[u], (2 + Cos[v]) Sin[u], Sin[v]},
    {u, 0, 2 Pi}, {v, 0, 2 Pi}, Mesh -> 10, 
    BoundaryStyle -> Tube[.03], MeshStyle -> Tube[.03]]

gives

enter image description here

In Version 10, you can post-process Lines into Tubes to get a similar result:

 ParametricPlot3D[{(2 + Cos[v]) Cos[u], (2 + Cos[v]) Sin[u], Sin[v]}, 
       {u, 0, 2 Pi}, {v, 0, 2 Pi}, Mesh -> 10,
       BoundaryStyle -> Automatic, MeshStyle ->Automatic]/. Line->Tube

gives

enter image description here

$\endgroup$
  • $\begingroup$ Thanks! Would you agree this is a bug in Version 10? $\endgroup$ – Russ Lyons Jul 15 '14 at 23:27
  • $\begingroup$ @Russ, not sure it is a bug; especially because the usage of Tube[.03] as a Directive is -- I think -- undocumented. $\endgroup$ – kglr Jul 15 '14 at 23:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.