# How to just set MeshStyle but don't change the BoundaryStyle?

This is my code:

RevolutionPlot3D[x^2, {x, 0, 1}, RevolutionAxis -> "X",
MeshFunctions -> {Boole[#2 == #^2] &}, Mesh -> {{1}},
MeshStyle -> Directive[Red, Thickness[0.03]], PlotPoints -> 200,
Boxed -> False, Axes -> True, AxesOrigin -> {0, 0, 0},
AxesStyle -> {Red, Green, Blue}]


But if I set BoundaryStyle -> None, then all MeshStyle will disappear. So how to just keep the MeshStyle but don't get that red circle BoundaryStyle?

• MeshFunctions -> {#4 &}, Mesh -> {{.99}}, BoundaryStyle -> None Jan 2 at 11:10
• @cvgmt I mean I don't want to get that red circle...
– yode
Jan 2 at 11:22
• MeshFunctions -> {#5 &}, Mesh -> {{2Pi - .001}}, BoundaryStyle -> None Jan 2 at 11:54

You can hide the unwanted ring using a combination of options Exclusions, ExclusionsStyle and the Method sub-option "BoundaryOffset" -> False:

RevolutionPlot3D[x^2, {x, 0, 1},
RevolutionAxis -> "X",
PlotPoints -> 100,
ImageSize -> 600,
ViewPoint -> {0.75, -1.5, 3},
Boxed -> False, Axes -> True, AxesOrigin -> {0, 0, 0},
AxesStyle -> {Red, Green, Blue},
MeshFunctions -> {Boole[#^2 == #2] &},
Mesh -> {{1}},
MeshStyle -> Directive[Red, Thickness[0.01]],
Method -> {"BoundaryOffset" -> False},
Exclusions -> {x == 1},
ExclusionsStyle -> None] /.  Line[x_] :> Tube[x, .015]


Alternatively, the combination of options Method -> {"BoundaryOffset" -> False}, MeshFunctions -> {#5 &}, Mesh -> {{0}} and BoundaryStyle -> None gives the same picture.

And a variation on Craig Carter's approach using ParametricPlot3D

rp = RevolutionPlot3D[x^2, {x, 0, 1},
RevolutionAxis -> "X",
Mesh -> None,
PlotPoints -> 100,
ImageSize -> 600,
ViewPoint -> {0.75, -1.5, 3},
Boxed -> False, Axes -> True, AxesOrigin -> {0, 0, 0},
AxesStyle -> {Red, Green, Blue}];

Show[rp,
ParametricPlot3D[{t, 0, t^2}, {t, 0, 1},
PlotStyle -> Directive[Red, CapForm["Round"], Tube[.015]]]]


I you want to add the x==1 ring with a different style, you can add a second ParametricPlot3D to Show:

Show[rp,
ParametricPlot3D[{t, 0, t^2}, {t, 0, 1},
PlotStyle -> Directive[Red, CapForm["Round"], Tube[.015]]],
ParametricPlot3D[{1, Cos @ t, Sin @ t}, {t, 0, 2 Pi},
PlotStyle -> Directive[Green, CapForm["Round"], Tube[.01]]]]


• I'm curious why I can't get rid of the circular red edge of this function using your method. RevolutionPlot3D[E^(-x^2), {x, -5, 5}, Boxed -> False, Axes -> True, AxesStyle -> {Red, Green, Blue}, AxesOrigin -> {0, 0, 0}, MeshFunctions -> {Boole[#2 == E^(-#^2)] &}, Mesh -> {{1}}, MeshStyle -> Directive[Red, Thickness[0.01]]]
– yode
Jan 2 at 16:28
• @yode, the second method (Method -> {"BoundaryOffset" -> False} + MeshFunctions -> {#5 &} + Mesh -> {{0}} + BoundaryStyle -> None) works for the example in your comment. I don't know how to set Exclusions for the first method to work.
– kglr
Jan 2 at 21:36
• @yode RevolutionPlot3D[E^(-x^2), {x, -5, 5}, Boxed -> False, Axes -> True, AxesStyle -> {Red, Green, Blue}, AxesOrigin -> {0, 0, 0}, Mesh -> None, Method -> {"BoundaryOffset" -> False}, Exclusions -> {{Abs@x == 5}}, ExclusionsStyle -> None, BoundaryStyle -> Red] Jan 3 at 1:20

This is a hack, but a working hack:

rp = RevolutionPlot3D[x^2, {x, 0, 1}, RevolutionAxis -> "X",
PlotPoints -> 200, MeshStyle -> None, Boxed -> False, Axes -> True,
AxesOrigin -> {0, 0, 0}, AxesStyle -> {Red, Green, Blue}]

Show[rp, Graphics3D[
{Red, Tube[BSplineCurve[{#, 0, #^2} & /@ Range[0, 1, .1]]],
Blue,
Tube[BSplineCurve[{1, Cos[#], Sin[#]} & /@ Range[0, 2 Pi, Pi/24]]]
}
]
]