forked from 1b-agent/opencadstudio-upstream
ucs: dynamic UCS on planar solid faces
With dynamic UCS on (UCSDETECT 1, toggled with F6), a command's first point picked on a planar face of a solid sets the UCS to that face for the rest of the command, so 2D commands draw on the face (#1711). An unsnapped first point lands on the face itself; a snapped point off the face's plane belongs to other geometry and leaves the UCS alone. The previous UCS comes back when the command ends. UCS commands themselves are left out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
19ecf78bd9
commit
cccea4008b
33 files changed
+193
No files matched your search
@@ -768,6 +768,7 @@ inventory::submit!(crate::command::CommandRegistration {
|
||||
"FILEDIA",
|
||||
"TRIMEXTENDMODE",
|
||||
"SELECTIONCYCLING",
|
||||
"UCSDETECT",
|
||||
"SURFACEASSOCIATIVITY",
|
||||
"LAYOUTCREATEVIEWPORT",
|
||||
"FIELDEVAL",
|
||||
|
||||
@@ -1216,6 +1216,7 @@ impl OpenCADStudio {
|
||||
| "FILEDIA"
|
||||
| "TRIMEXTENDMODE"
|
||||
| "SELECTIONCYCLING"
|
||||
| "UCSDETECT"
|
||||
| "SURFACEASSOCIATIVITY"
|
||||
| "UCSORTHO"
|
||||
| "UCSVIEW"
|
||||
@@ -1656,6 +1657,30 @@ impl OpenCADStudio {
|
||||
}
|
||||
return Some(self.finish_dispatch(cmd));
|
||||
}
|
||||
if name == "UCSDETECT" {
|
||||
let current = i16::from(self.dynamic_ucs);
|
||||
let prompt = format!("Enter new value for UCSDETECT <{current}>:");
|
||||
match value
|
||||
.as_deref()
|
||||
.map(|v| v.trim().parse::<i16>().ok().filter(|v| (0..=1).contains(v)))
|
||||
{
|
||||
Some(Some(mode)) => {
|
||||
self.dynamic_ucs = mode == 1;
|
||||
self.persist_settings_if_changed();
|
||||
}
|
||||
Some(None) => {
|
||||
self.command_line
|
||||
.push_error(crate::t!("Requires 0 or 1 only.").as_ref());
|
||||
self.command_line.push_output(&prompt);
|
||||
self.pending_setvar = Some(name.clone());
|
||||
}
|
||||
None => {
|
||||
self.command_line.push_output(&prompt);
|
||||
self.pending_setvar = Some(name.clone());
|
||||
}
|
||||
}
|
||||
return Some(self.finish_dispatch(cmd));
|
||||
}
|
||||
if name == "SELECTIONCYCLING" {
|
||||
// 1 and 2 both turn cycling on; the candidate list
|
||||
// always shows.
|
||||
|
||||
Reference in new issue
Block a user