Class Csg
java.lang.Object
eu.svjatoslav.aukio.e3d.renderer.raster.shapes.composite.base.Csg
Pure CSG (Constructive Solid Geometry) boolean engine: union, subtract
and intersect over lists of
SolidPolygons, built on BSP tree
clip/invert sequences.
These are pure functions — they take polygon lists and return new
polygon lists, touching no shape state. AbstractCompositeShape's
instance methods (union/subtract/intersect) delegate here and
handle the child-registry bookkeeping themselves.
All operations clone their inputs first (BSP operations mutate polygons in place), so caller lists are never modified.
-
Method Summary
Modifier and TypeMethodDescriptionstatic List<SolidPolygon> intersect(List<SolidPolygon> a, List<SolidPolygon> b) Intersection of two polygon sets: only the overlapping volume remains.static List<SolidPolygon> subtract(List<SolidPolygon> a, List<SolidPolygon> b) Subtractiona - b: the cutter volume carved out of the target.static List<SolidPolygon> union(List<SolidPolygon> a, List<SolidPolygon> b) Union of two polygon sets: every surface of both, interior faces removed.
-
Method Details
-
union
Union of two polygon sets: every surface of both, interior faces removed.- Parameters:
a- first operand's polygons (not modified)b- second operand's polygons (not modified)- Returns:
- the union result polygons
-
subtract
Subtractiona - b: the cutter volume carved out of the target.- Parameters:
a- target polygons (not modified)b- cutter polygons (not modified)- Returns:
- the difference result polygons
-
intersect
Intersection of two polygon sets: only the overlapping volume remains.- Parameters:
a- first operand's polygons (not modified)b- second operand's polygons (not modified)- Returns:
- the intersection result polygons
-