Introduce a more systematic strategy for adjudicating geometric questions involving (a) points lying precisely on polygon edges or prism faces, (b) the degenerate case of line/line intersection in the case where the lines are exactly or nearly parallel.
With this revision, the default convention is to consider points lying on polygon edges or prism faces to be inside the polygon/prism. However, this convention may be reversed by setting the environment variable LIBCTL_EXCLUDE_BOUNDARIES=1, in which case points on edges/faces are not considered interior points.
With this update, the test-prism unit test needed to be updated----it seems the legacy point_in_object implementation for blocks make somewhat arbitrary decisions about whether points on boundaries are interior points. This was causing mismatches with the new point_in_prism implementation, which makes more consistent decisions. In the updated test, if the results of point_in_block and point_in_prism disagree for a given point, the point_in_prism test is repeated with the sense of the boundary-point exclusion inverted (i.e. if points on prism faces were considered interior before, they are considered exterior now). This update eliminates all mismatches with the point_in_block code, so the unit test is passing again.
Introduce a more systematic strategy for adjudicating geometric questions involving (a) points lying precisely on polygon edges or prism faces, (b) the degenerate case of line/line intersection in the case where the lines are exactly or nearly parallel.
With this revision, the default convention is to consider points lying on polygon edges or prism faces to be inside the polygon/prism. However, this convention may be reversed by setting the environment variable
LIBCTL_EXCLUDE_BOUNDARIES=1,
in which case points on edges/faces are not considered interior points.With this update, the
test-prism
unit test needed to be updated----it seems the legacypoint_in_object
implementation forblock
s make somewhat arbitrary decisions about whether points on boundaries are interior points. This was causing mismatches with the newpoint_in_prism
implementation, which makes more consistent decisions. In the updated test, if the results ofpoint_in_block
andpoint_in_prism
disagree for a given point, thepoint_in_prism
test is repeated with the sense of the boundary-point exclusion inverted (i.e. if points on prism faces were considered interior before, they are considered exterior now). This update eliminates all mismatches with thepoint_in_block
code, so the unit test is passing again.