`insideFirst: true` (default false) draws each pen's path only after
the pen's paths that lie inside it: a letter's counter before the
letter, a part's holes before the part. Without `sortPaths` the paths
otherwise keep paint order; with it, the next path is the nearest of
those free to draw.
Touching outlines count as inside; crossing ones, and copies of one
outline, do not. Finding which paths lie inside which shares the plot's
work budget with sorting, and each case that runs out of it adds a
warning.
Docs: docs/mcp.md (HP-GL export), docs/target-app-parity.md.
Under --automation-read-root, prefs.get, prefs.list, prefs.set and
prefs.reset returned the folder preferences (fontsFolder, pluginsFolder,
scratchPrimary, scratchSecondary, recoveryFolder, templatesFolder) and
the export presets' folder even when they were outside the read roots.
Such a folder preference is now null, as ui.inspect leaves it out, and
such a preset's folder is left out. An empty folder and the scratch disk
choices stay; without roots the replies are unchanged.
A filled open path wrote its outline as an open polyline, so with fill
hatches left out (and in R12, and in CNC / CAM) the area lost its closing
edge. Fill outlines now close each open subpath that can enclose an area;
strokes of the same path stay open.
An approval question that a control request, MCP, injected input, or a
file dialog one of them opened leads to now keeps OK disabled and
refuses every confirm, a person's click included. The dialog says to
choose Object › Plug-ins › Install Plug-in…, and ui.installPlugin answers
approval: "personMustStartInstall". The person's own Install Plug-in…,
File › Open or drop inspects the module again and asks a new question
with its half-second delay.
The origin is fixed when the request is made and goes with a native
file dialog's deferred answer and the web picker's answers, which now
arrive apart from drops and from window.vectorcraft.openFile (always
automation). A question about taking another module's place now opens
in the approval dialog, and automation's replace: true no longer skips
it. A module that needs no approval still installs at once.
Convert To Point Type left Dynamic Text on when it turned Block area
type into point type. Point type has no Dynamic Text, but the flag was
saved, and converting the type back to area type turned Block on again
and fitted the lines to the new frame. The conversion now turns it off;
the point type keeps the sizes and leading Block wrote into the
characters, and the conversion is still one undo step.
The Blend panel gets a Create Spine menu (Auto, Always, Never) under Make,
and object.blend.createSpine {mode?} sets or reads it. It is kept with the
preferences, is not an undo step and leaves blends already made as they are.
object.blend.make takes createSpine to choose for one new blend.
Auto and Always give every new blend a straight spine, as before. Never
makes a blend without one: its steps sit where a straight spine puts them,
object.blend.info reports hasSpine: false, easing is refused and dimmed,
Reverse Spine and the spine point commands refuse it, Release gives back
no spine path, and Replace Spine gives it a spine. A blend taking more keys
keeps whether it has a spine. Native files save noSpine; older files open
with their spines.
Builds on #5177 by adambelis.
DXF Options gets Include Placed Images and Include Fill Hatches, and
document.exportDxf and document.export {format: dxf} take
includeImages and includeHatches. Both are VectorCraft's own options
and default to true, so Custom exports write what they wrote before.
- includeImages: false writes no IMAGE entity, IMAGEDEF, reactor or
linked file for a placed image, and does not decode its pixels.
- includeHatches: false writes each filled area's outlines without the
solid HATCH after them.
- Each adds one note to warnings when it left something out. R12,
which has neither, keeps its own notes.
- The CNC / CAM preset sets both to false, so its drawing holds the
cutting paths alone; the options given still override it, and
changing either checkbox shows Custom.
Docs: docs/mcp.md, docs/control-protocol.md, docs/target-app-parity.md.
ui.pointer and the headless pointer call read a pointer event's pressure,
holdMs, tiltX, tiltY and rotation with a default for any value that was not a
number, and treated any space other than screen as document space. Each event
is now checked before the packet runs: those values must be numbers and space
must be doc or screen, with null keeping the default. docs/mcp.md says so.
VectorCraft could open and place HP-GL plot files but not write them,
so art for a pen plotter or a vinyl cutter had to go through another
program.
Export As, document.export and Export Selection now write HP-GL.
vectorcraft_cad::hpgl::export draws each visible path once along its
own line: a filled shape is its closed outline and a stroked path its
center line. Type is drawn as glyph outlines, a gradient mesh as its
outline, and a symbol instance as its art with its effects and the
instance's stain. Clipping masks cut the art they clip, and the art is
cut at the artboard's edges. Hidden and non-printing layers, hidden objects,
objects at 0% opacity, template layers, guides and placed images are
left out. Coordinates are plotter units (1016 to the inch, y up) from
the artboard's bottom-left corner or its center, and art more than
8,388,607 units from the origin is cut off.
Each color is a pen, in the order the plot first draws in it (up to
255), or a pen table maps each path to the pen of the nearest color.
With Use Artboards every file of the export uses the same numbering.
The pens draw in turn, each in paint order or, with sortPaths, nearest
path first. Curves are flattened to curveTolerance (0.1 pt by default).
hpglVersion "hpgl" writes IN, SP, PU and PD; "hpgl2" also writes the
palette (NP, PC) and each pen's paths as one encoded polyline (PE).
Options are checked, and Export As writes the file with the defaults.
Plots read back by the HP-GL reader give the same lines.
Docs: docs/mcp.md, docs/control-protocol.md, docs/file-format-parity.md,
docs/target-app-parity.md.
A new gradient kind, `diamond`, runs its stops from the center (the
start) out to a square with a corner at the end of the vector; the
aspect stretches the square across the vector into a rhombus. The
Gradient panel's Type row has a Diamond button, the Gradient tool draws
the square with the aspect handle and center ring, and a gradient
fitted to an object covers its box.
- Model and canvas: the level is |x| + |y| in the square's frame; a
square with no area (no vector, an aspect of 0, numbers out of range)
paints the last stop. The canvas draws it as pixels, out to a
stroke's miters, caps and arrowheads. Transforms keep the vector and
take the mapped size across it as the aspect.
- Commands: `paint.setFill`, `paint.editGradient` and
`paint.setGradientGeom` take `kind: "diamond"`; a negative aspect or
a focal point is an error. A conic or diamond gradient that a plug-in
returns with a focal point loses the focal point.
- Gradient tool: dragging the aspect handle of a radial or diamond
gradient whose file gave it a negative aspect now sets a positive
aspect; only a conic's negative aspect mirrors it.
- Export: PDF, SVG, EPS and legacy .ai write four linear gradients, one
for each quarter of the square, clipped to the shape (PDF as axial
shadings). PDF and SVG write an image for translucent stops, a
dithered fill or a flat square, and for the Perceptual method unless
PDF writes the stops as spot color shadings. SVG writes a diamond on
type characters as a radial gradient through the corners, and so
does CSS. A swatch library saved as CSS gets four corner layers, a
value for the `background` property (a circle when the swatch is
turned by an angle that is not a multiple of 90 degrees). The .ai
editing data holds a radial gradient through the corners. The
document exports give a warning.
- SVG export: a stroke drawn as an image, as conic wedges or as diamond
quarters now covers the miters, caps and arrowheads that reach past
its paint box.
- PDF import reads a function-based shading whose color is the same
along each square about the origin of its space as a diamond.
- Object > Expand gives nested squares or a mesh of rings.
Docs: docs/mcp.md, docs/target-app-parity.md.
action.batch read its true/false options with a fallback, so
{"stopOnError": "false"} kept stopping on the first error, and a
number for a string option such as label or datasetFileNaming was
dropped or turned into an empty string. The source check also ran
after the destination folder was made.
includeSubdirs, overrideOpen, overrideSave, overrideExport and
stopOnError now take only true or false, and source, folder,
destination, destinationFolder, datasetFileNaming and label take only
a string. Any other value is an error naming the key, given before the
destination folder is made or a file is opened. A null reads as a key
left out. The params text and docs/mcp.md say so.
script_pump read vectorcraft_doc::cancel only after the guard that keeps
a run waiting, so a run asleep in $.sleep went on waiting until its wake
time (up to 1,000 ms), and a run waiting at a dialog or for approval to
grow waited until someone answered. The check now runs before that
guard, after the dialog-failure check, so a canceled request ends the
run at the next slice and every document goes back.
A headless or control channel pointer packet now checks every event's kind,
coordinates and mods before it sends any of them, so a malformed later event
no longer leaves the earlier ones applied. A mods value that is not an object,
such as an array, is refused. Rotate View takes null mods as omitted. The MCP
docs name the params that refuse null.
Direct and indirect eval, Function and host evaluators parsed and compiled
their source before taking any fuel or checking the heap, so a script with a
small fuel limit could make the interpreter parse megabytes of source in a
handful of instructions. Interp::prepare_source now takes one unit of fuel for
each UTF-16 code unit and checks that the source text fits in the heap before
the source is flattened, parsed or compiled. A host evaluator's string takes
the fuel for a third of its bytes before it is encoded, and the rest after.
Limits::fuel and the maxFuel row in docs/mcp.md say so.
A new built-in add-on, Image Tools (Object › Plug-ins › Image Tools),
adds Remove Background… (`addon.image.removeBackground`). It makes the
background of the selected images transparent by lowering the alpha of
their own pixels, in one undo step, with no service or model. The
background is the most common color along the image's edges, the
average of the image's corners, or colors the user picks. Contiguous
(on by default) clears it only where it reaches in from an edge; off,
it is cleared wherever it is. Tolerance and Softness (0 to 100, 10 by
default) set how near a color must be to be cleared and the band over
which pixels fade out. Match measures that nearness as the RGB
distance or as the largest difference on one channel. It is a
VectorCraft addition.
- The image stays an image: an embedded PNG with alpha, the source's
ICC profile and resolution, and 16 bits or gray when the source is.
A linked image is embedded and keeps its Placement Options.
- When the edges hold at least as many clear pixels as pixels of their
most common color, edge mode clears nothing, so a second run leaves
the subject alone. Corner mode leaves clear corners out of the
average and clears nothing when all four are clear.
- With Match set to Each Channel, a tolerance of t / 255 × 100 clears
the colors within t 8-bit steps on every channel.
- A CMYK image, a linked image that shows its preview, an image that
would need more than the decode allowance (checked from its header)
and a result with no pixel left are refused, and the document stays
as it was. When no pixel changes, no undo step is added. The result
reports `cleared`, the pixels made fully clear.
- Picked colors are hex colors, with or without `#`, or black, white,
red, green or blue.
- The dialog opens with Preview off; with Preview on, the canvas shows
the result, and Cancel puts the image back. While the dialog
previews, the session keeps the images' decoded pixels (at most
128 MiB, 32 MiB in the web app) so each preview step does not decode
them again, and releases them when the dialog closes with OK or
Cancel. A run that is not a preview step keeps nothing.
Docs: docs/mcp.md (Image Tools add-on), docs/target-app-parity.md.
Grouping for flattening joined every pair of objects whose 1 pt reach
boxes touched, transitively, so a row or grid of opaque objects next to
one see-through object became one group and was flattened with it.
Now a group holds each see-through object and every object its reach
touches. An object without transparency joins only where its reach
touches a member and it lies above that member but below the group's
topmost object, whose place the group takes, so the stacking order
stays the same. In files without transparency with Clip Complex Regions
on, art under a group within one image pixel of a member joins it too,
with the pixel size taken from the image's actual resolution. Objects in
an overlap set that includes one inside a clip group or clipping layer
keep the previous grouping.
The 1 pt antialiasing margin now goes around a group's art once instead
of once per nested group (a stroked path's plain art is a group, so it
had 2 pt).
On 3,000 stroked rectangles, 60 with a drop shadow, the Flattener Preview
counts 180 affected objects where it counted 3,000, and Flatten
Transparency with the Medium preset makes 240 flat regions and 2 images
where it made one image of the whole grid.
Document Setup gets a Color tab with the document color mode (RGB Color
or CMYK Color), a Convert to CMYK or Convert to RGB box for a mode
change (cleared, the colors keep their numbers), and the RGB and CMYK
profiles assigned to the document, with a working-space entry for none.
When the tab changes something, OK runs document.setup, then
edit.assignProfile, then file.documentColorMode in one command.batch,
and the document's changes are one undo step. Assign Profile runs first,
so a mode change converts through the profile picked with it. An
unchanged Color tab adds no color commands, and Cancel, or OK with
nothing changed, records no undo step. A Color tab field with a value of
the wrong kind is an error, and the dialog stays open with nothing
changed. File › Document Color Mode and Edit › Assign Profile… stay
where they are.
Catalogs: "Working RGB (don't tag)" and "Assign Profile" rows in every
complete catalog, and the "`{key}` must be a profile name or null"
message in every complete-message catalog. Docs: docs/mcp.md,
docs/control-protocol.md, docs/target-app-parity.md.