pub struct Face<S: Scalar> {
pub surface: NurbSurface3D<S>,
pub outer: BoundaryType,
pub holes: Vec<BoundaryType>,
pub shell: ShellId,
}Expand description
A trimmed patch of surface: everything inside outer and outside every
loop in holes.
The two are deliberately separate fields rather than one list with the outer loop by convention at index 0. A face always has exactly one outer boundary — that is what makes it a face — while holes are a genuinely variable collection, and encoding that in the type means no code has to re-establish it. It also removes a whole class of bug where a hole is accidentally treated as the outer loop (or vice versa) after a split/merge reorders the list.
Fields§
§surface: NurbSurface3D<S>§outer: BoundaryType§holes: Vec<BoundaryType>§shell: ShellIdImplementations§
Source§impl<S: Scalar> Face<S>
impl<S: Scalar> Face<S>
Sourcepub fn boundaries(&self) -> impl Iterator<Item = BoundaryType> + '_
pub fn boundaries(&self) -> impl Iterator<Item = BoundaryType> + '_
Every boundary, outer loop first.
Sourcepub fn boundaries_mut(&mut self) -> impl Iterator<Item = &mut BoundaryType> + '_
pub fn boundaries_mut(&mut self) -> impl Iterator<Item = &mut BoundaryType> + '_
Every boundary, outer loop first, for in-place rewriting — used by the operations that re-anchor or rename boundaries wholesale (a vertex being merged away, a loop’s anchor coedge being deleted) without caring which kind each one is.
Sourcepub fn boundary(&self, index: BoundaryIndex) -> Option<BoundaryType>
pub fn boundary(&self, index: BoundaryIndex) -> Option<BoundaryType>
The boundary index names, or None if it names a hole this face
does not have.
Sourcepub fn set_boundary(
&mut self,
index: BoundaryIndex,
boundary: BoundaryType,
) -> bool
pub fn set_boundary( &mut self, index: BoundaryIndex, boundary: BoundaryType, ) -> bool
Re-anchor the boundary index names on a different loop. Needed after
any restructuring that rewires next/prev, since the previous
anchor may no longer sit on the ring the boundary now describes.