Update: Using MeshFunctions
to get the intersection of the plane and ListSurfacePlot3D
surface:
We can use the points p1
, v1
and v2
to get the equation of the plane ip
:
Simplify[Cross[v1, v2].({x, y, z} - p1)]
7/5 + x - y - 2 z
and use it as the MeshFunctions
option value to show the intersection of ListSurfacePlot3D
and ip
:
lsp = ListSurfacePlot3D[data, Axes -> False,
MeshFunctions -> {7/5 + # - #2 - 2 #3 &}, Mesh -> {{0.}},
MeshStyle -> Directive[Red, Thick],
MeshShading -> {Opacity[.5, Yellow], Opacity[.5, Blue]},
BoxRatios -> 1];
Show[lsp, Graphics3D[{Lighting -> "Neutral", Point @ data,
Red, Sphere[#, .01] & /@ pts, EdgeForm[], Opacity[.3, Green], ip}]]
We can do the same for arbitrary function f
that defines a plane through f == 0
. For example,
f[x_, y_, z_, w_]:= x - y + 2 z - w; (* the plane x - y + 2 z == w *)
Show[ListSurfacePlot3D[data,
Axes -> False,
MeshFunctions -> {f[#, #2, #3, 1] &}, Mesh -> {{0}},
MeshStyle -> Directive[Red, Thick],
MeshShading -> {Opacity[.5, Blue], Opacity[.5, Yellow]},
BoxRatios -> 1, BoundaryStyle -> None],
ListPointPlot3D[data],
ContourPlot3D[f[x, y, z, 1] == 0, {x, 0, 1}, {y, 0, 1}, {z, 0, 1} ,
BoundaryStyle -> None,
ContourStyle -> Opacity[.25, Purple],
Mesh -> None]]
Original answer:
Using the same InfinitePlane
as in glS's answer:
p1 = {0, 0, 7/10};
v1 = {1, 1, 0};
v2 = {1, -1, 1};
dist = .01;
ip = InfinitePlane[p1, {v1, v2}];
Points within dist
of ip
can be obtained using Select
and RegionDistance
:
pts = Select[data, RegionDistance[ip, #] <= dist &];
We can also use ip
as the value for ClippingPlanes
directive to style parts of the surface above and below the plane differently:
lsp = ListSurfacePlot3D[data, Axes -> False,
Mesh -> None, PlotStyle -> Opacity[.7, Yellow], BoxRatios -> 1];
Graphics3D[{Lighting -> "Neutral", Point @ data,
Red, Sphere[#, .01] & /@ pts, lsp[[1]],
ClipPlanes -> ip, ClipPlanesStyle -> Opacity[.3, Green],
Opacity[.7, Blue], lsp[[1]] /. Directive[__] :> {}}]