I have a set of 4 Polygons :
polys = {Polygon[{{0, -2, -2.9}, {0, -1.5, -2.65}, {10, -1.5, -2.65}, \
{10, -2, -2.9}}],
Polygon[{{0, -1.5, -2.65}, {0, 0, -2.95}, {10,
0, -2.95}, {10, -1.5, -2.65}}],
Polygon[{{0, 0, -2.95}, {0, 1.5, -2.5}, {10, 1.5, -2.5}, {10,
0, -2.95}}],
Polygon[{{0, 1.5, -2.5}, {0, 2, -3.5}, {10, 2, -3.5}, {10,
1.5, -2.5}}]};
I want to find the intersection between some line and the surface region formed by the polygons:
line = HalfLine[{0, 1, 0}, {1, 0, -.52}];
surface = RegionUnion[polys]
But NSolve does not give any solution:
sol = NSolve[{Element[{x, y, z}, line],
Element[{x, y, z}, surface]}, {x, y, z}]
I found a solution by testing for each polygon separately with Or:
sol = NSolve[{RegionMember[line, {x, y, z} ],
Or @@ (RegionMember[#, {x, y, z} ] & /@ polys)}, {x, y, z}]
Why does NSolve not work if the polygons are assembled to a single surface with RegionUnion[polys]?