forked from 1b-agent/opencadstudio-upstream
Linear dimensional constraints: point flow, dynamic dimension, driving parameter
DCLINEAR, DCHORIZONTAL, DCVERTICAL and DCALIGNED follow the reference flow: `Specify first constraint point or [Object] <Object>:`, `Specify second constraint point:`, `Specify dimension line location:`, then `Dimension text = …` and `Enter value or name and value <d1=100>:`. Linear reads horizontal or vertical from the dimension line location the way a linear dimension does; Object takes a line's, an arc's or a polyline segment's ends. A miss reports `No valid constraint point found.` / `No object found.` and asks again; another object type reports `Invalid selection for Linear. Select a line, polyline segment or arc.`. Each constraint creates a drawing parameter (`d1`, `d2`, …, or the typed `name=expression`), drives the constraint through it, and draws a dynamic dimension in constraint gray whose text follows CONSTRAINTNAMEFORMAT (`d1=100.0000`); the dimension is associated with the constrained objects and its text is refreshed after every solve. A typed value other than the measured one moves the second point while the first stays, and so does a later parameter edit. Deleting the constraint removes its dimension and, when nothing else reads it, its parameter. Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
1 parent
fd2062bdec
commit
72fd3fd35b
9 files changed
+898
-36
No files matched your search
@@ -1610,6 +1610,25 @@ pub enum CmdResult {
|
||||
multiple: bool,
|
||||
label: &'static str,
|
||||
},
|
||||
/// Resolves a constraint-point pick against the live document and hands
|
||||
/// it back through `CadCommand::accept_constraint_point`; a miss reports
|
||||
/// `No valid constraint point found.` and asks again.
|
||||
CheckConstraintPoint(CoincidentPick),
|
||||
/// Adds a dimensional constraint between two constraint points together
|
||||
/// with the dynamic dimension that shows it and the parameter
|
||||
/// (`name` = `expression`) that drives it.
|
||||
AddDimensionalConstraint {
|
||||
kind: crate::scene::parametric_constraints::ConstraintKind,
|
||||
first: crate::scene::parametric_constraints::ParametricRef,
|
||||
second: crate::scene::parametric_constraints::ParametricRef,
|
||||
first_point: DVec3,
|
||||
second_point: DVec3,
|
||||
location: DVec3,
|
||||
axis: DVec3,
|
||||
name: String,
|
||||
expression: String,
|
||||
label: &'static str,
|
||||
},
|
||||
/// Adds a point or object symmetry relation around a picked line. The
|
||||
/// first reference and axis remain fixed during initial placement.
|
||||
AddSymmetricConstraint {
|
||||
@@ -2453,6 +2472,16 @@ pub trait CadCommand: Send {
|
||||
false
|
||||
}
|
||||
|
||||
/// A constraint point the host resolved for a `CheckConstraintPoint`
|
||||
/// pick, with its world position.
|
||||
fn accept_constraint_point(
|
||||
&mut self,
|
||||
_reference: crate::scene::parametric_constraints::ParametricRef,
|
||||
_point: DVec3,
|
||||
) -> CmdResult {
|
||||
CmdResult::NeedPoint
|
||||
}
|
||||
|
||||
/// Include filled hatch / DXF SOLID regions in the entity hit-test.
|
||||
///
|
||||
/// Most entity-pick commands operate on curve geometry and intentionally
|
||||
|
||||
Reference in new issue
Block a user