Path Precision Tools: Common Tangents draws the lines touching two closed paths

Object › Plug-ins › Path Precision Tools › Common Tangents…
(`addon.pathtools.commonTangents`) adds the common tangent lines of two
selected convex closed paths as separate open paths: external (both
paths on the same side of the line), internal (the lines between them)
or all, and with Centerline the line joining the two centers. An
ellipse drawn with the Ellipse tool is measured as an exact ellipse at
any rotation and scale; any other path must be closed, have one outline
and bend the same way all around, with at most 10000 segments.

Each line runs between the points where it touches the two paths, or
covers a straight side that lies along it. Separate paths have four
tangents, overlapping paths only external ones (two for ellipses), and
a path inside the other none. Paths that touch, from outside or from inside, share
one tangent instead: a line centered on the point where they touch and
as long as the narrower path is wide along it. When there is no tangent
of the kind asked for, nothing changes and the result carries a warning
that says why. The lines take the current stroke and no fill, go
directly above the upper path and are selected, as one undo step. The
dialog has Preview.

The geometry is in vectorcraft-pathops: the tangents are the zeros of
the difference of the two outlines' support values over the normal's
angle, sampled at 720 even steps and at every angle where either
path's touching point passes to another segment, then refined, so the
work per pair is bounded.

Catalog rows for the menu item, the dialog and the messages are in
every catalog.

Docs: docs/mcp.md (Path Precision Tools add-on), docs/target-app-parity.md
and ROADMAP.
This commit is contained in:
dotCooCoo
2026-11-15 13:48:21 -08:00
parent bb218101c9
commit 0189417e24
41 changed files with 1815 additions and 5 deletions
+21
View File
@@ -11965,6 +11965,26 @@ Commands:
- `addon.pathtools.shape.convert {ids?}` makes the selected plain closed paths that are rectangles, ellipses or
polygons with equal sides and corners (stretched along their own axes at most) parametric shapes with the same
outline. → `{ids}` (those converted).
- `addon.pathtools.commonTangents {tangents?, centerline?, ids?}` adds the common tangent lines of two convex closed
paths (`ids`, or the two selected objects) as separate open paths: lines that touch both paths without crossing into
either. `tangents`: `external` (both paths on the same side of the line), `internal` (lines that run between them)
or `all` (default). With `centerline: true` it also adds the line joining the two centers: an ellipse's center, or
a path's center of area. Each tangent of paths that do not touch runs from where it touches the lower path to
where it touches the upper one; where a straight side of a path lies along the line, the line covers the whole
side. An ellipse drawn with the Ellipse tool, then moved, turned or scaled, is measured as an exact ellipse. Any
other path must be closed, have one outline, bend the same way all around and have at most 10,000 segments; an open
path, a path that bends inward, a path without area, a group, a compound path or type is refused, and so are two
paths whose outlines are the same to within the touching tolerance given below. Two separate paths have two
external and two internal tangents. Overlapping paths have external tangents only. A path inside the other has
none. Paths that touch, from outside or from inside, share one tangent there instead: a line centered on the point
where they touch and as long as the narrower path is wide along it. Paths that meet at a corner or along a shared
stretch of outline get one such line, at the middle of the directions that touch both. Paths count as touching when
the gap between them is less than the tolerance, a billionth of the larger of their sizes and the distance between
their centers. The lines are stroked with the current stroke color and weight (black when the stroke is None), have
no fill, go directly above the upper of the two paths and are selected; one undo step. When there is no tangent of
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).
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;
@@ -11978,6 +11998,7 @@ plain path from then on.
{"name":"run_command","arguments":{"command":"addon.pathtools.crossings","params":{"cut":true}}}
{"name":"run_command","arguments":{"command":"addon.pathtools.shape.create","params":{"kind":"star","center":[200,150],"width":120,"height":120,"count":7,"a":0.4}}}
{"name":"run_command","arguments":{"command":"addon.pathtools.shape.set","params":{"id":14,"kind":"gear","count":16,"radius":2}}}
{"name":"run_command","arguments":{"command":"addon.pathtools.commonTangents","params":{"ids":[3,4],"tangents":"external","centerline":true}}}
```
### Path Effects (live)
+4
View File
@@ -2453,6 +2453,10 @@ A VectorCraft addition, so no area score moves. Object › Plug-ins › Cutting
A VectorCraft addition, so no area score moves. Object › Plug-ins › Cutting Tools › Nest Shapes… (`addon.cutting.nest`) moves the selected objects close together onto a sheet or a roll of material ([packing problems](https://en.wikipedia.org/wiki/Packing_problems)). The rest is VectorCraft's own: the sheet is an artboard, or a set width and height from its top-left corner, and a roll is a set width with no end; a margin is kept inside the edges and a spacing between objects. Objects are packed by their bounding boxes, with or without strokes and effects (shadows, glows and blurs included), the tallest first, each where its bottom edge is highest and then furthest left; with Rotate an object may turn 90° where that places it higher or where only the turned object fits. Objects that do not fit go in a column to the right of the sheet, in stacking order. The command is one undo step, and its result gives the length of material used. The dialog has Preview. Tests: `cmd::addons::cutting::nest::tests` in `vectorcraft-engine`, `nest_shapes_previews_cancels_and_runs_on_ok` in `vectorcraft-ui-egui` and `command_sweep`. Commands: `docs/mcp.md` › Cutting Tools add-on › Nest Shapes.
## Path Precision Tools add-on: Common Tangents (2026-11-15)
A VectorCraft addition, so no area score moves. Object › Plug-ins › Path Precision Tools › Common Tangents… (`addon.pathtools.commonTangents`) adds the common tangent lines of two convex closed paths ([tangent lines to circles](https://en.wikipedia.org/wiki/Tangent_lines_to_circles)) as separate open paths: external, internal or all, with the line joining the two centers if asked. The rest is VectorCraft's own: an ellipse drawn with the Ellipse tool, turned or scaled, is measured as an exact ellipse, and any other path must be closed, have one outline and bend the same way all around. Each line runs between the points where it touches the two paths. Separate paths have four tangents, overlapping paths only external ones (two for ellipses), and a path inside the other has none, in which case nothing changes and a message says why. Paths that touch, from outside or from inside, share one tangent there instead: a line centered on the point where they touch and as long as the narrower path is wide along it. The lines take the current stroke and no fill; one undo step. The dialog has Preview. Tests: `addons::pathtools::tangents::tests` in `vectorcraft-pathops` (circles against the closed form, turned ellipses against a brute-force scan, nested, overlapping and touching circles, a convex Bézier path, flat sides, squares meeting at a corner, a curve touched beside an anchor, refused outlines), `cmd::addons::pathtools::tangents::tests` in `vectorcraft-engine`, `common_tangents_previews_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: Divide into Dashes (2026-11-01)
A VectorCraft addition, not a feature of the reference app, so no area score moves. Object › Plug-ins › Path Precision Tools › Divide into Dashes… cuts the selected paths into separate open paths along the curve (arc length, not straight distance): each `dash` long (0.01 to 1000000 pt, 10 by default) with `gap` between them (0 by default: the pieces touch); the gap pieces are left out unless Remove Gaps is off. With direct-selected segments (or anchors) only those runs are divided, the pattern running on across segments that follow one another, and the rest of such a path stays as pieces of its own. Fit to Corners and Ends gives every run between corners and ends a whole number of dashes, all stretched or squeezed alike so it starts and ends on a dash (a closed path without corners holds whole periods); otherwise the lengths are exact and each run's last piece is what is left. Every piece keeps the path's appearance and is selected; one undo step; at most 100000 pieces (more is refused). The dialog takes lengths in any unit and previews on the canvas. Tests: `dashes::tests` in `vectorcraft-pathops` (exact and fitted lengths, curves measured along them, picked segments on open and closed paths, the piece cap and bad patterns), `divide_into_dashes_*` in `cmd::addons::pathtools::tests` in `vectorcraft-engine` (gaps removed or kept, fitted lengths, the stroke kept, one undo step, selected segments only, bad params and too many pieces refused), `divide_into_dashes_opens_its_dialog_previews_and_runs_on_ok` in `vectorcraft-ui-egui` and `command_sweep`. Commands: `docs/mcp.md` › Path Precision Tools add-on.