Cut a 3D surface by a horizontal plane?

Dear Community,

I’ve reconstructed a pond from its contourline polygons, and plotted it. The depth of the pond ranges from 0 ft to -70 ft. Now I would like to see where the water would be in the pond at -45ft depth? Mathematically: how to cut this 3D surface with a horizontal plane at -45 vertical value and plot both surface and obtained polygon? Unfortunately I’m unexperienced in this field and would appreciate your kind help here. Files are attached.

Tx in advance.
Best regards,
Andras

Pond.nb (121 KB)
PondPoints3D.xlsx (118 KB)

Here’s a sketch of how to combine graphics, where myListSurfacePlot3D corresponds to the “pond” you created in your notebook:

Show[myListSurfacePlot3D,Graphics3D[{Opacity[0.5],Blue,InfinitePlane[{{0,0,-45},{1,0,-45},{0,1,-45}}]}]]

Dear Seth,

Wow, tx very much, very elegant! Would it be also somehow possible to clip the plane outside the pond?

Tx in advance,
best regards
Andras

The following is not ideal, but it will work for your particular problem reasonably well:

Step 1: create a function of x and y and interpolates the height of the pond surface; the DeleteDuplicates function is slightly problematic in that it sweeps under the rug the possibility of a pond that could have “caves”. Hopefully yours does not.

Interpolation[DeleteDuplicatesBy[allpoints, Most], 
 InterpolationOrder -> 1]

Step 2: use RegionFunction to suppress points in the “water” that lie beneath the elevation of the pond;

pondwater = Plot3D[-45, {x, 0, 700}, {y, 0, 700}, 
 PlotStyle -> {Opacity[0.5], Blue}, 
 RegionFunction -> (-45 > i[#1, #2] &)]

Step 3: combine Graphics3D objects

Show[myListSurfacePlot3D,pondwater]

Dear Seth,

Tx very much, works perfectly well for my goals, and I learned a lot.
Now ready to take a bath in the pond :slight_smile:

Best regards,
Andras

A different approach, where the shape of the pond is extracted from the mesh line primitives:

pr = ListSurfacePlot3D[allpoints,
  PlotRange -> {All, All, {-130, -45}},
  MeshFunctions -> {#3 &}, Mesh -> {{-45}}]
lns = Cases[Normal[pr[[1]]], Line[{{_, _, -45.}, __}], All];
Show[ListSurfacePlot3D[allpoints, MeshFunctions -> {#3 &}], 
 Graphics3D[{Opacity[.5], Blue, Polygon @@ lns[[1]]}]]

Clever. I thought there might be many ways to do this. Yours will do better with ponds that have caves or that are not functions in the z direction.

A pond with an island may be a problem, too.

Dear Gianluca,

Thank you very much, works very nice! It will take me some time to fully understand it, but I’ll do my best.

Tx and best regards,
Andras