Crate plane_split

Source
Expand description

Plane splitting.

Uses euclid for the math basis. Introduces new geometrical primitives and associated logic.

Automatically splits a given set of 4-point polygons into sub-polygons that don’t intersect each other. This is useful for WebRender, to sort the resulting sub-polygons by depth and avoid transparency blending issues.

Structs§

BspSplitter
Binary Space Partitioning splitter, uses a BSP tree.
Clipper
A helper object to clip polygons by a number of planes.
Line
A generic line.
LineProjection
The projection of a Polygon on a line.
NegativeHemisphereError
An error returned when everything would end up projected to the negative hemisphere (W <= 0.0);
Plane
An infinite plane in 3D space, defined by equation: dot(v, normal) + offset = 0 When used for plane splitting, it’s defining a hemisphere with equation “dot(v, normal) + offset > 0”.
Polygon
A convex polygon with 4 points lying on a plane.

Enums§

Intersection
Polygon intersection results.
PlaneCut
The result of a polygon being cut by a plane. The “cut” here is an attempt to classify a plane as being in front or in the back of another one.