pub struct Solid { /* private fields */ }Expand description
A single solid topology shape wrapping a TopoDS_Shape guaranteed to be TopAbs_SOLID.
inner is private to prevent external mutation that could break the solid invariant.
Use the provided methods to query and transform the solid.
edges / faces are lazy OnceLock caches populated on first iter_edge /
iter_face call. Since topology-changing ops consume self and construct
a new Solid via Solid::new, these caches are invalidated automatically
(new instance → fresh OnceLock::new()). See
notes/20260420-OCCTトポロジ不変性と設計含意.md.
Implementations§
Source§impl Solid
impl Solid
pub fn id(&self) -> u64
pub fn cube(corner0: DVec3, corner1: DVec3) -> Solid
pub fn sphere(radius: f64) -> Solid
pub fn cylinder(r: f64, height: DVec3) -> Solid
pub fn cone(r1: f64, r2: f64, height: DVec3) -> Solid
pub fn torus(r1: f64, r2: f64, axis: DVec3) -> Solid
pub fn half_space(plane_origin: DVec3, plane_normal: DVec3) -> Solid
pub fn iter_edge(&self) -> impl Iterator<Item = &Edge> + '_
pub fn iter_face(&self) -> impl Iterator<Item = &Face> + '_
pub fn iter_history(&self) -> impl Iterator<Item = [u64; 2]> + '_
pub fn volume(&self) -> f64
pub fn area(&self) -> f64
pub fn center(&self) -> DVec3
pub fn inertia(&self) -> DMat3
pub fn contains(&self, point: DVec3) -> bool
pub fn bounding_box(&self) -> [DVec3; 2]
pub fn color(self, color: impl Into<Color>) -> Solid
pub fn color_clear(self) -> Solid
pub fn clean(&self) -> Result<Solid, Error>
pub fn extrude<'a>( profile: impl IntoIterator<Item = &'a Edge>, dir: DVec3, ) -> Result<Solid, Error>
pub fn shell<'a>( &self, thickness: f64, open_faces: impl IntoIterator<Item = &'a Face>, ) -> Result<Solid, Error>
pub fn fillet_edges<'a>( &self, radius: f64, edges: impl IntoIterator<Item = &'a Edge>, ) -> Result<Solid, Error>
pub fn chamfer_edges<'a>( &self, distance: f64, edges: impl IntoIterator<Item = &'a Edge>, ) -> Result<Solid, Error>
pub fn sweep<'a, 'b, 'c>( profile: impl IntoIterator<Item = &'a Edge>, spine: impl IntoIterator<Item = &'b Edge>, orient: ProfileOrient<'c>, ) -> Result<Solid, Error>
pub fn loft<'a, I: IntoIterator<Item = &'a Edge>, S: IntoIterator<Item = I>>( sections: S, ruled: bool, ) -> Result<Solid, Error>
pub fn sew<'a>( faces: impl IntoIterator<Item = &'a Face>, tolerance: f64, ) -> Result<Solid, Error>
pub fn offset_surface( &self, offset: f64, tolerance: f64, ) -> Result<Solid, Error>
pub fn bspline( u: usize, v: usize, u_periodic: bool, point: impl Fn(usize, usize) -> DVec3, ) -> Result<Solid, Error>
pub fn boolean<'a>( solids: impl IntoIterator<Item = &'a Solid>, clauses: impl IntoIterator<Item = i64>, ) -> Boolean<Solid>
pub fn boolean_build(b: &Boolean<Solid>) -> Result<Vec<Solid>, Error>
pub fn read_step<R: Read>(reader: &mut R) -> Result<Vec<Solid>, Error>
pub fn read_brep_binary<R: Read>(reader: &mut R) -> Result<Vec<Solid>, Error>
pub fn read_brep_text<R: Read>(reader: &mut R) -> Result<Vec<Solid>, Error>
pub fn write_step<'a, W: Write>( solids: impl IntoIterator<Item = &'a Solid>, writer: &mut W, ) -> Result<(), Error>
pub fn write_brep_binary<'a, W: Write>( solids: impl IntoIterator<Item = &'a Solid>, writer: &mut W, ) -> Result<(), Error>
pub fn write_brep_text<'a, W: Write>( solids: impl IntoIterator<Item = &'a Solid>, writer: &mut W, ) -> Result<(), Error>
pub fn mesh<'a>( solids: impl IntoIterator<Item = &'a Solid>, options: Tessellation, ) -> Result<Mesh, Error>
pub fn write_multiview_png<W: Write>(&self, writer: &mut W) -> Result<(), Error>
pub fn translate(self, translation: DVec3) -> Solid
pub fn rotate( self, axis_origin: DVec3, axis_direction: DVec3, angle: f64, ) -> Solid
pub fn rotate_x(self, angle: f64) -> Solid
pub fn rotate_y(self, angle: f64) -> Solid
pub fn rotate_z(self, angle: f64) -> Solid
pub fn scale(self, center: DVec3, factor: f64) -> Solid
pub fn mirror(self, plane_origin: DVec3, plane_normal: DVec3) -> Solid
pub fn align_x(self, new_x: DVec3, y_hint: DVec3) -> Solid
pub fn align_y(self, new_y: DVec3, z_hint: DVec3) -> Solid
pub fn align_z(self, new_z: DVec3, x_hint: DVec3) -> Solid
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Solid
impl !Sync for Solid
impl RefUnwindSafe for Solid
impl Send for Solid
impl Unpin for Solid
impl UnsafeUnpin for Solid
impl UnwindSafe for Solid
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