0
$\begingroup$

I am plotting two surfaces in Mathematica: green and yellow using ParametricPlot3D. Their intersection is the red curve.

However, in the vicinity of the intersection curve, the colors and meshes mess up. How to fix it?

Here is my simple code.

a = ParametricPlot3D[{3 z^2, (-z^3 + 3 z r), r}, {z, -1.3, 
1.3}, {r, -5, 3}, PlotStyle -> {Green}];

b = ParametricPlot3D[{z, d (z + d^2), -d^2} , {z, -3, 6}, {d, -2, 2}, 
PlotStyle -> {Yellow}];

c = ParametricPlot3D[{3 z^2, -4 z^3 , - z^2}, {z, -1.3, 1.3}, 
PlotStyle -> {Red}];

Show[a,b,c]

enter image description here

$\endgroup$
2
  • 1
    $\begingroup$ Prior to plots, add SetOptions[ParametricPlot3D, PlotPoints -> 200, MaxRecursion -> 8]; $\endgroup$
    – Bob Hanlon
    Nov 27, 2021 at 2:58
  • 1
    $\begingroup$ @BobHanlon Increasing PlotPoints cleans up the colors but not the mesh. $\endgroup$
    – bbgodfrey
    Nov 27, 2021 at 3:02

1 Answer 1

1
$\begingroup$
SetOptions[ParametricPlot3D,
  PlotPoints -> 200,
  MaxRecursion -> 8,
  WorkingPrecision -> 20,
  SphericalRegion -> True,
  PerformanceGoal -> "Quality",
  BoxRatios -> {1, 1, 1/2}];

Under Possible Issues for ParametricPlot3D it states that "Surfaces that have multiple coverings may exhibit unusual behavior". Turning off the Mesh for plot b avoids the overlapping meshes at the expense of some mesh outside the overlap.

a = ParametricPlot3D[
   {3 z^2, (-z^3 + 3 z r), r},
   {z, -13/10, 13/10}, {r, -5, 3},
   PlotStyle -> Green];

b = ParametricPlot3D[
   {z, d (z + d^2), -d^2},
   {z, -3, 6}, {d, -2, 2},
   PlotStyle -> Yellow,
   Mesh -> None];

c = ParametricPlot3D[
   {3 z^2, -4 z^3, -z^2},
   {z, -13/10, 13/10},
   PlotStyle -> Red];

Show[a, b, c]

enter image description here

$\endgroup$
2
  • $\begingroup$ Bob, thank you! So, the conclusion is that Mathematica cannot really do that? I guess I could try to use some other program to create such a plot. Any advice? $\endgroup$ Nov 28, 2021 at 14:22
  • $\begingroup$ I have no recommendations. $\endgroup$
    – Bob Hanlon
    Nov 28, 2021 at 14:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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