Consider the intersection of two ConvexHullMesh's, m1 and m2.

m1 = ConvexHullMesh@RandomReal[{0, 1}, {10, 3}];
m2 = ConvexHullMesh@RandomReal[{0, 1}, {10, 3}];
intersection = RegionIntersection[m1, m2];

All have a non-zero Volume

Volume /@ {m1, m2, intersection}

And one can obtain RandomPoints on m1 and m2

RandomPoint@m1  (*works*)
RandomPoint@m2 (*works*)

in contrast,

RandomPoint@intersection (*returns CompiledFunction errors*)

CompiledFunction: Argument Region <code>Mesh</code>CrossingCount errors

All run on 11.3.0 for Mac OS X x86 (64-bit)

Update 1: The 2D version of the above works fine without errors.

Update 2: (23 May 2019) Wolfram Tech Support confirms that this is a bug and is investigating.

  • 1
    $\begingroup$ Thanks for informing support about this! $\endgroup$ – Henrik Schumacher May 23 '19 at 19:59
  • $\begingroup$ RandomPoint[TriangulateMesh[intersection]] seems to work around the issue. $\endgroup$ – Chip Hurst May 23 '19 at 20:18

I can reproduce the error, but I don't know what went wrong. This is probably worth a bug report at Wolfram Support.

I found out that BoundaryDiscretizeRegion can help to circumvent the problems.

M = BoundaryDiscretizeRegion@intersection;
  • 1
    $\begingroup$ Your BoundaryDiscretizeRegion workaround does the job in v11.3.0 $\endgroup$ – Joshua Schrier May 22 '19 at 18:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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