forked from 1b-agent/opencadstudio-upstream
Aligned 2Lines: place the second line where the reference leaves it
The second line kept its midpoint and turned around it, so it settled at a different offset than the reference, which keeps the line's start along the first line and moves it to the distance the picked point had from it. Co-Authored-By: Claude Opus 5 <[email protected]>
This commit is contained in:
1 parent
133bfddba9
commit
48b8689fc3
4 files changed
+183
-15
No files matched your search
@@ -70,7 +70,11 @@ enum Step {
|
||||
/// Aligned's 2Lines: `Select first line:`
|
||||
TwoLinesFirst,
|
||||
/// `Select second line to make parallel:`
|
||||
TwoLinesSecond { line: LineTarget },
|
||||
TwoLinesSecond {
|
||||
line: LineTarget,
|
||||
/// Where the first line was picked.
|
||||
pick: DVec3,
|
||||
},
|
||||
/// The host is making the second line parallel; `accept_parallel_line`
|
||||
/// brings its solved ends.
|
||||
TwoLinesParallel {
|
||||
@@ -818,13 +822,16 @@ impl CadCommand for DimConstraintCommand {
|
||||
},
|
||||
Step::TwoLinesFirst => match self.pick_line(handle, point) {
|
||||
Ok(line) => {
|
||||
self.step = Step::TwoLinesSecond { line };
|
||||
self.step = Step::TwoLinesSecond { line, pick: point };
|
||||
CmdResult::NeedPoint
|
||||
}
|
||||
Err("") => CmdResult::NeedPoint,
|
||||
Err(message) => Self::report(message),
|
||||
},
|
||||
Step::TwoLinesSecond { line: first_line } => match self.pick_line(handle, point) {
|
||||
Step::TwoLinesSecond {
|
||||
line: first_line,
|
||||
pick: first_pick,
|
||||
} => match self.pick_line(handle, point) {
|
||||
Ok(second_line) => {
|
||||
if second_line.line == first_line.line {
|
||||
return Self::report(Self::SAME_POINT);
|
||||
@@ -839,6 +846,7 @@ impl CadCommand for DimConstraintCommand {
|
||||
CmdResult::MakeParallel {
|
||||
first_line: first_line.line,
|
||||
first_ends: [first_line.ends[0].0, first_line.ends[1].0],
|
||||
first_pick,
|
||||
second_line: second_line.line,
|
||||
second_ends: [second_line.ends[0].0, second_line.ends[1].0],
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user