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§
Sourcefn cut(&self, plane: &Plane3D) -> (Option<Polygon>, Option<Polygon>)
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 planeback: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
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".