0

Here is what I have done thus far:

h = x^2 - y^2 + z;
g = z;
Manipulate[
 ContourPlot3D[{h == 0, g == k}, {x, -3, 3}, {y, -4, 4}, {z, -2, 2},
  MeshFunctions -> {Function[{x, y, z}, h - g]},
  MeshStyle -> {{Thick, Blue}},
  Mesh -> {{0}},
  ContourStyle -> 
   Directive[Orange, Opacity[0.8], Specularity[White, 30]]],
 {{k, 0}, -2, 2, Appearance -> "Labeled"}]

And the resulting image:

enter image description here

Clearly, I am doing something wrong? Any suggestions?

Update: I should have put Mesh->{{k}}.

h = x^2 - y^2 + z;
g = z;
Manipulate[
 ContourPlot3D[{h == 0, g == k}, {x, -3, 3}, {y, -4, 4}, {z, -2, 2},
  MeshFunctions -> {Function[{x, y, z}, g - h]},
  MeshStyle -> {{Thick, Blue}},
  Mesh -> {{k}},
  ContourStyle -> 
   Directive[Orange, Opacity[0.8], Specularity[White, 30]]],
 {{k, 0}, -2, 2, Appearance -> "Labeled"}]

Which works.

enter image description here

David
  • 14,883
  • 4
  • 44
  • 117
  • Do you get what you need if you used Mesh -> None, BoundaryStyle -> {{1, 2} -> {Thick, Blue}}? – kglr Jun 03 '15 at 19:30
  • Mesh -> {{k}}, MeshFunctions -> {Function[{x, y, z}, z]} ? – Basheer Algohi Jun 03 '15 at 19:46
  • @Algohi: Yes, your suggestion does work, but it works because it doesn't put any mesh on g=k with this mesh function. If I were to change g=z to g=x+z, it doesn't put the mesh which is the curve of intersection. It just puts meshes at the z=k level on both contours, not where they intersect. But thanks for the help, as I learned a bit by playing with your idea. – David Jun 03 '15 at 21:40
  • @kguler: Your suggestion works. But where did you learn this? I went to the documentation for BoundaryStyle and there was no example of this type present. What does the {1,2} mean in {{1, 2} -> {Thick, Blue}}? – David Jun 03 '15 at 21:41
  • David, you can see (5968); uses the same trick, but still guler can provide more info. – Sektor Jun 03 '15 at 21:52
  • 1
    David, this usage for BoundaryStyle is undocumented. I must have learnt it from Daniel's answer in the link given by @Sektor. {1,2} means the "boundary" between surfaces 1 and 2. – kglr Jun 05 '15 at 21:17
  • @kguler, Just used your BoundaryStyle technique and posted a question on Mathematics Stack Exchange: http://math.stackexchange.com/questions/1315019/curve-of-intersection-of-two-surfaces. – David Jun 06 '15 at 21:41

0 Answers0