Add-ons: Parametric Shape Tool — re-editable stars, polygons, rings, arrows, gears and more

Path Precision Tools gains the Parametric Shape Tool: ten kinds of shape
(rectangle, ellipse, polygon, star, ring, arrow, cross, heart, gear,
speech bubble) that stay editable as numbers.

- Geometry in vectorcraft_pathops::addons::pathtools::shapes: each kind's
  outline, corner rounding limited to the middle of a side, a fingerprint
  of the outline, recovery of centre, size and rotation after a move,
  turn or scale, and recognition of plain rectangles, ellipses and
  regular polygons.
- The tool (parametricShape, All Tools drawer and Object › Plug-ins ›
  Path Precision Tools only, no shortcut): drag from the centre (Shift:
  45° steps), arrow keys change the count and values while dragging,
  handles edit a selected shape, double-click places one.
- Commands addon.pathtools.shape.create / .set / .convert, one undo step
  each; params checked (counts 3..1000, sizes up to 16384 pt).
- A shape keeps its numbers in one object-data entry (vc-pathtools-shape)
  that SVG export already leaves out; anchor edits make it a plain path.
- Parametric Shape panel, cursor stand-in, catalog rows in all 25
  languages, docs and tests.
This commit is contained in:
bflatastic
2026-10-30 20:55:14 +07:00
parent b496226ab5
commit 27ed249b1f
48 changed files with 2551 additions and 24 deletions
+8 -4
View File
@@ -1,8 +1,10 @@
//! Path Precision Tools (`addon.pathtools.*`), a built-in add-on: the Anchor Eraser Brush's stroke,
//! the Extend Path tool's extension, the Measure & Inspect tool's readouts, the Anchor Inspector's
//! anchor edits and Split / Add Points at Crossings. Its tools, panel and submenu (Object ›
//! Plug-ins › Path Precision Tools) are the tools crate's and the UI's.
//! anchor edits, Split / Add Points at Crossings and the Parametric Shape Tool's shapes ([`shape`]).
//! Its tools, panels and submenu (Object › Plug-ins › Path Precision Tools) are the tools crate's
//! and the UI's.
mod shape;
#[cfg(test)]
mod tests;
@@ -37,7 +39,7 @@ const MAX_EXTEND: f64 = 1e6;
const MAX_ADD: u64 = pt::MAX_ADDED_PER_SEGMENT as u64;
pub fn specs() -> Vec<CommandSpec> {
vec![
let mut v = vec![
cmd!(
"addon.pathtools.erase",
"Anchor Eraser Brush",
@@ -137,7 +139,9 @@ pub fn specs() -> Vec<CommandSpec> {
has_selection,
crossings
),
]
];
v.extend(shape::specs());
v
}
/// The editable paths (not guides) under `roots`, compound path members included.