OpenGeometry and need no body.
Region shapes
A region is an outer ring and a list of hole rings. There are two kinds:
Edge points are
[x, z]. Arc angles are in radians. Outer rings run clockwise in XZ and holes counter-clockwise.
1 0.75. The west side moves in 0.1 m and the other edges 0.25 m. The arc keeps its centre, so its radius goes from 1 to 0.75.
Booleans
OpenGeometry.booleanRegions2D(a, b, operation) and OpenGeometry.booleanCurvedRegions2D(a, b, operation) take two lists of regions. operation is 'union', 'intersection' or 'subtraction'.
- Results come back at the input height, wound the same way. Each planar ring starts at its smallest x.
- The tolerance is fixed at
OG_REGION_TOLERANCE,1e-6m. - A plain ring is not a region and throws
InvalidParameter. - More than 100 000 points or edges across both operands throws
LimitExceeded.
Insets and offsets
Rings and paths are flat
[x, y, z, ...] lists or a Float64Array; y is ignored. The region calls return CurvedRegion2D[] with exact lines and arcs. An inside corner of an inset is one arc of the setback.
1 2 1 1.
Rules for offsetCurvedRingVariable
- One distance per edge, finite and not negative. A distance of 0 keeps its edge.
- Where two edges meet tangentially and get different distances, the inset joins them with an extra arc.
- An arc stays on its centre. A convex arc moves to
r − d; a concave arc, or an arc of a hole, tor + d. - A distance larger than an arc’s radius, a wrong count, or a negative or non-finite distance throws
InvalidParameter. - A result that collapses is an empty list.
Rules for offsetPolyline
acuteThresholdDegreesdefaults to 35 andbeveltotrue.- When
closedis left out, a path whose ends meet is closed.

