Commit Graph
247 Commits
Author SHA1 Message Date
BFlat 20d8217312 Merge pull request #7950 from dotCooCoo/feat/smooth-bridge
Path Precision Tools: Smooth Bridge joins two circles with concave arcs
2026-11-18 13:12:40 +07:00
BFlat bbf6165fc8 Merge pull request #8206 from dotCooCoo/feat/packaging-fold-preview
Packaging Tools: Fold Preview folds the blank in 3D with the printed art on its panels
2026-11-18 10:30:50 +07:00
BFlat 1380e9c480 Merge pull request #7675 from dotCooCoo/feat/unit-converter
Unit Converter: one length in every unit, read from and applied to the selection
2026-11-18 10:16:26 +07:00
dotCooCoo 38a178154b Merge main into feat/smooth-bridge 2026-11-17 17:38:12 -08:00
BFlat 40f1080a86 Merge pull request #8215 from dotCooCoo/fix/trim-line-end-on-curve
Path Precision Tools: a path that ends on a curve still divides it after the curve is cut
2026-11-18 03:20:13 +07:00
dotCooCoo d00e3b6ecd Packaging Tools: Fold Preview picks the print level by a pixel's longer side and draws the board opaque
A print tipped away from the view shrinks up and down but not across, so
the level of the print raster is now chosen by the longer of a pixel's
two sides in flat terms, not its width alone, and fine print lines no
longer alias when the view is tipped.

The board's inside and outside colors were premultiplied by their alpha
and then drawn with full alpha, so a see-through color drew darker
instead. The depth buffer treats every panel as opaque, so the board is
now drawn opaque in its colors' RGB and their alpha is not used.

The tray test now checks that each wall's print faces away from the base
on its own side and that the walls fold below the base.
2026-11-16 12:26:28 -08:00
dotCooCoo 8b0effde6b Trim at Crossings: the selection is updated in one pass
A trim checked and changed the selection once for every trimmed path
and every piece, and each check or removal went through all selected
objects, so a trim of thousands of selected paths spent time
quadratic in their number on the selection alone. The command now
reads the selection through a set and removes and adds objects once
at the end. The resulting selection is the same as before, including
object order, the key object and key anchor, the direct-selected
anchors and segments, and the fields that a change to the object
selection clears.
2026-11-16 11:30:08 -08:00
dotCooCoo 2af27232e0 Path Precision Tools: a path that ends on a curve still divides it after the curve is cut
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.
2026-11-16 11:22:22 -08:00
dotCooCoo 4911e102b1 Packaging Tools: Fold Preview folds the blank in 3D with the printed art on its panels
Fold Preview (Object › Plug-ins › Packaging Tools, and the Fold Lines panel's button) shows the
document's blank folded about its largest panel, or the panel double-clicked. Creases and
perforations fold 90° away from the printed side and partial cuts 90° toward it. Each panel
samples a raster of the print, with the fold lines and non-printing layers left out, through its
projective map, with a depth buffer; the back shows the board's inside color. The window has a
Fold slider, seven view presets, orbit, zoom, pan and perspective, and its status line reports a
joint that does not close and panels that pass through each other.

- addon.packaging.fold returns each panel's frame, the hinges with their angle and gap, and the
  collisions. A closing hinge's gap is measured with every hinge folded all the way.
- ui.foldPreview sets the window and rejects values of the wrong kind or out of range; saved
  settings out of range are brought into range.
- The print renders off the UI thread where a worker exists and once per document revision. The
  fold and the view image are worked out again only when the document, the settings or the
  window's size change.
2026-11-16 10:20:36 -08:00
BFlat 36c1f37ac6 Merge pull request #8096 from dotCooCoo/feat/packaging-check-fold-lines
Packaging Tools: Check Fold Lines finds the panels and hinges of a blank and lists what is wrong
2026-11-16 23:08:07 +07:00
BFlat ee59999a00 Merge pull request #7982 from dotCooCoo/feat/common-tangents
Path Precision Tools: Common Tangents draws the lines touching two closed paths
2026-11-16 23:05:15 +07:00
dotCooCoo f54a3faa39 Packaging Tools: Check Fold Lines reports overshooting and stacked fold lines
- A crease that runs past the cut outline by the tolerance or more is
  reported as outside, though its hinge is still built.
- Two lines that fold, of any role, on top of each other are reported as
  duplicate; a line drawn twice is still checked for where it lies.
- Hidden lines are left out in every scope, members of a selected group
  included.
- The ids scope gets its own noCut message.
- The notStraight, ambiguous and summary texts say what the check finds:
  the summary counts hinges, not creases.
- The fold angle fields, which nothing in this change reads, are removed.
- A window drawn as open cut lines stays a hole when a cut line crosses
  it or when slits join it to an outline of open lines, so that three
  lines meet at a corner. Cut lines drawn whole that cross a cell leave
  it material.
- A slot drawn across the outline is a notch, not a hole, as when the
  notch is drawn in the outline; a crease in it lies outside the blank.
- notStraight measures each hinge piece at its farthest point from the
  hinge line instead of at five samples.
- Cut lines drawn on top of each other so many times that the gap search
  would look at more than 16,777,216 pairs are reported as tooComplex
  before the search.
2026-11-16 04:10:41 -08:00
dotCooCoo 532d2ea6d7 Packaging Tools: Check Fold Lines finds the panels and hinges of a blank and lists what is wrong
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.
2026-11-16 01:47:15 -08:00
dotCooCoo 3bde201d6c Path Precision Tools: Smooth Bridge reuses the tangent circle's Circle type
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.
2026-11-15 21:37:21 -08:00
FredApps bfe5c253f4 Merge remote-tracking branch 'origin/main' into feat/cutover-remaining-codecs
# Conflicts:
#	crates/engine/src/cmd/menucmds.rs
2026-11-16 06:35:17 +01:00
dotCooCoo 44051847c5 Merge main into feat/smooth-bridge 2026-11-15 20:57:30 -08:00
dotCooCoo 39a50adb46 Merge main into feat/common-tangents 2026-11-15 20:46:23 -08:00
dotCooCoo 83f21f4496 Path Precision Tools: Common Tangents adds the centerline between tiny paths
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.
2026-11-15 19:36:17 -08:00
dotCooCoo 1041a5c528 Merge main into feat/common-tangents 2026-11-15 18:44:19 -08:00
dotCooCoo 7ff63a6cd7 Merge main into feat/line-segment-common-tangent 2026-11-15 18:40:40 -08:00
dotCooCoo b983661aff Merge main into feat/smooth-bridge 2026-11-15 18:39:00 -08:00
FredApps be428f3fcf engine: keep the image size checks and depth of main through the cutover
Remove Background and Color Mask check the image's size from its header
again before decoding ("an image of W × H pixels is too large to change"),
and Crop Image's trim and Remove Background read a file that can't hold
the pixels its header declares as unreadable, as on main. The test helper
reading Remove Background's output keeps 16-bit samples.

The HEIF and JPEG XL readers and their tests go back to main's (heic-rs and
jxl-oxide): the craft-heif and craft-jxl versions failed eight of their
tests (resolution axes after a quarter turn, the container's mirror and
crop, refusing a grid of cropped tiles, 16-bit samples, the decode
allowance). Moving them stays to do.
2026-11-16 03:33:57 +01:00
BFlat 765334b9a6 Merge pull request #8010 from dotCooCoo/feat/tangent-circle
Path Precision Tools: Tangent Circle draws the circles that touch two or three shapes
2026-11-16 09:33:03 +07:00
BFlat 844f57a209 Merge pull request #7953 from dotCooCoo/feat/trim-hover-preview
Path Precision Tools: Trim at Crossings shows the stretch a click would remove
2026-11-16 09:32:44 +07:00
dotCooCoo 4ad75291cb Path Precision Tools: Tangent Circle draws the circles that touch two or three shapes
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.
2026-11-15 16:37:17 -08:00
dotCooCoo 0189417e24 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.
2026-11-15 13:48:21 -08:00
dotCooCoo 886c7bef8c Merge main into fix/graph-axes-group-edits-kept 2026-11-15 13:41:56 -08:00
FredApps caa62aa79f Merge remote-tracking branch 'origin/main' into work7669 2026-11-15 21:06:46 +01:00
dotCooCoo f151b74a2d Path Precision Tools: Smooth Bridge joins two circles with concave arcs
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.
2026-11-15 11:31:15 -08:00
dotCooCoo 5bba196c4f Path Precision Tools: Trim at Crossings shows the stretch a click would remove
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.
2026-11-15 11:24:17 -08:00
FredApps 31658546a8 fix(codecs): build the cutover against craft-libs d6cd7836d
- Test files whose image→craft-image-codecs rewrites didn't compile against
  main's newer tests go back to main's versions (engine fileio/tests.rs,
  tests_tiffbmp.rs, tests/menucmds.rs, eps tests.rs); they still use the image
  crate, which keeps its format features.
- craft_jxl::encode, craft_image_codecs::encode and Image::icc at d6cd7836d.
- jp2read and pdf export pass DecodeOptions, not Limits.
- EPS DCTDecode: grey JPEGs no longer use the image after moving it, and keep
  main's one-channel output.
- svg keeps its direct usvg dependency for main's image href code; pdf keeps
  jpeg-encoder for CMYK JPEGs.
- clippy -D warnings and rustfmt clean.
2026-11-15 18:05:45 +01:00
FredApps 5d492ebad2 Merge #7664 (fix/restore-codec-cutover-ci) into feat/cutover-remaining-codecs
Conflicts resolved in favour of main/#7664 in the 13 source files both touched
(doc/cmyk.rs, metafile/dib.rs, pdf images, svg import/files.rs, render paint and
encode tests, trace, engine load.rs), keeping main's newer TIFF/CMYK, DIB and PDF
image fixes. vectorcraft-doc stays on main's version until its CMYK reader moves
to craft-tiff. The image crate keeps its format features, and usvg, tiff,
zune-jpeg, hayro-ccitt and jpeg-encoder stay for the readers not yet moved.
Codec crates pinned to craft-libs d6cd7836d364177661b0ae17f48a0805e83a5f32.

Also fixes the compile errors CodeRabbit flagged (jp2read DecodeOptions,
filters.rs use-after-move) and the encode() arity at d6cd7836d.
2026-11-15 17:35:43 +01:00
dotCooCoo df49d7a5d0 Merge main into feat/packaging-fold-roles 2026-11-15 06:14:42 -08:00
dotCooCoo 3d85f7d617 Merge main into fix/graph-axes-group-edits-kept 2026-11-15 06:09:38 -08:00
BFlat 8138a6e973 Merge pull request #7814 from dotCooCoo/feat/editing-one-anchor-copies-the-whole-anchor-list
Paths: editing one anchor of a long path keeps one chunk of anchors for undo
2026-11-15 17:31:01 +07:00
BFlat 20282a13d0 Merge pull request #7807 from dotCooCoo/fix/guide-add-select-allonartboard-select-font-scope
MCP: guide.add and the artboard selections refuse an artboard that is not a whole number
2026-11-15 17:30:38 +07:00
dotCooCoo 1630c1af10 Merge main into feat/unit-converter 2026-11-14 22:10:31 -08:00
dotCooCoo 7104cd05f3 Merge main into feat/editing-one-anchor-copies-the-whole-anchor-list 2026-11-14 22:05:53 -08:00
dotCooCoo 18297cc662 Unit Converter: a signed or inch- or foot-suffixed thousands comma is refused
+1,000 read as 1 pt and 1,000" as 1 inch, though a single number with a
thousands comma is refused. The check now allows a leading + as well as -,
and accepts " and ' as the unit after the number, so +1,000, 1,000" and
1,000' are refused in addon.units.convert and in the number fields.
2026-11-14 21:52:07 -08:00
dotCooCoo a5493a1cd0 Paths: editing one anchor of a long path keeps one chunk of anchors for undo
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.
2026-11-14 21:25:15 -08:00
dotCooCoo ae0b5d2b5b Merge main into fix/guide-add-select-allonartboard-select-font-scope 2026-11-14 20:47:11 -08:00
dotCooCoo 71686757ec Unit Converter: a null unit is an error
addon.units.convert read {"value": 12, "unit": null} as 12 points. Only an
omitted unit is points now; a null unit is refused as an unknown unit.
2026-11-14 20:09:03 -08:00
dotCooCoo 3925b0c716 Merge main into fix/graph-axes-group-edits-kept 2026-11-14 20:03:31 -08:00
dotCooCoo d6761e23ba Unit Converter: a comma in a sum reads as a decimal comma again
The number fields read a comma in a sum as a decimal comma, so 1,500+2 is
3.5 (widgets::decimal_point_tests::a_decimal_comma_reads_as_a_point), and
only a value that is one number with a thousands comma, such as 1,000 mm,
is refused. Checking each number of a sum for a thousands comma broke that
test. The check is back to the single number, and addon.units.convert reads
1,500+2 the same way the number fields do.
2026-11-14 19:51:04 -08:00
dotCooCoo d34e9a1c67 Merge main into fix/path-commands-do-not-skip-locked-or-hidden-paths 2026-11-14 19:50:41 -08:00
BFlat 26878d3d0e Merge pull request #7715 from dotCooCoo/fix/svg-open-path-type-before-start
Type on a path: type on an open path can start before the path
2026-11-15 10:46:42 +07:00
dotCooCoo bcca1cf866 Merge main into fix/guide-add-select-allonartboard-select-font-scope 2026-11-14 19:35:00 -08:00
dotCooCoo e21bea6427 Merge main into fix/graph-axes-group-edits-kept 2026-11-14 18:51:43 -08:00
dotCooCoo 05527ee0f1 Artwork Cleanup: path commands take locked and hidden art named by ids
Simplify Anchors, Deep Ungroup and Rejoin Path Pieces now follow the
rule the text tools use: with `ids`, they act on the locked and hidden
paths and groups the ids name, and on those inside the groups and
layers they name, but not on art on a locked artboard. From the
selection they still take only art that can be edited.

- Rejoin Path Pieces joins only pieces alike in being hidden and in
  being locked (counting the groups and layers above them), so a joined
  path does not show hidden art or unlock locked art. Locked and hidden
  paths it makes are not selected. A compound path member named
  directly stays out, as members reached through the compound do.
- Deep Ungroup takes apart named locked and hidden groups, and the
  groups inside a named group or layer; a named layer stays. Objects of
  a hidden group become hidden, and objects of a locked group become
  locked.
- Simplify Anchors reports every named path it took in `ids`.
2026-11-14 18:49:20 -08:00
dotCooCoo 98efc6e956 MCP: guide.add and the artboard selections refuse an artboard that is not a whole number
guide.add and select.allOnArtboard (`artboard`), select.font
(`scope.artboards`) and addon.select.byArtboards (`artboards`) now read
artboard indices with the shared artboard helpers. A value that is not a
whole number of 0 or more, such as "1", -1, 1.5 or true, fails with an
error naming the key, instead of being reported as a missing artboard or
read as artboard 0, and the document and selection stay as they were.
A whole number past the last artboard is still `no such artboard`, and
an omitted or null `artboard` keeps its default.
2026-11-14 18:14:19 -08:00