Add bounding-box object alignment (ALIGNLEFT/TOP/etc.), ported from Mac2CAM

Six one-shot alignment commands for the current selection —
ALIGNLEFT/ALIGNHCENTER/ALIGNRIGHT/ALIGNTOP/ALIGNVCENTER/ALIGNBOTTOM —
distinct from the existing point-picking ALIGN/ALIGN3D command: each
nudges every selected object (or complete group, via new
Scene::selected_object_units) so its bounding-box edge/center lines up
with the extreme edge/center already present in the selection, closer
to a word processor's "align objects" than AutoCAD's 3-point ALIGN.

Wired as plain one-click Tool entries in the Modify extension panel,
next to the existing ALIGN entry, matching that panel's flat-list
convention (no point prompts, so no dropdown submenu needed).

Co-Authored-By: Claude Sonnet 5 <[email protected]>
This commit is contained in:
Felix RiestraandClaude Sonnet 5 committed 2026-09-15 01:08:41 +02:00
1 parent 59ae38ae1a
commit 0f739b459d
10 files changed
+329

No files matched your search

+41
View File
@@ -37,6 +37,47 @@ pub(super) const TOOLS: &[Tool] = &[
icon: include_bytes!("../../../assets/icons/modify_align.svg"),
options: &[],
},
// ALIGNLEFT/ALIGNHCENTER/ALIGNRIGHT/ALIGNTOP/ALIGNVCENTER/ALIGNBOTTOM:
// one-shot bounding-box alignment of the current selection — distinct
// from "ALIGN" above (point-picked 3D placement). No point prompts, so
// each is a plain one-click Tool rather than a dropdown submenu, matching
// this panel's existing flat-list convention.
Tool {
command: "ALIGNLEFT",
label: "Align Left",
icon: include_bytes!("../../../assets/icons/align_left.svg"),
options: &[],
},
Tool {
command: "ALIGNHCENTER",
label: "Align Horizontal Centers",
icon: include_bytes!("../../../assets/icons/align_hcenter.svg"),
options: &[],
},
Tool {
command: "ALIGNRIGHT",
label: "Align Right",
icon: include_bytes!("../../../assets/icons/align_right.svg"),
options: &[],
},
Tool {
command: "ALIGNTOP",
label: "Align Top",
icon: include_bytes!("../../../assets/icons/align_top.svg"),
options: &[],
},
Tool {
command: "ALIGNVCENTER",
label: "Align Vertical Centers",
icon: include_bytes!("../../../assets/icons/align_vcenter.svg"),
options: &[],
},
Tool {
command: "ALIGNBOTTOM",
label: "Align Bottom",
icon: include_bytes!("../../../assets/icons/align_bottom.svg"),
options: &[],
},
Tool {
command: "BREAK",
label: "Break",