Skip to content

PolygonalBoolean

Overview

Allows computing boolean operations on polygons (e.g. union, intersection, difference/complement)

@author Jonathan Olson <jonathan.olson@colorado.edu>

Class PolygonalBoolean

import { PolygonalBoolean } from 'scenerystack/alpenglow';

Static Methods

union( ...paths : RenderPath[] ) : Vector2[][]

intersection( ...paths : RenderPath[] ) : Vector2[][]

difference( pathA : RenderPath, pathB : RenderPath ) : Vector2[][]

getOverlaps( pathA : RenderPath, pathB : RenderPath ) : { intersection: Vector2[][]; aOnly: Vector2[][]; bOnly: Vector2[][] }

cag( paths : RenderPath[], getFaceData : ( face: RationalFace ) => FaceData, createOutputFace : ( face: PolygonalFace, faceData: FaceData, bounds: Bounds2 ) => OutputFace, isFaceDataCompatible : ( faceData1: FaceData, faceData2: FaceData | null ) => boolean, log : RasterTileLog | null ) : OutputFace[]

TODO: ideally handle the fully collinear simplification?

Source Code

See the source for PolygonalBoolean.ts in the alpenglow repository.