pub struct PartResolver<'a, A: ArchiveReader> { /* private fields */ }Expand description
Resolves resources across multiple model parts in a 3MF package.
Implementations§
Source§impl<'a, A: ArchiveReader> PartResolver<'a, A>
impl<'a, A: ArchiveReader> PartResolver<'a, A>
Sourcepub fn new(archive: &'a mut A, root_model: Model) -> Self
pub fn new(archive: &'a mut A, root_model: Model) -> Self
Creates a new PartResolver with the given archive and root model.
Sourcepub fn resolve_object(
&mut self,
id: ResourceId,
path: Option<&str>,
) -> Result<Option<(&Model, &Object)>>
pub fn resolve_object( &mut self, id: ResourceId, path: Option<&str>, ) -> Result<Option<(&Model, &Object)>>
Resolves an object by ID and optional model part path.
Sourcepub fn resolve_base_materials(
&mut self,
id: ResourceId,
path: Option<&str>,
) -> Result<Option<&BaseMaterialsGroup>>
pub fn resolve_base_materials( &mut self, id: ResourceId, path: Option<&str>, ) -> Result<Option<&BaseMaterialsGroup>>
Resolves a base materials group by ID and optional model part path.
Sourcepub fn resolve_color_group(
&mut self,
id: ResourceId,
path: Option<&str>,
) -> Result<Option<&ColorGroup>>
pub fn resolve_color_group( &mut self, id: ResourceId, path: Option<&str>, ) -> Result<Option<&ColorGroup>>
Resolves a color group by ID and optional model part path.
Sourcepub fn get_root_model(&self) -> &Model
pub fn get_root_model(&self) -> &Model
Returns a reference to the root model.
Sourcepub fn archive_mut(&mut self) -> &mut A
pub fn archive_mut(&mut self) -> &mut A
Returns a mutable reference to the underlying archive reader.
Sourcepub fn resolve_meshes(
&mut self,
options: &ResolveOptions,
) -> Result<Vec<ResolvedMesh>>
pub fn resolve_meshes( &mut self, options: &ResolveOptions, ) -> Result<Vec<ResolvedMesh>>
Resolves all printable meshes from the build, flattening component hierarchies.
Walks build items → component trees → sub-model files (via Production Extension
p:path references), accumulates transforms, and returns a flat Vec<ResolvedMesh>.
§Filtering
options.filter_non_printable(defaulttrue): skipBuildItem.printable == Some(false)options.filter_other_objects(defaulttrue): skip leaf objects withObjectType::Other
§Transform accumulation
Each ResolvedMesh.transform is the accumulated product of transforms along the
build item → component chain: build_item.transform * comp1.transform * comp2.transform ...
Transforms are NOT pre-applied to vertex positions; the consumer applies them in their
own coordinate space and precision.
§Errors
Returns an error if:
- A component references an object that does not exist in the target model
- A missing sub-model file is referenced
- A component cycle is detected (same
(object_id, path)in the current ancestry) - The component nesting depth exceeds
options.max_depth
Auto Trait Implementations§
impl<'a, A> Freeze for PartResolver<'a, A>
impl<'a, A> RefUnwindSafe for PartResolver<'a, A>where
A: RefUnwindSafe,
impl<'a, A> Send for PartResolver<'a, A>where
A: Send,
impl<'a, A> Sync for PartResolver<'a, A>where
A: Sync,
impl<'a, A> Unpin for PartResolver<'a, A>
impl<'a, A> UnsafeUnpin for PartResolver<'a, A>
impl<'a, A> !UnwindSafe for PartResolver<'a, A>
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more