Clip triangle against bounding boxΒΆ

The clip operator clips a triangle against a bounding box, returning the resulting polygon. The figure shows the triangle in blue and the polygon resulting from clip() in grey.

A polygon is produced by clipping a triangle.
#include "axom/primal/operators/clip.hpp"
  TriangleType tri(PointType {1.2, 0, 0},
                   PointType {0, 1.8, 0},
                   PointType {0, 0, 1.4});

  BoundingBoxType bbox(PointType {0, -0.5, 0}, PointType {1, 1, 1});

  PolygonType poly = clip(tri, bbox);