I find Region
computation very frustrating, because there are glaring holes in functionality. For example, this gives useless output:
cubd = Cuboid[{-2, -2, -2}, {4, 4, 4}];
hlfsp = HalfSpace[{-1, -1, 1}, {0, 0, 0}];
RegionIntersection[cubd, hlfsp]
However, if I replace the HalfSpace
with a large enough Simplex
I get the intersection as a real Polyhedron
:
smpl = Simplex[{{24, -10, 14}, {-8, 22, 14}, {-24, -4, -28}, {20,
20, -20}}];
RegionWithin[smpl, RegionIntersection[cubd, hlfsp]]
RegionIntersection[cubd, smpl] // Rationalize // Chop // InputForm
It is irritating that I need to Rationalize
and Chop
the result.