Skip to content

The Geometry Intersections

Justin edited this page Feb 24, 2022 · 6 revisions

This page refers to the functions found on the CGALIntersection static class found in the CGALDOtNet.Geometry namespace.

This static class provides intersection functions between all the basic geometry classes in CGAL. The intersection matrix can be found here.

The class also provides the DoIntersect, Intersection and SqrDistance function.

For intersections it is recommended to use the EEK kernel due to precision issues.

var box = new Box<EEK>(min, max);

var tri = new Triangle<EEK>(a, b, c);

if(CGALIntersection.DoIntersect(box, tri))
{
   //The box and the triangle intersect.
   var result = CGALIntersection.Intersection(box, tri);

   //This is the actual intersection result as a polygon.
   var polygon = PolygonFactory<EEK>.CreateBox(result.Box);
}

IntersectionResult

Clone this wiki locally