mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-19 19:11:26 +00:00
Part of #6966: Path Precision Tools draws a bounding rectangle or circle around the selection
Object › Plug-ins › Path Precision Tools › Add Bounding Rectangle runs addon.pathtools.boundingRectangle, which draws a live rectangle on the selection's geometric bounding box, strokes left out. Add Bounding Circle runs addon.pathtools.boundingCircle, which draws the smallest live circle that holds the outlines of the selected objects. Paths and compound paths count by their curves, clip groups and clipping sublayers by their clipping paths, other sublayers by their shown objects, images by their corners, and type and other objects by the corners of their bounding box. Each curve is split until its pieces lie within 0.01 pt of their chords (1,024 pieces at most, after which a piece counts by its control points), and the circle's radius is 0.01 pt larger than the smallest circle around those points, so it holds the curves. `offset` adds space around the objects, and `each` draws one shape around each selected object instead of one around them all. Objects with no outline, such as an empty group, and shapes with no size (the rectangle around a straight horizontal line, the circle around a single point) are not drawn; with `each`, `skipped` counts them. The shapes get the current paint and go on top of the current layer or of the isolated group, as Tangent Circle's circles do; inside an isolated compound path they go beside it. The new shapes are selected, and one undo removes them all. The smallest circle is computed in the geometry crate (shapes::enclosing_circle) from the convex hull of the points with a fixed shuffle, relative to one of the points so small art far from the origin keeps its exact circle. While the command gathers points from a large selection, it keeps only the corners of their convex hull, which bounds the memory it takes. Docs: docs/mcp.md, docs/ui-parity.md, docs/target-app-parity.md, ROADMAP. Menu labels in all 28 catalogs and messages in the 24 catalogs with complete messages.
This commit is contained in:
+24
@@ -13098,6 +13098,30 @@ Commands:
|
||||
the kind asked for, nothing changes, and the result's `warning` says why. Common Tangents…
|
||||
opens a dialog (Tangents, Centerline) with Preview. → `{ids, external, internal, centerline, warning?}`
|
||||
(`centerline`: the centerline's id, or null).
|
||||
- `addon.pathtools.boundingRectangle {each?, offset?}` draws a live rectangle on the geometric bounding box of the
|
||||
selected objects, strokes and effects left out (Object › Plug-ins › Path Precision Tools › Add Bounding Rectangle,
|
||||
#6966). `addon.pathtools.boundingCircle {each?, offset?}` draws the smallest live circle that holds the outlines of
|
||||
the selected objects (Add Bounding Circle). The circle reads paths and compound paths by their curves, clip groups
|
||||
and sublayers that clip their contents by their clipping paths, other sublayers by their shown objects, images by
|
||||
their corners, and type and other objects by the corners of their bounding box. It splits each curve into pieces
|
||||
until every piece's control points lie within 0.01 pt of its chord, fits the circle to the ends of the pieces, and
|
||||
makes the radius 0.01 pt larger, so the circle holds the curves themselves. A curve is split into 1,024 pieces at
|
||||
most; a piece that still bends more counts by its control points, which can make the circle slightly larger than the
|
||||
smallest one. `offset` (0 or more, default 0) adds space: a rectangle grows by `offset` on each side and a circle's
|
||||
radius grows by `offset`. `each: true` draws one shape around each selected object instead of one around the whole
|
||||
selection.
|
||||
|
||||
Each shape gets the current paint and goes on top of the current layer, or of the isolated group, as other new art
|
||||
does; inside an isolated compound path it goes beside the compound path and does not join it. The new shapes are
|
||||
selected, and one undo removes them all. An object with no outline (an empty group) gets no shape, and neither does
|
||||
a shape with no size: the rectangle around a straight horizontal or vertical line, or the circle around a single
|
||||
point, unless `offset` is more than 0. With `each`, the result's `skipped` counts those objects. It is an error, with
|
||||
the document unchanged, when no shape is left to draw and when `offset` is below 0. → `{id: the first shape, ids,
|
||||
skipped?}`
|
||||
|
||||
```json
|
||||
{"name":"run_command","arguments":{"command":"addon.pathtools.boundingCircle","params":{"offset":2}}}
|
||||
```
|
||||
|
||||
A parametric shape is an ordinary path. It keeps its numbers, with a fingerprint of the outline they drew, in one
|
||||
entry of its object data (`vc-pathtools-shape`, as `document.node` lists `attrs.data`), which SVG export leaves out;
|
||||
|
||||
@@ -2694,6 +2694,10 @@ A VectorCraft addition, not a feature of the reference app, so no area score mov
|
||||
|
||||
A VectorCraft addition, so no area score moves. Object › Plug-ins › Path Precision Tools › Tangent Circle… (`addon.pathtools.tangentCircle`) draws the circles that touch two selected paths or compound paths at a set radius, or that touch three of them; for three circles these are the solutions of the [problem of Apollonius](https://en.wikipedia.org/wiki/Problem_of_Apollonius), up to eight. The rest is VectorCraft's own: a circle touches a shape when it meets the outline without crossing it (the whole outline outside the circle or inside it), so it is tangent at a smooth point and passes through a corner or an open end; circles, ellipses at any angle and other closed or open paths all take part, a compound path's members as one outline. Circles are solved in closed form, each answer then moved onto the drawn Bézier outlines; other shapes are searched on a grid and refined with Newton's method on the curves, and with three shapes circles up to 64 times the diagonal of the box around the shapes' anchors and handles are found. The circles are listed by radius, then top to bottom, then left to right; the dialog previews every circle found, or one picked by number, and OK draws them with the current paint as one undo step. No circle, more than 64 (shapes touched along a whole curve) and more than 2000 segments are errors. Tests: `tangent_circle::tests` in `vectorcraft-pathops` (three circles: two known circles and eight distinct ones in a steady order; two circles and a radius; the search against the closed form; rotated and skewed ellipses against an independent solve of every combination; two circles close together; squares; a compound path moved far off and scaled; open paths and the errors), `cmd::addons::pathtools::tangent_circle::tests` in `vectorcraft-engine`, `tangent_circle_previews_picks_one_cancels_and_runs_on_ok` in `vectorcraft-ui-egui` and `command_sweep`. Commands: `docs/mcp.md` › Path Precision Tools add-on.
|
||||
|
||||
## Path Precision Tools add-on: Add Bounding Rectangle and Add Bounding Circle (2026-11-17)
|
||||
|
||||
A VectorCraft addition, so no area score moves. Object › Plug-ins › Path Precision Tools › Add Bounding Rectangle (`addon.pathtools.boundingRectangle`) draws a live rectangle on the selection's geometric bounding box, and Add Bounding Circle (`addon.pathtools.boundingCircle`) draws the [smallest enclosing circle](https://en.wikipedia.org/wiki/Smallest-circle_problem) of the selected outlines, with curves flattened to within 0.01 pt and the radius 0.01 pt larger, so the circle holds the curves. Both take `each` (one shape per object) and `offset`, use the current paint, go on top of the current layer or the isolated group, and are one undo step; shapes with no size are skipped (#6966). Tests: `shapes::tests` in `vectorcraft-geom` (`enclosing`) and `cmd::addons::pathtools::bounding::tests` in `vectorcraft-engine`. Commands: `docs/mcp.md` › Path Precision Tools add-on.
|
||||
|
||||
## Path Precision Tools add-on: Expand Dashes into Paths (2026-11-01)
|
||||
|
||||
A VectorCraft addition, not a feature of the reference app, so no area score moves. Object › Plug-ins › Path Precision Tools › Expand Dashes into Paths turns the dashed stroke of each selected path and compound path into separate open paths, one per dash, for cutters and plotters that need the centre lines rather than Outline Stroke's filled outlines. The dashes are laid out by the renderer's own dash code, so they match what the canvas draws: the dash pattern, its offset and Align Dashes to Corners and Path Ends, a dash running on through the start of a closed path, a dash all the way round staying closed, and under a round or projecting cap each dot (a dash of no length) as a path on its point. Each dash keeps the path's appearance with the top stroke's dashes and arrowheads off; the path's fills stay on it, below its dashes; a compound path's dashes are plain paths. One undo step; the dashes are selected; at most 100000 (more, or a pattern too fine to draw, is refused). Tests: `expand_dashes_*` in `cmd::addons::pathtools::tests` in `vectorcraft-engine` (the stroke kept with dashes off, the offset, one undo step, the fill kept below, dashes centred on corners when aligned, dots under round and butt caps, compound paths, refusals and the piece cap), `the_plugins_submenu_selects_the_tools_and_opens_the_anchor_inspector` in `vectorcraft-ui-egui` and `command_sweep`. Commands: `docs/mcp.md` › Path Precision Tools add-on.
|
||||
|
||||
@@ -501,6 +501,7 @@ next unit in the order a right-click on a ruler lists them, from Feet back to Po
|
||||
| Path Precision Tools add-on (VectorCraft addition): Object › Plug-ins › Path Precision Tools › Trim at Crossings Tool (also in the Scissors tool's group in both shipped toolbars, after the Knife, and listed there in the All Tools drawer; a toolbar edited before keeps its saved layout until Reset Toolbar; no shortcut until one is set in Edit › Keyboard Shortcuts › Tools; the Knife's cursor, drawn as a knife with the blade's point on the hotspot) removes stretches of paths between the places where they are crossed, on any editable path, selected or not: a click removes the stretch under the pointer, a drag removes every stretch its rectangle touches, and an Alt-drag removes every stretch its freehand line crosses; one undo step each; Escape during a drag removes nothing; hovering shows in red the stretch a click would remove, and a drag that reaches few paths shows what its release would remove | done | `addon.pathtools.trim` (in `crates/engine/src/cmd/addons/pathtools/trim.rs`), `crates/tools/src/addons/trim.rs` and their tests; not a feature of the reference app, so it is not scored |
|
||||
| Path Precision Tools add-on (VectorCraft addition): Object › Plug-ins › Path Precision Tools › Expand Dashes into Paths turns each selected path's dashed stroke into separate open paths, one per dash, laid out as the stroke draws them (pattern, offset, Align Dashes to Corners and Path Ends), each keeping the stroke with the dashes off; one undo step | done | #4922; `addon.pathtools.expandDashes` (in `crates/engine/src/cmd/addons/pathtools.rs`, using the renderer's dash layout) and its tests; not a feature of the reference app, so it is not scored |
|
||||
| Path Precision Tools add-on (VectorCraft addition): Object › Plug-ins › Path Precision Tools › Tangent Circle… draws the circles that touch two selected paths or compound paths at a radius, or three of them, each touching the outlines without crossing them; Radius (two shapes), a Circle menu (All or one by number) and Preview; one undo step | done | `addon.pathtools.tangentCircle` (in `crates/engine/src/cmd/addons/pathtools/tangent_circle.rs`, geometry in `crates/pathops/src/addons/pathtools/tangent_circle.rs`) and its tests; a VectorCraft addition, so it is not scored |
|
||||
| Path Precision Tools add-on (VectorCraft addition): Object › Plug-ins › Path Precision Tools › Add Bounding Rectangle and Add Bounding Circle draw a live rectangle on the selection's geometric bounding box, or the smallest live circle that holds its outlines, around the whole selection or each object, with an optional offset; one undo step | done | `addon.pathtools.boundingRectangle` and `addon.pathtools.boundingCircle` (in `crates/engine/src/cmd/addons/pathtools/bounding.rs`, the circle in `crates/geom/src/shapes.rs`, `enclosing_circle`) and their tests; a VectorCraft addition, so it is not scored |
|
||||
| Path Precision Tools add-on (VectorCraft addition): Effect › Path Effects lists its live effects (Dashes to Geometry, Add Anchors, Extend Path, Close Path, Smooth Anchors, Retract Handles, Reverse Direction, Simplify Anchors, Split at Anchors), each with the effect dialog's live Preview except Reverse Direction, which has no options, and listed in the Appearance panel like any effect | done | `addon.path.*`, `crates/effects/src/addons/path.rs`, `crates/ui-egui/src/addons/pathtools.rs` and their tests; not a feature of the reference app, so it is not scored |
|
||||
| Path Precision Tools add-on (VectorCraft addition): Object › Plug-ins › Path Precision Tools selects its four tools (Anchor Eraser Brush, Extend Path, Measure & Inspect, Parametric Shape), which the All Tools drawer lists under their own heading but neither toolbar shows as shipped, opens the Anchor Inspector panel (the selected anchor's X/Y and handle lengths and angles as fields; Make Smooth, Make Corner, Equalize Handles, Remove Points Keep Shape, Add Points, the three ways to close) and the Parametric Shape panel (kind, count, W/H, rotation, the kind's own values and corner radius of the selected parametric shape, or of the tool's next one), and runs Add Points at / Split at Crossings and Convert to Parametric Shape; the Parametric Shape Tool draws ten re-editable kinds from the centre (↑/↓ and ←/→ change their numbers while dragging) and edits a selected one with handles; a double-click on the brush or Extend Path tool opens its options | done | `addon.pathtools.*`, `crates/tools/src/addons/`, `crates/ui-egui/src/addons/pathtools.rs`, `crates/ui-egui/src/addons/pathtools/shape.rs` and their tests; not a feature of the reference app, so it is not scored |
|
||||
| Path Precision Tools add-on (VectorCraft addition): Object › Plug-ins › Path Precision Tools selects its six tools (Anchor Eraser Brush, Extend Path, Measure & Inspect, Parametric Shape, Corner Tool, Slide Anchor Along Path), which the All Tools drawer lists under their own heading but neither toolbar shows as shipped, opens the Anchor Inspector panel (the selected anchor's X/Y and handle lengths and angles as fields; Make Smooth, Make Corner, Equalize Handles, Remove Points Keep Shape, Add Points, the three ways to close) and the Parametric Shape panel (kind, count, W/H, rotation, the kind's own values and corner radius of the selected parametric shape, or of the tool's next one), and runs Add Points at / Split at Crossings and Convert to Parametric Shape; the Parametric Shape Tool draws ten re-editable kinds from the centre (↑/↓ and ←/→ change their numbers while dragging) and edits a selected one with handles; the Corner Tool cuts editable corners on any path (hover shows the anchor, a click uses its radius and kind, a drag sizes the corner, Shift whole values; a corner's marker selects it and loads its values, drags to resize, to 0 or double-clicked removes it; never past what fits; Alt-marquee cuts every anchor inside) with a Corners section in the Anchor Inspector (radius, kind, selected count, Apply to Selected Anchors); Slide Anchor Along Path drags an anchor along its curve with the segments beside it refitted, Shift snapping where the tangent is a multiple of 45°; a double-click on the brush or Extend Path tool opens its options | done | `addon.pathtools.*`, `crates/tools/src/addons/`, `crates/ui-egui/src/addons/pathtools.rs`, `crates/ui-egui/src/addons/pathtools/` and their tests; not a feature of the reference app, so it is not scored |
|
||||
|
||||
Reference in New Issue
Block a user