clip_halfspace_polygon

Function clip_halfspace_polygon 

Source
pub fn clip_halfspace_polygon(
    center: Vector,
    normal: Vector,
    polygon: &[Vector],
    result: &mut Vec<Vector>,
)
Expand description

Cuts a polygon with the given half-space.

Given the half-space center and outward normal, this computes the intersecting between the half-space and the polygon. (Note that a point pt is considered as inside of the half-space if normal.dot((pt - center)) <= 0.0.