Bug introduced in 12.1 or earlier and persisting in 13.2.1
I have a flat 3D-Polygon (all points have the same z-Value) and a 3D-line, which I need to check if they intercept using RegionDisjoint
. Assume this:
line = {{-7, 100, 42}, {0, 15, 10}};
poly = {{-(49/10), 266/5, 43/2}, {-(89/10), 47, 43/2}, {-(54/5), 85/2,
43/2}, {-(62/5), 217/5, 43/2}, {-(88/5), 499/10, 43/
2}, {-(183/10), 487/10, 43/2}, {-(211/10), 221/5, 43/
2}, {-(17/10), 162/5, 43/2}, {69/10, 459/10, 43/2}, {-(22/5), 53,
43/2}};
RegionDisjoint[Line[line], Polygon[poly]]
Graphics3D[{Line[line], Polygon[poly]}]
This doesn't evaluate. It just returns this:
When I simply remove one random point of the polygon or move it up above the end of the line (z-coordinate >43/2) it suddenly evaluates. This example:
poly2 = poly*2;
RegionDisjoint[Line[line], Polygon[poly2]]
returns True
. What am I doing wrong here?
Mathematica 12.1 on Windows 11
RegionIntersection[Line[line], Polygon[poly]]
returns a point in your case, indicating that there is an intersection. Perhaps you could could use that return value as a stop gap measure. $\endgroup$RegionDisjoint[Line[line], Polygon[poly], GenerateConditions -> True]
returns an error: "RegionDisjoint::reg: GenerateConditions->True is not a correctly specified region.". That is unexpected! I wonder if something is going awry withinRegionDisjoint
then. $\endgroup$InfiniteLine
, i.e.,RegionDisjoint[ InfiniteLine[line], Polygon[poly]]
evaluates toFalse
$\endgroup$