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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MNXLXkZLQ6T7TSi4wswcmk
This commit is contained in:
1 parent
b09c48a42a
commit
fe44a27e33
1 file changed
+11
-2
+11
-2
@@ -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<bool>)> {
|
||||
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
|
||||
|
||||
Reference in new issue
Block a user