Skip to main content

Module offset_geometry

Module offset_geometry 

Source
Expand description

Offset / buffer geometry operations.

Provides algorithms for:

  • Polygon offset via Minkowski sum approach (inward/outward)
  • Curve offset (equidistant curves for polylines)
  • Fillet (rounding interior corners)
  • Chamfer (beveling corners)
  • Rounded rectangles generation
  • Minkowski sum / difference for convex 2-D shapes
  • Morphological operations (erosion, dilation, opening, closing)
  • Tubular neighborhoods (thickening of curves/surfaces)

Structs§

Point2
A 2-D point / vector.

Functions§

chamfer_polygon
Apply a chamfer (bevel) at each vertex of a polygon.
ensure_ccw
Ensure polygon is in CCW order.
fillet_polygon
Apply a fillet (arc rounding) at each vertex of a polygon.
is_convex
Check if a polygon is convex.
minkowski_difference_convex
Minkowski difference of two convex polygons.
minkowski_sum_convex
Minkowski sum of two convex polygons (both assumed CCW).
morphological_closing
Morphological closing: dilation followed by erosion.
morphological_dilation
Dilate a polygon by radius (outward offset).
morphological_erosion
Erode a polygon by radius (inward offset).
morphological_opening
Morphological opening: erosion followed by dilation.
point_in_polygon
Point-in-polygon test (ray casting).
point_in_tubular
Check if a point is within distance d of a polyline.
point_to_segment_distance
Compute the distance from a point to a line segment.
polygon_area
Absolute area.
polygon_centroid
Centroid of a simple polygon.
polygon_offset
Offset a simple polygon by distance.
polygon_offset_3d
Offset a 3-D polygon (planar) by distance along edge normals.
polygon_offset_round
Polygon offset with arc joins at convex corners.
polygon_perimeter
Perimeter of a polygon.
polyline_offset
Offset an open polyline by distance.
rounded_rectangle
Generate a rounded rectangle polygon.
signed_area
Signed area of a simple polygon (positive = CCW).
tubular_neighborhood
Generate a tubular neighborhood (thickened polyline).