The following is a slight variation/addition to the solution suggested above.
Suppose you have a cube and some triangulation. This induces a triangulation of the boundary.
Code: Select all
$c=cube(3);
$t=$c->TRIANGULATION->BOUNDARY;
The following (naive) code checks all pairs of facets from the triangulation and the polytope. Extensions and speed up easily possible.
Code: Select all
foreach my $bnd_triangle (@{$t->FACETS}) {
foreach my $poly_facet (@{$c->VERTICES_IN_FACETS}) {
print $bnd_triangle, " in ", $poly_facet, "\n" if incl($bnd_triangle,$poly_facet)<0;
}
}
The output of the latter is:
Code: Select all
{0 1 2} in {0 1 2 3}
{0 1 4} in {0 1 4 5}
{0 2 4} in {0 2 4 6}
{1 2 3} in {0 1 2 3}
{1 3 5} in {1 3 5 7}
{1 4 5} in {0 1 4 5}
{2 3 6} in {2 3 6 7}
{2 4 6} in {0 2 4 6}
{4 5 6} in {4 5 6 7}
{3 5 7} in {1 3 5 7}
{3 6 7} in {2 3 6 7}
{5 6 7} in {4 5 6 7}
Of course, if you work with a PointConfiguration instead of a Polytope you additionally need to employ CONVEX_HULL and VERTEX_POINT_MAP as indicated above.