cgal_difference - ObjectVision/GeoDMS GitHub Wiki

Geometric functions > cgal_difference

syntax

  • cgal_difference(polygon_data_item1, polygon_data_item2)

description

cgal_difference(polygon_data_item1, polygon_data_item2) results in a data item with the difference of the two polygon arguments. The result contains, for each element, the area of the first argument that is not covered by the second argument (A minus B).

The operator is applied element-by-element. Both domains need to match, or one of the arguments needs to be a parameter (void domain).

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.

applies to

The value types of both arguments must be compatible (same point type).

conditions

  1. The composition type of both arguments needs to be polygon.
  2. The domains of the two arguments must match, or one argument must have a void domain (parameter).

since version

14.0

example

attribute<dpoint> geometry_difference (district) := cgal_difference(district/geometry, water/geometry);

see also

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