mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-19 09:13:34 +00:00
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.
26 lines
923 B
Rust
26 lines
923 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. Check Fold
|
||
//! Lines ([`check`]) finds the panels and hinges the lines make and what is wrong with them. Its submenu
|
||
//! (Object › Plug-ins › Packaging Tools) and its Fold Lines panel are the UI's.
|
||
|
||
mod check;
|
||
mod fold;
|
||
mod roles;
|
||
|
||
pub use fold::{fold_source, print_hidden};
|
||
pub(crate) use roles::{role_swatch_edited, role_swatches_merged};
|
||
|
||
use super::super::CommandSpec;
|
||
|
||
pub fn specs() -> Vec<CommandSpec> {
|
||
let mut v = roles::specs();
|
||
v.extend(check::specs());
|
||
v.extend(fold::specs());
|
||
v
|
||
}
|
||
|
||
#[cfg(test)]
|
||
mod tests;
|