class CSG::Node
- CSG::Node
- Reference
- Object
Overview
Holds a node in a BSP tree. A BSP tree is built from a collection of polygons by picking a polygon to split along. That polygon (and all other coplanar polygons) are added directly to that node and the other polygons are added to the front and/or back subtrees. This is not a leafy BSP tree since there is no distinction between internal and leaf nodes.
Defined in:
primitives/node.crConstructors
Instance Method Summary
- #add_polygon(p : Polygon)
-
#all_polygons : Array(Polygon)
Return a list of all polygons in this BSP tree.
- #back=(back : Nil | CSG::Node)
-
#build(polygons : Array(Polygon))
Build a BSP tree out of
polygons
. -
#clip_polygons(polygons : Array(Polygon)) : Array(Polygon)
Recursively remove all polygons in
polygons
that are inside this BSP tree. -
#clip_to(bsp : Node)
Remove all polygons in this BSP tree that are inside the other BSP tree bsp
- #clone
- #front=(front : Nil | CSG::Node)
-
#invert
Convert solid space to empty space and empty space to solid space.
- #plane=(plane : Nil | CSG::Plane)
Constructor Detail
Instance Method Detail
Build a BSP tree out of polygons
. When called on an existing tree, the
new polygons are filtered down to the bottom of the tree and become new
nodes there. Each set of polygons is partitioned using the first polygon
(no heuristic is used to pick a good split).
Recursively remove all polygons in polygons
that are inside this BSP tree.
Remove all polygons in this BSP tree that are inside the other BSP tree bsp