A point counts as on the path's outline when it is less than the
touching tolerance from it, with its distance from the path's center in
place of the distance between centers. The params text, docs/mcp.md and
the progress doc now say so, and say that every Tangents choice in the
dialog gives the same lines for a point.
Tests: a point half the tolerance inside and outside a circle gets the
one line there, and farther off gets none or two; a point placed on a
turned outline gets a line as long as the outline is wide along it; the
dialog previews the same two lines for every Tangents choice and keeps
them as one step, and a point inside changes nothing and says why.
- A canceled press on the second segment (a canceled touch, a second
finger) draws nothing and leaves the first segment picked. A canceled
press that picked the first segment leaves no segment picked. Before
this change a canceled press worked as Escape and forgot the first
segment.
- Shift pressed or let go during a click on the second segment, before
the pointer moves far enough to start a drag, counts at the release:
the circle is looked for again with or without the tool's radius.
- A session test sends the tool's release with a command that fails and
checks that the first segment stays picked.
- The radius option's test checks that a value outside 0.01 to 1000000,
or one that is not a number, leaves the radius as it is.
Docs: docs/target-app-parity.md lists every kind of circle the tool
leaves out: circles whose nearest point on the second segments is not on
the circle, circles that cross the first segment, circles that touch
both segments at one point, circles without a finite radius above 0, and
circles too small or too large for three of their points to give them
back. A circle found twice is kept once. docs/mcp.md says that in a
drag the circle touching nearest the press is drawn, and that the
radius option is not checked yet.
Part of #7178.
- The release returns shape.circleThroughPoints followed by a Notify,
and the tool forgets the first segment only when it is told, so a
command that fails leaves the segment picked (as the Direct Selection
tool's FRAME_PICKED notice follows its command).
- The preview leaves out circles that three of their points cannot give
back, so the note shows where a click would draw nothing.
- A double-click draws nothing more: the canvas sends it after the
second click's release, which drew the circle.
- The re-exports for the tool are a separate `pub use` in the pathops
pathtools module, whose module comment is unchanged.
- Circles of one radius at places tried close together along the
first segment are no longer taken for repeats: a repeat also touches
the first segment at the same point. At a radius of 1,000,000 pt the
513 places along a 100 pt line were cut to 86.
- A test checks the note's row in every complete catalog.
Docs: a drag's circle may touch the first segment anywhere along it;
the circles that are left out; an out-of-range radius option leaves
the radius as it is. The ROADMAP, target-app-parity and ui-parity
entries move next to related entries, and docs/mcp.md is rewrapped to
120 columns.
Part of #7178.
A point worked out on an outline lies a rounding error inside or outside
it. The new test places a point at 37 angles on a turned ellipse, and on
each anchor and three places along each segment of a turned and moved
Bezier circle, and checks that each gets exactly one line through it.
The Tangent Circle Tool (tangentCircle) joins the add-on's tools, in
Object > Plug-ins > Path Precision Tools and the All Tools drawer. A click
on a path segment picks it; a click on a second segment draws the circle
that is tangent to the first segment at the point clicked and touches
the second. The segments beside the second one count with it, and of
the circles found the one touching them nearest the pointer is drawn.
- Shift on the second click uses the tool's radius (36 pt to start, set
in its options), anywhere along the first segment.
- A drag from the second segment sets the radius to the drag's length;
Shift steps it by 1, 2 or 5 times a power of 10 pt, at least 4 screen
pixels, and Cmd/Ctrl pressed during the drag moves it by a tenth.
- Before the click the circle shows with its center, its radii to the
touch points and its radius, or a translated note says there is none.
The preview follows a pan, a zoom or an edit under a still pointer.
- The circle is drawn with shape.circleThroughPoints, so Align New
Objects to Pixel Grid leaves it tangent; one undo step. A circle that
its three points cannot give back in floating point is not drawn, and
the first segment stays picked. Escape, an edit outside the tool or
another document forgets the first segment.
The geometry is circles_through and circles_of_radius in the pathops
crate: the distance to the second segments is sampled along the first
segment's normal (or along the segment, for a radius) and the places
where it equals the radius are taken, including touches between samples.
Part of #7178.
Docs: docs/mcp.md, docs/ui-parity.md, docs/target-app-parity.md, ROADMAP.
The bridge's distance and arc-center math no longer squares lengths, so
circles larger than about 1e154 pt are bridged instead of refused, and
an outline that would not fit in f64 is refused instead of written with
non-finite anchors.
Common Tangents (addon.pathtools.commonTangents) now also takes a point,
a path of one anchor, together with a convex closed path. The lines run
from the point to where they touch the path: two from a point outside
it, one from a point on its outline (centered on the point and as long
as the path is wide along it, or the whole straight side the point lies
on), and none from a point inside, which leaves the document unchanged
and returns a warning. Centerline adds the line from the point to the
path's center. Every Tangents value gives the same lines; two points
are refused.
The geometry treats the point as an outline whose support value is
p . n, so the existing root search finds the lines.
Docs: docs/mcp.md, docs/target-app-parity.md, ROADMAP. The new warning
has a row in every catalog.
The crossing search splits curves into pieces until each lies within
0.0001 pt of its chord, and takes the place where two chords cross.
Where a line meets an arc at under a degree, that place sat up to
0.025 pt along the arc from the real crossing, so Trim at Crossings,
its hover and Add Points at Crossings cut there.
Each place found is now moved onto both curves with Newton's method on
a(s) = b(t). The move is kept only when it stays within both segments,
ends closer than 1e-9 pt, and moves no farther than a piece bent by
0.0001 pt can shift a crossing at that angle; otherwise the place stays
as it was.
The crossing search took a crossing only where the straight pieces it
splits two curves into actually cross. A line trimmed at a curve ends
where that search found the crossing, up to about 0.0001 pt off the
curve. Once the curve was cut as well, its segments were split
differently, the line's end could fall just short of them, and the end
no longer counted as a place on the curve. Trim at Crossings then
removed the curve past that line, to the next crossing or the whole
path.
An open end of a path that lies within 0.001 pt of another path now
meets it at the nearest point there, at any angle. Corners of a path
and closed paths keep the exact test, and paths that lie along each
other still don't cross. Trim at Crossings and its hover, Add Points
at Crossings (with and without cut) and the Join tool's trim and join
of crossing paths use this search. The params text of Trim at
Crossings and Add Points at Crossings and docs/mcp.md say so.
Object › Plug-ins › Packaging Tools › Check Fold Lines, and the Fold Lines
panel's Check button, check the fold lines of the selection, or of the
document while nothing is selected (`addon.packaging.check`).
- Cut lines bound the material: each connected piece that encloses an
area is one blank, its largest closed cut line is the outline, and a
closed cut line inside it is a hole. A slot drawn as a rectangle across
the outline leaves the same material as a notch drawn in it, and an
outline drawn as several open cut lines works too.
- Creases, partial cuts and perforations divide a blank into panels; the
pieces between the same two panels form one hinge.
- 15 issue codes, errors and warnings, each naming its lines; cut line
ends within a tolerance (0.1 pt, 0.01 to 10) are joined and reported as
a gap. With `select`, the lines the issues name are selected.
- The panel lists the issues in the interface language, with a summary
line; clicking an issue or its Select button selects its lines. The
list is kept until the document changes.
`vectorcraft_pathops::adjacency` maps paths as live_paint does and keeps,
for each edge, every input it lies on and the faces on both sides; the
blank model is `vectorcraft_three_d::fold::blanks`. The engine now depends
on vectorcraft-three-d directly.
Docs: docs/mcp.md (Check Fold Lines), crates/pathops/README.md, ROADMAP.
With three or more circles and no pair that can be bridged, the error
suggested a larger radius or gap when the largest one bridged a single
pair on its own, even when that pair's neck was still too thin to unite
among the other circles. The suggestion now uses the same rules as the
many-circle bridge (`bridges_any` in `vectorcraft-pathops`).
The command's params text, `docs/mcp.md` and `docs/ui-parity.md` now say
that a pair within reach also gets no bridge when its neck would be
thinner than the precision its shape is united at.
The bridge module defined a second Circle with the same fields and derives as tangent_circle::Circle, and pathtools re-exported the tangent one as TangentCircle. The bridge now imports the existing type, pt::Circle names it again as on main, and the tangent circle command's annotation is back to pt::Circle.
With three or more circles, a pair just inside the arcs' limit can have
a neck far thinner than the precision the shapes are united at, and the
union could drop it while the pair still counted as joined. Each set of
connected circles is now united at a precision fine enough for its
smallest circle, and a pair whose neck is narrower than twice that gets
no bridge, the same as a pair too far apart for the arcs.
The centerline was left out whenever the two centers were less than 1e-9
points apart, so two separate paths a billionth of a point wide got their
tangents but no centerline. Centers now count as one point only when they
are closer than a billionth of the larger path's size.
The convexity check compared points sampled along each segment and the
curvature inside each segment, but not the corner where one segment meets
the next. A segment that leaves its start a little the wrong way could make
an inward corner that neither check saw. Each join is now checked by the
directions the two segments meet it in, skipping segments of no length.
Smooth Bridge now takes three or more circles. Every two whose outlines
are within a reach of each other are bridged, the bridges that connect
are united into one shape each, and a circle bridged to no other stays
as it is.
- `addon.pathtools.bridge` takes `gap` (0 to 1000 pt) in place of
`radius`: the arcs' radius is the smaller circle's radius plus the
gap, so each arc stays the gap away from a circle of the smaller
circle's size about the arc's center. In a triangular grid of equal
circles that gap apart, the channels around an empty place keep one
width. Giving both is an error.
- `reach` (0 to 10000 pt, 10 by default) sets how far apart two circles'
outlines may be for a bridge between them. It applies to three or
more circles; two are bridged at any distance, and the dialog's Reach
field is unavailable then. Pairs are found through a grid of cells,
so each circle is compared only with its near neighbors. Holes
smaller than 1% of the smallest circle's area are filled.
- A pair within reach but too far apart for the radius or gap gets no
bridge. One circle inside another, no pair that can be bridged, no
two circles within reach, more than 2000 circles and more than 8000
bridges are refused with a message. An id given twice counts once.
- Each shape replaces its circles, painted as the topmost of them, or
with `keepOriginals` goes directly above that circle. One undo step;
the shapes and the circles left alone are selected, and the result is
`{ids, alone}`, with `id` as well for two circles.
- `smooth_bridge` refuses circles whose sizes overflow when squared;
it returned a path whose points were not numbers.
- The selection message becomes "select two or more circles to bridge".
- The dialog adds Constant Gap (a Gap field in place of Radius) and
Reach.
Docs: docs/mcp.md, docs/ui-parity.md, docs/target-app-parity.md,
ROADMAP.
The thin-ellipse test now also turns the figure 30 degrees and checks
that each line still ends at the ellipse's tip. A determinant four
times its rounding is accepted and one equal to its rounding is
refused, so the limit is tested on both sides.
The comment on the limit said the opposite of the rule: an ellipse is
measured exactly when its determinant is larger than the rounding of
its entries. The segment counter used by the tests is declared next to
the function it counts, and the estimate in the work test is corrected
to about 8,000 measurements per tangent.
Each tangent measured every segment of both paths to find where it
touches them, so two paths of thousands of segments with thousands of
tangents took segments × tangents work. Each line now starts from the
segment found for the nearest sampled direction and walks outward only
as far as the stretch that lies along it. On two 2,000-sided polygons
with 4,000 tangents, the segment measurements drop from about 33.5
million to 1.6 million.
A turned or scaled ellipse is measured exactly however thin it is. A
map is refused only when its determinant is within the rounding of its
entries; before, an ellipse more than about 1e12 times longer than wide
was refused as having no area.
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. A circle touches a shape when it meets the outline without
crossing it, with the whole outline outside the circle or inside it: at
a smooth point it is tangent there, and at a corner or an open end it
passes through that point. Circles, ellipses at any angle and other
closed or open paths all work; the members of a compound path count as
one outline.
When every shape is a circle, the circles are found in closed form (up
to eight for three circles, the problem of Apollonius) and then moved
onto the drawn Bézier circles, which differ from true circles by up to
0.0273% of the radius. Other shapes are searched on a grid, and the
centers left are refined with Newton's method on the curves. 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 takes the radius (with two shapes; 36 pt to start)
and previews every circle found or one picked by number; OK draws them
with the current paint as one undo step, selected. No circle, more than
64 circles (shapes touched along a whole curve, such as two concentric
circles), shapes at one point or too small for the radius, more than
2000 segments and a search past its limits are errors that leave the
document unchanged.
The Tangent Circle and Circle: rows are in every catalog, and the
command's messages in the catalogs that translate messages.
Docs: docs/mcp.md (Path Precision Tools add-on),
docs/target-app-parity.md, docs/ui-parity.md and ROADMAP.
The convexity check looked at 32 points along each segment, so a cubic
that bends the other way for a short stretch between two of those points
was taken as convex. Each segment is now also checked whole: the cross
product of its first and second derivatives, a quadratic in t, must not
turn against the way the outline turns anywhere on the segment.
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.
Object › Plug-ins › Path Precision Tools › Smooth Bridge… joins two
selected circles into one closed outline, like two drops of liquid
pulling apart. The outline goes around each circle on its side away from
the other and along two concave arcs, one on each side, that touch both
circles from outside, so it runs on smoothly into each circle and every
anchor is smooth.
- `addon.pathtools.bridge {radius?, keepOriginals?, ids?}`: `radius` is
the arcs' radius as a percentage of the smaller circle's radius (1 to
1000, 100 by default); a larger radius makes a wider, gentler bridge.
The outline replaces the two circles, painted as the upper one, or
with `keepOriginals` goes directly above the upper circle and the
circles stay. One undo step; the outline is selected.
- Overlapping and touching circles are joined at every radius. One
circle inside the other, circles too far apart for the radius (the
arcs would not reach both circles, or would cross), and anything other
than two circles that can be edited are refused with a message. The
message suggests a larger radius only when one up to 1000% would
bridge the circles.
- The dialog has a Radius field in percent, Keep Originals and Preview.
- `circle_of` and `smooth_bridge` in `vectorcraft-pathops` tell a
circle from other paths and build the outline.
Docs: docs/mcp.md, docs/ui-parity.md, docs/target-app-parity.md,
ROADMAP.
Hovering with the Trim at Crossings Tool draws in red the stretch a click
there would remove, on the same paths and by the same rules as the click,
and nothing over empty canvas or hidden and locked paths. A drag draws
every stretch its rectangle or freehand line would remove while it
reaches at most 32 paths. In isolation mode only paths inside the
isolated object are highlighted.
What a pick removes moves from the command into
vectorcraft_tools::addons::trim::plan, which the command and the tool
both use. A preview spends at most a twentieth of the crossing work a
click may (Work::share); past that it shows nothing, and the click or
release still removes what it reaches. The tool keeps the crossings it
found for the document as it is, so moving along one path does not
search again, and kept crossings still count against a pick's work
budget. Work::spent_since and Work::draw in vectorcraft-pathops measure
and charge that work.
Docs: docs/mcp.md, docs/ui-parity.md, docs/target-app-parity.md.
A subpath's anchors are now an `Anchors` list held in chunks of up to
256 anchors behind `Arc`s. Copying a path copies the chunk table and
shares the chunks, and editing one anchor copies only the chunk that
holds it, so the undo step of a one-anchor edit no longer keeps a copy
of every anchor of the path. Inserting or removing an anchor copies the
chunk it is in and rebuilds the table. Reads and edits follow the Vec
and slice methods the code used; files write and read each subpath's
anchors as one list, as before, within the same anchor read budget.
The undo memory estimate counts only the chunks the other version of
the path does not hold, and the renderer's kept paths compare only the
chunks an edit copied when they look for moved anchors.
Moving one anchor of an open path of 10,000 or 200,000 anchors
(path.moveAnchor, path.setHandle, path.moveAnchors, a nudge) keeps at
most 48 KiB in its undo and redo steps, where it kept 56 bytes per
anchor.
The comment on the zigzag cases said the open zigzag grown by 1.5 leaves
stroker loops whose faces the distance test drops. With the turned branch's
distance test measuring points in the turned frame, or dropping no face at
all, the three zigzag cases still pass and only the plate case fails (201
contours instead of 101). The comment now says what the zigzag cases check:
one turn for the low path, none for the path stood on end, and the same
region from both. The plate comment says its narrow holes are dropped by
the distance test measured at points turned back into the plate's frame.
When a Smooth tool drag refits the stretch at the first or last anchor
of an open path, the curve there now leaves or arrives along the
smoothed path within the tool's reach instead of along the first or
last segment, so a jagged end no longer keeps its jag. The end point
stays where it is. An end where the smoothed path turns back by 90
degrees or more keeps its segment's direction, and a stretch that ends
inside the path keeps the direction of the part outside the drag.
- pathops: SimplifyOptions gains free_start and free_end, off by
default; closed subpaths and simplify_part ignore them, so Simplify
and Object > Path > Smooth give the same output as before.
- engine: path.smoothRegion sets them for the ends of an open path
that a run's refit reaches.
Docs: docs/mcp.md, docs/target-app-parity.md.
`span_at` read the end of a closed subpath's closing segment as past
every stretch, so a click that landed there could leave the path
unchanged. It now reads that place as the first anchor.
The new Trim at Crossings Tool removes stretches of paths between the
places where they are crossed by another path or by themselves. 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. It works on every path that can be edited, selected or
not, and each gesture is one undo step.
- `addon.pathtools.trim {at, tolerance?}`, `{rect}` or `{points}` is the
command behind the tool. A closed path that loses a stretch becomes
open, an open path that loses a middle stretch becomes two paths with
its appearance in its place in the stacking order, and a path that
nothing crosses is removed whole. The stretches that stay get no new
anchors.
- Hidden and locked paths, guides and clipping paths are not trimmed and
do not count as crossing. Only the paths the gesture reaches are
searched for crossings, and one work limit covers every path the
command trims.
- `crossings_on` and `crossings_on_within` in `vectorcraft-pathops` find
the crossings on one path and compare it only with the segments in
its box.
- The new tool shares the crossing search with Add Points at Crossings
and Split at Crossings, so those change too: two segments of a path
that meet at an anchor, directly or across segments with no length,
now count as crossing where they cross again away from that anchor,
and do not count as crossing at the anchor itself. With Self
Crossings, a curved segment that loops over itself counts as crossing
itself. Before, both crossings were missed.
- The tool is an add-on tool: Object › Plug-ins › Path Precision Tools
and the All Tools drawer list it, it has no shortcut, and neither
shipped toolbar shows it.
Docs: docs/mcp.md, docs/ui-parity.md, docs/target-app-parity.md.