Mathematica 13.1 for some reason gives an error for the following code:
FindInstance[{x, y, z} \[Element] ReflectionTransform[{0, 0, 1}][Cuboid[{-1/2, -1/2, 1/2}, {1/2, 1/2, 3/2}]], {x, y, z}] The problem as far as I can see is that ReflectionTransform[{0, 0, 1}][Cuboid[{-1/2, -1/2, 1/2}, {1/2, 1/2, 3/2}]] resolves as Cuboid[{-1/2,-1/2,-1/2},{1/2,1/2,-3/2}], which is a problem for FindInstance because the z coordinates are not in the correct order (it should output Cuboid[{-1/2,-1/2,-3/2},{1/2,1/2,-1/2}] instead).
('Strangely' enough, Graphics3D has no problem with this Cuboid with coordinates in the wrong order.)
Is this a bug? And how do I handle cases like these where Cuboids are incorrectly generated? I want to test whether or not two cubes (not necessarily axis-aligned) intersect using the code
intersectQ[cb1_?RegionQ, cb2_?RegionQ] := If[FindInstance[{x, y, z} \[Element] cb1 && {x, y, z} \[Element] cb2, {x, y, z}] == {}, False, True] 