Files
vectorcraft/crates/engine/src/cmd/addons.rs
T
dotCooCoo d156bd4da6 Packaging Tools: Make … Line gives paths a fold line role that their swatch carries
Object › Plug-ins › Packaging Tools is a new built-in add-on for the
dielines of boxes and other folded packaging. A path, compound path or
live shape is a fold line when its top stroke is painted with the swatch
of a line role: Cut, Crease, Partial Cut or Perforation. Each document
has a role table (`packagingRoles`) that names the swatch of each role.
By default the swatches are named after the roles. Native files keep the
table and the strokes. PDF prints a role line on its swatch's separation
when the swatch is a spot color, as the default role swatches are. SVG,
DXF and HP-GL keep the stroke's color, so the default role swatches come
out as four colors.

- `addon.packaging.setRole` (Make Cut Line, Make Crease Line, Make
  Partial Cut Line, Make Perforation Line) paints the top stroke of each
  path among the objects with the role's swatch at 100%, through groups
  and clip groups. Locked and hidden objects are left out, also when
  named by id. A path without a stroke gets a 1 pt stroke, a hidden
  stroke is shown, and the stroke overprints unless `overprint` is false.
  A missing role swatch is made as a global spot swatch in the document's
  color mode (Cut 100% magenta, Crease 100% cyan, Partial Cut 100%
  yellow, Perforation 50% magenta and 50% cyan). When a color group or a
  swatch that can't carry a role has that name, the swatch is made as
  "Cut 2" and so on. `none` takes the role away and keeps the color. One
  undo step, none when nothing changes.
- `addon.packaging.roles` counts each role in the selection, or in the
  document while nothing is selected, locked and hidden lines included.
  The Fold Lines panel shows these counts, gives the selected paths a
  role when a row is clicked, and says when nothing is selected.
- `addon.packaging.setRoleSwatch` (the panel menu's Role Swatches…) makes
  another global or spot color swatch carry a role. It refuses missing,
  gradient, pattern, process, tint, [None] and [Registration] swatches
  and a swatch another role has.

When `swatch.edit` renames a role swatch, the role stays with it under
the new name. When it turns Global off, the role moves to a new swatch
name that the next Make … Line makes. When `swatch.merge` merges a role
swatch into a global swatch that carries no role, the kept swatch takes
the role.

Docs: docs/mcp.md (Packaging Tools add-on) and ROADMAP.
2026-11-14 15:25:30 -08:00

40 lines
989 B
Rust

//! VectorCraft's built-in add-ons: extra tools beyond the standard menus, each a module of its own
//! with commands under `addon.<name>.*` (see `docs/mcp.md`).
mod arrange;
mod cleanup;
mod color;
mod contour;
mod cutting;
mod document;
mod image;
mod packaging;
mod pathtools;
mod pen;
mod select;
mod shapes;
mod typetools;
pub(crate) use image::{DecodedImages, refresh_color_masks};
pub(crate) use packaging::{role_swatch_edited, role_swatches_merged};
use super::CommandSpec;
/// The commands of every built-in add-on.
pub fn specs() -> Vec<CommandSpec> {
let mut v = arrange::specs();
v.extend(cleanup::specs());
v.extend(color::specs());
v.extend(contour::specs());
v.extend(cutting::specs());
v.extend(document::specs());
v.extend(image::specs());
v.extend(packaging::specs());
v.extend(pathtools::specs());
v.extend(pen::specs());
v.extend(select::specs());
v.extend(shapes::specs());
v.extend(typetools::specs());
v
}