pub struct Solid3D {
pub faces: Vec<Face3D>,
}Expand description
A 3D Planar B-Rep solid (or multi-shell collection) represented as a set of oriented planar faces.
Fields§
§faces: Vec<Face3D>Implementations§
Source§impl Solid3D
impl Solid3D
pub fn new(faces: Vec<Face3D>) -> Self
Sourcepub fn from_box(min: [f64; 3], max: [f64; 3]) -> Self
pub fn from_box(min: [f64; 3], max: [f64; 3]) -> Self
Construct an axis-aligned box [min_x, max_x] × [min_y, max_y] × [min_z, max_z] with 6 CCW outward planar faces.
Sourcepub fn from_extruded_polygon(
outer_xy: &[[f64; 2]],
holes_xy: &[Vec<[f64; 2]>],
z_min: f64,
z_max: f64,
) -> Self
pub fn from_extruded_polygon( outer_xy: &[[f64; 2]], holes_xy: &[Vec<[f64; 2]>], z_min: f64, z_max: f64, ) -> Self
Construct a right prism by extruding a 2D polygon along the Z axis from z_min to z_max.
Sourcepub fn volume(&self) -> f64
pub fn volume(&self) -> f64
Compute total signed volume via the Divergence Theorem:
V = (1/6) ∑_{F} ∑_{ring ∈ F} ∑_{i} p_0 · (ring[i] × ring[i+1]).
Sourcepub fn surface_area(&self) -> f64
pub fn surface_area(&self) -> f64
Compute total surface area of all faces in the solid.
Trait Implementations§
impl StructuralPartialEq for Solid3D
Auto Trait Implementations§
impl Freeze for Solid3D
impl RefUnwindSafe for Solid3D
impl Send for Solid3D
impl Sync for Solid3D
impl Unpin for Solid3D
impl UnsafeUnpin for Solid3D
impl UnwindSafe for Solid3D
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more