forked from 1b-agent/opencadstudio-upstream
DCDIAMETER/DCRADIUS: the reference flow with a real radial dimension
The commands ask for the circle or arc themselves, report the measured size, take a dimension line location and then the value or name and value, creating a radius or diameter dimension as the constraint's dynamic dimension with a radN/diaN parameter, refusing a second radial constraint on the same object and any non-positive value. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
64c020293a
commit
19204d1b2c
8 files changed
+531
-24
No files matched your search
@@ -1891,12 +1891,30 @@ impl OpenCADStudio {
|
||||
self.tabs[i].active_cmd = Some(Box::new(command));
|
||||
}
|
||||
|
||||
"DCONSTRAINT" | "DCRADIUS" | "DCDIAMETER" => {
|
||||
if cmd == "DCRADIUS" {
|
||||
self.dim_constraint_last = "Radius";
|
||||
} else if cmd == "DCDIAMETER" {
|
||||
self.dim_constraint_last = "Diameter";
|
||||
}
|
||||
"DCRADIUS" | "DCDIAMETER" => {
|
||||
use crate::modules::parametric::{DimConstraintAxis, DimConstraintCommand};
|
||||
use crate::scene::parametric_constraints::next_radial_parameter_name;
|
||||
let diameter = cmd == "DCDIAMETER";
|
||||
self.dim_constraint_last = if diameter { "Diameter" } else { "Radius" };
|
||||
// The reference asks for the circle itself, whatever is
|
||||
// selected, so a pick-first set is left alone.
|
||||
let name = next_radial_parameter_name(
|
||||
self.tabs[i].scene.named_parameters(),
|
||||
diameter,
|
||||
);
|
||||
let command = DimConstraintCommand::new(
|
||||
if diameter {
|
||||
DimConstraintAxis::Diameter
|
||||
} else {
|
||||
DimConstraintAxis::Radius
|
||||
},
|
||||
name,
|
||||
);
|
||||
self.command_line.push_info(&command.prompt());
|
||||
self.tabs[i].active_cmd = Some(Box::new(command));
|
||||
}
|
||||
|
||||
"DCONSTRAINT" => {
|
||||
let handles = self.tabs[i].scene.selected_handles_in_order();
|
||||
if handles.is_empty() {
|
||||
use crate::modules::draw::select::SelectObjectsCommand;
|
||||
@@ -1914,8 +1932,6 @@ impl OpenCADStudio {
|
||||
"DCHORIZONTAL" => ("DCHORIZONTAL", DistanceMode::X),
|
||||
"DCVERTICAL" => ("DCVERTICAL", DistanceMode::Y),
|
||||
"DCALIGNED" => ("DCALIGNED", DistanceMode::Aligned),
|
||||
"DCRADIUS" => ("DCRADIUS", DistanceMode::Radius),
|
||||
"DCDIAMETER" => ("DCDIAMETER", DistanceMode::Diameter),
|
||||
_ => ("DCONSTRAINT", DistanceMode::Auto),
|
||||
};
|
||||
match DistanceConstraintCommand::with_mode(
|
||||
|
||||
Reference in new issue
Block a user