Files
vectorcraft/crates/engine/src/cmd/addons/packaging.rs
T
dotCooCoo 4911e102b1 Packaging Tools: Fold Preview folds the blank in 3D with the printed art on its panels
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.
2026-11-16 10:20:36 -08:00

26 lines
923 B
Rust
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
//! 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;