From f4a0b1d68be7bc3f0637cfb47ab7663c697725c2 Mon Sep 17 00:00:00 2001 From: ramox81 <184937705+ramox81@users.noreply.github.com> Date: Mon, 12 Oct 2026 09:53:07 +0300 Subject: [PATCH] Apply an EXTRUDE taper only when it is chosen A taper angle given in one EXTRUDE was applied to every later extrusion. As in the reference, a new extrusion has no taper; the last angle stays the Taper angle prompt's default. Co-Authored-By: Claude Opus 5.5 --- src/modules/insert/solid3d_cmds.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/modules/insert/solid3d_cmds.rs b/src/modules/insert/solid3d_cmds.rs index 3e3d1ab1b..81969ef8d 100644 --- a/src/modules/insert/solid3d_cmds.rs +++ b/src/modules/insert/solid3d_cmds.rs @@ -26,6 +26,9 @@ pub struct ExtrudeCommand { direction_start: Option, mode: ExtrudeMode, taper_angle: f64, + /// The taper prompt's default: the last angle given, which a new + /// extrusion does not apply until the Taper angle option is chosen. + taper_default: f64, last_height: Option, taper_return: ExtrudeStep, color: [f32; 4], @@ -80,7 +83,8 @@ impl ExtrudeCommand { profile_direction: None, direction_start: None, mode: defaults.mode, - taper_angle: defaults.taper_angle, + taper_angle: 0.0, + taper_default: defaults.taper_angle, last_height: defaults.height, taper_return: ExtrudeStep::Height, color, @@ -242,7 +246,7 @@ impl CadCommand for ExtrudeCommand { ExtrudeStep::Taper => format!( "{} <{}>:", t!("EXTRUDE Specify taper angle or [Expression]"), - crate::entities::common::format_angle(self.taper_angle) + crate::entities::common::format_angle(self.taper_default) ), ExtrudeStep::Expression => t!("EXTRUDE Enter height expression:").into_owned(), ExtrudeStep::TaperExpression => { @@ -415,7 +419,7 @@ impl CadCommand for ExtrudeCommand { if !angle.is_finite() || angle.abs() >= std::f64::consts::FRAC_PI_2 { return Some(CmdResult::NeedPoint); } - self.taper_angle = angle; + (self.taper_angle, self.taper_default) = (angle, angle); extrude_defaults() .lock() .unwrap_or_else(|error| error.into_inner()) @@ -432,7 +436,7 @@ impl CadCommand for ExtrudeCommand { if !angle.is_finite() || angle.abs() >= std::f64::consts::FRAC_PI_2 { return Some(CmdResult::NeedPoint); } - self.taper_angle = angle; + (self.taper_angle, self.taper_default) = (angle, angle); extrude_defaults() .lock() .unwrap_or_else(|error| error.into_inner()) @@ -459,6 +463,7 @@ impl CadCommand for ExtrudeCommand { .map(|height| self.finish(ExtrudeExtent::Height(height))) .unwrap_or(CmdResult::Cancel), ExtrudeStep::Taper => { + self.taper_angle = self.taper_default; self.step = self.taper_return; CmdResult::NeedPoint }