mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-17 03:14:48 +00:00
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.
19 lines
676 B
Rust
19 lines
676 B
Rust
//! Packaging Tools (`addon.packaging.*`), a built-in add-on for the dielines of boxes and other
|
||
//! folded packaging. A path is a fold line when its top stroke is painted with the swatch of a line
|
||
//! role: Cut, Crease, Partial Cut or Perforation ([`roles`]). The document's role table maps each
|
||
//! role to its swatch, so every format that keeps the stroke's swatch keeps the role. Its submenu
|
||
//! (Object › Plug-ins › Packaging Tools) and its Fold Lines panel are the UI's.
|
||
|
||
mod roles;
|
||
|
||
pub(crate) use roles::{role_swatch_edited, role_swatches_merged};
|
||
|
||
use super::super::CommandSpec;
|
||
|
||
pub fn specs() -> Vec<CommandSpec> {
|
||
roles::specs()
|
||
}
|
||
|
||
#[cfg(test)]
|
||
mod tests;
|