Skip to main content

Solid

Struct Solid 

Source
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

Source

pub fn colormap(&self) -> &HashMap<u64, Color>

Read-only access to the per-face colormap.

Source

pub fn colormap_mut(&mut self) -> &mut HashMap<u64, Color>

Mutable access to the per-face colormap.

Source

pub fn is_null(&self) -> bool

Returns true if this solid wraps a null shape.

Source§

impl Solid

Source

pub fn id(&self) -> u64

Source

pub fn cube(corner0: DVec3, corner1: DVec3) -> Solid

Source

pub fn sphere(radius: f64) -> Solid

Source

pub fn cylinder(r: f64, height: DVec3) -> Solid

Source

pub fn cone(r1: f64, r2: f64, height: DVec3) -> Solid

Source

pub fn torus(r1: f64, r2: f64, axis: DVec3) -> Solid

Source

pub fn half_space(plane_origin: DVec3, plane_normal: DVec3) -> Solid

Source

pub fn iter_edge(&self) -> impl Iterator<Item = &Edge> + '_

Source

pub fn iter_face(&self) -> impl Iterator<Item = &Face> + '_

Source

pub fn iter_history(&self) -> impl Iterator<Item = [u64; 2]> + '_

Source

pub fn volume(&self) -> f64

Source

pub fn area(&self) -> f64

Source

pub fn center(&self) -> DVec3

Source

pub fn inertia(&self) -> DMat3

Source

pub fn contains(&self, point: DVec3) -> bool

Source

pub fn bounding_box(&self) -> [DVec3; 2]

Source

pub fn color(self, color: impl Into<Color>) -> Solid

Source

pub fn color_clear(self) -> Solid

Source

pub fn clean(&self) -> Result<Solid, Error>

Source

pub fn extrude<'a>( profile: impl IntoIterator<Item = &'a Edge>, dir: DVec3, ) -> Result<Solid, Error>

Source

pub fn shell<'a>( &self, thickness: f64, open_faces: impl IntoIterator<Item = &'a Face>, ) -> Result<Solid, Error>

Source

pub fn fillet_edges<'a>( &self, radius: f64, edges: impl IntoIterator<Item = &'a Edge>, ) -> Result<Solid, Error>

Source

pub fn chamfer_edges<'a>( &self, distance: f64, edges: impl IntoIterator<Item = &'a Edge>, ) -> Result<Solid, Error>

Source

pub fn sweep<'a, 'b, 'c>( profile: impl IntoIterator<Item = &'a Edge>, spine: impl IntoIterator<Item = &'b Edge>, orient: ProfileOrient<'c>, ) -> Result<Solid, Error>

Source

pub fn loft<'a, I: IntoIterator<Item = &'a Edge>, S: IntoIterator<Item = I>>( sections: S, ruled: bool, ) -> Result<Solid, Error>

Source

pub fn sew<'a>( faces: impl IntoIterator<Item = &'a Face>, tolerance: f64, ) -> Result<Solid, Error>

Source

pub fn offset_surface( &self, offset: f64, tolerance: f64, ) -> Result<Solid, Error>

Source

pub fn bspline( u: usize, v: usize, u_periodic: bool, point: impl Fn(usize, usize) -> DVec3, ) -> Result<Solid, Error>

Source

pub fn boolean<'a>( solids: impl IntoIterator<Item = &'a Solid>, clauses: impl IntoIterator<Item = i64>, ) -> Boolean<Solid>

Source

pub fn boolean_build(b: &Boolean<Solid>) -> Result<Vec<Solid>, Error>

Source

pub fn read_step<R: Read>(reader: &mut R) -> Result<Vec<Solid>, Error>

Source

pub fn read_brep_binary<R: Read>(reader: &mut R) -> Result<Vec<Solid>, Error>

Source

pub fn read_brep_text<R: Read>(reader: &mut R) -> Result<Vec<Solid>, Error>

Source

pub fn write_step<'a, W: Write>( solids: impl IntoIterator<Item = &'a Solid>, writer: &mut W, ) -> Result<(), Error>

Source

pub fn write_brep_binary<'a, W: Write>( solids: impl IntoIterator<Item = &'a Solid>, writer: &mut W, ) -> Result<(), Error>

Source

pub fn write_brep_text<'a, W: Write>( solids: impl IntoIterator<Item = &'a Solid>, writer: &mut W, ) -> Result<(), Error>

Source

pub fn mesh<'a>( solids: impl IntoIterator<Item = &'a Solid>, options: Tessellation, ) -> Result<Mesh, Error>

Source

pub fn write_multiview_png<W: Write>(&self, writer: &mut W) -> Result<(), Error>

Source

pub fn translate(self, translation: DVec3) -> Solid

Source

pub fn rotate( self, axis_origin: DVec3, axis_direction: DVec3, angle: f64, ) -> Solid

Source

pub fn rotate_x(self, angle: f64) -> Solid

Source

pub fn rotate_y(self, angle: f64) -> Solid

Source

pub fn rotate_z(self, angle: f64) -> Solid

Source

pub fn scale(self, center: DVec3, factor: f64) -> Solid

Source

pub fn mirror(self, plane_origin: DVec3, plane_normal: DVec3) -> Solid

Source

pub fn align_x(self, new_x: DVec3, y_hint: DVec3) -> Solid

Source

pub fn align_y(self, new_y: DVec3, z_hint: DVec3) -> Solid

Source

pub fn align_z(self, new_z: DVec3, x_hint: DVec3) -> Solid

Trait Implementations§

Source§

impl Add for Solid

Source§

type Output = Boolean<Solid>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Solid) -> Boolean<Solid>

Performs the + operation. Read more
Source§

impl Add<&Solid> for Solid

Source§

type Output = Boolean<Solid>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &Solid) -> Boolean<Solid>

Performs the + operation. Read more
Source§

impl Add<&Solid> for &Solid

Source§

type Output = Boolean<Solid>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &Solid) -> Boolean<Solid>

Performs the + operation. Read more
Source§

impl Add<Boolean<Solid>> for Solid

Source§

type Output = Boolean<Solid>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Boolean<Solid>) -> Boolean<Solid>

Performs the + operation. Read more
Source§

impl Add<Boolean<Solid>> for &Solid

Source§

type Output = Boolean<Solid>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Boolean<Solid>) -> Boolean<Solid>

Performs the + operation. Read more
Source§

impl Add<Solid> for &Solid

Source§

type Output = Boolean<Solid>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Solid) -> Boolean<Solid>

Performs the + operation. Read more
Source§

impl Clone for Solid

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Mul for Solid

Source§

type Output = Boolean<Solid>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Solid) -> Boolean<Solid>

Performs the * operation. Read more
Source§

impl Mul<&Solid> for Solid

Source§

type Output = Boolean<Solid>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Solid) -> Boolean<Solid>

Performs the * operation. Read more
Source§

impl Mul<&Solid> for &Solid

Source§

type Output = Boolean<Solid>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Solid) -> Boolean<Solid>

Performs the * operation. Read more
Source§

impl Mul<Boolean<Solid>> for Solid

Source§

type Output = Boolean<Solid>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Boolean<Solid>) -> Boolean<Solid>

Performs the * operation. Read more
Source§

impl Mul<Boolean<Solid>> for &Solid

Source§

type Output = Boolean<Solid>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Boolean<Solid>) -> Boolean<Solid>

Performs the * operation. Read more
Source§

impl Mul<Solid> for &Solid

Source§

type Output = Boolean<Solid>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Solid) -> Boolean<Solid>

Performs the * operation. Read more
Source§

impl Sub for Solid

Source§

type Output = Boolean<Solid>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Solid) -> Boolean<Solid>

Performs the - operation. Read more
Source§

impl Sub<&Solid> for Solid

Source§

type Output = Boolean<Solid>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &Solid) -> Boolean<Solid>

Performs the - operation. Read more
Source§

impl Sub<&Solid> for &Solid

Source§

type Output = Boolean<Solid>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &Solid) -> Boolean<Solid>

Performs the - operation. Read more
Source§

impl Sub<Boolean<Solid>> for Solid

Source§

type Output = Boolean<Solid>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Boolean<Solid>) -> Boolean<Solid>

Performs the - operation. Read more
Source§

impl Sub<Boolean<Solid>> for &Solid

Source§

type Output = Boolean<Solid>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Boolean<Solid>) -> Boolean<Solid>

Performs the - operation. Read more
Source§

impl Sub<Solid> for &Solid

Source§

type Output = Boolean<Solid>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Solid) -> Boolean<Solid>

Performs the - operation. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.