mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-12-04 04:52:54 -05:00
Merge main into feat/scripts-export-autocad
This commit is contained in:
commit
d09d00fa25
278 files changed
+9496
-2128
No files matched your search
+101
-23
@@ -1355,7 +1355,7 @@ a script does the same with those commands.
|
||||
SVG Options: `export` to SVG takes them in `options`, flat or as `{"svg": {…}}`: `styling` (`presentation`,
|
||||
`style`, `entities`, `css`), `outlineText`, `images` (`embed`, or `link`: embedded images are written next to the
|
||||
SVG, or returned as `linked`), `objectIds` (`layerNames`, `minimal`, `unique`), `decimals` (1–7), `minify`,
|
||||
`responsive`, `useArtboards`, `range: "all"` (one SVG per artboard, listed in `files`, each holding only the art over its artboard), `preserveEditing` (the SVG
|
||||
`responsive`, `units` (`px`, `pt`, `mm`, `cm` or `in`: overrides the document unit for `width` and `height`; omit to retain the document unit, explicit null is rejected; `px` means bare numbers, the `viewBox` stays in points; ignored with `responsive`), `useArtboards`, `range: "all"` (one SVG per artboard, listed in `files`, each holding only the art over its artboard), `preserveEditing` (the SVG
|
||||
reopens as the full document), `metadata` and `fewerTspans` (one `<tspan>` per line of type). Unknown keys inside `svg` are rejected; `run_command document.formats`
|
||||
lists every option with its default. `encoding` is `utf8`, `utf16` (big-endian after a byte order mark) or `latin1`
|
||||
(ISO 8859-1, other characters as `&#x…;` references); `document.serialize` still answers `text`, plus `dataBase64`
|
||||
@@ -6177,7 +6177,9 @@ already walks Image Trace. Short agent entry points:
|
||||
When `livePaint.gapOptions` or `livePaint.merge` cuts an edge into pieces, each piece takes the edge's paint, with
|
||||
its rows fitted to its part of the edge in the same way. A face or edge given no such row has one unpainted row. Rows that do not draw stay with the stored sources, which
|
||||
`livePaint.release` returns unchanged. The source's object effects and the strokes' pen pressure are not carried.
|
||||
Expand keeps those face fills.
|
||||
Expand keeps those face fills. Make, Merge and Gap Options stop with an error and leave the art unchanged when the
|
||||
paths are too many or too complex to map. This happens when the paths have more than 131,072 pieces once cut where
|
||||
they meet, or exceed the sweep's work budget, which counts pairs of segments with overlapping bounds. The paths include lines across the gaps when Gap Detection is on.
|
||||
`livePaint.expand` keeps each face and edge that draws, with all its fill and stroke rows: it is shown, its opacity
|
||||
is above 0, and a fill or stroke row is shown, has paint and an opacity above 0 (a stroke also a weight above 0),
|
||||
whichever row is on top. A painted lower row under an unpainted top row keeps the part; a part whose only painted
|
||||
@@ -6201,7 +6203,9 @@ already walks Image Trace. Short agent entry points:
|
||||
when another merged group has it on. When Gap Detection is off in every merged group, it stays off.
|
||||
The Gap Options dialog (`ui.livePaintGapOptions`) takes `color` as `#rrggbb` or a layer color's name; its OK gives
|
||||
an error for a `color` with an alpha part (`#rrggbbaa` or `#rgba`) and changes nothing. With Preview on, a
|
||||
`#rrggbbaa` color is not previewed: the groups keep their own color, and the previewed gaps draw in black.
|
||||
`#rrggbbaa` color is not previewed: the groups keep their own color, and the previewed gaps draw in black. When a
|
||||
preview fails, the status bar shows the error, the groups go back to how they were, and the dialog stops drawing its preview of the gaps. View › Show Live Paint Gaps still draws the restored
|
||||
groups' own gaps.
|
||||
`view.livePaintGaps` (View › Show Live Paint Gaps, or Hide Live Paint Gaps while it is on) turns the drawing of
|
||||
those gaps on or off. While it is on and edges show, the canvas draws the gaps of each selected Live Paint group in
|
||||
that group's Gap Preview Color. The reply is the new state (`true` when on).
|
||||
@@ -7778,8 +7782,10 @@ Pathfinder command (`object.pathfinder.unite` … `minusBack`) also takes `preci
|
||||
whatever the options are then. Unite, Minus Front, Intersect, Exclude and Minus Back close open paths, so a straight
|
||||
line encloses no area and does not change the result's shape. When a selected object is or holds such a path, the reply's
|
||||
`warning` says so and names Object › Path › Outline Stroke. When such a path leaves the result empty (Intersect, a line
|
||||
at the back in Minus Front, or a line in front in Minus Back), the error says so too.
|
||||
|
||||
at the back in Minus Front, or a line in front in Minus Back), the error says so too. Divide with open paths among
|
||||
the objects stops with an error and leaves the art unchanged when the paths are too many or too complex to map.
|
||||
This happens when the paths Divide maps, as it prepares them from the selection, have more than 65,536 segments, have more than 131,072 pieces once cut where
|
||||
they meet, or exceed the sweep's work budget, which counts pairs of segments with overlapping bounds.
|
||||
```json
|
||||
{"name":"run_command","arguments":{"command":"object.pathfinder.options","params":{"precision":0.1,"removeUnpainted":true}}}
|
||||
```
|
||||
@@ -9053,16 +9059,28 @@ path's last point, drawn with the tool's `action` option:
|
||||
Alt (Option on macOS) pressed and let go with no other key, click or wheel turn in between switches to the next action:
|
||||
Line, Continuous Arc, Sharp Corner Arc, and back to Line. C flips the last piece, while it is a sharp-corner arc, to
|
||||
the other side of its chord. `[` and `]` make the arc size 15° smaller or larger, for the last sharp-corner arc and the
|
||||
arcs after it. During a drag, C and `[` `]` change the sharp-corner arc being dragged, and Alt switches its action. A
|
||||
dragged piece ends where the press is let go. A click on the first point closes the path, and a click on an end of an
|
||||
open path goes on drawing from that end. Escape or Enter ends the path, and so does an edit made to it by another
|
||||
command. An edit made by another command during a drag, to the path or to other art, also ends the path: the edit
|
||||
arcs after it, as `tool.quickPen.arcSmaller {}` and `tool.quickPen.arcLarger {}` do (each first finishes any pending
|
||||
tool edit, then returns false, changing nothing more, when the Quick Pen tool is not active or the step would leave 1° to
|
||||
359°). `tool.quickPen.arcSmaller` and `tool.quickPen.arcLarger` run in the desktop app (`--connect`). Ctrl with a
|
||||
scroll on a touchpad over the canvas (the Control key on macOS too) changes the arc size as well, as
|
||||
[Quick Pen tool keyboard shortcuts](https://helpx.adobe.com/illustrator/web/add-and-edit-artwork/draw-and-edit-paths/quick-pen-tool-keyboard-shortcuts.html)
|
||||
lists: the touchpad makes one step for each wheel line of its motion, and motion that goes on after the fingers lift
|
||||
makes none. A mouse wheel turned with Ctrl over the canvas does the same, one step for each net whole wheel line
|
||||
reported by the canvas framework, with at least one step for a nonzero share. The framework sums events within a
|
||||
frame, so opposite notches cancel and their order is unavailable. Up makes the arc size larger and down smaller.
|
||||
Sideways motion makes no step, except when Ctrl on Windows or Linux makes the framework report it as zoom motion.
|
||||
The view does not zoom or scroll for the rest of that wheel turn. During a drag,
|
||||
C, `[` `]` and the wheel change the sharp-corner arc being
|
||||
dragged, and Alt switches its action. A dragged piece ends where the press is let go. A click on the first point
|
||||
closes the path, and a click on an end of an open path goes on drawing from that end. Escape or Enter ends the path,
|
||||
and so does an edit made to it by another command. An edit made by another command during a drag, to the path or to other art, also ends the path: the edit
|
||||
stays, and the piece stays as last shown. With the `realTimeDrawing` preference off, a press during which another
|
||||
command edits the document adds no piece, and the edit stays. The path's points show as circles without handles, and a
|
||||
preview shows the piece the next click adds. Points snap to Smart Guides. Each piece is one undo step, together with the
|
||||
flips and size changes made during its drag, and each flip or size change made between presses is one undo step. The
|
||||
arc size of 180°, its 15° steps, the side an arc bulges to, what C and `[` `]` do during a drag and Enter ending the
|
||||
path are VectorCraft's own rules. The tool keeps `action` and `turn` with the preferences
|
||||
arc size of 180°, its 15° steps, the side an arc bulges to, what C, `[` `]` and the wheel do during a drag, Enter
|
||||
ending the path, the mouse wheel changing the arc size, and the wheel's step per net wheel line and its direction are
|
||||
VectorCraft's own rules. The tool keeps `action` and `turn` with the preferences
|
||||
(`tool.setOption {tool: "quickPen", key, value}`).
|
||||
|
||||
While an arc is drawn, by a drag or as the piece the next click adds, the tool shows a protractor around the arc's
|
||||
@@ -12083,7 +12101,8 @@ height (`"100h"`) or a resolution (`"72ppi"`); raster rows name their files `@2x
|
||||
otherwise. `fullDocument` writes one file per row instead (a PDF of every artboard, other formats the bounds of all
|
||||
art), `includeBleed` grows each artboard by the document's bleed (a PDF row's page keeps the artboard as its
|
||||
TrimBox and puts the row's `bleed` around it once: the row's own values, zero included, else the document's bleed
|
||||
when the row sets none and its PDF preset gives none or a bleed of 0), `includeArtboardFill: false` (Include Artboard
|
||||
when the row sets none and its PDF preset gives none or a bleed of 0; a native, `.ai` or EPS file of an artboard
|
||||
holds the grown artboard with a bleed of 0, so the bleed is not added again when the file is opened), `includeArtboardFill: false` (Include Artboard
|
||||
Fill unchecked) leaves the artboards' background colors out of the files, `pdfs: "single"` (Export PDFs As › Single file)
|
||||
writes the artboards a PDF row exports as the pages of one PDF named after the document (it is refused with
|
||||
`assets`, `layers` or `selection: "each"`, whose files each hold one item's art), `subfolders` puts each
|
||||
@@ -13654,7 +13673,12 @@ for near matches; when none passes, the shape stays an outline. Glyphs fused int
|
||||
or 65,536 path elements is matched whole only. One command groups at most 16,384 contours, in selection order; the shapes after them are
|
||||
matched whole only. Near matching compares a shape with at most the 256 glyphs closest to it in proportion, in at
|
||||
most 50 million point comparisons per shape and 2 billion per command, ranking a glyph by proportion counting as one
|
||||
comparison per contour and one more; past them, the glyphs not yet ranked or compared are left out. It looks glyphs up for at most 1,024 distinct shapes and runs per command: every selected shape first, in
|
||||
comparison per contour and one more; past them, the glyphs not yet ranked or compared are left out. Those 256 can
|
||||
all be glyphs of other fonts drawn alike (a period or a dot): a shape matched whole, whose matches are all near
|
||||
matches in other fonts than that of the line before it, is also compared with the 256 glyphs of that line's font
|
||||
closest to it in proportion when it does not join the line, and joins the line when one of them fits. A shape with an
|
||||
exact match, a shape split into several glyphs, a shape that matches no glyph at all and a shape after an unmatched
|
||||
shape are not compared again. It looks glyphs up for at most 1,024 distinct shapes and runs per command: every selected shape first, in
|
||||
selection order, then the runs of groups of the compound paths. Glyphs close only to the shapes and runs past that
|
||||
limit are not looked up. At most 262,144 glyphs are drawn to check whether they could near match, and at most 32,768
|
||||
are indexed for it, each face taking an equal share of both; of a face's glyphs, those closest to the selected shapes
|
||||
@@ -17078,7 +17102,7 @@ Commands:
|
||||
- `addon.pathtools.bridge {radius?, gap?, reach?, keepOriginals?, ids?}` joins circles (`ids`, default: the selection,
|
||||
with a group other than a clipping group giving the objects inside it at any depth, which must all be circles; paths
|
||||
whose outline is a circle, not hidden or locked) into metaball (aka meatball) shapes, as one undo step (Object ›
|
||||
Plug-ins › Path Precision Tools › Smooth Bridge…). Two circles become one closed outline that goes around each circle
|
||||
Plug-ins › Path Precision Tools › Common Tangents… with External and Curved). Two circles become one closed outline that goes around each circle
|
||||
on its side away from the other and along two concave arcs, one on each side of the line through the centers, each
|
||||
touching both circles from outside, so every anchor is smooth. `radius` is the arcs' radius as a percentage of the
|
||||
smaller circle's radius (1 to 1,000, 100 by default): a larger radius makes a wider, gentler bridge. `gap` (0 to 1,000
|
||||
@@ -17108,10 +17132,11 @@ Commands:
|
||||
other stays as it is. The shapes and the circles left as they are are selected. It is an error when any pair within
|
||||
reach has one circle inside the other, when no pair within reach can be bridged (suggesting a larger radius or gap
|
||||
only when the largest would bridge a pair of them under these rules), when no two circles are within reach, and above 2,000 circles or 8,000 bridges. → `{ids, alone}`:
|
||||
the shapes and the circles left as they are, with `id` as well for two circles. Smooth Bridge… opens a dialog
|
||||
(`ui.menuDialog {command}`, key `addon.pathtools.bridge`) with Constant Gap (a Gap field in place of the Radius field in
|
||||
percent), Reach (unavailable when the selection, a selected group's objects counted, holds two objects), Keep Originals
|
||||
and Preview.
|
||||
the shapes and the circles left as they are, with `id` as well for two circles. Opening `addon.pathtools.bridge`
|
||||
from the menu dialog (`ui.menuDialog {command}`) opens Common Tangents' dialog (key
|
||||
`addon.pathtools.commonTangents`) with External and Curved on, described under
|
||||
`addon.pathtools.commonTangents`. No menu item runs `addon.pathtools.bridge`, and the command palette and Keyboard
|
||||
Shortcuts leave it out; scripts and actions still run it.
|
||||
- `addon.pathtools.tangentCircle {ids?, radius?, circle?}` draws the circles that touch two paths or compound paths
|
||||
and have `radius` (0.01 to 1,000,000 pt, needed with two), or that touch three (which set the radius themselves, so
|
||||
`radius` is then an error), as one undo step (Object › Plug-ins › Path Precision Tools › Tangent Circle…). `ids`
|
||||
@@ -17212,7 +17237,7 @@ 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
|
||||
- `addon.pathtools.commonTangents {tangents?, centerline?, connect?, curved?, radius?, gap?, reach?, keepOriginals?, 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
|
||||
@@ -17237,9 +17262,19 @@ Commands:
|
||||
runs from the point to the path's center. Two points are refused with "select two closed paths". 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; with a point selected, every Tangents choice gives the same lines. → `{ids, external, internal,
|
||||
centerline, warning?}` (`centerline`: the centerline's id, or null).
|
||||
nothing changes, and the result's `warning` says why. → `{ids, external, internal, centerline, warning?}`
|
||||
(`centerline`: the centerline's id, or null). With `connect: true` the two tangents of each kind become one closed
|
||||
path instead of two lines, joined by the chords between where they touch each path (two internal tangents make a
|
||||
crossed shape, and a point's two lines make a triangle); a kind with one tangent stays a line, and the centerline
|
||||
stays a line. With `curved: true` it joins the selected circles into one outline along concave arcs instead, as
|
||||
`addon.pathtools.bridge` does, taking that command's `radius` or `gap`, `reach`, `keepOriginals` and `ids`, and
|
||||
the result is that command's. `tangents` other than `external`, `centerline` and `connect: false` with `curved` are
|
||||
an error, and so are `radius`, `gap`, `reach` and `keepOriginals` without it. Common Tangents… opens a dialog with
|
||||
Tangents, Centerline and Connect tangents; with External it also shows Straight and Curved (Straight by default) and
|
||||
the bridge's options: Constant Gap (a Gap field in place of the Radius field in percent), Reach (unavailable when the
|
||||
selection, a selected group's objects counted, holds two objects) and Keep Originals, which take input only with
|
||||
Curved. With Curved, Centerline is unavailable and Connect tangents shows on. Choosing another kind of tangent goes
|
||||
back to Straight. With a point selected, every Tangents choice gives the same lines.
|
||||
- `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
|
||||
@@ -18266,7 +18301,7 @@ enabled only when a selected image has a mask. → `{changed, ids}`
|
||||
|
||||
## Type Tools add-on
|
||||
|
||||
Type Tools is a built-in add-on for type: its commands are `addon.type.textTweaker` and `addon.type.releasePath`, and
|
||||
Type Tools is a built-in add-on for type: its commands are `addon.type.textTweaker`, `addon.type.releasePath` and `addon.type.numbers`, and
|
||||
in the desktop app it lives in Object › Plug-ins › Type Tools (#4924, #5532). Text Tweaker gives one character attribute to the characters letter by letter,
|
||||
from a start value to an end value along a shape, as one undo step; the text stays live and editable. Each value is set
|
||||
as `text.setRangeStyle` sets it (the Character panel), in its units and ranges ([formatting type](https://helpx.adobe.com/illustrator/using/formatting-type.html)), so on scaled
|
||||
@@ -18331,6 +18366,49 @@ Path Options' Preview does (#5360).
|
||||
{"name":"run_command","arguments":{"command":"addon.type.releasePath","params":{"mode":"path","keepOriginal":true}}}
|
||||
```
|
||||
|
||||
### Make Numbers Sequence
|
||||
|
||||
`addon.type.numbers` numbers the type objects among `ids` (or `id`, else the selection), groups included, from `start`
|
||||
by `step`, as one undo step. Each number replaces the object's whole text, every number in it, or every `{%n}`
|
||||
placeholder in it. It is based on Sergey Osokin's MIT-licensed
|
||||
[MakeNumbersSequence](https://github.com/creold/illustrator-scripts/blob/master/md/Text.md#makenumberssequence)
|
||||
script.
|
||||
|
||||
- With `end` omitted the numbers run to the last object. With `end`, they stop past it and the objects after the last
|
||||
number keep their text, or are deleted with `removeUnused`. A type object that is the mask of a clipping group or layer
|
||||
is not deleted. The sign of `step` is set to run toward `end`.
|
||||
- Locked or hidden type, also inside a selected group, is not numbered or deleted.
|
||||
- With `replace` `numbers` or `placeholder`, objects that hold no number or placeholder are skipped and get no number,
|
||||
and `order` leaves them out. The remaining objects are ordered before `end` limits the sequence, so objects past
|
||||
`end` still count for rows and columns. A number is a run of digits with any `.` or `,` between digits,
|
||||
and a `-` before it that does not follow a letter or digit. Replaced text takes the style of the text it replaces;
|
||||
a number or placeholder that already reads the new number keeps its text and style. With `numbers` or
|
||||
`placeholder`, one run replaces at most 10,000 numbers or placeholders; more is an error, and nothing changes.
|
||||
- Values are rounded to the most decimal places among `start`, `step` and `end` (at most 6), so 0.1 by 0.1 gives
|
||||
0.1, 0.2, 0.3.
|
||||
- Objects that already read so are left as they are; when nothing changes no undo step is made.
|
||||
- A frame of threaded type among the objects is an error, and nothing changes.
|
||||
|
||||
| Parameter | Values (default) |
|
||||
|---|---|
|
||||
| `start`, `step` | numbers −1e12…1e12 (1, 1; `step` 0: every object gets `start`) |
|
||||
| `end` | number −1e12…1e12 (omitted: to the last object) |
|
||||
| `order` | `stacking` (from the back), `rows` (top to bottom, each row left to right), `columns` (left to right, each column top to bottom) (`stacking`). Objects whose centers are within half the median height (width for columns) of a row's first object share its row |
|
||||
| `replace` | `all`, `numbers`, `placeholder` (`all`) |
|
||||
| `shuffle`, `seed` | false; true: the numbers go to the objects in random order, the same `seed` (a whole number, 0) giving the same order, and `order` is not used. A `seed` that is not a whole number is an error even with `shuffle` off |
|
||||
| `leadingZeros` | true: non-negative numbers are padded with zeros to the whole digits of the wider of `start` and `end` (or the last number) |
|
||||
| `digits` | 1…30: with `leadingZeros`, at least this many whole digits |
|
||||
| `trailingZeros` | false; true: every number gets as many decimal places as the one with the most |
|
||||
| `removeUnused` | false; true needs `end` |
|
||||
|
||||
→ `{count (objects changed), ids (numbered, in order), removed}`. Make Numbers Sequence… opens a dialog (`ui.menuDialog
|
||||
{command}`, dialog key `addon.type.numbers`) whose fields are the command's parameters, with Preview.
|
||||
|
||||
```json
|
||||
{"name":"run_command","arguments":{"command":"addon.type.numbers","params":{"start":1,"order":"rows"}}}
|
||||
{"name":"run_command","arguments":{"command":"addon.type.numbers","params":{"start":5,"end":50,"step":5,"replace":"placeholder","digits":3}}}
|
||||
```
|
||||
|
||||
## Unit Converter add-on
|
||||
|
||||
Unit Converter is a built-in add-on that shows one length in every unit at once (#5528): its commands are
|
||||
|
||||
Reference in new issue
Block a user