Cuttable

Trait Cuttable 

Source
pub trait Cuttable {
    // Required method
    fn cut(&self, plane: &Plane3D) -> (Option<Polygon>, Option<Polygon>);
}
Expand description

Trait for geometry that can be cut by a plane.

Required Methods§

Source

fn cut(&self, plane: &Plane3D) -> (Option<Polygon>, Option<Polygon>)

Cuts the geometry by a plane.

Returns (front, back) where:

  • front: Some(polygon) containing the part on the front side of the plane
  • back: Some(polygon) containing the part on the back side of the plane
§Return values by classification
  • Front: (Some(self), None) - entire geometry is in front
  • Back: (None, Some(self)) - entire geometry is behind
  • Coplanar: (Some(self), None) - treated as front
  • Spanning: (Some(front_part), Some(back_part)) - split into two pieces

Implementors§