Skip to main content

ExactBRep

Struct ExactBRep 

Source
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

Source

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:

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

Source

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.

Source

pub fn edge_name(&self, edge: EdgeId) -> Option<&EdgeName>

Persistent structural name for an edge, when the producer supplied one.

Source

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.

Source

pub fn edge_by_name(&self, name: &EdgeName) -> Option<EdgeId>

Find the edge carrying name.

Source

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.

Source

pub fn topology(&self) -> &BRep<Curve3Id, Curve2Id, SurfaceId>

Structural topology with typed support handles.

Source

pub fn curves3(&self) -> &[Curve3]

Owned exact 3D curve supports.

Source

pub fn curves2(&self) -> &[Curve2]

Owned exact 2D trim-curve supports.

Source

pub fn surfaces(&self) -> &[Surface]

Owned exact support surfaces.

Source

pub fn edge_interval(&self, edge: EdgeId) -> Option<Interval>

Native parameter span oriented from an edge’s start vertex to its end.

Source

pub fn pcurve_interval( &self, loop_id: LoopId, use_index: usize, ) -> Option<Interval>

Native parameter span for an edge use’s pcurve in loop traversal order.

Trait Implementations§

Source§

impl Clone for ExactBRep

Source§

fn clone(&self) -> ExactBRep

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 Debug for ExactBRep

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl PartialEq for ExactBRep

Source§

fn eq(&self, other: &ExactBRep) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ExactBRep

Auto Trait Implementations§

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.