pub struct AssemblyComponent {
pub name: String,
pub solid: BrepSolid,
pub transform: AssemblyTransform,
pub children: Vec<AssemblyComponent>,
}Expand description
A component in an assembly.
Fields§
§name: StringComponent name.
solid: BrepSolidBREP solid geometry.
transform: AssemblyTransformTransform relative to parent.
children: Vec<AssemblyComponent>Child components.
Implementations§
Source§impl AssemblyComponent
impl AssemblyComponent
Sourcepub fn new(name: &str, solid: BrepSolid, transform: AssemblyTransform) -> Self
pub fn new(name: &str, solid: BrepSolid, transform: AssemblyTransform) -> Self
Create a new component.
Sourcepub fn add_child(&mut self, child: AssemblyComponent)
pub fn add_child(&mut self, child: AssemblyComponent)
Add a child component.
Sourcepub fn total_components(&self) -> usize
pub fn total_components(&self) -> usize
Count total components (including self).
Sourcepub fn world_bounding_box(&self) -> BoundingBox
pub fn world_bounding_box(&self) -> BoundingBox
Compute the bounding box in world space.
Sourcepub fn leaf_names(&self) -> Vec<String>
pub fn leaf_names(&self) -> Vec<String>
Collect all leaf component names.
Trait Implementations§
Source§impl Clone for AssemblyComponent
impl Clone for AssemblyComponent
Source§fn clone(&self) -> AssemblyComponent
fn clone(&self) -> AssemblyComponent
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for AssemblyComponent
impl RefUnwindSafe for AssemblyComponent
impl Send for AssemblyComponent
impl Sync for AssemblyComponent
impl Unpin for AssemblyComponent
impl UnsafeUnpin for AssemblyComponent
impl UnwindSafe for AssemblyComponent
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.