From a3eee372e49fa8b78cc5d218437f7be250dcae55 Mon Sep 17 00:00:00 2001 From: ramox81 <184937705+ramox81@users.noreply.github.com> Date: Fri, 11 Sep 2026 10:25:10 +0300 Subject: [PATCH] Support first-point reset and same-point breaks --- src/modules/draw/modify/break_cmd.rs | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/modules/draw/modify/break_cmd.rs b/src/modules/draw/modify/break_cmd.rs index 2ce6e8460..0ad841512 100644 --- a/src/modules/draw/modify/break_cmd.rs +++ b/src/modules/draw/modify/break_cmd.rs @@ -382,7 +382,7 @@ impl CadCommand for BreakInteractiveCommand { } else if self.p1.is_none() { crate::t!("BREAK Specify first break point:").into_owned() } else { - crate::t!("BREAK Specify second break point:").into_owned() + crate::t!("BREAK Specify second break point or [First point]:").into_owned() } } @@ -390,6 +390,28 @@ impl CadCommand for BreakInteractiveCommand { self.target.is_none() } + fn options(&self) -> Vec { + if self.target.is_some() && self.p1.is_some() { + vec![crate::command::CmdOption::new("First point", "F")] + } else { + Vec::new() + } + } + + fn on_text_input(&mut self, text: &str) -> Option { + let handle = self.target?; + match text.trim().to_ascii_uppercase().as_str() { + "F" | "FIRST" => { + self.p1 = None; + Some(CmdResult::NeedPoint) + } + "@" => self.p1.map(|point| CmdResult::BreakEntity { + handle, p1: point, p2: point, + }), + _ => None, + } + } + fn on_entity_pick(&mut self, handle: Handle, pt: DVec3) -> CmdResult { if handle.is_null() { return CmdResult::NeedPoint;