Crate plane_split [] [src]

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.

Line

A generic line.

LineProjection

The projection of a Polygon on a line.

NaiveSplitter

Naive plane splitter, has at least O(n2) complexity.

Polygon

A convex flat polygon with 4 points, defined by equation: dot(v, normal) + offset = 0

Enums

Intersection

Polygon intersection results.

Traits

Splitter

Generic plane splitter interface

Functions

_make_grid

Helper method used for benchmarks and tests. Constructs a 3D grid of polygons.