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::make_point(1.2, 0, 0),
                   PointType::make_point(0, 1.8, 0),
                   PointType::make_point(0, 0, 1.4));

  BoundingBoxType bbox(PointType::make_point(0, -0.5, 0),
                       PointType::make_point(1, 1, 1));

  PolygonType poly = clip(tri, bbox);