2

I have two surfaces given by

f1 = -3 (x^6 + y^6 + z^6) + 5 (x^4 + y^4 + z^4) \[Pi]^2 - 5/9 (x^2 + y^2 + z^2) \[Pi]^4 + \[Pi]^6/81
f2 = -6 (x^5 + y^5 + z^5) \[Pi] + 20/9 (x^3 + y^3 + z^3) \[Pi]^3 - 2/27 (x + y + z) \[Pi]^5

I would like to plot the intersection between f1==0 and f2==0 surfaces. I can plot each of these surfaces using

curve1 = ContourPlot3D[f1 == 0, {x, -Pi, Pi}, {y, -Pi, Pi}, {z, -Pi, Pi},ContourStyle -> Directive[Opacity[0.45]], Mesh -> None]
curve2 = ContourPlot3D[f2 == 0, {x, -Pi, Pi}, {y, -Pi, Pi}, {z, -Pi, Pi},ContourStyle -> Directive[Opacity[0.45]], Mesh -> None]

which results in

enter image description here enter image description here

However, even after waiting for a long time, I can not get output from

curve3 = ContourPlot3D[Solve[f2 == f1 && f1 == 0], {x, -Pi, Pi}, {y, -Pi, Pi}, {z, -Pi, Pi}, ContourStyle -> Directive[Opacity[0.45]], Mesh -> None]

Do you have better suggestions on generating the intersection between f1==0 and f2==0 surfaces?

Shasa
  • 1,043
  • 5
  • 12
  • Show[ContourPlot3D[f1 == 0, {x, -Pi, Pi}, {y, -Pi, Pi}, {z, -Pi, Pi}, MeshFunctions -> Function[{x, y, z}, f2], Mesh -> {{0}}, PlotPoints -> 80, MaxRecursion -> 4, MeshStyle -> {Thick, Red}], ContourPlot3D[f2 == 0, {x, -Pi, Pi}, {y, -Pi, Pi}, {z, -Pi, Pi}, Mesh -> None, ContourStyle -> {Opacity[.2], Green}]]? – cvgmt Jun 13 '22 at 11:00
  • @cvgmt Thanks! How can I remove f1==0 and f2==0 surfaces and only keep the red intersection curve? – Shasa Jun 13 '22 at 11:03

1 Answers1

5
ContourPlot3D[f1 == 0, {x, -Pi, Pi}, {y, -Pi, Pi}, {z, -Pi, Pi}, 
 MeshFunctions -> Function[{x, y, z}, f2], Mesh -> {{0}}, 
 PlotPoints -> 80, MaxRecursion -> 4, MeshStyle -> {Thick, Red}, 
 ContourStyle -> None, PlotRange -> Automatic]

enter image description here

cvgmt
  • 72,231
  • 4
  • 75
  • 133