Report a missed first 2Points pick at once for Horizontal/Vertical

The first empty-space click of the 2Points flow was only resolved against
the document together with the second one, so "No valid constraint point
found." appeared one pick late. The command now hands the first pick to
the host (`CmdResult::CheckHorizontalPoint`), which resolves it right away:
a miss reports and re-asks for the first point, a hit moves on to the
second point.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
ramox81andClaude Fable 5.1 committed 2026-09-18 20:36:01 +03:00
1 parent a7ab5314f2
commit cda0627804
3 files changed
+44 -8

No files matched your search

+25
View File
@@ -3318,6 +3318,31 @@ impl OpenCADStudio {
}
};
}
CmdResult::CheckHorizontalPoint { kind, pick } => {
use crate::modules::parametric::HorizontalConstraintCommand;
use crate::scene::parametric_constraints::nearest_parametric_point;
// The reference rejects a missed first point right away and
// asks for it again; a hit moves on to the second point.
let scope = self.tabs[i].current_parametric_scope();
let found = nearest_parametric_point(
&self.tabs[i].scene.document,
scope,
acadrust::types::Vector3::new(pick.point.x, pick.point.y, pick.point.z),
None,
)
.is_some();
if !found {
self.command_line
.push_error("No valid constraint point found.");
}
let command = HorizontalConstraintCommand::resume(kind, found.then_some(pick));
self.command_line
.push_info(&crate::command::CadCommand::prompt(&command));
self.tabs[i].active_cmd = Some(Box::new(command));
self.tabs[i].snap_result = None;
return Task::none();
}
CmdResult::AddHorizontalConstraint {
kind,
selection,