Sketch Offset on two sides, or symmetric about the source (#807)

Sketch Offset can place the copy on both sides of the source, or symmetric about it.
This commit is contained in:
William Dunn authored and GitHub committed 2026-10-13 16:29:24 -04:00
1 parent 5d661fa2af
commit 53238fba5f
6 files changed
+567 -144

No files matched your search

+3 -2
View File
@@ -53,9 +53,10 @@ pub fn anchor(app: &SolveApp, d: &Dialog) -> Option<(Vec3, Option<Vec3>)> {
let (mid, tangent) = poly_mid(&pts)?;
// An offset's drag arrow: the in-plane direction the distance grows along. The
// command offsets a picked curve to its left, and the window's Flip row reverses it.
// Symmetric hides Flip and offsets both ways, so the arrow keeps the left side.
let dir = match &d.kind {
Kind::SketchModify(crate::sketch_modify_ui::Mod::Offset { flip, .. }) => {
let n = if *flip { -tangent.perp() } else { tangent.perp() };
Kind::SketchModify(crate::sketch_modify_ui::Mod::Offset { flip, mode, .. }) => {
let n = if *flip && !crate::sketch_modify_ui::offset_symmetric(*mode) { -tangent.perp() } else { tangent.perp() };
Some(ss.plane.to_world(mid + n) - ss.plane.to_world(mid))
}
_ => None,