6
$\begingroup$

The documentation says that RegionIntersection is not implemented for MeshRegion objects embedded in 3D. But I have one such region and would like to slice it with xy, yz, and xz planes, and I can't figure out how.

Here are two example inputs regions:

r1 = RegionBoundary@ConvexHullMesh[RandomReal[{-1, 1}, {200, 3}]]
r2 = InfinitePlane[{{1, 0, 0}, {1, 1, 1}, {0, 0, 1}}]

and this is what I've tried that fails:

enter image description here

$\endgroup$

1 Answer 1

8
$\begingroup$

You can intersect 3D primitives separately:

Show[r1, Graphics3D[
  DeleteCases[RegionIntersection[r2, #] & /@ MeshPrimitives[r1, 2], _EmptyRegion]]]

enter image description here

The intersection is a set of lines since r1 is a boundary region.

$\endgroup$
1
  • $\begingroup$ I tried this on my machine running version 10.2 and it did not work. However after updating to 10.3 it did. $\endgroup$ Feb 11, 2016 at 15:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.