cgal_polygon - ObjectVision/GeoDMS GitHub Wiki

Geometric functions > cgal_polygon

syntax

  • cgal_polygon(polygon_data_item)

description

cgal_polygon(polygon_data_item) results in a data item with the same domain as the polygon_data_item, with the geometry cleaned and validated using the CGAL library. It can be used to repair or normalize polygon geometries.

The cgal_ prefix of the function name indicates that the implementation of the operator uses CGAL, which provides exact predicates and exact constructions for maximum numerical precision. CGAL's polygon repair functionality is particularly robust for handling self-intersecting polygons and other geometric anomalies.

applies to

conditions

  1. The composition type of the polygon_data_item needs to be polygon.
  2. The order of points in the polygon_data_item needs to be clockwise for exterior bounds and counterclockwise for holes (right-hand-rule).

since version

14.0

example

attribute<dpoint> geometry_clean (district) := cgal_polygon(district/geometry);

see also

⚠️ **GitHub.com Fallback** ⚠️