Sketch free-form curves: Ellipse (centre, major axis end, minor radius), Fit Point and Control Point (degree 3 and 5) Splines, Conic Curve (rho); solved like other curves (points on them, tangency at shared ends, drag fit points), profiled as polylines; mirror/pattern/move/scale copy them; Tangent Arc continues splines and conics
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AS5Tn3xieewUSg3uxrMVdL
This commit is contained in:
1 parent
956492c993
commit
8d7a0cf3d0
14 files changed
+708
-100
No files matched your search
@@ -897,7 +897,7 @@ fn c_symmetry(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
fn round_center(sk: &Sketch, c: usize) -> Option<usize> {
|
||||
match sk.curves.get(c)?.kind {
|
||||
CurveKind::Circle { c, .. } | CurveKind::Arc { c, .. } => Some(c),
|
||||
CurveKind::Line { .. } => None,
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -910,12 +910,7 @@ fn c_fix(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
vec![i]
|
||||
} else {
|
||||
let c = sk.curve_index(r).ok_or_else(|| bad(cmd, format!("unknown entity `{r}`")))?;
|
||||
match sk.curves.get(c).map(|c| c.kind.clone()) {
|
||||
Some(CurveKind::Line { a, b }) => vec![a, b],
|
||||
Some(CurveKind::Circle { c, .. }) => vec![c],
|
||||
Some(CurveKind::Arc { c, a, b }) => vec![c, a, b],
|
||||
None => vec![],
|
||||
}
|
||||
sk.curves.get(c).map(|c| c.kind.point_ids()).unwrap_or_default()
|
||||
};
|
||||
let is_fixed = |sk: &Sketch, q: usize| sk.constraints.iter().any(|c| c.kind == ConstraintKind::Fix { p: q });
|
||||
let all_fixed = pts.iter().all(|q| is_fixed(sk, *q));
|
||||
|
||||
Reference in new issue
Block a user