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>
impl<'a> ChamferBuilder<'a>
Sourcepub fn new(topo: &'a mut Topology, solid: SolidId) -> Self
pub fn new(topo: &'a mut Topology, solid: SolidId) -> Self
Create a new chamfer builder for the given solid.
Sourcepub fn add_edges_symmetric(&mut self, edges: &[EdgeId], d: f64) -> &mut Self
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.
Sourcepub fn add_edges_asymmetric(
&mut self,
edges: &[EdgeId],
d1: f64,
d2: f64,
) -> &mut Self
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.
Sourcepub fn add_edges_distance_angle(
&mut self,
edges: &[EdgeId],
distance: f64,
angle: f64,
) -> &mut Self
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.
Sourcepub fn build(self) -> Result<BlendResult, BlendError>
pub fn build(self) -> Result<BlendResult, BlendError>
Compute and build the chamfered solid.
§Algorithm
- Build adjacency index for the solid.
- For each target edge, find the two adjacent faces.
- Build single-edge spines (no chain propagation in v1).
- Compute stripes via analytic fast path or record failure.
- Trim adjacent faces along contact curves.
- 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.