# Get a better resolution of the intersection of two surfaces?

**URL:** <https://community.wolfram.com/t/get-a-better-resolution-of-the-intersection-of-two-surfaces/9343>\
**Category:** Questions\
**Tags:** geometry, graphics-and-visualization, 3d-printing\
**Created:** [September 30, 2016, 10:53pm UTC](https://community.wolfram.com/t/get-a-better-resolution-of-the-intersection-of-two-surfaces/9343 "2016-09-30T22:53:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![noraischerer](https://avatars.discourse-cdn.com/v4/letter/n/ac8455/32.png) [@noraischerer](https://community.wolfram.com/u/noraischerer)\
**Post date:** [September 30, 2016, 10:53pm UTC](https://community.wolfram.com/t/get-a-better-resolution-of-the-intersection-of-two-surfaces/9343/1 "2016-09-30T22:53:13Z")

</div>

I want to get a more precise graphic of the intersection curve of two surfaces. How can I add more points to the graphic, so that it looks more precise

 ![Intersection.png](https://global.discourse-cdn.com/wolfram/original/3X/8/2/823e62e682df2e43e691df934b34b74c1483544b.png)  
?

```
ContourPlot3D[{y^2 - x^2 - x^3 + 0 z == 0, y - x*z == 0}, {x, -2, 
  2}, {y, -2, 2}, {z, -2, 2}, 
 MeshFunctions -> {Function[{x, y, z, 
     f}, (y^2 - x^2 - x^3 + 0 z) - (y - x*z)]}, 
 MeshStyle -> {{Thick, Black}}, Mesh -> {{0}}, 
 ContourStyle -> 
  Directive[White, Opacity[0.5], Specularity[White, 30]]]

```

---

<div class="post-metadata">

**Author:** ![gianlucagorni](https://avatars.discourse-cdn.com/v4/letter/g/ec9cab/32.png) [@gianlucagorni](https://community.wolfram.com/u/gianlucagorni)\
**Post date:** [October 1, 2016, 1:36pm UTC](https://community.wolfram.com/t/get-a-better-resolution-of-the-intersection-of-two-surfaces/9343/2 "2016-10-01T13:36:09Z")

</div>

Along the z axix the function y^2 - x^2 - x^3 + 0 z has zero gradient, and this makes it difficult to compute the mesh numerically. You get a better picture by splitting the surface into two nicer-behaved surfaces:

```
Show[ContourPlot3D[{y == x Sqrt[1 + x], y == -x Sqrt[1 + x]}, {x, -1, 
   2}, {y, -2, 2}, {z, -2, 2}, 
  MeshFunctions -> {Function[{x, y, z, f}, -(y - x*z)]}, 
  MeshStyle -> {{Thick, Black}}, Mesh -> {{0}}, 
  ContourStyle -> 
   Directive[White, Opacity[0.5], Specularity[White, 30]], 
  AxesLabel -> Automatic, BoundaryStyle -> None],
 ContourPlot3D[y - x*z == 0, {x, -2, 2}, {y, -2, 2}, {z, -2, 2}, 
  Mesh -> None, 
  ContourStyle -> 
   Directive[White, Opacity[0.5], Specularity[White, 30]]]]

```

 ![sdaf4356eyrtseawfsdg.png](https://global.discourse-cdn.com/wolfram/original/3X/6/e/6e328c3f0d90e715c707d8d7f85c779ec72a58b1.png)

---

<div class="post-metadata">

**Author:** ![noraischerer](https://avatars.discourse-cdn.com/v4/letter/n/ac8455/32.png) [@noraischerer](https://community.wolfram.com/u/noraischerer)\
**Post date:** [October 2, 2016, 8:51am UTC](https://community.wolfram.com/t/get-a-better-resolution-of-the-intersection-of-two-surfaces/9343/3 "2016-10-02T08:51:36Z")

</div>

Dear Gianluca Gorni,  
thank you very much for your answer! That is exactly the graphic I wanted to get!  
Greetings, Isabell

---

<div class="post-metadata">

**Author:** ![noraischerer](https://avatars.discourse-cdn.com/v4/letter/n/ac8455/32.png) [@noraischerer](https://community.wolfram.com/u/noraischerer)\
**Post date:** [October 2, 2016, 10:40am UTC](https://community.wolfram.com/t/get-a-better-resolution-of-the-intersection-of-two-surfaces/9343/4 "2016-10-02T10:40:01Z")

</div>

Is it also possible to do it for some more complicated surfaces, for example (x^2+y^2)^2+3x^2y-y^3)=0 and (x^2+y^2)^3-x^4+2x^2y^2-y^4=0? I also would like to have the intersection of these surfaces with the surface y\_x\*z=0. I don’t know how to split them into nicer-behaved surfaces. My result for the second surface is

```
ContourPlot3D[{(x^2*y^2)^3 - x^4 + 2 x^2*y^2 - y^4 == 0, 
y - x*z == 0}, {x, -5, 5}, {y, -5, 5}, {z, -5, 5}, 
MeshFunctions -> {Function[{x, y, z, 
f}, ((x^2*y^2)^3 - x^4 + 2 x^2*y^2 - y^4) - (y - x*z)]}, 
MeshStyle -> {{Thick, Black}}, Mesh -> {{0}}, 
ContourStyle -> 
Directive[White, Opacity[0.5], Specularity[White, 30]]]

```

and you can’t recognize anything in the graphic

 ![5782Intersection.png](https://global.discourse-cdn.com/wolfram/original/3X/9/1/91281f98bcfc9737ad4c6d6b0a9e12cad7454954.png)

I would be glad, if someone could help me!  
Thank you.

---

<div class="post-metadata">

**Author:** ![gianlucagorni](https://avatars.discourse-cdn.com/v4/letter/g/ec9cab/32.png) [@gianlucagorni](https://community.wolfram.com/u/gianlucagorni)\
**Post date:** [October 3, 2016, 6:03am UTC](https://community.wolfram.com/t/get-a-better-resolution-of-the-intersection-of-two-surfaces/9343/5 "2016-10-03T06:03:52Z")

</div>

That case is more complicated, but perhaps still manageable. I would start with `Reduce`:

```
Reduce[(x^2 y^2)^3 - x^4 + 2 x^2 y^2 - y^4 == 0, {x, y, z}, Reals]

```

One piece of your graph is like this:

```
ContourPlot3D[
 y == Sqrt[Root[-x^4 + 2 x^2 #1 - #1^2 + x^6 #1^3 &, 1]], {x, -5, 
  5}, {y, -5, 5}, {z, -5, 5}, 
 MeshFunctions -> {Function[{x, y, z, f}, -(y - x z)]}, 
 MeshStyle -> {{Thick, Black}}, Mesh -> {{0}}, 
 ContourStyle -> 
  Directive[White, Opacity[0.5], Specularity[White, 30]]]

```

There are a few more, obtained by changing the sign of the `Sqrt` and the number of the `Root`. I have not tried them all.

---

<div class="post-metadata">

**Author:** ![noraischerer](https://avatars.discourse-cdn.com/v4/letter/n/ac8455/32.png) [@noraischerer](https://community.wolfram.com/u/noraischerer)\
**Post date:** [October 3, 2016, 10:29pm UTC](https://community.wolfram.com/t/get-a-better-resolution-of-the-intersection-of-two-surfaces/9343/6 "2016-10-03T22:29:12Z")

</div>

Thank you very much! I will try to get simpler surfaces.
