feat: fillet radius tapers along an edge to the room there (#749)

Adds `fit: taper` to Fillet: where a constant radius doesn't fit along a straight edge, it follows the room there as a smooth spline, down to zero where a face closes to a point. Taper to Fit is in the Fillet dialog, and the feature's warning says how far it tapered.
This commit is contained in:
Irakli Kourtis authored and GitHub committed 2026-10-13 11:45:33 -04:00
1 parent 1a5e961362
commit 1d30e4e1d2
8 files changed
+576 -197

No files matched your search

+21 -6
View File
@@ -1715,11 +1715,18 @@ pub fn show(app: &mut SolveApp, ctx: &egui::Context) {
);
enter |= field(ui, radius);
ui.end_row();
// A constant radius too large for the edges: refused, or reduced to the
// largest that fits (the preview shows what was used).
// A constant radius too large for the edges: refused, reduced to the
// largest that fits (the preview shows what was used), or tapered along
// the edges to the room there.
if !*chamfer && rtype == 0 {
row_label(ui, "Radius Fit");
let fit = extra_choice(ui, &mut d.extra, "fi_fit", "fit", &[("Exact", "exact"), ("Reduce to Fit", "reduce")]);
let fit = extra_choice(
ui,
&mut d.extra,
"fi_fit",
"fit",
&[("Exact", "exact"), ("Reduce to Fit", "reduce"), ("Taper to Fit", "taper")],
);
ui.end_row();
if fit == 1
&& let Some((lo, hi)) = app.preview.applied
@@ -3552,9 +3559,17 @@ pub fn for_feature(app: &SolveApp, id: u64, marker: Option<usize>) -> Option<Dia
*flip = *f;
}
}
// A fillet that reduces a radius too large for its edges.
if let FeatureKind::Fillet { fit: solidcraft_engine::doc::FilletFit::Reduce, .. } = &f.kind {
d.extra.insert("fit".into(), json!("reduce"));
// A fillet that reduces or tapers a radius too large for its edges.
if let FeatureKind::Fillet { fit, .. } = &f.kind {
use solidcraft_engine::doc::FilletFit;
let mode = match fit {
FilletFit::Exact => None,
FilletFit::Reduce => Some("reduce"),
FilletFit::Taper => Some("taper"),
};
if let Some(mode) = mode {
d.extra.insert("fit".into(), json!(mode));
}
}
// A chord-length or variable fillet.
if let FeatureKind::Fillet { style, .. } = &f.kind {