pub struct ExactBRep { /* private fields */ }Expand description
Owned, analytic boundary representation.
Every edge and pcurve use has a finite, non-zero native parameter span. An interval is deliberately owned here rather than inferred from endpoints: periodic supports, reversed pcurves, and parameter re-mapping are not recoverable from coordinates. The result may be an open sheet; an eventual exact-solid contract will additionally require a selected closed shell.
Implementations§
Source§impl ExactBRep
impl ExactBRep
Sourcepub fn transformed(
&self,
transform: &DAffine3,
) -> Result<ExactBRep, TransformError>
pub fn transformed( &self, transform: &DAffine3, ) -> Result<ExactBRep, TransformError>
This B-rep moved by the rigid motion transform (#223).
§Exactness
The result is exact for the transform as given in f64, after one
rounding per coordinate – not for the ideal rotation the matrix
approximates. Every vertex position, frame origin and axis, line
origin and direction, and control point is transform applied once
in f64, so each coordinate carries a few units in the last place
of error relative to the ideal placement, and a rotated frame is
orthonormal only to that rounding. A matrix accepted within
RIGID_TOLERANCE is applied as given, not re-orthonormalised.
What IS exact: every curve and surface stays in its own family with
its radii, semi-axes, angles, knots and weights unchanged; the
topology, structural names and parameter intervals are kept (a
reflection reparameterises as below); nothing is tessellated,
sampled or refitted. Vertices and the curves through them are
mapped by the same rounded transform, so they agree to the same
rounding they agreed to before.
A rotation and a translation keep every parameter. A reflection
(determinant -1) keeps each frame right-handed: curved surfaces
(cylinders, elliptical cylinders, cones, spheres, tori) then read
their angle as u -> 2 pi - u and their pcurves are reflected to
match, and every face is flipped, so a solid stays outward oriented
(see the module docs).
§Errors
For every transform:
TransformError::NonFinite: a NaN or infinite matrix entry or translation;TransformError::NotRigid: a linear part whose columns are not orthonormal withinRIGID_TOLERANCEin every dot product – any scale (uniform or not) or shear;TransformError::Unsupported: an elevated alignment curve (Curve3::Elevated), or an unknown curve or surface family.
Additionally under a reflection, TransformError::Unsupported for:
- an intrinsic space curve (its torsion would change sign);
- a ruled or torus section curve, and a traced or paired section on a ruled, spherical or toroidal carrier;
- a lifted pcurve on any face;
- on a curved (non-planar, non-B-spline) face, any pcurve other than a line, circle, ellipse, polyline, B-spline or sinusoid;
- a pcurve shared by faces that would need different reflections.
Source§impl ExactBRep
impl ExactBRep
Sourcepub fn face_name(&self, face: FaceId) -> Option<&FaceName>
pub fn face_name(&self, face: FaceId) -> Option<&FaceName>
Persistent structural name for a face, when the producer supplied one.
Absence means the producing operation did not track provenance, not
that the face is invalid. Callers that require a name should treat
None as a refusal rather than substituting an index.
Sourcepub fn edge_name(&self, edge: EdgeId) -> Option<&EdgeName>
pub fn edge_name(&self, edge: EdgeId) -> Option<&EdgeName>
Persistent structural name for an edge, when the producer supplied one.
Sourcepub fn face_by_name(&self, name: &FaceName) -> Option<FaceId>
pub fn face_by_name(&self, name: &FaceName) -> Option<FaceId>
Find the face carrying name.
This is the lookup that makes names useful across operations: a caller holding a name from before an edit resolves it against the new result instead of hoping an arena index still points at the same face.
Sourcepub fn edge_by_name(&self, name: &EdgeName) -> Option<EdgeId>
pub fn edge_by_name(&self, name: &EdgeName) -> Option<EdgeId>
Find the edge carrying name.
Sourcepub fn name_caps(&mut self, start: Option<FaceName>, end: Option<FaceName>)
pub fn name_caps(&mut self, start: Option<FaceName>, end: Option<FaceName>)
Name the two cap faces of a swept solid after assembly.
The caps are identified by construction order – a sweep adds the
start cap then the end cap before any wall – rather than by
geometry, because a cap that shares a plane with a wall would be
ambiguous geometrically. Passing None leaves that cap unnamed.
Sourcepub fn topology(&self) -> &BRep<Curve3Id, Curve2Id, SurfaceId>
pub fn topology(&self) -> &BRep<Curve3Id, Curve2Id, SurfaceId>
Structural topology with typed support handles.
Sourcepub fn edge_interval(&self, edge: EdgeId) -> Option<Interval>
pub fn edge_interval(&self, edge: EdgeId) -> Option<Interval>
Native parameter span oriented from an edge’s start vertex to its end.