From fe44a27e332135e502e4dae58a9191b4fa8a1dbe Mon Sep 17 00:00:00 2001 From: brett19 Date: Sat, 31 Oct 2026 04:59:21 +0100 Subject: [PATCH] smlib: blend_dropping routes to solidcore (capi 241f7ba) The overflow-first rounds need the fork's cliff overflow, which solidcore has not ported: on solidcore the rounds blend together and no pick is dropped. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01MNXLXkZLQ6T7TSi4wswcmk --- crates/smlib/src/ops.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/crates/smlib/src/ops.rs b/crates/smlib/src/ops.rs index 47333a9e2..5ba35511a 100644 --- a/crates/smlib/src/ops.rs +++ b/crates/smlib/src/ops.rs @@ -222,18 +222,27 @@ impl Brep { /// [`Brep::blend`], with whether each point picked an edge that a larger round, overflowing /// its faces, removed whole: that edge is gone and not rounded (SMLib rounds the edges whose /// blends overflow first, then what is left of the others). + /// + /// On solidcore no point is dropped: the overflow that goes first (`smlib_blend_dropping`'s + /// `SetOverflowFirst`, fork 241f7ba) builds on the fork's cliff overflow + /// (`SmFilletCliffOverflow`), which solidcore has not ported: there the rounds are blended + /// together, as [`Brep::blend`] blends them. pub fn blend_dropping(&self, kind: Blend, edges: &[[f64; 3]], sizes: &[f64], tolerance: f64) -> Result<(Brep, Vec)> { - init()?; if edges.len() > MAX_POINTS || edges.is_empty() || sizes.len() != edges.len() { return Err(Error::Argument); } + if route::Op::Blend.backend() == route::Backend::Solidcore { + let out = self.core_blend(kind, edges, sizes, tolerance, &[], &[], core::blend::Corners::Filled)?; + return Ok((out, vec![false; edges.len()])); + } + init()?; let kind = match kind { Blend::Round => ffi::ops::BLEND_ROUND, Blend::Curvature => ffi::ops::BLEND_CURVATURE, Blend::Chord => ffi::ops::BLEND_CHORD, Blend::Chamfer => ffi::ops::BLEND_CHAMFER, }; - ffi::ops::blend_dropping(kind, &self.0, edges, sizes, tolerance).map(|(b, d)| (Brep(b), d)).map_err(pick_error) + ffi::ops::blend_dropping(kind, self.cpp()?, edges, sizes, tolerance).map(|(b, d)| (Brep::made(b), d)).map_err(pick_error) } /// [`Brep::blend`] with corner setbacks: each of `corners` picks the vertex nearest it