Skip to main content

ChamferBuilder

Struct ChamferBuilder 

Source
pub struct ChamferBuilder<'a> { /* private fields */ }
Expand description

Builder for chamfer (bevel) operations on solid edges.

Collects edge sets with their distance parameters, then computes and assembles the chamfered solid in a single build() call.

Implementations§

Source§

impl<'a> ChamferBuilder<'a>

Source

pub fn new(topo: &'a mut Topology, solid: SolidId) -> Self

Create a new chamfer builder for the given solid.

Source

pub fn add_edges_symmetric(&mut self, edges: &[EdgeId], d: f64) -> &mut Self

Add edges with symmetric chamfer distance (d1 = d2 = d).

Returns &mut Self for method chaining.

Source

pub fn add_edges_asymmetric( &mut self, edges: &[EdgeId], d1: f64, d2: f64, ) -> &mut Self

Add edges with asymmetric chamfer distances.

d1 is the distance on face 1, d2 on face 2.

Returns &mut Self for method chaining.

Source

pub fn add_edges_distance_angle( &mut self, edges: &[EdgeId], distance: f64, angle: f64, ) -> &mut Self

Add edges with distance-angle chamfer.

distance is measured on face 1; angle (radians) determines the depth on face 2 as distance * tan(angle).

Returns &mut Self for method chaining.

Source

pub fn build(self) -> Result<BlendResult, BlendError>

Compute and build the chamfered solid.

§Algorithm
  1. Build adjacency index for the solid.
  2. For each target edge, find the two adjacent faces.
  3. Build single-edge spines (no chain propagation in v1).
  4. Compute stripes via analytic fast path or record failure.
  5. Trim adjacent faces along contact curves.
  6. Assemble new solid from trimmed faces, blend faces, and untouched original faces.
§Errors

Returns BlendError if no edges were specified, or if topology lookups fail. Individual edge failures are recorded in BlendResult::failed rather than aborting the whole operation.

Auto Trait Implementations§

§

impl<'a> !UnwindSafe for ChamferBuilder<'a>

§

impl<'a> Freeze for ChamferBuilder<'a>

§

impl<'a> RefUnwindSafe for ChamferBuilder<'a>

§

impl<'a> Send for ChamferBuilder<'a>

§

impl<'a> Sync for ChamferBuilder<'a>

§

impl<'a> Unpin for ChamferBuilder<'a>

§

impl<'a> UnsafeUnpin for ChamferBuilder<'a>

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.