mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-17 08:26:28 +00:00
Merge pull request #8096 from dotCooCoo/feat/packaging-check-fold-lines
Packaging Tools: Check Fold Lines finds the panels and hinges of a blank and lists what is wrong
This commit is contained in:
Generated
+2
@@ -6841,6 +6841,7 @@ dependencies = [
|
||||
"vectorcraft-svg",
|
||||
"vectorcraft-testkit",
|
||||
"vectorcraft-text",
|
||||
"vectorcraft-three-d",
|
||||
"vectorcraft-tools",
|
||||
"vectorcraft-trace",
|
||||
"wat",
|
||||
@@ -7154,6 +7155,7 @@ dependencies = [
|
||||
name = "vectorcraft-three-d"
|
||||
version = "0.24.1"
|
||||
dependencies = [
|
||||
"proptest",
|
||||
"vectorcraft-geom 0.24.1",
|
||||
"vectorcraft-pathops 0.24.1",
|
||||
]
|
||||
|
||||
@@ -135,6 +135,7 @@ Ranked; detail in [docs/roadmap.md](docs/roadmap.md) and [docs/gaps.md](docs/gap
|
||||
- 2026-11-05: Release Type on a Path joins the Type Tools add-on (Object › Plug-ins › Type Tools): each selected type on a path splits into point type with the same text and attributes, on one straight line starting where its first character sat, and the plain path it was set on, with its exact shape and place in the stacking order and no paint; or keeps only the path or only the text, optionally leaving the original. A dialog with Preview, one undo step (`addon.type.releasePath`, #5532). A VectorCraft addition: headline numbers unchanged.
|
||||
- 2026-11-04: New Document: the units chosen in Preset Details now belong to the chosen document, as the pane's options are listed for the selected preset; the chosen card shows them, every other Recent and Saved card keeps the units its document or preset was made in, and the built-in tabs still follow the chosen units, so switching between inches and millimetres no longer restyles every recent template. Scores and estimates unchanged.
|
||||
- 2026-11-14: Packaging Tools add-on (Object › Plug-ins › Packaging Tools): fold line roles for dielines (Cut, Crease, Partial Cut, Perforation), each carried by the swatch on a path's top stroke through a per-document role table that native files keep; PDF prints a role line on its swatch's separation when that swatch is a spot color, as the default role swatches are, and SVG, DXF and HP-GL keep the stroke's color. Make Cut Line, Make Crease Line, Make Partial Cut Line and Make Perforation Line give the selected paths a role, overprinting by default, and make a missing role swatch; the Fold Lines panel counts each role in the selection or the document, and its Role Swatches… picks another swatch for a role (`addon.packaging.setRole`, `addon.packaging.roles`, `addon.packaging.setRoleSwatch`). A VectorCraft addition: headline numbers unchanged.
|
||||
- 2026-11-16: Check Fold Lines in the Packaging Tools add-on (Object › Plug-ins › Packaging Tools, and the Fold Lines panel's Check button): the fold lines of the selection or the document are split into blanks, panels and hinges (cut lines bound the material, and creases, partial cuts and perforations divide it into panels), and 15 kinds of issue are listed, errors and warnings, each naming its lines: cut lines that enclose nothing or end loose, gaps closed within a tolerance, a cut on top of a crease, duplicate lines, creases that end inside a panel, divide nothing, lie outside the blank or are not straight, gaps too narrow to map, fold lines in a hole, panels joined by no crease, and fold lines on a non-printing layer. The panel lists the issues in the interface language; clicking one selects its lines (`addon.packaging.check`). A VectorCraft addition: headline numbers unchanged.
|
||||
- 2026-11-02: Mouse wheel over a closed font-family field in Character, Properties or Control changes selected text through the family list using saved font filters (excluding search text), one undo step per notch, stopping at the ends (#5253). Scores and estimates unchanged.
|
||||
- 2026-10-31: Pattern libraries: Window › Swatch Libraries › Patterns and the Swatches panel's library menu open Geometric Patterns, a built-in library of eleven pattern swatches (dots, stripes, checks, a grid and shapes); clicking one adds its pattern and swatch to the document, once, and applies it to the active fill or stroke (`swatch.library.add`).
|
||||
- 2026-11-11: Pattern libraries: Patterns › Grit Textures, a second built-in pattern library, holds eight seamless black textures (Fine Grain, Coarse Grit, Sand, Speckle, Stipple, Scratches, Sparse Flecks and Dense Flecks) on tiles of 18 to 36 pt, each drawn the same way every time; marks that reach past a tile edge continue on the next tile, so the tiles join without a seam (`swatch.library.add`). Scores and estimates unchanged.
|
||||
|
||||
@@ -29,6 +29,8 @@ vectorcraft-tools = { workspace = true }
|
||||
vectorcraft-text = { workspace = true }
|
||||
vectorcraft-render = { workspace = true }
|
||||
vectorcraft-pathops = { workspace = true }
|
||||
# The panels and hinges of a packaging blank (Packaging Tools' Check Fold Lines).
|
||||
vectorcraft-three-d = { workspace = true }
|
||||
vectorcraft-brush = { workspace = true }
|
||||
vectorcraft-trace = { workspace = true }
|
||||
vectorcraft-svg = { workspace = true }
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
//! 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
|
||||
//! 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 roles;
|
||||
|
||||
pub(crate) use roles::{role_swatch_edited, role_swatches_merged};
|
||||
@@ -11,7 +13,9 @@ pub(crate) use roles::{role_swatch_edited, role_swatches_merged};
|
||||
use super::super::CommandSpec;
|
||||
|
||||
pub fn specs() -> Vec<CommandSpec> {
|
||||
roles::specs()
|
||||
let mut v = roles::specs();
|
||||
v.extend(check::specs());
|
||||
v
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
@@ -0,0 +1,179 @@
|
||||
//! Check Fold Lines (`addon.packaging.check`): the blanks the fold lines make, their panels and
|
||||
//! hinges, and what is wrong with the lines, found by [`vectorcraft_three_d::fold::blanks`].
|
||||
|
||||
use serde_json::{Value, json};
|
||||
use vectorcraft_doc::{Document, Node, NodeId, NodeKind};
|
||||
use vectorcraft_geom::PathData;
|
||||
use vectorcraft_three_d::fold::{FoldLine, IssueCode, LineKind, MAX_SEGMENTS, blanks};
|
||||
|
||||
use super::super::super::pathops::length_given;
|
||||
use super::super::super::{CommandSpec, bad, checked_ids_or_selection, cmd, has_doc, switch_or};
|
||||
use super::roles::{Role, RoleTable, can_carry, role_targets};
|
||||
use crate::{Result, Session};
|
||||
|
||||
const CHECK: &str = "addon.packaging.check";
|
||||
|
||||
/// How far apart the ends of two lines may be and still be joined, in points.
|
||||
const TOLERANCE: (f64, f64, f64) = (0.01, 0.1, 10.0);
|
||||
|
||||
pub fn specs() -> Vec<CommandSpec> {
|
||||
vec![cmd!(
|
||||
"addon.packaging.check",
|
||||
"Check Fold Lines",
|
||||
["Object", "Plug-ins", "Packaging Tools"],
|
||||
None,
|
||||
"{ids?: [id…] (default: the selection), select?: bool (false), tolerance?: pt 0.01..10 (0.1)} check the fold lines (addon.packaging.roles) among the objects (through groups and clip groups), or, while nothing is selected and ids is left out, every fold line of the document; hidden lines are left out, also in a selected group. Cut lines bound the blanks: each connected piece of them that encloses material is one blank, its outline is its largest closed cut line, and a closed cut line inside it is a hole, so a slot drawn as a rectangle across the outline leaves the same material as a notch drawn in it; open cut lines that meet end to end count as one closed cut line. Crease, Partial Cut and Perforation lines divide a blank into panels; the pieces of them between two panels are that pair's hinge. A cut line end that comes within tolerance of another cut line is joined to it. Issues, in this order: noCut, open, looseEnd (errors), gap (a warning: the gap is closed), tooComplex (an error: more than 65,536 segments or 256 panels in a blank), cutOverCrease (an error), duplicate (two cut lines, or two lines that fold of any role), danglingCrease, noSplit, outside (wholly, or in part for tolerance or more), notStraight (a hinge's pieces are not on one straight line), sliver, ambiguous, loosePanel (joined to the largest panel by no chain of hinges), nonPrinting (warnings). With select, the objects the issues name become the selection, unless no issue names one. Changes nothing in the document → {ok (no error), blanks, panels, hinges, holes, issues: [{severity: error|warning, code, message (English), ids, at?: [x, y]}], scope: ids|selection|document}",
|
||||
has_doc,
|
||||
check
|
||||
)]
|
||||
}
|
||||
|
||||
/// The English message for an issue (the Fold Lines panel shows it in the interface language).
|
||||
fn message(code: IssueCode, scope: &str) -> &'static str {
|
||||
match code {
|
||||
IssueCode::NoCut if scope == "document" => "No cut lines are in the document.",
|
||||
IssueCode::NoCut if scope == "ids" => "No cut lines are among the given objects.",
|
||||
IssueCode::NoCut => "No cut lines are in the selection.",
|
||||
IssueCode::Open => "The cut lines do not enclose an area.",
|
||||
IssueCode::LooseEnd => "A cut line ends without meeting another cut line.",
|
||||
IssueCode::Gap => "A gap between cut lines was closed.",
|
||||
IssueCode::TooComplex => "The fold lines are too complex to check.",
|
||||
IssueCode::CutOverCrease => "A cut line and a crease lie on top of each other.",
|
||||
IssueCode::Duplicate => "Two fold lines lie on top of each other.",
|
||||
IssueCode::DanglingCrease => "A crease ends inside a panel.",
|
||||
IssueCode::NoSplit => "A crease does not divide two panels.",
|
||||
IssueCode::Outside => "A crease lies outside the cut outline, wholly or in part.",
|
||||
IssueCode::NotStraight => "The pieces of a hinge are not on one straight line.",
|
||||
IssueCode::Sliver => "A gap between cut lines is too narrow to tell apart.",
|
||||
IssueCode::Ambiguous => "A cut-out area holds other fold lines or another blank.",
|
||||
IssueCode::LoosePanel => "A panel is not joined to the rest by a crease.",
|
||||
IssueCode::NonPrinting => "A fold line is on a non-printing layer.",
|
||||
}
|
||||
}
|
||||
|
||||
/// Every object of the document that can carry a role and is shown: on a shown layer, in shown
|
||||
/// groups, and shown itself.
|
||||
fn shown_targets(d: &Document) -> Vec<NodeId> {
|
||||
fn walk(n: &Node, out: &mut Vec<NodeId>) {
|
||||
if !n.visible {
|
||||
return;
|
||||
}
|
||||
match &n.kind {
|
||||
NodeKind::Layer { children, .. } | NodeKind::Group { children, .. } => children.iter().for_each(|c| walk(c, out)),
|
||||
_ if can_carry(n) => out.push(n.id),
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
let mut out = vec![];
|
||||
d.layers.iter().for_each(|l| walk(l, &mut out));
|
||||
out
|
||||
}
|
||||
|
||||
/// The path of object `n` in document coordinates: a path's own, or a compound path's members'.
|
||||
fn path_of(n: &Node) -> Option<PathData> {
|
||||
match &n.kind {
|
||||
NodeKind::Path { path, .. } => Some(path.clone()),
|
||||
NodeKind::Compound { children, .. } => Some(PathData::new(
|
||||
children
|
||||
.iter()
|
||||
.filter_map(|c| match &c.kind {
|
||||
NodeKind::Path { path, .. } => Some(path.subpaths.iter().cloned()),
|
||||
_ => None,
|
||||
})
|
||||
.flatten()
|
||||
.collect(),
|
||||
)),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
/// Whether object `id` is on a layer, or a sublayer, that does not print.
|
||||
fn on_non_printing_layer(d: &Document, id: NodeId) -> bool {
|
||||
d.ancestry(id).unwrap_or_default().iter().filter_map(|a| d.node(*a)).any(|n| matches!(n.kind, NodeKind::Layer { printable: false, .. }))
|
||||
}
|
||||
|
||||
fn kind(role: Role) -> LineKind {
|
||||
match role {
|
||||
Role::Cut => LineKind::Cut,
|
||||
Role::Crease => LineKind::Crease,
|
||||
Role::PartialCut => LineKind::PartialCut,
|
||||
Role::Perforation => LineKind::Perforation,
|
||||
}
|
||||
}
|
||||
|
||||
fn check(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
let select = switch_or(p, "select", false, CHECK)?;
|
||||
let tolerance = match length_given(p, "tolerance", CHECK)? {
|
||||
None => TOLERANCE.1,
|
||||
Some(t) if (TOLERANCE.0..=TOLERANCE.2).contains(&t) => t,
|
||||
Some(_) => return Err(bad(CHECK, format!("`tolerance` must be from {} to {} pt", TOLERANCE.0, TOLERANCE.2))),
|
||||
};
|
||||
let given = p.get("ids").is_some_and(|v| !v.is_null());
|
||||
let roots = checked_ids_or_selection(s, p, CHECK)?;
|
||||
let d = &s.doc()?.doc;
|
||||
// Hidden lines are left out in every scope, members of a selected group included.
|
||||
let shown = |ids: Vec<NodeId>| ids.into_iter().filter(|id| d.is_visible(*id)).collect::<Vec<_>>();
|
||||
let (scope, targets) = match (given, roots.is_empty()) {
|
||||
(true, _) => ("ids", shown(role_targets(d, &roots, false).0)),
|
||||
(false, false) => ("selection", shown(role_targets(d, &roots, false).0)),
|
||||
(false, true) => ("document", shown_targets(d)),
|
||||
};
|
||||
let table = RoleTable::of(d);
|
||||
let mut lines = vec![];
|
||||
let mut non_printing = vec![];
|
||||
let mut segments = 0usize;
|
||||
for id in targets {
|
||||
// Once the lines have more segments than the check takes, it reports them as too complex:
|
||||
// the rest are not copied.
|
||||
if segments > MAX_SEGMENTS {
|
||||
break;
|
||||
}
|
||||
let Some(n) = d.node(id) else { continue };
|
||||
let (Some(role), Some(path)) = (table.role_of(n), path_of(n)) else { continue };
|
||||
if on_non_printing_layer(d, id) {
|
||||
non_printing.push(id.0);
|
||||
}
|
||||
segments = segments.saturating_add(path.subpaths.iter().map(|sp| sp.segment_count()).sum());
|
||||
lines.push(FoldLine { path, kind: kind(role), key: id.0 });
|
||||
}
|
||||
let (found, mut issues) = blanks(&lines, tolerance);
|
||||
if !non_printing.is_empty() {
|
||||
issues.push(vectorcraft_three_d::fold::Issue { code: IssueCode::NonPrinting, keys: non_printing, at: None });
|
||||
}
|
||||
let ok = !issues.iter().any(|i| i.code.is_error());
|
||||
let rows: Vec<Value> = issues
|
||||
.iter()
|
||||
.map(|i| {
|
||||
let mut row = json!({
|
||||
"severity": if i.code.is_error() { "error" } else { "warning" },
|
||||
"code": i.code.id(),
|
||||
"message": message(i.code, scope),
|
||||
"ids": i.keys,
|
||||
});
|
||||
if let (Some(at), Some(o)) = (i.at, row.as_object_mut()) {
|
||||
o.insert("at".into(), json!([at.x, at.y]));
|
||||
}
|
||||
row
|
||||
})
|
||||
.collect();
|
||||
if select {
|
||||
let mut ids: Vec<NodeId> = issues.iter().flat_map(|i| i.keys.iter().map(|k| NodeId(*k))).filter(|id| d.node(*id).is_some()).collect();
|
||||
ids.sort_unstable_by_key(|id| id.0);
|
||||
ids.dedup();
|
||||
if !ids.is_empty() {
|
||||
s.select(|_, sel| sel.set(ids.iter().copied()))?;
|
||||
}
|
||||
}
|
||||
Ok(json!({
|
||||
"ok": ok,
|
||||
"blanks": found.len(),
|
||||
"panels": found.iter().map(|b| b.panels.len()).sum::<usize>(),
|
||||
"hinges": found.iter().map(|b| b.hinges.len()).sum::<usize>(),
|
||||
"holes": found.iter().map(|b| b.holes.len()).sum::<usize>(),
|
||||
"issues": rows,
|
||||
"scope": scope,
|
||||
}))
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests;
|
||||
@@ -0,0 +1,180 @@
|
||||
//! Tests for Check Fold Lines: the blanks, panels, hinges and issues of fold lines drawn in a
|
||||
//! document.
|
||||
|
||||
use serde_json::{Value, json};
|
||||
|
||||
use crate::*;
|
||||
|
||||
fn session() -> Session {
|
||||
let mut s = Session::new();
|
||||
s.execute("file.new", &json!({"width": 600, "height": 600})).unwrap();
|
||||
s
|
||||
}
|
||||
|
||||
fn path(s: &mut Session, d: &str) -> u64 {
|
||||
s.execute("path.create", &json!({ "d": d })).unwrap()["id"].as_u64().unwrap()
|
||||
}
|
||||
|
||||
fn role(s: &mut Session, role: &str, ids: &[u64]) {
|
||||
s.execute("addon.packaging.setRole", &json!({ "role": role, "ids": ids })).unwrap();
|
||||
}
|
||||
|
||||
fn check(s: &mut Session, p: Value) -> Value {
|
||||
s.execute("addon.packaging.check", &p).unwrap()
|
||||
}
|
||||
|
||||
fn codes(r: &Value) -> Vec<&str> {
|
||||
r["issues"].as_array().unwrap().iter().map(|i| i["code"].as_str().unwrap()).collect()
|
||||
}
|
||||
|
||||
/// A tray blank: a 100 pt base with a 40 pt wall on each side, its outline a cut line and the
|
||||
/// base's four sides creases → (outline, creases).
|
||||
fn tray(s: &mut Session) -> (u64, Vec<u64>) {
|
||||
let outline = path(s, "M140 100 L240 100 L240 140 L280 140 L280 240 L240 240 L240 280 L140 280 L140 240 L100 240 L100 140 L140 140 Z");
|
||||
let creases = vec![path(s, "M140 140 L240 140"), path(s, "M240 140 L240 240"), path(s, "M240 240 L140 240"), path(s, "M140 240 L140 140")];
|
||||
role(s, "cut", &[outline]);
|
||||
role(s, "crease", &creases);
|
||||
s.execute("select.none", &json!({})).unwrap();
|
||||
(outline, creases)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_tray_checks_clean_with_five_panels_and_four_hinges() {
|
||||
let mut s = session();
|
||||
tray(&mut s);
|
||||
let steps = s.doc().unwrap().history.undo.len();
|
||||
let r = check(&mut s, json!({}));
|
||||
assert_eq!(r["ok"], true, "{r}");
|
||||
assert_eq!((r["blanks"].as_u64(), r["panels"].as_u64(), r["hinges"].as_u64(), r["holes"].as_u64()), (Some(1), Some(5), Some(4), Some(0)), "{r}");
|
||||
assert!(codes(&r).is_empty(), "{r}");
|
||||
assert_eq!(r["scope"], "document");
|
||||
assert_eq!(s.doc().unwrap().history.undo.len(), steps, "a check records no undo step");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_selection_or_ids_limit_the_check_to_their_lines() {
|
||||
let mut s = session();
|
||||
let (outline, creases) = tray(&mut s);
|
||||
s.execute("select.set", &json!({ "ids": [creases[0]] })).unwrap();
|
||||
let r = check(&mut s, json!({}));
|
||||
assert_eq!((r["scope"].as_str(), r["ok"].as_bool()), (Some("selection"), Some(false)));
|
||||
assert_eq!(codes(&r), ["noCut"]);
|
||||
assert_eq!(r["issues"][0]["message"], "No cut lines are in the selection.");
|
||||
let r = check(&mut s, json!({ "ids": [outline] }));
|
||||
assert_eq!((r["scope"].as_str(), r["ok"].as_bool(), r["panels"].as_u64()), (Some("ids"), Some(true), Some(1)), "{r}");
|
||||
let r = check(&mut s, json!({ "ids": [creases[1]] }));
|
||||
assert_eq!((r["scope"].as_str(), codes(&r)), (Some("ids"), vec!["noCut"]));
|
||||
assert_eq!(r["issues"][0]["message"], "No cut lines are among the given objects.");
|
||||
// No fold lines at all in the document.
|
||||
let mut s = session();
|
||||
let r = check(&mut s, json!({}));
|
||||
assert_eq!(codes(&r), ["noCut"]);
|
||||
assert_eq!(r["issues"][0]["message"], "No cut lines are in the document.");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn issues_name_their_lines_and_select_selects_them() {
|
||||
let mut s = session();
|
||||
let (_, creases) = tray(&mut s);
|
||||
// A slit from the outline that stops in the middle of the base.
|
||||
let slit = path(&mut s, "M190 100 L190 190");
|
||||
role(&mut s, "cut", &[slit]);
|
||||
s.execute("select.none", &json!({})).unwrap();
|
||||
let r = check(&mut s, json!({}));
|
||||
assert_eq!(r["ok"], false);
|
||||
let loose = r["issues"].as_array().unwrap().iter().find(|i| i["code"] == "looseEnd").cloned().unwrap();
|
||||
assert_eq!((loose["severity"].as_str(), loose["ids"].clone()), (Some("error"), json!([slit])), "{r}");
|
||||
assert_eq!(loose["at"], json!([190.0, 190.0]));
|
||||
assert!(s.doc().unwrap().selection.objects.is_empty(), "without select, the selection stays");
|
||||
let r = check(&mut s, json!({ "select": true }));
|
||||
let named: std::collections::BTreeSet<u64> =
|
||||
r["issues"].as_array().unwrap().iter().flat_map(|i| i["ids"].as_array().unwrap().iter().map(|v| v.as_u64().unwrap())).collect();
|
||||
let selected: std::collections::BTreeSet<u64> = s.doc().unwrap().selection.objects.iter().map(|id| id.0).collect();
|
||||
assert!(selected.contains(&slit) && selected == named, "{selected:?} {named:?}");
|
||||
assert!(!selected.contains(&creases[1]));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_clean_check_with_select_leaves_the_selection_alone() {
|
||||
let mut s = session();
|
||||
let (outline, _) = tray(&mut s);
|
||||
s.execute("select.set", &json!({ "ids": [outline] })).unwrap();
|
||||
let r = check(&mut s, json!({ "ids": [outline], "select": true }));
|
||||
assert!(codes(&r).is_empty(), "{r}");
|
||||
assert_eq!(s.doc().unwrap().selection.objects.iter().map(|id| id.0).collect::<Vec<_>>(), [outline]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn tolerance_is_checked_and_joins_gaps_up_to_it() {
|
||||
let mut s = session();
|
||||
tray(&mut s);
|
||||
for bad in [json!(0.005), json!(10.5), json!("x"), json!(true)] {
|
||||
let e = s.execute("addon.packaging.check", &json!({ "tolerance": bad })).unwrap_err().to_string();
|
||||
assert!(e.contains("tolerance"), "{e}");
|
||||
}
|
||||
let e = s.execute("addon.packaging.check", &json!({ "select": 1 })).unwrap_err().to_string();
|
||||
assert!(e.contains("select"), "{e}");
|
||||
for edge in [json!(0.01), json!(10), json!("2 mm")] {
|
||||
assert_eq!(check(&mut s, json!({ "tolerance": edge }))["ok"], true);
|
||||
}
|
||||
// A slit that stops 0.5 pt short of a crease: a gap at a tolerance of 1 pt, a loose end at 0.1 pt.
|
||||
let mut s = session();
|
||||
tray(&mut s);
|
||||
let slit = path(&mut s, "M190 100 L190 139.5");
|
||||
role(&mut s, "cut", &[slit]);
|
||||
s.execute("select.none", &json!({})).unwrap();
|
||||
assert!(codes(&check(&mut s, json!({ "tolerance": 0.1 }))).contains(&"looseEnd"));
|
||||
let near = check(&mut s, json!({ "tolerance": 1 }));
|
||||
assert!(!codes(&near).contains(&"looseEnd"), "{near}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn hidden_lines_are_left_out_and_lines_on_a_non_printing_layer_are_noted() {
|
||||
let mut s = session();
|
||||
let (_, creases) = tray(&mut s);
|
||||
// A hidden crease is not checked while nothing is selected: the tray has three hinges and a
|
||||
// panel joined by none.
|
||||
s.execute("layer.setProps", &json!({ "ids": [creases[0]], "visible": false })).unwrap();
|
||||
s.execute("select.none", &json!({})).unwrap();
|
||||
let r = check(&mut s, json!({}));
|
||||
assert_eq!((r["panels"].as_u64(), r["hinges"].as_u64()), (Some(4), Some(3)), "{r}");
|
||||
// The same in a selected group, and with the group named by `ids`: the hidden member is left
|
||||
// out too.
|
||||
let mut s = session();
|
||||
let (outline, creases) = tray(&mut s);
|
||||
s.execute("select.set", &json!({ "ids": [outline, creases[0], creases[1], creases[2], creases[3]] })).unwrap();
|
||||
let group = s.execute("object.group", &json!({})).unwrap()["id"].as_u64().unwrap();
|
||||
s.execute("layer.setProps", &json!({ "ids": [creases[0]], "visible": false })).unwrap();
|
||||
s.execute("select.set", &json!({ "ids": [group] })).unwrap();
|
||||
for p in [json!({}), json!({ "ids": [group] })] {
|
||||
let r = check(&mut s, p);
|
||||
assert_eq!((r["panels"].as_u64(), r["hinges"].as_u64()), (Some(4), Some(3)), "{r}");
|
||||
}
|
||||
// A cut line on a layer that does not print.
|
||||
let mut s = session();
|
||||
s.execute("layer.new", &json!({ "printable": false })).unwrap();
|
||||
let (outline, _) = tray(&mut s);
|
||||
let r = check(&mut s, json!({}));
|
||||
assert_eq!(r["ok"], true, "a warning only");
|
||||
let note = r["issues"].as_array().unwrap().iter().find(|i| i["code"] == "nonPrinting").cloned().unwrap();
|
||||
assert_eq!(note["severity"], "warning");
|
||||
assert!(note["ids"].as_array().unwrap().contains(&json!(outline)), "{note}");
|
||||
assert_eq!(note["message"], "A fold line is on a non-printing layer.");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_compound_path_and_a_grouped_line_are_checked() {
|
||||
let mut s = session();
|
||||
let (outline, creases) = tray(&mut s);
|
||||
// A window: a closed cut line in the base, made a compound path with nothing else.
|
||||
let window = path(&mut s, "M170 170 L210 170 L210 210 L170 210 Z");
|
||||
s.execute("select.set", &json!({ "ids": [window] })).unwrap();
|
||||
let compound = s.execute("object.compoundPath.make", &json!({})).unwrap()["id"].as_u64();
|
||||
let window = compound.unwrap_or(window);
|
||||
role(&mut s, "cut", &[window]);
|
||||
s.execute("select.set", &json!({ "ids": [outline, creases[0], creases[1], creases[2], creases[3], window] })).unwrap();
|
||||
s.execute("object.group", &json!({})).unwrap();
|
||||
let r = check(&mut s, json!({}));
|
||||
assert_eq!(r["scope"], "selection");
|
||||
assert_eq!((r["ok"].as_bool(), r["panels"].as_u64(), r["holes"].as_u64()), (Some(true), Some(5), Some(1)), "{r}");
|
||||
}
|
||||
@@ -186,7 +186,7 @@ fn free_role_name(d: &Document, table: &RoleTable, role: Role) -> String {
|
||||
|
||||
/// Whether `n` can carry a role: a path (a live shape too) that is neither a clipping path nor a
|
||||
/// guide, or a compound path.
|
||||
fn can_carry(n: &Node) -> bool {
|
||||
pub(super) fn can_carry(n: &Node) -> bool {
|
||||
match &n.kind {
|
||||
NodeKind::Path { clipping, guide, .. } => !clipping && !guide,
|
||||
NodeKind::Compound { .. } => true,
|
||||
@@ -199,7 +199,7 @@ fn can_carry(n: &Node) -> bool {
|
||||
/// how many of `roots` and their members can't (text, images, symbol instances and other objects).
|
||||
/// With `editable`, objects that are locked or hidden, are in a locked or hidden group or layer, or
|
||||
/// are on a locked artboard are left out and counted as skipped.
|
||||
fn role_targets(d: &Document, roots: &[NodeId], editable: bool) -> (Vec<NodeId>, usize) {
|
||||
pub(super) fn role_targets(d: &Document, roots: &[NodeId], editable: bool) -> (Vec<NodeId>, usize) {
|
||||
fn walk(n: &Node, out: &mut Vec<NodeId>, skipped: &mut usize) {
|
||||
match &n.kind {
|
||||
NodeKind::Group { children, .. } => {
|
||||
|
||||
@@ -40,6 +40,7 @@ pub(super) const ALLOWED: &[&str] = &[
|
||||
"addon.image.colorMask",
|
||||
"addon.image.removeBackground",
|
||||
"addon.image.removeColorMask",
|
||||
"addon.packaging.check",
|
||||
"addon.packaging.roles",
|
||||
"addon.packaging.setRole",
|
||||
"addon.packaging.setRoleSwatch",
|
||||
|
||||
@@ -1011,6 +1011,9 @@ fn structured_junk() {
|
||||
("addon.packaging.roles", json!({"ids": [-1, 1e300]})),
|
||||
("addon.packaging.setRoleSwatch", json!({"role": "perforation", "swatch": "[Registration]"})),
|
||||
("addon.packaging.setRoleSwatch", json!({"role": "cut", "swatch": 5})),
|
||||
("addon.packaging.check", json!({"ids": [u64::MAX, -1], "select": "yes", "tolerance": 1e308})),
|
||||
("addon.packaging.check", json!({"tolerance": "-5 mm", "select": true})),
|
||||
("addon.packaging.check", json!({"ids": [], "tolerance": null})),
|
||||
// Smart Pen add-on.
|
||||
("addon.pen.append", json!({"id": 2, "x": 1e308, "y": 0, "in": [1e308, -1e308]})),
|
||||
("addon.pen.append", json!({"id": 2, "subpath": u64::MAX, "x": 0, "y": 0, "segment": "curved"})),
|
||||
|
||||
@@ -61,6 +61,14 @@ Unlike `regions`, which splits the filled areas of closed shapes, `live_paint` t
|
||||
|
||||
`shape_builder` gives the Shape Builder's regions. With closed paths only, they are the `regions`. Once an open path is among them, they are the `live_paint` faces, so a stroke-only line across a shape splits it and lines can enclose a region of their own. The second list holds the pieces of each path that has no closed subpath, keyed by its index, so the Shape Builder can delete them one by one. The caller closes any open path whose fill should count. Inputs with more than `SHAPE_BUILDER_MAX_SEGMENTS` segments fall back to the filled areas.
|
||||
|
||||
```rust
|
||||
pub struct Adjacency { pub faces: Vec<MapFace>, pub edges: Vec<MapEdge>, pub slivers: Vec<PathData>, pub outlines: Vec<MapOutline> }
|
||||
pub struct MapEdge { pub path: PathData, pub sources: Vec<usize>, pub left: Option<usize>, pub right: Option<usize>, pub piece: usize }
|
||||
pub fn adjacency(shapes: &[Shape], precision: f64) -> Option<Adjacency>;
|
||||
```
|
||||
|
||||
`adjacency` maps the paths as `live_paint` does and also reports, for each edge, every input it lies on and the faces on its left and right as it runs along its path (document coordinates, y down). A line drawn on top of another keeps both inputs on the edge, whatever the input order. A piece of line that ends inside a face has that face on both sides. Faces narrower than `precision` are listed as slivers, and `outlines` holds the outer boundary of each connected piece of the paths. It returns `None` for more than `SHAPE_BUILDER_MAX_SEGMENTS` segments, non-finite input or a `precision` that is not a positive number.
|
||||
|
||||
## Offset / stroke
|
||||
|
||||
```rust
|
||||
|
||||
@@ -30,8 +30,8 @@ pub use fit::{fit_cubics, fit_cubics_through};
|
||||
pub use offset::{Cap, Join, MAX_OFFSET_SEGMENT_PAIRS, offset_path, outline_stroke, stroke_region, try_offset_path};
|
||||
pub use pathfinder::{FaceMerger, PathfinderOp, Region, Shape, merge_regions, pathfinder, pathfinder_with, region_at, regions, regions_within};
|
||||
pub use planar::{
|
||||
BuilderArrangement, SHAPE_BUILDER_MAX_GAP, SHAPE_BUILDER_MAX_SEGMENTS, cut_out, encloses_area, find_gaps, has_open_path, interior_point,
|
||||
live_paint, live_paint_with_gaps, run_around, shape_builder, shape_builder_with_gap,
|
||||
Adjacency, BuilderArrangement, MapEdge, MapFace, MapOutline, SHAPE_BUILDER_MAX_GAP, SHAPE_BUILDER_MAX_SEGMENTS, adjacency, cut_out,
|
||||
encloses_area, find_gaps, has_open_path, interior_point, live_paint, live_paint_with_gaps, run_around, shape_builder, shape_builder_with_gap,
|
||||
};
|
||||
pub use trap::{TRAP_HEIGHT_WIDTH_RANGE, TRAP_MAX_WIDTH, TRAP_MIN_WIDTH, trap_band};
|
||||
|
||||
|
||||
@@ -26,12 +26,14 @@ use vectorcraft_geom::{FillRule, PathData, SubPath};
|
||||
use crate::boolean::{DEFAULT_PRECISION, Seg, Tidy, eps_for, is_sliver, segs_to_subpath, snap_horizontals, tidy_segments, to_seg};
|
||||
use crate::pathfinder::{Region, Shape};
|
||||
|
||||
mod adjacency;
|
||||
mod graph;
|
||||
mod index;
|
||||
mod live_paint;
|
||||
mod map;
|
||||
mod shape_builder;
|
||||
|
||||
pub use adjacency::{Adjacency, MapEdge, MapFace, MapOutline, adjacency};
|
||||
pub(crate) use graph::pin_ends;
|
||||
#[cfg(test)]
|
||||
use index::{Crossings, RectIndex, reference_budget, segment_footprint, work_done};
|
||||
|
||||
@@ -0,0 +1,169 @@
|
||||
//! Which faces of a planar map each edge separates, and every input each edge lies on.
|
||||
//!
|
||||
//! [`live_paint`](super::live_paint) gives each edge under its front-most input only, and says
|
||||
//! nothing about the faces on its sides. [`adjacency`] reads both from the same planar map, so a
|
||||
//! caller can tell which faces a line divides and which lines lie on top of each other.
|
||||
|
||||
use super::graph::{find, half_segs, twin, unshear};
|
||||
use super::index::RectIndex;
|
||||
use super::map::{Map, map_with};
|
||||
use super::*;
|
||||
|
||||
/// A planar map of some paths with each edge's sides and inputs ([`adjacency`]).
|
||||
#[derive(Clone, Debug, Default)]
|
||||
pub struct Adjacency {
|
||||
pub faces: Vec<MapFace>,
|
||||
pub edges: Vec<MapEdge>,
|
||||
/// Bounded areas left out as slivers: narrower than the precision on average, such as a thin
|
||||
/// gap between two lines.
|
||||
pub slivers: Vec<PathData>,
|
||||
/// The outer boundary of each connected piece of the paths.
|
||||
pub outlines: Vec<MapOutline>,
|
||||
}
|
||||
|
||||
/// A bounded face: its outline, then the outer boundaries of the pieces inside it (as holes), and
|
||||
/// its area without them.
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct MapFace {
|
||||
pub path: PathData,
|
||||
pub area: f64,
|
||||
/// The connected piece of the paths whose edges bound it.
|
||||
pub piece: usize,
|
||||
}
|
||||
|
||||
/// An edge: a piece of one or more inputs between two places where paths meet.
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct MapEdge {
|
||||
pub path: PathData,
|
||||
/// Every input it lies on (indices into the inputs, ascending).
|
||||
pub sources: Vec<usize>,
|
||||
/// The faces on each side of it as it runs along `path`, seen on the page (document
|
||||
/// coordinates, y down): `left` on the left. `None` outside every bounded face, or in a sliver.
|
||||
/// A piece of line that ends loose inside a face has that face on both sides.
|
||||
pub left: Option<usize>,
|
||||
pub right: Option<usize>,
|
||||
pub piece: usize,
|
||||
}
|
||||
|
||||
/// The outer boundary of a connected piece of the paths.
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct MapOutline {
|
||||
pub path: PathData,
|
||||
pub piece: usize,
|
||||
}
|
||||
|
||||
/// The planar map of `shapes`, every path an edge as in [`live_paint`](super::live_paint), with
|
||||
/// faces refit to `precision` and slivers narrower than it left out. `None` when the paths can't be
|
||||
/// swept (non-finite, too degenerate, or more than [`SHAPE_BUILDER_MAX_SEGMENTS`] segments), when
|
||||
/// `precision` is not a positive number, and when no path has two anchors.
|
||||
pub fn adjacency(shapes: &[Shape], precision: f64) -> Option<Adjacency> {
|
||||
if !(precision.is_finite() && precision > 0.0) {
|
||||
return None;
|
||||
}
|
||||
let segments: usize = shapes.iter().flat_map(|s| &s.path.subpaths).map(SubPath::segment_count).sum();
|
||||
if segments > SHAPE_BUILDER_MAX_SEGMENTS {
|
||||
return None;
|
||||
}
|
||||
let m = map_with(shapes, false, precision)?;
|
||||
Some(read(&m))
|
||||
}
|
||||
|
||||
fn read(m: &Map) -> Adjacency {
|
||||
let path = |cycle: &[usize], closed: bool| {
|
||||
let segs: Vec<Seg> = cycle.iter().flat_map(|&h| half_segs(&m.edges, h)).collect();
|
||||
segs_to_subpath(&tidy_segments(segs, closed, &m.tidy), closed)
|
||||
};
|
||||
let unsheared = |subpaths: Vec<SubPath>| unshear(PathData::new(subpaths), &m.anchors, m.snap);
|
||||
|
||||
// Connected pieces, by the vertices the edges join, numbered in the order they are first met.
|
||||
let vertices = m.edges.iter().flat_map(|e| e.ends).max().map_or(0, |v| v + 1);
|
||||
let mut parent: Vec<usize> = (0..vertices).collect();
|
||||
for e in &m.edges {
|
||||
let (a, b) = (find(&mut parent, e.ends[0]), find(&mut parent, e.ends[1]));
|
||||
if let Some(p) = parent.get_mut(a) {
|
||||
*p = b;
|
||||
}
|
||||
}
|
||||
let mut number: Vec<Option<usize>> = vec![None; vertices];
|
||||
let mut pieces = 0;
|
||||
let mut piece_of_vertex = |v: usize| {
|
||||
let root = find(&mut parent, v);
|
||||
match number.get_mut(root) {
|
||||
Some(Some(n)) => *n,
|
||||
Some(slot) => {
|
||||
*slot = Some(pieces);
|
||||
pieces += 1;
|
||||
pieces - 1
|
||||
}
|
||||
None => 0,
|
||||
}
|
||||
};
|
||||
let edge_pieces: Vec<usize> = m.edges.iter().map(|e| piece_of_vertex(e.ends[0])).collect();
|
||||
let piece_of = |cycle: &[usize]| cycle.first().and_then(|&h| edge_pieces.get(h / 2)).copied().unwrap_or(0);
|
||||
|
||||
// The face on each half-edge's side: a face's own cycle, and the outer boundaries of the
|
||||
// pieces inside it, bound it.
|
||||
let mut face_of: Vec<Option<usize>> = vec![None; 2 * m.edges.len()];
|
||||
let mut faces = Vec::with_capacity(m.faces.len());
|
||||
for (i, (cycle, _, area)) in m.faces.iter().enumerate() {
|
||||
let holes: Vec<&(Vec<usize>, BezPath)> = m.face_holes.get(i).into_iter().flatten().filter_map(|&k| m.holes.get(k)).collect();
|
||||
for &h in cycle.iter().chain(holes.iter().flat_map(|(c, _)| c)) {
|
||||
if let Some(f) = face_of.get_mut(h) {
|
||||
*f = Some(i);
|
||||
}
|
||||
}
|
||||
let mut subpaths: Vec<SubPath> = path(cycle, true).into_iter().collect();
|
||||
subpaths.extend(holes.iter().filter_map(|(c, _)| path(c, true)));
|
||||
// A hole's outer boundary winds the other way: its area is negative.
|
||||
let area = area + holes.iter().map(|(_, bp)| bp.area()).sum::<f64>();
|
||||
faces.push(MapFace { path: unsheared(subpaths), area, piece: piece_of(cycle) });
|
||||
}
|
||||
|
||||
// A face walk leaves out the edges that end loose (spurs): such an edge lies inside the face
|
||||
// around its middle, on both sides.
|
||||
let mut on_cycle = vec![false; 2 * m.edges.len()];
|
||||
let cycles = m.faces.iter().map(|f| &f.0).chain(m.holes.iter().map(|h| &h.0)).chain(m.slivers.iter().map(|s| &s.0));
|
||||
for &h in cycles.flatten() {
|
||||
if let Some(c) = on_cycle.get_mut(h) {
|
||||
*c = true;
|
||||
}
|
||||
}
|
||||
let spur = |e: usize| !on_cycle.get(2 * e).copied().unwrap_or(true) && !on_cycle.get(twin(2 * e)).copied().unwrap_or(true);
|
||||
// The faces by their bounds, so that each spur tests only the faces whose bounds hold it;
|
||||
// built only when there is a spur.
|
||||
let bezpaths: Vec<BezPath> = if (0..m.edges.len()).any(spur) { faces.iter().map(|f| f.path.to_bezpath()).collect() } else { vec![] };
|
||||
let face_index = RectIndex::new(bezpaths.iter().enumerate().map(|(i, bp)| (bp.bounding_box(), i)).collect());
|
||||
let face_around = |p: Point| {
|
||||
face_index
|
||||
.at(p, 0.0)
|
||||
.copied()
|
||||
.filter(|&i| bezpaths.get(i).is_some_and(|bp| bp.winding(p) != 0))
|
||||
.min_by(|&a, &b| faces.get(a).map_or(f64::INFINITY, |f| f.area).total_cmp(&faces.get(b).map_or(f64::INFINITY, |f| f.area)))
|
||||
};
|
||||
|
||||
// A face cycle winds so its face is on the side where the cross product of the half-edge's
|
||||
// direction and the way to the face is positive: on the page, with y down, that is the right.
|
||||
let edges = m
|
||||
.edges
|
||||
.iter()
|
||||
.enumerate()
|
||||
.filter_map(|(e, edge)| {
|
||||
let sp = path(&[2 * e], false)?;
|
||||
let path = unsheared(vec![sp]);
|
||||
let (left, right) = if spur(e) {
|
||||
let around = path.to_bezpath().segments().next().map(|s| s.eval(0.5)).and_then(face_around);
|
||||
(around, around)
|
||||
} else {
|
||||
(face_of.get(twin(2 * e)).copied().flatten(), face_of.get(2 * e).copied().flatten())
|
||||
};
|
||||
Some(MapEdge { path, sources: edge.sources.clone(), left, right, piece: edge_pieces.get(e).copied().unwrap_or(0) })
|
||||
})
|
||||
.collect();
|
||||
let slivers = m.slivers.iter().filter_map(|(cycle, _)| path(cycle, true)).map(|sp| unsheared(vec![sp])).collect();
|
||||
let outlines =
|
||||
m.holes.iter().filter_map(|(cycle, _)| Some(MapOutline { path: unsheared(vec![path(cycle, true)?]), piece: piece_of(cycle) })).collect();
|
||||
Adjacency { faces, edges, slivers, outlines }
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests;
|
||||
@@ -0,0 +1,200 @@
|
||||
use super::*;
|
||||
use kurbo::{ParamCurveNearest, Vec2};
|
||||
use proptest::prelude::*;
|
||||
use vectorcraft_geom::{FillRule, Rect, shapes};
|
||||
|
||||
fn line(a: (f64, f64), b: (f64, f64)) -> Shape {
|
||||
Shape::new(PathData::single(SubPath::polyline(&[Point::new(a.0, a.1), Point::new(b.0, b.1)], false)), FillRule::NonZero, 0)
|
||||
}
|
||||
|
||||
fn rect(x0: f64, y0: f64, x1: f64, y1: f64) -> Shape {
|
||||
Shape::new(shapes::rectangle(Rect::new(x0, y0, x1, y1)), FillRule::NonZero, 0)
|
||||
}
|
||||
|
||||
fn inside(f: &MapFace, p: Point) -> bool {
|
||||
f.path.to_bezpath().winding(p) != 0
|
||||
}
|
||||
|
||||
/// The edges whose middle lies within 0.01 of `p`.
|
||||
fn edges_at(a: &Adjacency, p: Point) -> Vec<&MapEdge> {
|
||||
a.edges
|
||||
.iter()
|
||||
.filter(|e| {
|
||||
let bp = e.path.to_bezpath();
|
||||
bp.segments().any(|s| {
|
||||
let n = s.nearest(p, 1e-6);
|
||||
n.distance_sq < 1e-4
|
||||
})
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_line_across_a_rectangle_divides_two_faces_it_lies_between() {
|
||||
let a = adjacency(&[rect(0.0, 0.0, 100.0, 50.0), line((40.0, -10.0), (40.0, 60.0))], DEFAULT_PRECISION).unwrap();
|
||||
assert_eq!(a.faces.len(), 2, "{:?}", a.faces);
|
||||
let left_face = a.faces.iter().position(|f| inside(f, Point::new(20.0, 25.0))).unwrap();
|
||||
let right_face = a.faces.iter().position(|f| inside(f, Point::new(70.0, 25.0))).unwrap();
|
||||
assert_ne!(left_face, right_face);
|
||||
assert!((a.faces[left_face].area - 2000.0).abs() < 1e-6 && (a.faces[right_face].area - 3000.0).abs() < 1e-6);
|
||||
let shared = edges_at(&a, Point::new(40.0, 25.0));
|
||||
assert_eq!(shared.len(), 1, "{shared:?}");
|
||||
let e = shared[0];
|
||||
assert_eq!(e.sources, vec![1]);
|
||||
let mut sides = [e.left.unwrap(), e.right.unwrap()];
|
||||
sides.sort_unstable();
|
||||
let mut want = [left_face, right_face];
|
||||
want.sort_unstable();
|
||||
assert_eq!(sides, want);
|
||||
// The rectangle's own sides have a face on one side only; the line's ends stick out into no face.
|
||||
let side = edges_at(&a, Point::new(70.0, 0.0));
|
||||
assert_eq!(side.len(), 1);
|
||||
assert_eq!([side[0].left, side[0].right].iter().flatten().count(), 1);
|
||||
let stub = edges_at(&a, Point::new(40.0, -5.0));
|
||||
assert_eq!((stub[0].left, stub[0].right), (None, None));
|
||||
assert!(a.faces.iter().all(|f| f.piece == 0) && a.edges.iter().all(|e| e.piece == 0));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_line_that_ends_inside_a_face_has_that_face_on_both_sides() {
|
||||
let a = adjacency(&[rect(0.0, 0.0, 100.0, 50.0), line((50.0, 0.0), (50.0, 30.0)), line((20.0, 10.0), (30.0, 20.0))], DEFAULT_PRECISION).unwrap();
|
||||
assert_eq!(a.faces.len(), 1);
|
||||
for at in [Point::new(50.0, 15.0), Point::new(25.0, 15.0)] {
|
||||
let e = edges_at(&a, at);
|
||||
assert_eq!(e.len(), 1, "{at:?}");
|
||||
assert_eq!((e[0].left, e[0].right), (Some(0), Some(0)), "{at:?}");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn loose_lines_in_many_faces_look_only_at_the_faces_near_them() {
|
||||
// A 40 × 40 grid of separate squares, then the same with a loose line in each.
|
||||
let squares: Vec<Shape> =
|
||||
(0..1600).map(|k| (f64::from(k % 40) * 20.0, f64::from(k / 40) * 20.0)).map(|(x, y)| rect(x, y, x + 10.0, y + 10.0)).collect();
|
||||
let started = super::super::index::work_done();
|
||||
assert_eq!(adjacency(&squares, DEFAULT_PRECISION).unwrap().faces.len(), 1600);
|
||||
let plain = super::super::index::work_done() - started;
|
||||
let mut all = squares.clone();
|
||||
all.extend((0..1600).map(|k| (f64::from(k % 40) * 20.0, f64::from(k / 40) * 20.0)).map(|(x, y)| line((x + 5.0, y), (x + 5.0, y + 5.0))));
|
||||
let started = super::super::index::work_done();
|
||||
let a = adjacency(&all, DEFAULT_PRECISION).unwrap();
|
||||
let work = super::super::index::work_done() - started - plain;
|
||||
let loose: Vec<&MapEdge> = a.edges.iter().filter(|e| e.sources.len() == 1 && e.sources[0] >= 1600).collect();
|
||||
assert_eq!(loose.len(), 1600);
|
||||
for e in loose {
|
||||
let mid = e.path.to_bezpath().segments().next().unwrap().eval(0.5);
|
||||
let face = a.faces.iter().position(|f| inside(f, mid));
|
||||
assert_eq!((e.left, e.right), (face, face));
|
||||
assert!(face.is_some());
|
||||
}
|
||||
// Testing every face for each loose line would read 1,600 faces per line.
|
||||
assert!(work <= 64 * 1600, "{work} reads");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_line_on_a_rectangle_side_keeps_both_inputs_in_either_order() {
|
||||
for flip in [false, true] {
|
||||
let (r, l) = (rect(0.0, 0.0, 100.0, 50.0), line((-10.0, 50.0), (110.0, 50.0)));
|
||||
let shapes = if flip { vec![l, r] } else { vec![r, l] };
|
||||
let a = adjacency(&shapes, DEFAULT_PRECISION).unwrap();
|
||||
let on = edges_at(&a, Point::new(30.0, 50.0));
|
||||
assert_eq!(on.len(), 1, "flip {flip}: {on:?}");
|
||||
assert_eq!(on[0].sources, vec![0, 1], "flip {flip}");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn each_side_names_the_face_seen_on_that_side_of_the_edge() {
|
||||
// A tray-like outline with a crease grid, edges drawn in every direction.
|
||||
let a = adjacency(
|
||||
&[
|
||||
rect(0.0, 0.0, 90.0, 60.0),
|
||||
line((30.0, 0.0), (30.0, 60.0)),
|
||||
line((60.0, 60.0), (60.0, 0.0)),
|
||||
line((90.0, 20.0), (0.0, 20.0)),
|
||||
line((0.0, 40.0), (90.0, 40.0)),
|
||||
],
|
||||
DEFAULT_PRECISION,
|
||||
)
|
||||
.unwrap();
|
||||
assert_eq!(a.faces.len(), 9);
|
||||
let mut checked = 0;
|
||||
for e in &a.edges {
|
||||
let bp = e.path.to_bezpath();
|
||||
let Some(seg) = bp.segments().next() else { continue };
|
||||
let (p, d) = (seg.eval(0.5), seg.end() - seg.start());
|
||||
let n = d.normalize();
|
||||
// On the page (y down), the left of a direction (dx, dy) is (dy, -dx).
|
||||
let (left_at, right_at) = (p + Vec2::new(n.y, -n.x) * 0.5, p + Vec2::new(-n.y, n.x) * 0.5);
|
||||
for (side, at) in [(e.left, left_at), (e.right, right_at)] {
|
||||
match side {
|
||||
Some(f) => assert!(inside(&a.faces[f], at), "{e:?}"),
|
||||
None => assert!(a.faces.iter().all(|f| !inside(f, at)), "{e:?}"),
|
||||
}
|
||||
checked += 1;
|
||||
}
|
||||
}
|
||||
assert!(checked >= 24, "{checked}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_slot_narrower_than_the_precision_is_a_sliver() {
|
||||
let a = adjacency(&[rect(0.0, 0.0, 100.0, 50.0), rect(50.0, 10.0, 50.004, 40.0)], DEFAULT_PRECISION).unwrap();
|
||||
assert_eq!(a.slivers.len(), 1, "{:?}", a.slivers);
|
||||
assert_eq!(a.faces.len(), 1);
|
||||
let b = adjacency(&[rect(0.0, 0.0, 100.0, 50.0), rect(50.0, 10.0, 51.0, 40.0)], DEFAULT_PRECISION).unwrap();
|
||||
assert!(b.slivers.is_empty());
|
||||
assert_eq!(b.faces.len(), 2, "the slot is a face of its own");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_ring_is_a_face_with_a_hole_and_two_pieces() {
|
||||
let a = adjacency(&[rect(0.0, 0.0, 100.0, 100.0), rect(30.0, 30.0, 70.0, 70.0)], DEFAULT_PRECISION).unwrap();
|
||||
assert_eq!(a.faces.len(), 2);
|
||||
let ring = a.faces.iter().find(|f| inside(f, Point::new(10.0, 10.0))).unwrap();
|
||||
assert!(!inside(ring, Point::new(50.0, 50.0)), "the inner square is a hole in the ring");
|
||||
assert!((ring.area - 8400.0).abs() < 1e-6, "{}", ring.area);
|
||||
assert_eq!(a.outlines.len(), 2);
|
||||
assert_ne!(a.outlines[0].piece, a.outlines[1].piece);
|
||||
let inner = a.faces.iter().find(|f| inside(f, Point::new(50.0, 50.0))).unwrap();
|
||||
assert_ne!(inner.piece, ring.piece);
|
||||
let inner_side = edges_at(&a, Point::new(50.0, 30.0));
|
||||
let mut sides = [inner_side[0].left, inner_side[0].right];
|
||||
sides.sort_unstable();
|
||||
assert!(sides.iter().all(Option::is_some), "a ring face on one side, the inner square on the other: {sides:?}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn bad_input_gives_no_map() {
|
||||
assert!(adjacency(&[], DEFAULT_PRECISION).is_none());
|
||||
assert!(adjacency(&[line((0.0, 0.0), (f64::NAN, 1.0))], DEFAULT_PRECISION).is_none());
|
||||
assert!(adjacency(&[rect(0.0, 0.0, 10.0, 10.0)], 0.0).is_none());
|
||||
assert!(adjacency(&[rect(0.0, 0.0, 10.0, 10.0)], f64::INFINITY).is_none());
|
||||
let mut points: Vec<Point> = (0..=SHAPE_BUILDER_MAX_SEGMENTS + 1).map(|i| Point::new(i as f64, (i % 2) as f64)).collect();
|
||||
let open = Shape::new(PathData::single(SubPath::polyline(&points, false)), FillRule::NonZero, 0);
|
||||
assert!(adjacency(&[open], DEFAULT_PRECISION).is_none(), "over the segment limit");
|
||||
points.truncate(64);
|
||||
let open = Shape::new(PathData::single(SubPath::polyline(&points, false)), FillRule::NonZero, 0);
|
||||
assert!(adjacency(&[open], DEFAULT_PRECISION).is_some());
|
||||
}
|
||||
|
||||
proptest! {
|
||||
#![proptest_config(ProptestConfig::with_cases(64))]
|
||||
/// Random lines and boxes never panic, and every side an edge names is a face.
|
||||
#[test]
|
||||
fn random_lines_give_a_consistent_map(
|
||||
segs in proptest::collection::vec((-50.0f64..50.0, -50.0f64..50.0, -50.0f64..50.0, -50.0f64..50.0), 1..12),
|
||||
boxed in any::<bool>(),
|
||||
) {
|
||||
let mut shapes: Vec<Shape> = segs.iter().map(|&(a, b, c, d)| line((a, b), (c, d))).collect();
|
||||
if boxed {
|
||||
shapes.push(rect(-40.0, -40.0, 40.0, 40.0));
|
||||
}
|
||||
if let Some(a) = adjacency(&shapes, DEFAULT_PRECISION) {
|
||||
for e in &a.edges {
|
||||
prop_assert!(e.left.is_none_or(|f| f < a.faces.len()) && e.right.is_none_or(|f| f < a.faces.len()));
|
||||
prop_assert!(e.sources.iter().all(|&s| s < shapes.len()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,23 +15,23 @@ pub(crate) struct Rest {
|
||||
/// The planar graph of `shapes` (in the sweep's frame) with its faces walked: what [`build`] makes
|
||||
/// Live Paint faces and edges from, and what [`Map::merge`] merges faces in.
|
||||
pub(crate) struct Map {
|
||||
edges: Vec<Edge>,
|
||||
pub(super) edges: Vec<Edge>,
|
||||
around: Vec<Vec<usize>>,
|
||||
slot_of: Vec<usize>,
|
||||
/// Bounded faces: their cycle of half-edges, path and area; and, by their bounds, which can
|
||||
/// hold a point, so finding the face around one tests only those.
|
||||
faces: Vec<(Vec<usize>, BezPath, f64)>,
|
||||
pub(super) faces: Vec<(Vec<usize>, BezPath, f64)>,
|
||||
face_index: RectIndex<usize>,
|
||||
/// Bounded faces left out as slivers ([`is_sliver`]): their cycle of half-edges and the inputs
|
||||
/// whose fill covers them (none for a gap, such as a thin cutout).
|
||||
pub(super) slivers: Vec<(Vec<usize>, Vec<usize>)>,
|
||||
/// Outer boundaries of connected pieces, and the face each one is a hole in.
|
||||
holes: Vec<(Vec<usize>, BezPath)>,
|
||||
face_holes: Vec<Vec<usize>>,
|
||||
tidy: Tidy,
|
||||
pub(super) holes: Vec<(Vec<usize>, BezPath)>,
|
||||
pub(super) face_holes: Vec<Vec<usize>>,
|
||||
pub(super) tidy: Tidy,
|
||||
/// The inputs' anchors (sorted by x) and how close results snap back onto them.
|
||||
anchors: Vec<Point>,
|
||||
snap: f64,
|
||||
pub(super) anchors: Vec<Point>,
|
||||
pub(super) snap: f64,
|
||||
}
|
||||
|
||||
/// With `cover`, also finds which inputs cover each sliver, which only [`Map::merge`] reads;
|
||||
@@ -41,7 +41,7 @@ pub(crate) fn map(shapes: &[Shape], cover: bool) -> Option<Map> {
|
||||
}
|
||||
|
||||
/// [`map`] whose faces and pieces are refit to `precision`, and whose slivers thinner than it are dropped.
|
||||
fn map_with(shapes: &[Shape], cover: bool, precision: f64) -> Option<Map> {
|
||||
pub(super) fn map_with(shapes: &[Shape], cover: bool, precision: f64) -> Option<Map> {
|
||||
let mut inputs: Vec<(BezPath, usize)> = Vec::new();
|
||||
for (i, s) in shapes.iter().enumerate() {
|
||||
let mut bp = BezPath::new();
|
||||
|
||||
@@ -11,3 +11,6 @@ workspace = true
|
||||
[dependencies]
|
||||
vectorcraft-geom = { workspace = true }
|
||||
vectorcraft-pathops = { workspace = true }
|
||||
|
||||
[dev-dependencies]
|
||||
proptest = { workspace = true }
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,916 @@
|
||||
use super::*;
|
||||
use proptest::prelude::*;
|
||||
use vectorcraft_geom::Rect;
|
||||
|
||||
const TOL: f64 = 0.1;
|
||||
|
||||
fn p(x: f64, y: f64) -> Point {
|
||||
Point::new(x, y)
|
||||
}
|
||||
|
||||
fn poly(points: &[(f64, f64)], closed: bool) -> PathData {
|
||||
PathData::single(SubPath::polyline(&points.iter().map(|&(x, y)| p(x, y)).collect::<Vec<_>>(), closed))
|
||||
}
|
||||
|
||||
fn line(kind: LineKind, points: &[(f64, f64)], closed: bool, key: u64) -> FoldLine {
|
||||
FoldLine { path: poly(points, closed), kind, key }
|
||||
}
|
||||
|
||||
fn cut(points: &[(f64, f64)], key: u64) -> FoldLine {
|
||||
line(LineKind::Cut, points, true, key)
|
||||
}
|
||||
|
||||
fn crease(a: (f64, f64), b: (f64, f64), key: u64) -> FoldLine {
|
||||
line(LineKind::Crease, &[a, b], false, key)
|
||||
}
|
||||
|
||||
fn codes(issues: &[Issue]) -> Vec<&'static str> {
|
||||
issues.iter().map(|i| i.code.id()).collect()
|
||||
}
|
||||
|
||||
fn areas(b: &Blank) -> Vec<i64> {
|
||||
let mut a: Vec<i64> = b.panels.iter().map(|p| (p.area * 1000.0).round() as i64).collect();
|
||||
a.sort_unstable();
|
||||
a
|
||||
}
|
||||
|
||||
/// A tray: a 100 × 60 base with a 30 pt wall on each side, drawn as one closed cross, and the four
|
||||
/// creases round the base (keys 10 to 13).
|
||||
fn tray() -> Vec<FoldLine> {
|
||||
vec![
|
||||
cut(
|
||||
&[
|
||||
(30.0, 0.0),
|
||||
(130.0, 0.0),
|
||||
(130.0, 30.0),
|
||||
(160.0, 30.0),
|
||||
(160.0, 90.0),
|
||||
(130.0, 90.0),
|
||||
(130.0, 120.0),
|
||||
(30.0, 120.0),
|
||||
(30.0, 90.0),
|
||||
(0.0, 90.0),
|
||||
(0.0, 30.0),
|
||||
(30.0, 30.0),
|
||||
],
|
||||
1,
|
||||
),
|
||||
crease((30.0, 30.0), (130.0, 30.0), 10),
|
||||
crease((130.0, 30.0), (130.0, 90.0), 11),
|
||||
crease((130.0, 90.0), (30.0, 90.0), 12),
|
||||
crease((30.0, 90.0), (30.0, 30.0), 13),
|
||||
]
|
||||
}
|
||||
|
||||
/// The outline of a slotted box in the style of FEFCO 0201 (glue flap, four body panels 100, 60,
|
||||
/// 100 and 60 wide and 80 high, 30 pt flaps top and bottom) with its 4 pt slots drawn as notches.
|
||||
const NOTCHED: [(f64, f64); 30] = [
|
||||
(20.0, 0.0),
|
||||
(118.0, 0.0),
|
||||
(118.0, 30.0),
|
||||
(122.0, 30.0),
|
||||
(122.0, 0.0),
|
||||
(178.0, 0.0),
|
||||
(178.0, 30.0),
|
||||
(182.0, 30.0),
|
||||
(182.0, 0.0),
|
||||
(278.0, 0.0),
|
||||
(278.0, 30.0),
|
||||
(282.0, 30.0),
|
||||
(282.0, 0.0),
|
||||
(340.0, 0.0),
|
||||
(340.0, 140.0),
|
||||
(282.0, 140.0),
|
||||
(282.0, 110.0),
|
||||
(278.0, 110.0),
|
||||
(278.0, 140.0),
|
||||
(182.0, 140.0),
|
||||
(182.0, 110.0),
|
||||
(178.0, 110.0),
|
||||
(178.0, 140.0),
|
||||
(122.0, 140.0),
|
||||
(122.0, 110.0),
|
||||
(118.0, 110.0),
|
||||
(118.0, 140.0),
|
||||
(20.0, 140.0),
|
||||
(20.0, 110.0),
|
||||
(0.0, 110.0),
|
||||
];
|
||||
|
||||
/// The slotted box's creases: the glue flap's and the body panels' (vertical), and the flaps'
|
||||
/// (horizontal, from slot to slot).
|
||||
fn box_creases() -> Vec<FoldLine> {
|
||||
let mut out = vec![];
|
||||
for (k, x) in [20.0, 120.0, 180.0, 280.0].into_iter().enumerate() {
|
||||
out.push(crease((x, 30.0), (x, 110.0), 100 + k as u64));
|
||||
}
|
||||
for (k, (x0, x1)) in [(20.0, 118.0), (122.0, 178.0), (182.0, 278.0), (282.0, 340.0)].into_iter().enumerate() {
|
||||
out.push(crease((x0, 30.0), (x1, 30.0), 110 + k as u64));
|
||||
out.push(crease((x0, 110.0), (x1, 110.0), 120 + k as u64));
|
||||
}
|
||||
out
|
||||
}
|
||||
|
||||
fn notched_box() -> Vec<FoldLine> {
|
||||
let mut outline: Vec<(f64, f64)> = NOTCHED.to_vec();
|
||||
outline.extend([(0.0, 30.0), (20.0, 30.0)]);
|
||||
let mut lines = vec![cut(&outline, 1)];
|
||||
lines.extend(box_creases());
|
||||
lines
|
||||
}
|
||||
|
||||
fn check(lines: &[FoldLine]) -> (Vec<Blank>, Vec<Issue>) {
|
||||
blanks(lines, TOL)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_tray_has_a_base_four_walls_and_four_hinges() {
|
||||
let (b, issues) = check(&tray());
|
||||
assert!(issues.is_empty(), "{issues:?}");
|
||||
assert_eq!(b.len(), 1);
|
||||
assert_eq!(areas(&b[0]), vec![1_800_000, 1_800_000, 3_000_000, 3_000_000, 6_000_000]);
|
||||
assert_eq!(b[0].hinges.len(), 4);
|
||||
for h in &b[0].hinges {
|
||||
assert!(h.straight && h.keys.len() == 1, "{h:?}");
|
||||
assert!((h.from.distance(h.to) - if h.keys[0] % 2 == 0 { 100.0 } else { 60.0 }).abs() < 1e-6, "{h:?}");
|
||||
}
|
||||
assert_eq!(base_panel(&b[0].panels).map(|i| (b[0].panels[i].area).round()), Some(6000.0));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_slotted_box_gives_the_same_panels_however_its_slots_and_outline_are_drawn() {
|
||||
let (notched, issues) = check(¬ched_box());
|
||||
assert!(issues.is_empty(), "{issues:?}");
|
||||
assert_eq!(notched.len(), 1);
|
||||
assert_eq!(notched[0].panels.len(), 13, "glue flap, four body panels, eight flaps");
|
||||
assert_eq!(notched[0].hinges.len(), 12);
|
||||
assert!(notched[0].holes.is_empty());
|
||||
|
||||
// The slots as rectangles across a plain outline.
|
||||
let mut across =
|
||||
vec![cut(&[(20.0, 0.0), (340.0, 0.0), (340.0, 140.0), (20.0, 140.0), (20.0, 110.0), (0.0, 110.0), (0.0, 30.0), (20.0, 30.0)], 1)];
|
||||
for (k, x) in [120.0, 180.0, 280.0].into_iter().enumerate() {
|
||||
across.push(cut(&[(x - 2.0, -5.0), (x + 2.0, -5.0), (x + 2.0, 30.0), (x - 2.0, 30.0)], 2 + k as u64));
|
||||
across.push(cut(&[(x - 2.0, 110.0), (x + 2.0, 110.0), (x + 2.0, 145.0), (x - 2.0, 145.0)], 5 + k as u64));
|
||||
}
|
||||
across.extend(box_creases());
|
||||
let (b, issues) = check(&across);
|
||||
assert!(issues.is_empty(), "{issues:?}");
|
||||
assert_eq!(b.len(), 1);
|
||||
assert_eq!(areas(&b[0]), areas(¬ched[0]));
|
||||
assert_eq!(b[0].hinges.len(), 12);
|
||||
|
||||
// The notched outline as four open paths, end to end.
|
||||
let mut outline: Vec<(f64, f64)> = NOTCHED.to_vec();
|
||||
outline.extend([(0.0, 30.0), (20.0, 30.0), (20.0, 0.0)]);
|
||||
let mut open: Vec<FoldLine> =
|
||||
[0..9, 8..17, 16..25, 24..33].into_iter().enumerate().map(|(k, r)| line(LineKind::Cut, &outline[r], false, 1 + k as u64)).collect();
|
||||
open.extend(box_creases());
|
||||
let (b, issues) = check(&open);
|
||||
assert!(issues.is_empty(), "{issues:?}");
|
||||
assert_eq!(areas(&b[0]), areas(¬ched[0]));
|
||||
assert_eq!(b[0].hinges.len(), 12);
|
||||
|
||||
// Input order does not change the result.
|
||||
let mut reversed = notched_box();
|
||||
reversed.reverse();
|
||||
let (b, _) = check(&reversed);
|
||||
assert_eq!(areas(&b[0]), areas(¬ched[0]));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_round_tuck_flap_folds_like_any_panel() {
|
||||
let mut bp = BezPath::new();
|
||||
bp.move_to(p(0.0, 40.0));
|
||||
bp.line_to(p(0.0, 140.0));
|
||||
bp.line_to(p(100.0, 140.0));
|
||||
bp.line_to(p(100.0, 40.0));
|
||||
bp.curve_to(p(100.0, 10.0), p(80.0, 0.0), p(50.0, 0.0));
|
||||
bp.curve_to(p(20.0, 0.0), p(0.0, 10.0), p(0.0, 40.0));
|
||||
bp.close_path();
|
||||
let lines = vec![FoldLine { path: PathData::from_bezpath(&bp), kind: LineKind::Cut, key: 1 }, crease((0.0, 40.0), (100.0, 40.0), 2)];
|
||||
let (b, issues) = check(&lines);
|
||||
assert!(issues.is_empty(), "{issues:?}");
|
||||
assert_eq!(b[0].panels.len(), 2);
|
||||
assert_eq!(b[0].hinges.len(), 1);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_window_is_a_hole_in_its_panel() {
|
||||
let mut lines = tray();
|
||||
lines.push(cut(&[(60.0, 45.0), (100.0, 45.0), (100.0, 75.0), (60.0, 75.0)], 2));
|
||||
let (b, issues) = check(&lines);
|
||||
assert!(issues.is_empty(), "{issues:?}");
|
||||
assert_eq!(b[0].holes.len(), 1);
|
||||
assert_eq!(areas(&b[0]), vec![1_800_000, 1_800_000, 3_000_000, 3_000_000, 4_800_000]);
|
||||
}
|
||||
|
||||
/// The tray's outline as one open path whose end stops `short` before its start.
|
||||
fn tray_with_gap(short: f64) -> Vec<FoldLine> {
|
||||
let mut lines = tray();
|
||||
lines[0] = line(
|
||||
LineKind::Cut,
|
||||
&[
|
||||
(30.0 + short, 0.0),
|
||||
(130.0, 0.0),
|
||||
(130.0, 30.0),
|
||||
(160.0, 30.0),
|
||||
(160.0, 90.0),
|
||||
(130.0, 90.0),
|
||||
(130.0, 120.0),
|
||||
(30.0, 120.0),
|
||||
(30.0, 90.0),
|
||||
(0.0, 90.0),
|
||||
(0.0, 30.0),
|
||||
(30.0, 30.0),
|
||||
(30.0, 0.0),
|
||||
],
|
||||
false,
|
||||
1,
|
||||
);
|
||||
lines
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_gap_within_the_tolerance_is_closed_and_one_past_it_is_a_loose_end() {
|
||||
let (closed, _) = check(&tray());
|
||||
let (b, issues) = check(&tray_with_gap(0.05));
|
||||
assert_eq!(codes(&issues), vec!["gap"], "{issues:?}");
|
||||
assert_eq!(issues[0].keys, vec![1]);
|
||||
assert_eq!(areas(&b[0]), areas(&closed[0]));
|
||||
assert_eq!(b[0].hinges.len(), 4);
|
||||
// The tolerance boundary.
|
||||
let (_, issues) = blanks(&tray_with_gap(0.05), 0.06);
|
||||
assert_eq!(codes(&issues), vec!["gap"]);
|
||||
let (b, issues) = blanks(&tray_with_gap(0.05), 0.04);
|
||||
assert!(codes(&issues).starts_with(&["open", "looseEnd", "looseEnd"]) || codes(&issues).starts_with(&["looseEnd"]), "{issues:?}");
|
||||
assert!(issues.iter().any(|i| i.code == IssueCode::LooseEnd && i.at.is_some_and(|a| a.distance(p(30.05, 0.0)) < 1e-9)), "{issues:?}");
|
||||
assert!(b.iter().all(|b| b.panels.len() < 5), "the outline does not close");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn no_cut_lines_or_no_enclosed_area_build_nothing() {
|
||||
let (b, issues) = check(&[crease((0.0, 0.0), (10.0, 0.0), 1)]);
|
||||
assert!(b.is_empty());
|
||||
assert_eq!(codes(&issues), vec!["noCut"]);
|
||||
let (b, issues) = check(&[]);
|
||||
assert!(b.is_empty());
|
||||
assert_eq!(codes(&issues), vec!["noCut"]);
|
||||
let (b, issues) = check(&[line(LineKind::Cut, &[(0.0, 0.0), (50.0, 0.0), (50.0, 50.0)], false, 1)]);
|
||||
assert!(b.is_empty());
|
||||
assert!(codes(&issues).contains(&"open") && codes(&issues).contains(&"looseEnd"), "{issues:?}");
|
||||
// A non-finite line is left out.
|
||||
let mut lines = tray();
|
||||
lines.push(line(LineKind::Crease, &[(0.0, 0.0), (f64::NAN, 1.0)], false, 9));
|
||||
let (b, issues) = check(&lines);
|
||||
assert!(issues.is_empty() && b[0].panels.len() == 5, "{issues:?}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_cut_end_inside_the_blank_is_a_loose_end() {
|
||||
let mut lines = tray();
|
||||
lines.push(line(LineKind::Cut, &[(80.0, 0.0), (80.0, 20.0)], false, 2));
|
||||
let (b, issues) = check(&lines);
|
||||
assert_eq!(codes(&issues), vec!["looseEnd"], "{issues:?}");
|
||||
assert_eq!((issues[0].keys.clone(), issues[0].at), (vec![2], Some(p(80.0, 20.0))));
|
||||
assert_eq!(b[0].panels.len(), 5, "a cut into a wall does not divide it");
|
||||
// A slit that ends on a crease is not loose: it cuts the wall in two.
|
||||
let mut lines = tray();
|
||||
lines.push(line(LineKind::Cut, &[(80.0, 0.0), (80.0, 30.0)], false, 2));
|
||||
let (b, issues) = check(&lines);
|
||||
assert!(issues.is_empty(), "{issues:?}");
|
||||
assert_eq!((b[0].panels.len(), b[0].hinges.len()), (6, 5));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_cut_line_that_comes_back_through_its_own_end_meets_it() {
|
||||
// From (80, 10) out to (90, 20), then back through (80, 10) to the outline at (70, 0): the
|
||||
// start lies on the line's own second segment, so it is not loose.
|
||||
let mut lines = tray();
|
||||
lines.push(line(LineKind::Cut, &[(80.0, 10.0), (90.0, 20.0), (70.0, 0.0)], false, 2));
|
||||
let (_, issues) = check(&lines);
|
||||
assert!(!codes(&issues).contains(&"looseEnd"), "{issues:?}");
|
||||
// A first segment shorter than the tolerance does not make the second one meet the end.
|
||||
let mut lines = tray();
|
||||
lines.push(line(LineKind::Cut, &[(90.0, 25.0), (90.05, 25.0), (80.0, 20.0), (80.0, 0.0)], false, 2));
|
||||
let (_, issues) = check(&lines);
|
||||
assert_eq!(codes(&issues), vec!["looseEnd"], "{issues:?}");
|
||||
assert_eq!(issues[0].at, Some(p(90.0, 25.0)));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn two_outlines_joined_by_a_cut_line_are_both_material() {
|
||||
let lines = vec![
|
||||
cut(&[(0.0, 0.0), (100.0, 0.0), (100.0, 100.0), (0.0, 100.0)], 1),
|
||||
cut(&[(150.0, 0.0), (180.0, 0.0), (180.0, 30.0), (150.0, 30.0)], 2),
|
||||
line(LineKind::Cut, &[(100.0, 10.0), (150.0, 10.0)], false, 3),
|
||||
];
|
||||
let (b, issues) = check(&lines);
|
||||
assert_eq!(b.len(), 1, "one connected piece");
|
||||
assert_eq!(areas(&b[0]), vec![900_000, 10_000_000], "{issues:?}");
|
||||
assert!(b[0].holes.is_empty());
|
||||
// A slot drawn across the outline is still cut out, not made material where it sticks out.
|
||||
let lines =
|
||||
vec![cut(&[(0.0, 0.0), (100.0, 0.0), (100.0, 100.0), (0.0, 100.0)], 1), cut(&[(48.0, -10.0), (52.0, -10.0), (52.0, 20.0), (48.0, 20.0)], 2)];
|
||||
let (b, _) = check(&lines);
|
||||
assert_eq!(b.len(), 1);
|
||||
assert_eq!(areas(&b[0]), vec![10_000_000 - 80_000]);
|
||||
// The same slot drawn as four open lines end to end, one of them backwards.
|
||||
let slot = [(48.0, -10.0), (52.0, -10.0), (52.0, 20.0), (48.0, 20.0)];
|
||||
let mut lines = vec![cut(&[(0.0, 0.0), (100.0, 0.0), (100.0, 100.0), (0.0, 100.0)], 1)];
|
||||
lines.push(line(LineKind::Cut, &[slot[0], slot[1]], false, 2));
|
||||
lines.push(line(LineKind::Cut, &[slot[2], slot[1]], false, 3));
|
||||
lines.push(line(LineKind::Cut, &[slot[2], slot[3]], false, 4));
|
||||
lines.push(line(LineKind::Cut, &[slot[3], slot[0]], false, 5));
|
||||
let (b, issues) = check(&lines);
|
||||
assert_eq!(b.len(), 1, "{issues:?}");
|
||||
assert_eq!(areas(&b[0]), vec![10_000_000 - 80_000]);
|
||||
// And with a gap within the tolerance at one corner.
|
||||
lines[4] = line(LineKind::Cut, &[slot[3], (48.0, -9.95)], false, 5);
|
||||
let (b, issues) = check(&lines);
|
||||
assert_eq!(codes(&issues), vec!["gap"], "{issues:?}");
|
||||
assert_eq!(b.len(), 1);
|
||||
assert_eq!(areas(&b[0]), vec![10_000_000 - 80_000]);
|
||||
// A slot right across the blank, with no corner inside the outline and no outline corner
|
||||
// inside the slot, cuts it in two.
|
||||
let lines = vec![
|
||||
cut(&[(0.0, 0.0), (100.0, 0.0), (100.0, 100.0), (0.0, 100.0)], 1),
|
||||
cut(&[(10.0, -210.0), (20.0, -210.0), (20.0, 110.0), (10.0, 110.0)], 2),
|
||||
];
|
||||
let (b, _) = check(&lines);
|
||||
assert_eq!(b.len(), 1);
|
||||
assert_eq!(areas(&b[0]), vec![1_000_000, 8_000_000]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn an_outline_drawn_twice_keeps_its_material() {
|
||||
let square = [(0.0, 0.0), (100.0, 0.0), (100.0, 100.0), (0.0, 100.0)];
|
||||
let (b, issues) = check(&[cut(&square, 1), cut(&square, 2)]);
|
||||
assert_eq!(codes(&issues), vec!["duplicate"], "{issues:?}");
|
||||
assert_eq!(issues[0].keys, vec![1, 2]);
|
||||
assert_eq!(b.len(), 1);
|
||||
assert_eq!(areas(&b[0]), vec![10_000_000]);
|
||||
// The same two squares as the subpaths of one compound path.
|
||||
let mut twice = poly(&square, true);
|
||||
twice.subpaths.extend(poly(&square, true).subpaths);
|
||||
let (b, issues) = check(&[FoldLine { path: twice, kind: LineKind::Cut, key: 1 }]);
|
||||
assert_eq!(codes(&issues), vec!["duplicate"], "{issues:?}");
|
||||
assert_eq!(issues[0].keys, vec![1]);
|
||||
assert_eq!(areas(&b[0]), vec![10_000_000]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_large_tolerance_still_closes_nearly_touching_ends_and_short_outlines() {
|
||||
// Ends 0.0005 apart, closer than 1/10,000 of the tolerance.
|
||||
let nearly = line(LineKind::Cut, &[(0.0005, 0.0), (100.0, 0.0), (100.0, 100.0), (0.0, 100.0), (0.0, 0.0)], false, 1);
|
||||
let (b, issues) = blanks(&[nearly], 10.0);
|
||||
assert!(issues.is_empty(), "{issues:?}");
|
||||
assert_eq!(areas(&b[0]), vec![10_000_000]);
|
||||
// An outline shorter than the tolerance, 0.05 pt open: a gap, and no loose end.
|
||||
let short = line(LineKind::Cut, &[(0.05, 0.0), (1.0, 0.0), (1.0, 1.0), (0.0, 1.0), (0.0, 0.0)], false, 1);
|
||||
let (b, issues) = blanks(&[short], 10.0);
|
||||
assert_eq!(codes(&issues), vec!["gap"], "{issues:?}");
|
||||
assert_eq!(areas(&b[0]), vec![1000]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_lookup_wider_than_the_occupied_cells_reads_only_those_cells() {
|
||||
// Two points 1e-9 apart make cells about 2.4e-13 wide: a lookup 1e-6 around one spans some
|
||||
// 10^14 cells, and finds both points by reading the two cells that hold them.
|
||||
let cells = Cells::new(vec![(Rect::from_points(p(0.0, 0.0), p(0.0, 0.0)), 1), (Rect::from_points(p(1e-9, 0.0), p(1e-9, 0.0)), 2)], 0.0, 4096.0);
|
||||
assert_eq!(cells.near(p(0.0, 0.0), 1e-6), vec![1, 2]);
|
||||
assert_eq!(cells.near(p(5.0, 5.0), 1e-6), Vec::<i32>::new());
|
||||
// A square open by 0.0000011 pt at a 10 pt tolerance.
|
||||
let square = line(LineKind::Cut, &[(0.0000011, 0.0), (1.0, 0.0), (1.0, 1.0), (0.0, 1.0), (0.0, 0.0)], false, 1);
|
||||
let (b, issues) = blanks(&[square], 10.0);
|
||||
assert!(issues.is_empty(), "{issues:?}");
|
||||
assert_eq!(b.len(), 1);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_window_of_open_lines_with_a_slit_to_its_corner_is_still_a_hole() {
|
||||
let outline = cut(&[(0.0, 0.0), (100.0, 0.0), (100.0, 100.0), (0.0, 100.0)], 1);
|
||||
let window = [(40.0, 40.0), (60.0, 40.0), (60.0, 60.0), (40.0, 60.0)];
|
||||
let slit = line(LineKind::Cut, &[(40.0, 0.0), (40.0, 40.0)], false, 2);
|
||||
let (closed, issues) = check(&[outline.clone(), slit.clone(), cut(&window, 3)]);
|
||||
assert!(issues.is_empty(), "{issues:?}");
|
||||
assert_eq!((closed[0].holes.len(), areas(&closed[0])), (1, vec![10_000_000 - 400_000]));
|
||||
let mut lines = vec![outline, slit];
|
||||
for k in 0..4 {
|
||||
lines.push(line(LineKind::Cut, &[window[k], window[(k + 1) % 4]], false, 3 + k as u64));
|
||||
}
|
||||
let (open, issues) = check(&lines);
|
||||
assert!(issues.is_empty(), "{issues:?}");
|
||||
assert_eq!((open[0].holes.len(), areas(&open[0])), (1, areas(&closed[0])));
|
||||
// The outline as four open lines too, the slit from its corner to the window's.
|
||||
let corners = [(0.0, 0.0), (100.0, 0.0), (100.0, 100.0), (0.0, 100.0)];
|
||||
let mut lines: Vec<FoldLine> = (0..4).map(|k| line(LineKind::Cut, &[corners[k], corners[(k + 1) % 4]], false, 10 + k as u64)).collect();
|
||||
lines.push(line(LineKind::Cut, &[(0.0, 0.0), (40.0, 40.0)], false, 2));
|
||||
for k in 0..4 {
|
||||
lines.push(line(LineKind::Cut, &[window[k], window[(k + 1) % 4]], false, 3 + k as u64));
|
||||
}
|
||||
let (b, issues) = check(&lines);
|
||||
assert!(issues.is_empty(), "{issues:?}");
|
||||
assert_eq!((b[0].holes.len(), areas(&b[0])), (1, areas(&closed[0])));
|
||||
// A cut across the window of open lines, so that three lines meet at two of its corners.
|
||||
let mut lines = vec![cut(&corners, 1), line(LineKind::Cut, &[(40.0, 0.0), (40.0, 40.0)], false, 2)];
|
||||
for k in 0..4 {
|
||||
lines.push(line(LineKind::Cut, &[window[k], window[(k + 1) % 4]], false, 3 + k as u64));
|
||||
}
|
||||
lines.push(line(LineKind::Cut, &[(40.0, 40.0), (60.0, 60.0)], false, 20));
|
||||
let (b, issues) = check(&lines);
|
||||
assert!(issues.is_empty(), "{issues:?}");
|
||||
assert_eq!((b[0].holes.len(), areas(&b[0])), (1, areas(&closed[0])));
|
||||
// The outline and the window both as open lines, joined by two slits: the same as when both are
|
||||
// closed.
|
||||
let slits = [line(LineKind::Cut, &[(0.0, 0.0), (40.0, 40.0)], false, 30), line(LineKind::Cut, &[(100.0, 100.0), (60.0, 60.0)], false, 31)];
|
||||
let (want, want_issues) = check(&[cut(&corners, 1), cut(&window, 3), slits[0].clone(), slits[1].clone()]);
|
||||
let mut lines: Vec<FoldLine> = (0..4).map(|k| line(LineKind::Cut, &[corners[k], corners[(k + 1) % 4]], false, 10 + k as u64)).collect();
|
||||
for k in 0..4 {
|
||||
lines.push(line(LineKind::Cut, &[window[k], window[(k + 1) % 4]], false, 3 + k as u64));
|
||||
}
|
||||
lines.extend(slits);
|
||||
let (b, issues) = check(&lines);
|
||||
assert_eq!(codes(&issues), codes(&want_issues), "{issues:?}");
|
||||
assert_eq!((b[0].holes.len(), areas(&b[0])), (want[0].holes.len(), areas(&want[0])));
|
||||
assert_eq!(want[0].holes.len(), 1);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_slot_drawn_across_the_outline_is_a_notch_not_a_hole() {
|
||||
let outline = || cut(&[(0.0, 0.0), (100.0, 0.0), (100.0, 100.0), (0.0, 100.0)], 1);
|
||||
let (b, issues) = check(&[outline(), cut(&[(48.0, -10.0), (52.0, -10.0), (52.0, 20.0), (48.0, 20.0)], 2)]);
|
||||
assert!(issues.is_empty(), "{issues:?}");
|
||||
assert!(b[0].holes.is_empty(), "{:?}", b[0].holes);
|
||||
let notched = cut(&[(0.0, 0.0), (48.0, 0.0), (48.0, 20.0), (52.0, 20.0), (52.0, 0.0), (100.0, 0.0), (100.0, 100.0), (0.0, 100.0)], 1);
|
||||
assert_eq!(areas(&b[0]), areas(&check(std::slice::from_ref(¬ched)).0[0]));
|
||||
// A crease in the notch lies outside the blank, and one that runs on into it from a panel too.
|
||||
let slot = || cut(&[(48.0, -10.0), (52.0, -10.0), (52.0, 20.0), (48.0, 20.0)], 2);
|
||||
let (_, issues) = check(&[outline(), slot(), crease((49.0, 5.0), (51.0, 5.0), 3)]);
|
||||
assert_eq!(codes(&issues), vec!["outside"], "{issues:?}");
|
||||
let (_, issues) = check(&[outline(), slot(), crease((50.0, 5.0), (50.0, 100.0), 3)]);
|
||||
let (_, want) = check(&[notched, crease((50.0, 5.0), (50.0, 100.0), 3)]);
|
||||
assert_eq!(codes(&issues), codes(&want), "{issues:?}");
|
||||
assert!(codes(&issues).contains(&"outside"), "{issues:?}");
|
||||
// A cutout whose top side lies on the outline opens onto the outside directly.
|
||||
let flush = || cut(&[(48.0, 0.0), (52.0, 0.0), (52.0, 20.0), (48.0, 20.0)], 2);
|
||||
let (b, issues) = check(&[outline(), flush()]);
|
||||
assert!(b[0].holes.is_empty() && !codes(&issues).contains(&"ambiguous"), "{:?} {issues:?}", b[0].holes);
|
||||
let (_, issues) = check(&[outline(), flush(), crease((49.0, 5.0), (51.0, 5.0), 3)]);
|
||||
assert!(codes(&issues).contains(&"outside") && !codes(&issues).contains(&"ambiguous"), "{issues:?}");
|
||||
// A window joined to the outline by a slit stays a hole when a cut across it leaves a sliver.
|
||||
let window = || cut(&[(40.0, 40.0), (60.0, 40.0), (60.0, 60.0), (40.0, 60.0)], 4);
|
||||
let slit = || line(LineKind::Cut, &[(40.0, 0.0), (40.0, 40.0)], false, 5);
|
||||
let (b, _) = check(&[outline(), window(), slit(), line(LineKind::Cut, &[(40.0, 40.004), (60.0, 40.004)], false, 6)]);
|
||||
assert_eq!(b[0].holes.len(), 1, "{:?}", b[0].holes);
|
||||
// And a window 0.004 pt below the outline, joined to it at both corners, leaving a sliver.
|
||||
let near = cut(&[(40.0, 0.004), (60.0, 0.004), (60.0, 20.0), (40.0, 20.0)], 4);
|
||||
let joins = [line(LineKind::Cut, &[(40.0, 0.0), (40.0, 0.004)], false, 5), line(LineKind::Cut, &[(60.0, 0.0), (60.0, 0.004)], false, 6)];
|
||||
let (b, _) = check(&[outline(), near, joins[0].clone(), joins[1].clone()]);
|
||||
assert_eq!(b[0].holes.len(), 1, "{:?}", b[0].holes);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn many_small_outlines_of_open_lines_fit_the_gap_search() {
|
||||
// 784 unit squares 3 pt apart, each four open lines, at a tolerance of 0.5 pt.
|
||||
let mut lines = vec![];
|
||||
for i in 0..28u64 {
|
||||
for j in 0..28u64 {
|
||||
let (x, y) = (3.0 * i as f64, 3.0 * j as f64);
|
||||
let c = [(x, y), (x + 1.0, y), (x + 1.0, y + 1.0), (x, y + 1.0)];
|
||||
for k in 0..4 {
|
||||
lines.push(line(LineKind::Cut, &[c[k], c[(k + 1) % 4]], false, 4 * (28 * i + j) + k as u64));
|
||||
}
|
||||
}
|
||||
}
|
||||
let (b, issues) = blanks(&lines, 0.5);
|
||||
assert!(!codes(&issues).contains(&"tooComplex"), "{issues:?}");
|
||||
assert_eq!(b.len(), 784);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn thousands_of_cut_lines_on_top_of_each_other_are_too_complex_before_the_gap_search() {
|
||||
let lines: Vec<FoldLine> = (0..3000u64).map(|k| line(LineKind::Cut, &[(0.0, 0.0), (100.0, 0.0)], false, k)).collect();
|
||||
let (b, issues) = check(&lines);
|
||||
assert_eq!(codes(&issues), vec!["tooComplex"], "{issues:?}");
|
||||
assert!(b.is_empty());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn cut_lines_that_cross_an_outline_of_open_lines_leave_every_cell_material() {
|
||||
// A 90 pt square whose sides are open lines ending every 30 pt, and four cut lines right across
|
||||
// it: nine pieces of material, as with a closed outline.
|
||||
let mut lines = vec![];
|
||||
for k in 0..3 {
|
||||
let (a, b) = (30.0 * k as f64, 30.0 * (k + 1) as f64);
|
||||
for (i, seg) in [[(a, 0.0), (b, 0.0)], [(90.0, a), (90.0, b)], [(b, 90.0), (a, 90.0)], [(0.0, b), (0.0, a)]].iter().enumerate() {
|
||||
lines.push(line(LineKind::Cut, seg, false, 10 + 4 * k as u64 + i as u64));
|
||||
}
|
||||
}
|
||||
let across = [[(30.0, 0.0), (30.0, 90.0)], [(60.0, 0.0), (60.0, 90.0)], [(0.0, 30.0), (90.0, 30.0)], [(0.0, 60.0), (90.0, 60.0)]];
|
||||
for (i, seg) in across.iter().enumerate() {
|
||||
lines.push(line(LineKind::Cut, seg, false, 30 + i as u64));
|
||||
}
|
||||
let mut closed = vec![cut(&[(0.0, 0.0), (90.0, 0.0), (90.0, 90.0), (0.0, 90.0)], 1)];
|
||||
closed.extend(lines.iter().skip(12).cloned());
|
||||
let (want, want_issues) = check(&closed);
|
||||
let (b, issues) = check(&lines);
|
||||
assert_eq!(codes(&issues), codes(&want_issues), "{issues:?}");
|
||||
let pieces = |b: &[Blank]| b.iter().map(|x| (x.panels.len(), x.holes.len())).collect::<Vec<_>>();
|
||||
assert_eq!(pieces(&b), pieces(&want));
|
||||
assert_eq!(b.iter().map(|x| x.panels.len()).sum::<usize>(), 9);
|
||||
// With the crossing lines drawn in 30 pt pieces, the four pieces round the middle cell meet end
|
||||
// to end and count as one closed cut line, whether the outline is closed or drawn in pieces.
|
||||
let mut split = vec![];
|
||||
for (i, seg) in across.iter().enumerate() {
|
||||
let (a, b) = (seg[0], seg[1]);
|
||||
for k in 0..3 {
|
||||
let at = |t: f64| (a.0 + (b.0 - a.0) * t, a.1 + (b.1 - a.1) * t);
|
||||
split.push(line(LineKind::Cut, &[at(k as f64 / 3.0), at((k + 1) as f64 / 3.0)], false, 40 + 3 * i as u64 + k as u64));
|
||||
}
|
||||
}
|
||||
let mut closed = vec![cut(&[(0.0, 0.0), (90.0, 0.0), (90.0, 90.0), (0.0, 90.0)], 1)];
|
||||
closed.extend(split.iter().cloned());
|
||||
let (want, want_issues) = check(&closed);
|
||||
let mut open: Vec<FoldLine> = lines.iter().take(12).cloned().collect();
|
||||
open.extend(split);
|
||||
let (b, issues) = check(&open);
|
||||
assert_eq!(codes(&issues), codes(&want_issues), "{issues:?}");
|
||||
assert_eq!(pieces(&b), pieces(&want));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_curved_crease_is_measured_at_its_farthest_point_from_its_line() {
|
||||
// A crease from corner to corner of a square: its curve strays about 10.1 pt from the diagonal,
|
||||
// where samples at quarters of it see 9.8 pt.
|
||||
let off = 35.0 / 2f64.sqrt();
|
||||
let mut bp = BezPath::new();
|
||||
bp.move_to(p(0.0, 0.0));
|
||||
bp.curve_to(p(10000.0 / 3.0 - off, 10000.0 / 3.0 + off), p(20000.0 / 3.0 + off, 20000.0 / 3.0 - off), p(10000.0, 10000.0));
|
||||
let lines = vec![
|
||||
cut(&[(0.0, 0.0), (10000.0, 0.0), (10000.0, 10000.0), (0.0, 10000.0)], 1),
|
||||
FoldLine { path: PathData::from_bezpath(&bp), kind: LineKind::Crease, key: 2 },
|
||||
];
|
||||
let (b, issues) = blanks(&lines, 10.0);
|
||||
assert_eq!(codes(&issues), vec!["notStraight"], "{issues:?}");
|
||||
assert_eq!(b[0].hinges.len(), 1);
|
||||
let (_, issues) = blanks(&lines, 10.5);
|
||||
assert!(issues.is_empty(), "{issues:?}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_grid_of_many_touching_outlines_is_classified_without_comparing_every_pair() {
|
||||
// 100 × 100 touching squares, each its own closed outline: one piece of 10,000 panels.
|
||||
let mut lines = vec![];
|
||||
for i in 0..100u64 {
|
||||
for j in 0..100u64 {
|
||||
let (x, y) = (10.0 * i as f64, 10.0 * j as f64);
|
||||
lines.push(cut(&[(x, y), (x + 10.0, y), (x + 10.0, y + 10.0), (x, y + 10.0)], 100 * i + j));
|
||||
}
|
||||
}
|
||||
let (b, issues) = check(&lines);
|
||||
assert!(b.is_empty());
|
||||
assert!(codes(&issues).contains(&"tooComplex"), "{issues:?}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn open_cut_lines_far_from_the_origin_are_checked_without_overflow() {
|
||||
let lines = [
|
||||
line(LineKind::Cut, &[(1e13, 0.0), (1e13 + 4096.0, 0.0), (1e13 + 4096.0, 4096.0)], false, 1),
|
||||
line(LineKind::Cut, &[(1e13 + 4096.0, 4096.0), (1e13, 4096.0), (1e13, 0.0)], false, 2),
|
||||
];
|
||||
let (b, issues) = check(&lines);
|
||||
assert!(b.len() <= 1, "{issues:?}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_blank_in_the_hole_of_a_narrow_ring_is_a_blank_of_its_own() {
|
||||
// The ring's own area (1,900) is less than the hole's (8,100), but the square lies in the hole.
|
||||
let lines = vec![
|
||||
cut(&[(0.0, 0.0), (100.0, 0.0), (100.0, 100.0), (0.0, 100.0)], 1),
|
||||
cut(&[(5.0, 5.0), (95.0, 5.0), (95.0, 95.0), (5.0, 95.0)], 2),
|
||||
cut(&[(40.0, 40.0), (60.0, 40.0), (60.0, 60.0), (40.0, 60.0)], 3),
|
||||
];
|
||||
let (b, issues) = check(&lines);
|
||||
assert_eq!(b.len(), 2, "{issues:?}");
|
||||
assert_eq!(codes(&issues), vec!["ambiguous"], "{issues:?}");
|
||||
assert_eq!(issues[0].keys, vec![3]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn too_many_segments_are_refused_before_the_lines_are_copied() {
|
||||
// Many lines that together pass the limit by one segment.
|
||||
let each: Vec<(f64, f64)> = (0..=64).map(|i| (i as f64, 0.0)).collect();
|
||||
let lines: Vec<FoldLine> = (0..=(MAX_SEGMENTS / 64) as u64).map(|k| line(LineKind::Cut, &each, false, k)).collect();
|
||||
assert!(lines.len() * 64 > MAX_SEGMENTS);
|
||||
let (b, issues) = check(&lines);
|
||||
assert!(b.is_empty());
|
||||
assert_eq!(codes(&issues), vec!["tooComplex"]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn many_separate_blanks_each_with_a_window_are_told_apart() {
|
||||
// A 50 × 40 grid of 10 pt squares 5 pt apart, each with a 4 pt window and a crease beside it.
|
||||
let mut lines = vec![];
|
||||
for i in 0..50u64 {
|
||||
for j in 0..40u64 {
|
||||
let (x, y) = (15.0 * i as f64, 15.0 * j as f64);
|
||||
let k = 10 * (40 * i + j);
|
||||
lines.push(cut(&[(x, y), (x + 10.0, y), (x + 10.0, y + 10.0), (x, y + 10.0)], k));
|
||||
lines.push(cut(&[(x + 1.0, y + 1.0), (x + 5.0, y + 1.0), (x + 5.0, y + 5.0), (x + 1.0, y + 5.0)], k + 1));
|
||||
lines.push(crease((x + 7.0, y), (x + 7.0, y + 10.0), k + 2));
|
||||
}
|
||||
}
|
||||
let (blanks, issues) = check(&lines);
|
||||
assert!(issues.is_empty(), "{:?}", issues.first());
|
||||
assert_eq!(blanks.len(), 2000);
|
||||
assert!(blanks.iter().all(|b| b.panels.len() == 2 && b.hinges.len() == 1 && b.holes.len() == 1));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn many_separate_cut_lines_are_checked_by_the_cells_near_each_end() {
|
||||
// 2,000 short slits from the top edge of a long blank, each ending loose inside it.
|
||||
let mut lines = vec![cut(&[(0.0, 0.0), (4000.0, 0.0), (4000.0, 100.0), (0.0, 100.0)], 1)];
|
||||
for i in 0..2000u64 {
|
||||
let x = 1.0 + 2.0 * i as f64;
|
||||
lines.push(line(LineKind::Cut, &[(x, 0.0), (x, 50.0)], false, 10 + i));
|
||||
}
|
||||
let (_, issues) = check(&lines);
|
||||
let loose: Vec<&Issue> = issues.iter().filter(|i| i.code == IssueCode::LooseEnd).collect();
|
||||
assert_eq!(loose.len(), 2000);
|
||||
assert!(loose.iter().all(|i| i.at.is_some_and(|at| (at.y - 50.0).abs() < 1e-9)));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn too_many_segments_or_panels_are_too_complex() {
|
||||
// One point more than segments.
|
||||
let mut zigzag: Vec<(f64, f64)> = (0..=MAX_SEGMENTS + 1).map(|i| (i as f64 * 0.5, (i % 2) as f64)).collect();
|
||||
let (b, issues) = check(&[line(LineKind::Cut, &zigzag, false, 1)]);
|
||||
assert!(b.is_empty());
|
||||
assert_eq!(codes(&issues), vec!["tooComplex"]);
|
||||
zigzag.truncate(MAX_SEGMENTS + 1);
|
||||
let (_, issues) = check(&[line(LineKind::Cut, &zigzag, false, 1)]);
|
||||
assert!(!codes(&issues).contains(&"tooComplex"), "at the limit");
|
||||
// A grid of 16 × 16 panels is at the panel limit; 17 × 16 is past it.
|
||||
let grid = |cols: usize| {
|
||||
let mut lines = vec![cut(&[(0.0, 0.0), (cols as f64 * 10.0, 0.0), (cols as f64 * 10.0, 160.0), (0.0, 160.0)], 1)];
|
||||
for i in 1..cols {
|
||||
lines.push(crease((i as f64 * 10.0, 0.0), (i as f64 * 10.0, 160.0), 100 + i as u64));
|
||||
}
|
||||
for j in 1..16 {
|
||||
lines.push(crease((0.0, j as f64 * 10.0), (cols as f64 * 10.0, j as f64 * 10.0), 200 + j as u64));
|
||||
}
|
||||
lines
|
||||
};
|
||||
let (b, issues) = check(&grid(16));
|
||||
assert!(issues.is_empty(), "{issues:?}");
|
||||
assert_eq!(b[0].panels.len(), MAX_PANELS);
|
||||
let (b, issues) = check(&grid(17));
|
||||
assert!(b.is_empty());
|
||||
assert_eq!(codes(&issues), vec!["tooComplex"]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn lines_on_top_of_each_other_are_reported() {
|
||||
let mut lines = tray();
|
||||
lines.push(crease((40.0, 0.0), (120.0, 0.0), 20));
|
||||
let (_, issues) = check(&lines);
|
||||
assert_eq!(codes(&issues), vec!["cutOverCrease"], "{issues:?}");
|
||||
assert_eq!(issues[0].keys, vec![1, 20]);
|
||||
|
||||
let mut lines = tray();
|
||||
lines.push(crease((130.0, 30.0), (30.0, 30.0), 20));
|
||||
let (b, issues) = check(&lines);
|
||||
assert_eq!(codes(&issues), vec!["duplicate"], "{issues:?}");
|
||||
assert_eq!(issues[0].keys, vec![10, 20]);
|
||||
assert_eq!(b[0].hinges.len(), 4);
|
||||
assert_eq!(b[0].hinges.iter().find(|h| h.keys.contains(&20)).map(|h| h.keys.clone()), Some(vec![10, 20]));
|
||||
|
||||
// A perforation over a crease, lines of two kinds that fold.
|
||||
let mut lines = tray();
|
||||
lines.push(line(LineKind::Perforation, &[(130.0, 30.0), (30.0, 30.0)], false, 20));
|
||||
let (_, issues) = check(&lines);
|
||||
assert_eq!(codes(&issues), vec!["duplicate"], "{issues:?}");
|
||||
assert_eq!(issues[0].keys, vec![10, 20]);
|
||||
|
||||
// A crease drawn twice outside the blank is reported where it lies as well.
|
||||
let mut lines = tray();
|
||||
lines.push(crease((200.0, 0.0), (250.0, 0.0), 20));
|
||||
lines.push(crease((250.0, 0.0), (200.0, 0.0), 21));
|
||||
let (_, issues) = check(&lines);
|
||||
assert_eq!(codes(&issues), vec!["duplicate", "outside", "outside"], "{issues:?}");
|
||||
assert_eq!((issues[1].keys.clone(), issues[2].keys.clone()), (vec![20], vec![21]));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_crease_that_runs_past_the_outline_is_reported() {
|
||||
let outline = || cut(&[(0.0, 0.0), (100.0, 0.0), (100.0, 50.0), (0.0, 50.0)], 1);
|
||||
// 5 pt past the outline at each end: the hinge is built, and the line is reported.
|
||||
let (b, issues) = check(&[outline(), crease((50.0, -5.0), (50.0, 55.0), 2)]);
|
||||
assert_eq!(codes(&issues), vec!["outside"], "{issues:?}");
|
||||
assert_eq!(issues[0].keys, vec![2]);
|
||||
assert_eq!(b[0].hinges.len(), 1);
|
||||
// Past it by less than the tolerance: no issue.
|
||||
let (b, issues) = check(&[outline(), crease((50.0, -0.05), (50.0, 50.0), 2)]);
|
||||
assert!(issues.is_empty(), "{issues:?}");
|
||||
assert_eq!(b[0].hinges.len(), 1);
|
||||
// A crease drawn round a sliver inside the blank does not run outside it.
|
||||
let (_, issues) = check(&[outline(), line(LineKind::Crease, &[(50.0, 10.0), (50.004, 10.0), (50.004, 40.0), (50.0, 40.0)], true, 2)]);
|
||||
assert!(!codes(&issues).contains(&"outside"), "{issues:?}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_crease_that_ends_inside_a_panel_is_dangling() {
|
||||
let mut lines = tray();
|
||||
lines.push(crease((80.0, 30.0), (80.0, 60.0), 20));
|
||||
let (b, issues) = check(&lines);
|
||||
assert_eq!(codes(&issues), vec!["danglingCrease"], "{issues:?}");
|
||||
assert_eq!(issues[0].keys, vec![20]);
|
||||
assert_eq!(b[0].panels.len(), 5);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_hinge_shorter_than_the_tolerance_divides_nothing_and_leaves_a_loose_panel() {
|
||||
let lines = vec![
|
||||
cut(&[(0.0, 0.0), (50.0, 0.0), (50.0, 49.95), (100.0, 49.95), (100.0, 99.95), (50.0, 99.95), (50.0, 50.0), (0.0, 50.0)], 1),
|
||||
crease((50.0, 49.95), (50.0, 50.0), 2),
|
||||
];
|
||||
let (b, issues) = check(&lines);
|
||||
assert_eq!(codes(&issues), vec!["noSplit", "loosePanel"], "{issues:?}");
|
||||
assert_eq!(issues[0].keys, vec![2]);
|
||||
assert!(b[0].hinges.is_empty());
|
||||
// The same with a hinge as long as the panels: no issue.
|
||||
let lines = vec![cut(&[(0.0, 0.0), (100.0, 0.0), (100.0, 50.0), (0.0, 50.0)], 1), crease((50.0, 0.0), (50.0, 50.0), 2)];
|
||||
let (_, issues) = check(&lines);
|
||||
assert!(issues.is_empty(), "{issues:?}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn hinge_pieces_far_apart_are_measured_by_their_own_length() {
|
||||
// A window leaves two 0.02 pt strips joining the halves, each crossed by a crease: 0.04 pt of
|
||||
// hinge, though its pieces span 100 pt.
|
||||
let lines = vec![
|
||||
cut(&[(0.0, 0.0), (100.0, 0.0), (100.0, 100.0), (0.0, 100.0)], 1),
|
||||
cut(&[(40.0, 0.02), (60.0, 0.02), (60.0, 99.98), (40.0, 99.98)], 2),
|
||||
crease((50.0, 0.0), (50.0, 0.02), 3),
|
||||
crease((50.0, 99.98), (50.0, 100.0), 4),
|
||||
];
|
||||
let (b, issues) = check(&lines);
|
||||
assert!(codes(&issues).contains(&"noSplit"), "{issues:?}");
|
||||
assert!(b[0].hinges.is_empty());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_window_split_by_a_cut_line_is_one_hole() {
|
||||
let mut lines =
|
||||
vec![cut(&[(0.0, 0.0), (100.0, 0.0), (100.0, 100.0), (0.0, 100.0)], 1), cut(&[(40.0, 40.0), (60.0, 40.0), (60.0, 60.0), (40.0, 60.0)], 2)];
|
||||
lines.push(line(LineKind::Cut, &[(40.0, 50.0), (60.0, 50.0)], false, 3));
|
||||
let (b, issues) = check(&lines);
|
||||
assert!(issues.is_empty(), "{issues:?}");
|
||||
assert_eq!(b[0].holes.len(), 1);
|
||||
let area = vectorcraft_pathops::area(&b[0].holes[0], FillRule::NonZero);
|
||||
assert!((area - 400.0).abs() < 1e-3, "{area}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_hinge_drawn_as_short_pieces_is_measured_whole() {
|
||||
// Ten 5 pt pieces make a 50 pt hinge, longer than a 10 pt tolerance though each piece is not.
|
||||
let mut lines = vec![cut(&[(0.0, 0.0), (100.0, 0.0), (100.0, 50.0), (0.0, 50.0)], 1)];
|
||||
for k in 0..10u64 {
|
||||
let y = 5.0 * k as f64;
|
||||
lines.push(crease((50.0, y), (50.0, y + 5.0), 10 + k));
|
||||
}
|
||||
let (b, issues) = blanks(&lines, 10.0);
|
||||
assert!(issues.is_empty(), "{issues:?}");
|
||||
assert_eq!(b[0].hinges.len(), 1);
|
||||
let h = &b[0].hinges[0];
|
||||
assert!((h.from.distance(h.to) - 50.0).abs() < 1e-6 && h.keys.len() == 10, "{h:?}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_crease_outside_the_blank_is_reported() {
|
||||
let mut lines = tray();
|
||||
lines.push(crease((200.0, 0.0), (250.0, 0.0), 20));
|
||||
let (_, issues) = check(&lines);
|
||||
assert_eq!(codes(&issues), vec!["outside"], "{issues:?}");
|
||||
assert_eq!(issues[0].keys, vec![20]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_bent_crease_folds_along_its_longest_piece() {
|
||||
let mut lines = tray();
|
||||
lines[1] = line(LineKind::Crease, &[(30.0, 30.0), (90.0, 30.0), (130.0, 32.0)], false, 10);
|
||||
lines[0] = cut(
|
||||
&[
|
||||
(30.0, 0.0),
|
||||
(130.0, 0.0),
|
||||
(130.0, 32.0),
|
||||
(160.0, 32.0),
|
||||
(160.0, 90.0),
|
||||
(130.0, 90.0),
|
||||
(130.0, 120.0),
|
||||
(30.0, 120.0),
|
||||
(30.0, 90.0),
|
||||
(0.0, 90.0),
|
||||
(0.0, 30.0),
|
||||
(30.0, 30.0),
|
||||
],
|
||||
1,
|
||||
);
|
||||
lines[2] = crease((130.0, 32.0), (130.0, 90.0), 11);
|
||||
let (b, issues) = check(&lines);
|
||||
assert_eq!(codes(&issues), vec!["notStraight"], "{issues:?}");
|
||||
let h = b[0].hinges.iter().find(|h| h.keys == vec![10]).unwrap();
|
||||
assert!(!h.straight);
|
||||
assert!((h.from.y - 30.0).abs() < 1e-9 && (h.to.y - 30.0).abs() < 1e-9, "along the 60 pt piece: {h:?}");
|
||||
// Within the tolerance, a crease is straight.
|
||||
let mut lines = tray();
|
||||
lines[1] = line(LineKind::Crease, &[(30.0, 30.0), (90.0, 30.05), (130.0, 30.0)], false, 10);
|
||||
let (b, issues) = check(&lines);
|
||||
assert!(issues.is_empty(), "{issues:?}");
|
||||
assert!(b[0].hinges.iter().all(|h| h.straight));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_slot_too_narrow_to_map_is_a_sliver() {
|
||||
let mut lines = tray();
|
||||
lines.push(cut(&[(60.0, 45.0), (60.004, 45.0), (60.004, 75.0), (60.0, 75.0)], 2));
|
||||
let (_, issues) = check(&lines);
|
||||
assert_eq!(codes(&issues), vec!["sliver"], "{issues:?}");
|
||||
assert!(issues[0].at.is_some_and(|a| Rect::new(59.9, 44.0, 60.1, 76.0).contains(a)));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn lines_in_a_hole_are_ambiguous() {
|
||||
let mut window = tray();
|
||||
window.push(cut(&[(60.0, 45.0), (100.0, 45.0), (100.0, 75.0), (60.0, 75.0)], 2));
|
||||
let mut lines = window.clone();
|
||||
lines.push(crease((70.0, 45.0), (70.0, 75.0), 20));
|
||||
let (_, issues) = check(&lines);
|
||||
assert_eq!(codes(&issues), vec!["ambiguous"], "{issues:?}");
|
||||
assert_eq!(issues[0].keys, vec![20]);
|
||||
let mut lines = window;
|
||||
lines.push(cut(&[(70.0, 50.0), (90.0, 50.0), (90.0, 70.0), (70.0, 70.0)], 3));
|
||||
let (b, issues) = check(&lines);
|
||||
assert_eq!(codes(&issues), vec!["ambiguous"], "{issues:?}");
|
||||
assert_eq!(issues[0].keys, vec![3]);
|
||||
assert_eq!(b.len(), 2, "the square in the window is a blank of its own");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn partial_cuts_and_perforations_make_hinges_as_creases_do() {
|
||||
let mut lines = tray();
|
||||
lines[1].kind = LineKind::PartialCut;
|
||||
lines[3].kind = LineKind::Perforation;
|
||||
let (b, issues) = check(&lines);
|
||||
assert!(issues.is_empty(), "{issues:?}");
|
||||
let mut keys: Vec<Vec<u64>> = b[0].hinges.iter().map(|h| h.keys.clone()).collect();
|
||||
keys.sort_unstable();
|
||||
assert_eq!(keys, vec![vec![10], vec![11], vec![12], vec![13]]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn every_code_has_an_id_and_a_severity() {
|
||||
let ids: Vec<&str> = IssueCode::ALL.iter().map(|c| c.id()).collect();
|
||||
assert_eq!(ids.len(), 15);
|
||||
let mut unique = ids.clone();
|
||||
unique.sort_unstable();
|
||||
unique.dedup();
|
||||
assert_eq!(unique.len(), 15);
|
||||
let errors: Vec<&str> = IssueCode::ALL.iter().filter(|c| c.is_error()).map(|c| c.id()).collect();
|
||||
assert_eq!(errors, vec!["noCut", "open", "looseEnd", "tooComplex", "cutOverCrease"]);
|
||||
let mut sorted = IssueCode::ALL;
|
||||
sorted.sort();
|
||||
assert_eq!(sorted, IssueCode::ALL, "listed in issue order");
|
||||
}
|
||||
|
||||
proptest! {
|
||||
#![proptest_config(ProptestConfig::with_cases(48))]
|
||||
/// Random fold lines never panic, and the panels and hinges they give are consistent.
|
||||
#[test]
|
||||
fn random_fold_lines_give_consistent_blanks(
|
||||
segs in proptest::collection::vec((0u8..4, -50.0f64..50.0, -50.0f64..50.0, -50.0f64..50.0, -50.0f64..50.0), 1..10),
|
||||
boxed in any::<bool>(),
|
||||
) {
|
||||
let kinds = [LineKind::Cut, LineKind::Crease, LineKind::PartialCut, LineKind::Perforation];
|
||||
let mut lines: Vec<FoldLine> = segs
|
||||
.iter()
|
||||
.enumerate()
|
||||
.map(|(i, &(k, a, b, c, d))| line(kinds[usize::from(k)], &[(a, b), (c, d)], false, i as u64))
|
||||
.collect();
|
||||
if boxed {
|
||||
lines.push(cut(&[(-40.0, -40.0), (40.0, -40.0), (40.0, 40.0), (-40.0, 40.0)], 99));
|
||||
}
|
||||
let (blanks, issues) = blanks(&lines, TOL);
|
||||
for b in &blanks {
|
||||
prop_assert!(!b.panels.is_empty() && b.panels.len() <= MAX_PANELS);
|
||||
for h in &b.hinges {
|
||||
prop_assert!(h.a < h.b && h.b < b.panels.len());
|
||||
prop_assert!(h.from.is_finite() && h.to.is_finite());
|
||||
}
|
||||
}
|
||||
let mut sorted = issues.clone();
|
||||
sorted.sort_by_key(|i| i.code);
|
||||
prop_assert_eq!(sorted, issues);
|
||||
}
|
||||
}
|
||||
@@ -4,8 +4,11 @@
|
||||
//! Open profiles optionally close their circular ends with caps, and a partial sweep its cut sides. Faces are projected and sorted back to front,
|
||||
//! then flat or smoothly shaded with vector gradients. This preview uses a painter's algorithm, not a depth buffer:
|
||||
//! intersecting profiles can have ambiguous visibility and are not solid modelling inputs.
|
||||
//!
|
||||
//! [`fold`] finds the panels and hinges of a flat packaging blank from its fold lines.
|
||||
#![forbid(unsafe_code)]
|
||||
|
||||
pub mod fold;
|
||||
mod solid;
|
||||
mod visibility;
|
||||
pub use solid::{
|
||||
|
||||
@@ -2,10 +2,15 @@
|
||||
//! panel lists the fold line roles, each with its swatch's chip and how many of the selected objects
|
||||
//! have it (of the whole document while nothing is selected); clicking a role gives the selected
|
||||
//! paths that role (`addon.packaging.setRole`). Its menu's Role Swatches… picks the swatch that
|
||||
//! carries a role (`addon.packaging.setRoleSwatch`).
|
||||
//! carries a role (`addon.packaging.setRoleSwatch`). Its Check button, like the Check Fold Lines menu
|
||||
//! item, checks the fold lines (`addon.packaging.check`) and lists the issues found under it, each
|
||||
//! with a Select button; the list is kept until the document changes.
|
||||
|
||||
use std::sync::{Arc, Weak};
|
||||
|
||||
use egui::{Align, Layout, Sense, Ui, vec2};
|
||||
use serde_json::{Value, json};
|
||||
use vectorcraft_engine::doc::Document;
|
||||
|
||||
use crate::VectorcraftApp;
|
||||
use crate::menus::Item;
|
||||
@@ -18,12 +23,16 @@ pub const ID: &str = "foldLines";
|
||||
pub const SET_ROLE: &str = "addon.packaging.setRole";
|
||||
/// The command that picks a role's swatch.
|
||||
pub const SET_ROLE_SWATCH: &str = "addon.packaging.setRoleSwatch";
|
||||
/// The command that checks the fold lines.
|
||||
pub const CHECK: &str = "addon.packaging.check";
|
||||
/// The roles by name, as `addon.packaging.setRole` and Role Swatches… take them.
|
||||
pub const ROLES: &[(&str, &str)] =
|
||||
&[("Cut Line", "cut"), ("Crease Line", "crease"), ("Partial Cut Line", "partialCut"), ("Perforation Line", "perforation")];
|
||||
|
||||
/// Where the panel keeps the last `addon.packaging.roles` answer (panel state).
|
||||
const STATE: &str = "fold-lines";
|
||||
/// Where the panel keeps the last check (panel state).
|
||||
const CHECKED: &str = "fold-lines-check";
|
||||
|
||||
/// Object › Plug-ins › Packaging Tools.
|
||||
pub fn menu() -> Vec<Item> {
|
||||
@@ -35,9 +44,141 @@ pub fn menu() -> Vec<Item> {
|
||||
make("Make Crease Line", "crease"),
|
||||
make("Make Partial Cut Line", "partialCut"),
|
||||
make("Make Perforation Line", "perforation"),
|
||||
Item::Sep,
|
||||
Item::Cmd("Check Fold Lines", CHECK, Value::Null),
|
||||
]
|
||||
}
|
||||
|
||||
/// One issue of a check: whether it is an error, its message (English) and the objects it names.
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
pub(crate) struct Issue {
|
||||
pub error: bool,
|
||||
pub message: String,
|
||||
pub ids: Vec<u64>,
|
||||
}
|
||||
|
||||
/// The document a check was made on: its id, and its content as it was then. Selecting changes
|
||||
/// neither, so the issues stay listed while their Select buttons are used. The content is held
|
||||
/// weakly: it is compared, never kept alive.
|
||||
type DocKey = (u64, Weak<Document>);
|
||||
|
||||
/// The last check of a document.
|
||||
#[derive(Clone, Debug, Default)]
|
||||
pub(crate) struct Checked {
|
||||
pub key: Option<DocKey>,
|
||||
pub panels: u64,
|
||||
pub hinges: u64,
|
||||
pub issues: Vec<Issue>,
|
||||
}
|
||||
|
||||
impl Checked {
|
||||
/// The check `r` (an `addon.packaging.check` answer) of the document `key`.
|
||||
fn of(key: DocKey, r: &Value) -> Checked {
|
||||
let count = |k: &str| r[k].as_u64().unwrap_or(0);
|
||||
let issues: Vec<Issue> = r["issues"]
|
||||
.as_array()
|
||||
.into_iter()
|
||||
.flatten()
|
||||
.map(|i| Issue {
|
||||
error: i["severity"] == "error",
|
||||
message: i["message"].as_str().unwrap_or_default().to_string(),
|
||||
ids: i["ids"].as_array().into_iter().flatten().filter_map(Value::as_u64).collect(),
|
||||
})
|
||||
.collect();
|
||||
Checked { key: Some(key), panels: count("panels"), hinges: count("hinges"), issues }
|
||||
}
|
||||
|
||||
/// The summary line, in English (the status bar and the panel show it translated).
|
||||
fn summary(&self) -> String {
|
||||
let errors = self.issues.iter().filter(|i| i.error).count();
|
||||
crate::i18n::fmt(
|
||||
"Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings}",
|
||||
&[
|
||||
("panels", &self.panels.to_string()),
|
||||
("hinges", &self.hinges.to_string()),
|
||||
("errors", &errors.to_string()),
|
||||
("warnings", &(self.issues.len() - errors).to_string()),
|
||||
],
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/// The active document's [`DocKey`].
|
||||
fn doc_key(app: &VectorcraftApp) -> Option<DocKey> {
|
||||
app.session.active().map(|st| (st.uid, Arc::downgrade(&st.doc)))
|
||||
}
|
||||
|
||||
/// Runs `addon.packaging.check` with `p` and shows its summary in the status bar → the check, kept
|
||||
/// in `ctx` for the panel.
|
||||
fn run_check(app: &mut VectorcraftApp, ctx: &egui::Context, p: Value) -> Option<Checked> {
|
||||
let r = app.run(CHECK, p).map_err(|e| app.status(e)).ok()?;
|
||||
let checked = Checked::of(doc_key(app)?, &r);
|
||||
app.status(checked.summary());
|
||||
set_pstate(ctx, CHECKED, checked.clone());
|
||||
Some(checked)
|
||||
}
|
||||
|
||||
/// Check Fold Lines from its menu item: checks with `p`, keeps the issues for the Fold Lines panel
|
||||
/// and shows the panel.
|
||||
pub(crate) fn check(app: &mut VectorcraftApp, p: Value) {
|
||||
let ctx = app.ui_ctx.clone().unwrap_or_default();
|
||||
if run_check(app, &ctx, p).is_some()
|
||||
&& let Err(e) = crate::panel_docking::reveal_panel(app, ID)
|
||||
{
|
||||
app.status(e);
|
||||
}
|
||||
}
|
||||
|
||||
/// The last check of the active document, while the document has not changed since.
|
||||
fn last_check(app: &VectorcraftApp, ctx: &egui::Context) -> Option<Checked> {
|
||||
let checked: Checked = pstate(ctx, CHECKED);
|
||||
let same = match (&checked.key, doc_key(app)) {
|
||||
(Some((uid, doc)), Some((now, current))) => *uid == now && doc.ptr_eq(¤t),
|
||||
_ => false,
|
||||
};
|
||||
same.then_some(checked)
|
||||
}
|
||||
|
||||
/// The Check button, then the last check's summary and issues (errors in the error color, warnings
|
||||
/// in the warning color), each with a Select button; clicking an issue selects its objects too.
|
||||
fn show_check(app: &mut VectorcraftApp, ui: &mut Ui) {
|
||||
widgets::divider(ui);
|
||||
let width = ui.available_width();
|
||||
if widgets::flat_button(ui, tl!("Check"), width).clicked() {
|
||||
run_check(app, ui.ctx(), json!({}));
|
||||
}
|
||||
let Some(checked) = last_check(app, ui.ctx()) else { return };
|
||||
ui.add_space(4.0);
|
||||
dim_label(ui, &crate::i18n::msg(&checked.summary()));
|
||||
if checked.issues.is_empty() {
|
||||
dim_label(ui, tl!("No issues found."));
|
||||
}
|
||||
let t = crate::theme::Tokens::get(ui.ctx());
|
||||
let mut select = None;
|
||||
for (n, issue) in checked.issues.iter().enumerate() {
|
||||
ui.horizontal(|ui| {
|
||||
let can = !issue.ids.is_empty();
|
||||
let picked = ui
|
||||
.with_layout(Layout::right_to_left(Align::Center), |ui| {
|
||||
let button = ui.add_enabled_ui(can, |ui| widgets::flat_button(ui, tl!("Select"), 56.0)).inner;
|
||||
let text = egui::RichText::new(crate::i18n::msg(&issue.message)).color(if issue.error { t.error } else { t.warning });
|
||||
let row =
|
||||
ui.with_layout(Layout::left_to_right(Align::Center), |ui| ui.add(egui::Label::new(text).sense(Sense::click()).wrap())).inner;
|
||||
button.clicked() || (row.clicked() && can)
|
||||
})
|
||||
.inner;
|
||||
if picked {
|
||||
select = Some(n);
|
||||
}
|
||||
});
|
||||
}
|
||||
if let Some(issue) = select.and_then(|n| checked.issues.get(n))
|
||||
&& let Err(e) = app.run("select.set", json!({ "ids": issue.ids }))
|
||||
{
|
||||
app.status(e);
|
||||
}
|
||||
}
|
||||
|
||||
/// One role row: (role id, swatch name, the swatch's paint if the document has it, count).
|
||||
type Row = (String, String, Option<vectorcraft_color::Paint>, u64);
|
||||
|
||||
@@ -103,6 +244,7 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) {
|
||||
{
|
||||
app.status(e);
|
||||
}
|
||||
show_check(app, ui);
|
||||
}
|
||||
|
||||
/// Role Swatches… (the dialog of `addon.packaging.setRoleSwatch`): when another role is picked, its
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use serde_json::json;
|
||||
use vectorcraft_engine::Session;
|
||||
|
||||
use super::{ID, ROLES, SET_ROLE, SET_ROLE_SWATCH, show};
|
||||
use super::{CHECK, ID, ROLES, SET_ROLE, SET_ROLE_SWATCH, show};
|
||||
use crate::tests_labels::painted_text;
|
||||
use crate::{VectorcraftApp, menus};
|
||||
|
||||
@@ -125,6 +125,139 @@ fn role_swatches_shows_the_swatch_of_the_role_picked() {
|
||||
assert_eq!(crate::dialogs::form::params(&d), json!({"role": "crease", "swatch": "Ink"}), "the dialog sends no __role");
|
||||
}
|
||||
|
||||
/// An app with a square blank cut on its outline, a crease across it and a cut line that stops
|
||||
/// inside it, nothing selected → (app, the cut line that stops).
|
||||
fn blank() -> (VectorcraftApp, u64) {
|
||||
let mut app = VectorcraftApp::new(Session::new(), Default::default());
|
||||
app.run("file.new", json!({"width": 300, "height": 300})).unwrap();
|
||||
let path = |app: &mut VectorcraftApp, d: &str| app.run("path.create", json!({ "d": d })).unwrap()["id"].as_u64().unwrap();
|
||||
let outline = path(&mut app, "M50 50 L250 50 L250 250 L50 250 Z");
|
||||
let crease = path(&mut app, "M50 150 L250 150");
|
||||
let slit = path(&mut app, "M100 50 L100 100");
|
||||
app.run(SET_ROLE, json!({"role": "cut", "ids": [outline, slit]})).unwrap();
|
||||
app.run(SET_ROLE, json!({"role": "crease", "ids": [crease]})).unwrap();
|
||||
app.run("select.none", json!({})).unwrap();
|
||||
(app, slit)
|
||||
}
|
||||
|
||||
/// Frames of the panel in one context, the pointer clicking the middle of the element that screen
|
||||
/// readers name `click` (egui finds what the pointer is over from the frame before, so the move
|
||||
/// gets a frame of its own) → the text the last frame painted.
|
||||
fn frames(app: &mut VectorcraftApp, ctx: &egui::Context, click: Option<&str>) -> String {
|
||||
ctx.enable_accesskit();
|
||||
crate::theme::install_fonts(ctx);
|
||||
// The context's clock runs on from its last frame: egui requires time to move forward.
|
||||
let mut time = ctx.input(|i| i.time);
|
||||
let mut frame = |app: &mut VectorcraftApp, events: Vec<egui::Event>| {
|
||||
time += 0.1;
|
||||
let screen = egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(320.0, 480.0));
|
||||
let input = egui::RawInput { events, time: Some(time), screen_rect: Some(screen), ..Default::default() };
|
||||
let mut out = ctx.run_ui(input, |ui| show(app, ui));
|
||||
out.textures_delta.clear();
|
||||
out
|
||||
};
|
||||
frame(app, vec![]);
|
||||
let out = frame(app, vec![]);
|
||||
let Some(label) = click else { return crate::tests_labels::shapes_text(&out) };
|
||||
let nodes = &out.platform_output.accesskit_update.as_ref().expect("an accessibility tree").nodes;
|
||||
// A button carries its text as its name, a label as its value.
|
||||
let node = nodes.iter().find(|(_, n)| n.label() == Some(label) || n.value() == Some(label));
|
||||
let b = node.unwrap_or_else(|| panic!("nothing named {label:?}")).1.bounds().expect("bounds");
|
||||
let at = egui::pos2((b.x0 + b.x1) as f32 * 0.5, (b.y0 + b.y1) as f32 * 0.5);
|
||||
let button = |pressed| egui::Event::PointerButton { pos: at, button: egui::PointerButton::Primary, pressed, modifiers: egui::Modifiers::NONE };
|
||||
frame(app, vec![egui::Event::PointerMoved(at)]);
|
||||
frame(app, vec![button(true)]);
|
||||
let out = frame(app, vec![button(false)]);
|
||||
crate::tests_labels::shapes_text(&out)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn check_fold_lines_lists_its_issues_in_the_panel_until_the_document_changes() {
|
||||
crate::i18n::set_current(crate::i18n::Lang::EN);
|
||||
let (mut app, _) = blank();
|
||||
let entries = menus::menu_entries(&app);
|
||||
let item = entries.iter().find(|e| e.path == ["Object", "Plug-ins", "Packaging Tools"] && e.label == "Check Fold Lines").expect("listed");
|
||||
assert_eq!(item.command.as_deref(), Some(CHECK));
|
||||
let ctx = egui::Context::default();
|
||||
app.ui_ctx = Some(ctx.clone());
|
||||
assert!(!crate::panel_docking::showing(&app.ui, ID));
|
||||
menus::invoke(&mut app, CHECK, item.params.clone());
|
||||
assert!(crate::panel_docking::showing(&app.ui, ID), "the panel opens");
|
||||
assert_eq!(app.ui.status, "Panels: 2, hinges: 1, errors: 1, warnings: 0");
|
||||
let text = frames(&mut app, &ctx, None);
|
||||
assert!(text.contains("A cut line ends without meeting another cut line."), "{text}");
|
||||
assert!(text.contains("Panels: 2, hinges: 1, errors: 1, warnings: 0") && text.contains("Select"), "{text}");
|
||||
// Any change to the document takes the list away.
|
||||
app.run("shape.rectangle", json!({"x": 0, "y": 0, "width": 5, "height": 5})).unwrap();
|
||||
let text = frames(&mut app, &ctx, None);
|
||||
assert!(!text.contains("A cut line ends"), "{text}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_check_button_checks_and_clicking_an_issue_selects_its_lines() {
|
||||
crate::i18n::set_current(crate::i18n::Lang::EN);
|
||||
let (mut app, slit) = blank();
|
||||
let ctx = egui::Context::default();
|
||||
let text = frames(&mut app, &ctx, Some("Check"));
|
||||
assert!(text.contains("A cut line ends without meeting another cut line."), "{text}");
|
||||
assert!(app.session.active().unwrap().selection.is_empty());
|
||||
frames(&mut app, &ctx, Some("A cut line ends without meeting another cut line."));
|
||||
let selected: Vec<u64> = app.session.active().unwrap().selection.objects.iter().map(|id| id.0).collect();
|
||||
assert_eq!(selected, [slit]);
|
||||
let text = frames(&mut app, &ctx, None);
|
||||
assert!(text.contains("A cut line ends without meeting another cut line."), "selecting keeps the list: {text}");
|
||||
// A clean blank: no issues.
|
||||
app.run("edit.clear", json!({})).unwrap();
|
||||
let text = frames(&mut app, &ctx, Some("Check"));
|
||||
assert!(text.contains("No issues found.") && text.contains("Panels: 2, hinges: 1, errors: 0, warnings: 0"), "{text}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn issues_and_the_summary_show_in_the_interface_language() {
|
||||
let (mut app, _) = blank();
|
||||
let ctx = egui::Context::default();
|
||||
crate::i18n::set_current(crate::i18n::Lang::from_code("de").unwrap());
|
||||
let text = frames(&mut app, &ctx, Some(crate::i18n::t("Check")));
|
||||
crate::i18n::set_current(crate::i18n::Lang::EN);
|
||||
assert!(!text.contains("A cut line ends") && !text.contains("Panels:"), "{text}");
|
||||
assert!(text.contains("Eine Schnittlinie endet, ohne auf eine andere Schnittlinie zu treffen."), "{text}");
|
||||
assert!(text.contains("Felder: 2, Scharniere: 1, Fehler: 1, Warnungen: 0"), "{text}");
|
||||
}
|
||||
|
||||
/// The messages `addon.packaging.check` gives its issues, one for each code (three for `noCut`).
|
||||
const ISSUE_MESSAGES: [&str; 17] = [
|
||||
"No cut lines are in the selection.",
|
||||
"No cut lines are in the document.",
|
||||
"No cut lines are among the given objects.",
|
||||
"The cut lines do not enclose an area.",
|
||||
"A cut line ends without meeting another cut line.",
|
||||
"A gap between cut lines was closed.",
|
||||
"The fold lines are too complex to check.",
|
||||
"A cut line and a crease lie on top of each other.",
|
||||
"Two fold lines lie on top of each other.",
|
||||
"A crease ends inside a panel.",
|
||||
"A crease does not divide two panels.",
|
||||
"A crease lies outside the cut outline, wholly or in part.",
|
||||
"The pieces of a hinge are not on one straight line.",
|
||||
"A gap between cut lines is too narrow to tell apart.",
|
||||
"A cut-out area holds other fold lines or another blank.",
|
||||
"A panel is not joined to the rest by a crease.",
|
||||
"A fold line is on a non-printing layer.",
|
||||
];
|
||||
|
||||
#[test]
|
||||
fn every_issue_message_translates_in_every_complete_message_catalog() {
|
||||
for code in [
|
||||
"cs", "de", "el", "es", "fr", "hi", "hu", "it", "ja", "ka", "ko", "pl", "pt-br", "ru", "sv", "uk", "vi", "zh-hans", "zh-hant", "fi", "tr",
|
||||
"ca", "nl", "da",
|
||||
] {
|
||||
let lang = crate::i18n::Lang::from_code(code).unwrap();
|
||||
for m in ISSUE_MESSAGES.into_iter().chain(["Panels: 3, hinges: 2, errors: 1, warnings: 0"]) {
|
||||
assert_ne!(crate::i18n::message(lang, m), m, "{code}: {m}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_panel_without_a_document_asks_for_one() {
|
||||
let mut app = VectorcraftApp::new(Session::new(), Default::default());
|
||||
|
||||
@@ -7092,4 +7092,24 @@ breakText Glyphs Глифи
|
||||
No objects are selected. Няма избрани обекти.
|
||||
Open a document to mark its fold lines. Отворете документ, за да отбележите линиите му на сгъване.
|
||||
Remove Fold Line Role Премахни вида на линията
|
||||
Check Провери
|
||||
Check Fold Lines Провери линиите на сгъване
|
||||
@msg No cut lines are in the selection. В селекцията няма линии за рязане.
|
||||
@msg No cut lines are in the document. В документа няма линии за рязане.
|
||||
@msg The cut lines do not enclose an area. Линиите за рязане не ограждат площ.
|
||||
@msg A cut line ends without meeting another cut line. Линия за рязане завършва, без да срещне друга линия за рязане.
|
||||
@msg A gap between cut lines was closed. Процеп между линии за рязане беше затворен.
|
||||
@msg The fold lines are too complex to check. Линиите на сгъване са твърде сложни за проверка.
|
||||
@msg A cut line and a crease lie on top of each other. Линия за рязане и линия за биговане лежат една върху друга.
|
||||
@msg No cut lines are among the given objects. Сред дадените обекти няма линии за рязане.
|
||||
@msg Two fold lines lie on top of each other. Две линии на сгъване лежат една върху друга.
|
||||
@msg A crease ends inside a panel. Линия за биговане завършва вътре в панел.
|
||||
@msg A crease does not divide two panels. Линия за биговане не разделя два панела.
|
||||
@msg A crease lies outside the cut outline, wholly or in part. Линия за биговане лежи изцяло или отчасти извън контура за рязане.
|
||||
@msg The pieces of a hinge are not on one straight line. Частите на една панта не лежат на една права линия.
|
||||
@msg A gap between cut lines is too narrow to tell apart. Процеп между линии за рязане е твърде тесен, за да се различи.
|
||||
@msg A cut-out area holds other fold lines or another blank. Изрязана област съдържа други линии на сгъване или друг разкрой.
|
||||
@msg A panel is not joined to the rest by a crease. Панел не е свързан с останалите с линия за биговане.
|
||||
@msg A fold line is on a non-printing layer. Линия на сгъване е на слой, който не се печата.
|
||||
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Панели: {panels}, панти: {hinges}, грешки: {errors}, предупреждения: {warnings}
|
||||
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer трябва да е "singleLine", "everyLine", "standardSingleLine" или "standardEveryLine"
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7145,4 +7145,24 @@ shape Open Otvoren
|
||||
No objects are selected. Nijedan objekat nije odabran.
|
||||
Open a document to mark its fold lines. Otvorite dokument da označite njegove linije savijanja.
|
||||
Remove Fold Line Role Ukloni vrstu linije
|
||||
Check Provjeri
|
||||
Check Fold Lines Provjeri linije savijanja
|
||||
@msg No cut lines are in the selection. U odabiru nema linija rezanja.
|
||||
@msg No cut lines are in the document. U dokumentu nema linija rezanja.
|
||||
@msg The cut lines do not enclose an area. Linije rezanja ne zatvaraju nijednu površinu.
|
||||
@msg A cut line ends without meeting another cut line. Linija rezanja završava a da ne susreće drugu liniju rezanja.
|
||||
@msg A gap between cut lines was closed. Razmak između linija rezanja je zatvoren.
|
||||
@msg The fold lines are too complex to check. Linije savijanja su previše složene za provjeru.
|
||||
@msg A cut line and a crease lie on top of each other. Linija rezanja i linija bigovanja leže jedna preko druge.
|
||||
@msg No cut lines are among the given objects. Među zadanim objektima nema linija rezanja.
|
||||
@msg Two fold lines lie on top of each other. Dvije linije savijanja leže jedna preko druge.
|
||||
@msg A crease ends inside a panel. Linija bigovanja završava unutar panela.
|
||||
@msg A crease does not divide two panels. Linija bigovanja ne razdvaja dva panela.
|
||||
@msg A crease lies outside the cut outline, wholly or in part. Linija bigovanja leži potpuno ili djelimično izvan konture rezanja.
|
||||
@msg The pieces of a hinge are not on one straight line. Dijelovi jedne šarke ne leže na jednoj pravoj liniji.
|
||||
@msg A gap between cut lines is too narrow to tell apart. Razmak između linija rezanja je preuzak da bi se razlikovao.
|
||||
@msg A cut-out area holds other fold lines or another blank. Izrezana površina sadrži druge linije savijanja ili drugi kroj.
|
||||
@msg A panel is not joined to the rest by a crease. Panel nije povezan s ostatkom nijednom linijom bigovanja.
|
||||
@msg A fold line is on a non-printing layer. Linija savijanja je na sloju koji se ne štampa.
|
||||
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Paneli: {panels}, šarke: {hinges}, greške: {errors}, upozorenja: {warnings}
|
||||
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer mora biti "singleLine", "everyLine", "standardSingleLine" ili "standardEveryLine"
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 2 and column 73.
|
@@ -7953,4 +7953,24 @@ breakText Glyphs Glifs
|
||||
No objects are selected. No hi ha cap objecte seleccionat.
|
||||
Open a document to mark its fold lines. Obre un document per marcar-ne les línies de plegat.
|
||||
Remove Fold Line Role Elimina el tipus de línia
|
||||
Check Comprova
|
||||
Check Fold Lines Comprova les línies de plegat
|
||||
@msg No cut lines are in the selection. No hi ha cap línia de tall a la selecció.
|
||||
@msg No cut lines are in the document. No hi ha cap línia de tall al document.
|
||||
@msg The cut lines do not enclose an area. Les línies de tall no tanquen cap àrea.
|
||||
@msg A cut line ends without meeting another cut line. Una línia de tall acaba sense trobar cap altra línia de tall.
|
||||
@msg A gap between cut lines was closed. S’ha tancat un buit entre línies de tall.
|
||||
@msg The fold lines are too complex to check. Les línies de plegat són massa complexes per comprovar-les.
|
||||
@msg A cut line and a crease lie on top of each other. Una línia de tall i una d’hendit estan superposades.
|
||||
@msg No cut lines are among the given objects. No hi ha cap línia de tall entre els objectes indicats.
|
||||
@msg Two fold lines lie on top of each other. Dues línies de plegat estan superposades.
|
||||
@msg A crease ends inside a panel. Una línia d’hendit acaba dins d’un panell.
|
||||
@msg A crease does not divide two panels. Una línia d’hendit no separa dos panells.
|
||||
@msg A crease lies outside the cut outline, wholly or in part. Una línia d’hendit és fora del contorn de tall, del tot o en part.
|
||||
@msg The pieces of a hinge are not on one straight line. Els trams d’una frontissa no són en una sola línia recta.
|
||||
@msg A gap between cut lines is too narrow to tell apart. Un buit entre línies de tall és massa estret per distingir-lo.
|
||||
@msg A cut-out area holds other fold lines or another blank. Una àrea retallada conté altres línies de plegat o un altre troquelat.
|
||||
@msg A panel is not joined to the rest by a crease. Un panell no està unit a la resta per cap línia d’hendit.
|
||||
@msg A fold line is on a non-printing layer. Una línia de plegat és en una capa que no s’imprimeix.
|
||||
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Panells: {panels}, frontisses: {hinges}, errors: {errors}, avisos: {warnings}
|
||||
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer ha de ser "singleLine", "everyLine", "standardSingleLine" o "standardEveryLine"
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 2 and column 73.
|
@@ -9750,3 +9750,23 @@ breakText Glyphs Glyfy
|
||||
No objects are selected. Nejsou vybrány žádné objekty.
|
||||
Open a document to mark its fold lines. Otevřete dokument, abyste označili jeho linie skladu.
|
||||
Remove Fold Line Role Odstranit typ linie
|
||||
Check Zkontrolovat
|
||||
Check Fold Lines Zkontrolovat linie skladu
|
||||
@msg No cut lines are in the selection. Ve výběru nejsou žádné linie řezu.
|
||||
@msg No cut lines are in the document. V dokumentu nejsou žádné linie řezu.
|
||||
@msg The cut lines do not enclose an area. Linie řezu neohraničují žádnou plochu.
|
||||
@msg A cut line ends without meeting another cut line. Linie řezu končí, aniž by se setkala s jinou linií řezu.
|
||||
@msg A gap between cut lines was closed. Mezera mezi liniemi řezu byla uzavřena.
|
||||
@msg The fold lines are too complex to check. Linie skladu jsou příliš složité na kontrolu.
|
||||
@msg A cut line and a crease lie on top of each other. Linie řezu a linie bigu leží přes sebe.
|
||||
@msg No cut lines are among the given objects. Mezi zadanými objekty nejsou žádné linie řezu.
|
||||
@msg Two fold lines lie on top of each other. Dvě linie skladu leží přes sebe.
|
||||
@msg A crease ends inside a panel. Linie bigu končí uvnitř panelu.
|
||||
@msg A crease does not divide two panels. Linie bigu nerozděluje dva panely.
|
||||
@msg A crease lies outside the cut outline, wholly or in part. Linie bigu leží zcela nebo zčásti mimo obrys řezu.
|
||||
@msg The pieces of a hinge are not on one straight line. Části jednoho pantu neleží na jedné přímce.
|
||||
@msg A gap between cut lines is too narrow to tell apart. Mezera mezi liniemi řezu je příliš úzká na rozlišení.
|
||||
@msg A cut-out area holds other fold lines or another blank. Vyříznutá oblast obsahuje další linie skladu nebo jiný přířez.
|
||||
@msg A panel is not joined to the rest by a crease. Panel není se zbytkem spojen žádnou linií bigu.
|
||||
@msg A fold line is on a non-printing layer. Linie skladu je na netisknutelné vrstvě.
|
||||
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Panely: {panels}, panty: {hinges}, chyby: {errors}, upozornění: {warnings}
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -9852,4 +9852,24 @@ breakText Glyphs Glyffer
|
||||
No objects are selected. Ingen objekter er markeret.
|
||||
Open a document to mark its fold lines. Åbn et dokument for at markere dets foldelinjer.
|
||||
Remove Fold Line Role Fjern linjetype
|
||||
Check Kontrollér
|
||||
Check Fold Lines Kontrollér foldelinjer
|
||||
@msg No cut lines are in the selection. Der er ingen skærelinjer i markeringen.
|
||||
@msg No cut lines are in the document. Der er ingen skærelinjer i dokumentet.
|
||||
@msg The cut lines do not enclose an area. Skærelinjerne omslutter ikke et område.
|
||||
@msg A cut line ends without meeting another cut line. En skærelinje slutter uden at møde en anden skærelinje.
|
||||
@msg A gap between cut lines was closed. Et mellemrum mellem skærelinjer blev lukket.
|
||||
@msg The fold lines are too complex to check. Foldelinjerne er for komplekse til at kontrollere.
|
||||
@msg A cut line and a crease lie on top of each other. En skærelinje og en rillelinje ligger oven på hinanden.
|
||||
@msg No cut lines are among the given objects. Der er ingen skærelinjer blandt de angivne objekter.
|
||||
@msg Two fold lines lie on top of each other. To foldelinjer ligger oven på hinanden.
|
||||
@msg A crease ends inside a panel. En rillelinje slutter inde i et panel.
|
||||
@msg A crease does not divide two panels. En rillelinje deler ikke to paneler.
|
||||
@msg A crease lies outside the cut outline, wholly or in part. En rillelinje ligger helt eller delvist uden for skærekonturen.
|
||||
@msg The pieces of a hinge are not on one straight line. Delene af et hængsel ligger ikke på én ret linje.
|
||||
@msg A gap between cut lines is too narrow to tell apart. Et mellemrum mellem skærelinjer er for smalt til at skelne.
|
||||
@msg A cut-out area holds other fold lines or another blank. Et udskåret område indeholder andre foldelinjer eller et andet emne.
|
||||
@msg A panel is not joined to the rest by a crease. Et panel er ikke forbundet med resten af en rillelinje.
|
||||
@msg A fold line is on a non-printing layer. En foldelinje ligger på et lag, der ikke udskrives.
|
||||
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Paneler: {panels}, hængsler: {hinges}, fejl: {errors}, advarsler: {warnings}
|
||||
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer skal være "singleLine", "everyLine", "standardSingleLine" eller "standardEveryLine"
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -9348,3 +9348,23 @@ breakText Glyphs Glyphen
|
||||
No objects are selected. Es sind keine Objekte ausgewählt.
|
||||
Open a document to mark its fold lines. Öffnen Sie ein Dokument, um seine Faltlinien festzulegen.
|
||||
Remove Fold Line Role Linienart entfernen
|
||||
Check Prüfen
|
||||
Check Fold Lines Faltlinien prüfen
|
||||
@msg No cut lines are in the selection. Die Auswahl enthält keine Schnittlinien.
|
||||
@msg No cut lines are in the document. Das Dokument enthält keine Schnittlinien.
|
||||
@msg The cut lines do not enclose an area. Die Schnittlinien umschließen keine Fläche.
|
||||
@msg A cut line ends without meeting another cut line. Eine Schnittlinie endet, ohne auf eine andere Schnittlinie zu treffen.
|
||||
@msg A gap between cut lines was closed. Eine Lücke zwischen Schnittlinien wurde geschlossen.
|
||||
@msg The fold lines are too complex to check. Die Faltlinien sind zu komplex für die Prüfung.
|
||||
@msg A cut line and a crease lie on top of each other. Eine Schnittlinie und eine Rilllinie liegen übereinander.
|
||||
@msg No cut lines are among the given objects. Die angegebenen Objekte enthalten keine Schnittlinien.
|
||||
@msg Two fold lines lie on top of each other. Zwei Faltlinien liegen übereinander.
|
||||
@msg A crease ends inside a panel. Eine Rilllinie endet innerhalb eines Felds.
|
||||
@msg A crease does not divide two panels. Eine Rilllinie trennt keine zwei Felder.
|
||||
@msg A crease lies outside the cut outline, wholly or in part. Eine Rilllinie liegt ganz oder teilweise außerhalb der Schnittkontur.
|
||||
@msg The pieces of a hinge are not on one straight line. Die Teile eines Scharniers liegen nicht auf einer geraden Linie.
|
||||
@msg A gap between cut lines is too narrow to tell apart. Eine Lücke zwischen Schnittlinien ist zu schmal, um sie zu unterscheiden.
|
||||
@msg A cut-out area holds other fold lines or another blank. Ein ausgeschnittener Bereich enthält weitere Faltlinien oder einen anderen Zuschnitt.
|
||||
@msg A panel is not joined to the rest by a crease. Ein Feld ist durch keine Rilllinie mit den übrigen verbunden.
|
||||
@msg A fold line is on a non-printing layer. Eine Faltlinie liegt auf einer nicht druckbaren Ebene.
|
||||
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Felder: {panels}, Scharniere: {hinges}, Fehler: {errors}, Warnungen: {warnings}
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7927,4 +7927,24 @@ breakText Glyphs Γλύφοι
|
||||
No objects are selected. Δεν έχουν επιλεγεί αντικείμενα.
|
||||
Open a document to mark its fold lines. Ανοίξτε ένα έγγραφο για να σημειώσετε τις γραμμές δίπλωσής του.
|
||||
Remove Fold Line Role Αφαίρεση τύπου γραμμής
|
||||
Check Έλεγχος
|
||||
Check Fold Lines Έλεγχος γραμμών δίπλωσης
|
||||
@msg No cut lines are in the selection. Η επιλογή δεν περιέχει γραμμές κοπής.
|
||||
@msg No cut lines are in the document. Το έγγραφο δεν περιέχει γραμμές κοπής.
|
||||
@msg The cut lines do not enclose an area. Οι γραμμές κοπής δεν περικλείουν καμία περιοχή.
|
||||
@msg A cut line ends without meeting another cut line. Μια γραμμή κοπής τελειώνει χωρίς να συναντήσει άλλη γραμμή κοπής.
|
||||
@msg A gap between cut lines was closed. Ένα κενό ανάμεσα σε γραμμές κοπής κλείστηκε.
|
||||
@msg The fold lines are too complex to check. Οι γραμμές δίπλωσης είναι πολύ σύνθετες για έλεγχο.
|
||||
@msg A cut line and a crease lie on top of each other. Μια γραμμή κοπής και μια γραμμή πτύχωσης βρίσκονται η μία πάνω στην άλλη.
|
||||
@msg No cut lines are among the given objects. Τα δοσμένα αντικείμενα δεν περιέχουν γραμμές κοπής.
|
||||
@msg Two fold lines lie on top of each other. Δύο γραμμές δίπλωσης βρίσκονται η μία πάνω στην άλλη.
|
||||
@msg A crease ends inside a panel. Μια γραμμή πτύχωσης τελειώνει μέσα σε ένα πάνελ.
|
||||
@msg A crease does not divide two panels. Μια γραμμή πτύχωσης δεν χωρίζει δύο πάνελ.
|
||||
@msg A crease lies outside the cut outline, wholly or in part. Μια γραμμή πτύχωσης βρίσκεται εν όλω ή εν μέρει έξω από το περίγραμμα κοπής.
|
||||
@msg The pieces of a hinge are not on one straight line. Τα τμήματα ενός μεντεσέ δεν βρίσκονται σε μία ευθεία.
|
||||
@msg A gap between cut lines is too narrow to tell apart. Ένα κενό ανάμεσα σε γραμμές κοπής είναι πολύ στενό για να διακριθεί.
|
||||
@msg A cut-out area holds other fold lines or another blank. Μια αποκομμένη περιοχή περιέχει άλλες γραμμές δίπλωσης ή άλλο ανάπτυγμα.
|
||||
@msg A panel is not joined to the rest by a crease. Ένα πάνελ δεν συνδέεται με τα υπόλοιπα με καμία γραμμή πτύχωσης.
|
||||
@msg A fold line is on a non-printing layer. Μια γραμμή δίπλωσης βρίσκεται σε επίπεδο που δεν εκτυπώνεται.
|
||||
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Πάνελ: {panels}, μεντεσέδες: {hinges}, σφάλματα: {errors}, προειδοποιήσεις: {warnings}
|
||||
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" το composer πρέπει να είναι "singleLine", "everyLine", "standardSingleLine" ή "standardEveryLine"
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7914,4 +7914,24 @@ breakText Glyphs Glifos
|
||||
No objects are selected. No hay objetos seleccionados.
|
||||
Open a document to mark its fold lines. Abre un documento para marcar sus líneas de plegado.
|
||||
Remove Fold Line Role Quitar tipo de línea
|
||||
Check Comprobar
|
||||
Check Fold Lines Comprobar líneas de plegado
|
||||
@msg No cut lines are in the selection. No hay líneas de corte en la selección.
|
||||
@msg No cut lines are in the document. No hay líneas de corte en el documento.
|
||||
@msg The cut lines do not enclose an area. Las líneas de corte no encierran ningún área.
|
||||
@msg A cut line ends without meeting another cut line. Una línea de corte termina sin llegar a otra línea de corte.
|
||||
@msg A gap between cut lines was closed. Se cerró un hueco entre líneas de corte.
|
||||
@msg The fold lines are too complex to check. Las líneas de plegado son demasiado complejas para comprobarlas.
|
||||
@msg A cut line and a crease lie on top of each other. Una línea de corte y una de hendido están superpuestas.
|
||||
@msg No cut lines are among the given objects. No hay líneas de corte entre los objetos indicados.
|
||||
@msg Two fold lines lie on top of each other. Dos líneas de plegado están superpuestas.
|
||||
@msg A crease ends inside a panel. Una línea de hendido termina dentro de un panel.
|
||||
@msg A crease does not divide two panels. Una línea de hendido no separa dos paneles.
|
||||
@msg A crease lies outside the cut outline, wholly or in part. Una línea de hendido está fuera del contorno de corte, total o parcialmente.
|
||||
@msg The pieces of a hinge are not on one straight line. Los tramos de una bisagra no están en una sola línea recta.
|
||||
@msg A gap between cut lines is too narrow to tell apart. Un hueco entre líneas de corte es demasiado estrecho para distinguirlo.
|
||||
@msg A cut-out area holds other fold lines or another blank. Un área recortada contiene otras líneas de plegado u otro troquelado.
|
||||
@msg A panel is not joined to the rest by a crease. Un panel no está unido al resto por ninguna línea de hendido.
|
||||
@msg A fold line is on a non-printing layer. Una línea de plegado está en una capa que no se imprime.
|
||||
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Paneles: {panels}, bisagras: {hinges}, errores: {errors}, advertencias: {warnings}
|
||||
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer debe ser "singleLine", "everyLine", "standardSingleLine" o "standardEveryLine"
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 2 and column 73.
|
@@ -8010,4 +8010,24 @@ breakText Glyphs Merkit
|
||||
No objects are selected. Objekteja ei ole valittu.
|
||||
Open a document to mark its fold lines. Avaa asiakirja, niin voit merkitä sen taittoviivat.
|
||||
Remove Fold Line Role Poista viivatyyppi
|
||||
Check Tarkista
|
||||
Check Fold Lines Tarkista taittoviivat
|
||||
@msg No cut lines are in the selection. Valinnassa ei ole leikkausviivoja.
|
||||
@msg No cut lines are in the document. Asiakirjassa ei ole leikkausviivoja.
|
||||
@msg The cut lines do not enclose an area. Leikkausviivat eivät rajaa aluetta.
|
||||
@msg A cut line ends without meeting another cut line. Leikkausviiva päättyy kohtaamatta toista leikkausviivaa.
|
||||
@msg A gap between cut lines was closed. Leikkausviivojen välinen rako suljettiin.
|
||||
@msg The fold lines are too complex to check. Taittoviivat ovat liian monimutkaisia tarkistettaviksi.
|
||||
@msg A cut line and a crease lie on top of each other. Leikkausviiva ja nuuttausviiva ovat päällekkäin.
|
||||
@msg No cut lines are among the given objects. Annetuissa objekteissa ei ole leikkausviivoja.
|
||||
@msg Two fold lines lie on top of each other. Kaksi taittoviivaa on päällekkäin.
|
||||
@msg A crease ends inside a panel. Nuuttausviiva päättyy paneelin sisään.
|
||||
@msg A crease does not divide two panels. Nuuttausviiva ei jaa kahta paneelia.
|
||||
@msg A crease lies outside the cut outline, wholly or in part. Nuuttausviiva on kokonaan tai osittain leikkausääriviivan ulkopuolella.
|
||||
@msg The pieces of a hinge are not on one straight line. Saranan osat eivät ole yhdellä suoralla.
|
||||
@msg A gap between cut lines is too narrow to tell apart. Leikkausviivojen välinen rako on liian kapea erotettavaksi.
|
||||
@msg A cut-out area holds other fold lines or another blank. Leikattu alue sisältää muita taittoviivoja tai toisen aihion.
|
||||
@msg A panel is not joined to the rest by a crease. Paneelia ei ole liitetty muihin millään nuuttausviivalla.
|
||||
@msg A fold line is on a non-printing layer. Taittoviiva on tasolla, jota ei tulosteta.
|
||||
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Paneelit: {panels}, saranat: {hinges}, virheet: {errors}, varoitukset: {warnings}
|
||||
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer on oltava "singleLine", "everyLine", "standardSingleLine" tai "standardEveryLine"
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 2 and column 73.
|
@@ -9735,4 +9735,24 @@ breakText Glyphs Glyphes
|
||||
No objects are selected. Aucun objet n’est sélectionné.
|
||||
Open a document to mark its fold lines. Ouvrez un document pour marquer ses lignes de pliage.
|
||||
Remove Fold Line Role Supprimer le type de ligne
|
||||
Check Vérifier
|
||||
Check Fold Lines Vérifier les lignes de pliage
|
||||
@msg No cut lines are in the selection. La sélection ne contient aucune ligne de découpe.
|
||||
@msg No cut lines are in the document. Le document ne contient aucune ligne de découpe.
|
||||
@msg The cut lines do not enclose an area. Les lignes de découpe n’entourent aucune zone.
|
||||
@msg A cut line ends without meeting another cut line. Une ligne de découpe se termine sans rejoindre une autre ligne de découpe.
|
||||
@msg A gap between cut lines was closed. Un écart entre des lignes de découpe a été fermé.
|
||||
@msg The fold lines are too complex to check. Les lignes de pliage sont trop complexes pour être vérifiées.
|
||||
@msg A cut line and a crease lie on top of each other. Une ligne de découpe et une ligne de rainage se superposent.
|
||||
@msg No cut lines are among the given objects. Les objets indiqués ne contiennent aucune ligne de découpe.
|
||||
@msg Two fold lines lie on top of each other. Deux lignes de pliage se superposent.
|
||||
@msg A crease ends inside a panel. Une ligne de rainage se termine à l’intérieur d’un panneau.
|
||||
@msg A crease does not divide two panels. Une ligne de rainage ne sépare pas deux panneaux.
|
||||
@msg A crease lies outside the cut outline, wholly or in part. Une ligne de rainage se trouve en tout ou en partie hors du contour de découpe.
|
||||
@msg The pieces of a hinge are not on one straight line. Les morceaux d’une charnière ne sont pas sur une seule ligne droite.
|
||||
@msg A gap between cut lines is too narrow to tell apart. Un écart entre des lignes de découpe est trop étroit pour être distingué.
|
||||
@msg A cut-out area holds other fold lines or another blank. Une zone découpée contient d’autres lignes de pliage ou un autre flan.
|
||||
@msg A panel is not joined to the rest by a crease. Un panneau n’est relié au reste par aucune ligne de rainage.
|
||||
@msg A fold line is on a non-printing layer. Une ligne de pliage se trouve sur un calque non imprimable.
|
||||
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} {panels} panneau(x), {hinges} charnière(s), {errors} erreur(s), {warnings} avertissement(s)
|
||||
@msg {_1} × {_2} pixels is too large for GIF (at most 65535 pixels a side): lower the resolution {_1} × {_2} pixels, c’est trop grand pour le GIF (65535 pixels par côté au plus) : réduisez la résolution
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -4849,6 +4849,26 @@ swatch [Registration] [રજિસ્ટ્રેશન]
|
||||
No objects are selected. કોઈ ઑબ્જેક્ટ પસંદ કરેલ નથી.
|
||||
Open a document to mark its fold lines. તેની ફોલ્ડ લાઇન્સ ચિહ્નિત કરવા દસ્તાવેજ ખોલો.
|
||||
Remove Fold Line Role લાઇન પ્રકાર દૂર કરો
|
||||
Check ચેક કરો
|
||||
Check Fold Lines ફોલ્ડ લાઇન્સ ચેક કરો
|
||||
@msg No cut lines are in the selection. પસંદગીમાં કોઈ કટ લાઇન નથી.
|
||||
@msg No cut lines are in the document. ડૉક્યુમેન્ટમાં કોઈ કટ લાઇન નથી.
|
||||
@msg The cut lines do not enclose an area. કટ લાઇન્સ કોઈ વિસ્તાર ઘેરતી નથી.
|
||||
@msg A cut line ends without meeting another cut line. એક કટ લાઇન બીજી કટ લાઇનને મળ્યા વિના પૂરી થાય છે.
|
||||
@msg A gap between cut lines was closed. કટ લાઇન્સ વચ્ચેનો ગેપ બંધ કરવામાં આવ્યો.
|
||||
@msg The fold lines are too complex to check. ફોલ્ડ લાઇન્સ ચેક કરવા માટે ખૂબ જટિલ છે.
|
||||
@msg A cut line and a crease lie on top of each other. એક કટ લાઇન અને એક ક્રીઝ લાઇન એકબીજા પર છે.
|
||||
@msg No cut lines are among the given objects. આપેલા ઑબ્જેક્ટ્સમાં કોઈ કટ લાઇન નથી.
|
||||
@msg Two fold lines lie on top of each other. બે ફોલ્ડ લાઇન્સ એકબીજા પર છે.
|
||||
@msg A crease ends inside a panel. એક ક્રીઝ લાઇન પેનલની અંદર પૂરી થાય છે.
|
||||
@msg A crease does not divide two panels. એક ક્રીઝ લાઇન બે પેનલને અલગ કરતી નથી.
|
||||
@msg A crease lies outside the cut outline, wholly or in part. એક ક્રીઝ લાઇન પૂરેપૂરી અથવા આંશિક રીતે કટ આઉટલાઇનની બહાર છે.
|
||||
@msg The pieces of a hinge are not on one straight line. એક હિન્જના ભાગો એક સીધી લાઇન પર નથી.
|
||||
@msg A gap between cut lines is too narrow to tell apart. કટ લાઇન્સ વચ્ચેનો ગેપ ઓળખવા માટે ખૂબ સાંકડો છે.
|
||||
@msg A cut-out area holds other fold lines or another blank. એક કટ-આઉટ વિસ્તારમાં બીજી ફોલ્ડ લાઇન્સ અથવા બીજું બ્લેન્ક છે.
|
||||
@msg A panel is not joined to the rest by a crease. એક પેનલ કોઈ ક્રીઝ લાઇનથી બાકીના સાથે જોડાયેલી નથી.
|
||||
@msg A fold line is on a non-printing layer. એક ફોલ્ડ લાઇન નોન-પ્રિન્ટિંગ લેયર પર છે.
|
||||
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} પેનલ: {panels}, હિન્જ: {hinges}, ભૂલો: {errors}, ચેતવણીઓ: {warnings}
|
||||
Middle Eastern & South Asian Single-line Composer સિંગલ-લાઇન કમ્પોઝર (મધ્ય પૂર્વ અને દક્ષિણ એશિયા)
|
||||
Middle Eastern & South Asian Every-line Composer એવરી-લાઇન કમ્પોઝર (મધ્ય પૂર્વ અને દક્ષિણ એશિયા)
|
||||
Standard Single-line Composer સ્ટાન્ડર્ડ સિંગલ-લાઇન કમ્પોઝર
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 72 and column 5.
|
@@ -9355,3 +9355,23 @@ theme Appearance अपीयरेंस
|
||||
No objects are selected. कोई ऑब्जेक्ट सिलेक्ट नहीं है।
|
||||
Open a document to mark its fold lines. फ़ोल्ड लाइनें मार्क करने के लिए कोई डॉक्यूमेंट ओपन करें।
|
||||
Remove Fold Line Role लाइन प्रकार हटाएँ
|
||||
Check चेक करें
|
||||
Check Fold Lines फ़ोल्ड लाइनें चेक करें
|
||||
@msg No cut lines are in the selection. सिलेक्शन में कोई कट लाइन नहीं है।
|
||||
@msg No cut lines are in the document. डॉक्यूमेंट में कोई कट लाइन नहीं है।
|
||||
@msg The cut lines do not enclose an area. कट लाइनें कोई एरिया नहीं घेरतीं।
|
||||
@msg A cut line ends without meeting another cut line. एक कट लाइन किसी दूसरी कट लाइन से मिले बिना खत्म हो जाती है।
|
||||
@msg A gap between cut lines was closed. कट लाइनों के बीच का गैप बंद कर दिया गया।
|
||||
@msg The fold lines are too complex to check. फ़ोल्ड लाइनें चेक करने के लिए बहुत जटिल हैं।
|
||||
@msg A cut line and a crease lie on top of each other. एक कट लाइन और एक क्रीज़ लाइन एक-दूसरे के ऊपर हैं।
|
||||
@msg No cut lines are among the given objects. दिए गए ऑब्जेक्ट में कोई कट लाइन नहीं है।
|
||||
@msg Two fold lines lie on top of each other. दो फ़ोल्ड लाइनें एक-दूसरे के ऊपर हैं।
|
||||
@msg A crease ends inside a panel. एक क्रीज़ लाइन किसी पैनल के अंदर खत्म होती है।
|
||||
@msg A crease does not divide two panels. एक क्रीज़ लाइन दो पैनलों को अलग नहीं करती।
|
||||
@msg A crease lies outside the cut outline, wholly or in part. एक क्रीज़ लाइन पूरी तरह या आंशिक रूप से कट आउटलाइन के बाहर है।
|
||||
@msg The pieces of a hinge are not on one straight line. एक हिंज के हिस्से एक सीधी लाइन पर नहीं हैं।
|
||||
@msg A gap between cut lines is too narrow to tell apart. कट लाइनों के बीच का गैप पहचानने के लिए बहुत पतला है।
|
||||
@msg A cut-out area holds other fold lines or another blank. एक कट-आउट एरिया में दूसरी फ़ोल्ड लाइनें या दूसरा ब्लैंक है।
|
||||
@msg A panel is not joined to the rest by a crease. कोई पैनल किसी क्रीज़ लाइन से बाकी से जुड़ा नहीं है।
|
||||
@msg A fold line is on a non-printing layer. एक फ़ोल्ड लाइन नॉन-प्रिंटिंग लेयर पर है।
|
||||
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} पैनल: {panels}, हिंज: {hinges}, एरर: {errors}, वॉर्निंग: {warnings}
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -9738,3 +9738,23 @@ breakText Glyphs Glifák
|
||||
No objects are selected. Nincs kijelölt objektum.
|
||||
Open a document to mark its fold lines. Nyiss meg egy dokumentumot a hajtásvonalai megjelöléséhez.
|
||||
Remove Fold Line Role Vonaltípus eltávolítása
|
||||
Check Ellenőrzés
|
||||
Check Fold Lines Hajtásvonalak ellenőrzése
|
||||
@msg No cut lines are in the selection. A kijelölésben nincs vágóvonal.
|
||||
@msg No cut lines are in the document. A dokumentumban nincs vágóvonal.
|
||||
@msg The cut lines do not enclose an area. A vágóvonalak nem zárnak közre területet.
|
||||
@msg A cut line ends without meeting another cut line. Egy vágóvonal úgy ér véget, hogy nem találkozik másik vágóvonallal.
|
||||
@msg A gap between cut lines was closed. A vágóvonalak közötti rés le lett zárva.
|
||||
@msg The fold lines are too complex to check. A hajtásvonalak túl összetettek az ellenőrzéshez.
|
||||
@msg A cut line and a crease lie on top of each other. Egy vágóvonal és egy bigvonal egymáson fekszik.
|
||||
@msg No cut lines are among the given objects. A megadott objektumok között nincs vágóvonal.
|
||||
@msg Two fold lines lie on top of each other. Két hajtásvonal egymáson fekszik.
|
||||
@msg A crease ends inside a panel. Egy bigvonal egy panelen belül ér véget.
|
||||
@msg A crease does not divide two panels. Egy bigvonal nem választ el két panelt.
|
||||
@msg A crease lies outside the cut outline, wholly or in part. Egy bigvonal teljesen vagy részben a vágási körvonalon kívül van.
|
||||
@msg The pieces of a hinge are not on one straight line. Egy zsanér részei nem egy egyenesen vannak.
|
||||
@msg A gap between cut lines is too narrow to tell apart. A vágóvonalak közötti rés túl keskeny a megkülönböztetéshez.
|
||||
@msg A cut-out area holds other fold lines or another blank. Egy kivágott terület további hajtásvonalakat vagy egy másik kiterítéket tartalmaz.
|
||||
@msg A panel is not joined to the rest by a crease. Egy panelt egyetlen bigvonal sem köt a többihez.
|
||||
@msg A fold line is on a non-printing layer. Egy hajtásvonal nem nyomtatható rétegen van.
|
||||
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Panelek: {panels}, zsanérok: {hinges}, hibák: {errors}, figyelmeztetések: {warnings}
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7107,4 +7107,24 @@ breakText Glyphs Glif
|
||||
No objects are selected. Tidak ada objek yang dipilih.
|
||||
Open a document to mark its fold lines. Buka dokumen untuk menandai garis lipatnya.
|
||||
Remove Fold Line Role Hapus jenis garis
|
||||
Check Periksa
|
||||
Check Fold Lines Periksa garis lipat
|
||||
@msg No cut lines are in the selection. Tidak ada garis potong dalam seleksi.
|
||||
@msg No cut lines are in the document. Tidak ada garis potong dalam dokumen.
|
||||
@msg The cut lines do not enclose an area. Garis potong tidak melingkupi area apa pun.
|
||||
@msg A cut line ends without meeting another cut line. Sebuah garis potong berakhir tanpa bertemu garis potong lain.
|
||||
@msg A gap between cut lines was closed. Celah di antara garis potong telah ditutup.
|
||||
@msg The fold lines are too complex to check. Garis lipat terlalu rumit untuk diperiksa.
|
||||
@msg A cut line and a crease lie on top of each other. Sebuah garis potong dan sebuah garis lekuk bertumpuk.
|
||||
@msg No cut lines are among the given objects. Tidak ada garis potong di antara objek yang diberikan.
|
||||
@msg Two fold lines lie on top of each other. Dua garis lipat bertumpuk.
|
||||
@msg A crease ends inside a panel. Sebuah garis lekuk berakhir di dalam panel.
|
||||
@msg A crease does not divide two panels. Sebuah garis lekuk tidak membagi dua panel.
|
||||
@msg A crease lies outside the cut outline, wholly or in part. Sebuah garis lekuk berada seluruhnya atau sebagian di luar kontur potong.
|
||||
@msg The pieces of a hinge are not on one straight line. Bagian-bagian sebuah engsel tidak berada pada satu garis lurus.
|
||||
@msg A gap between cut lines is too narrow to tell apart. Celah di antara garis potong terlalu sempit untuk dibedakan.
|
||||
@msg A cut-out area holds other fold lines or another blank. Area yang dipotong berisi garis lipat lain atau bentangan lain.
|
||||
@msg A panel is not joined to the rest by a crease. Sebuah panel tidak tersambung ke bagian lain oleh garis lekuk apa pun.
|
||||
@msg A fold line is on a non-printing layer. Sebuah garis lipat berada di lapisan yang tidak dicetak.
|
||||
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Panel: {panels}, engsel: {hinges}, galat: {errors}, peringatan: {warnings}
|
||||
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer harus "singleLine", "everyLine", "standardSingleLine", atau "standardEveryLine"
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 2491 and column 5.
|
@@ -9382,3 +9382,23 @@ breakText Glyphs Glifi
|
||||
No objects are selected. Nessun oggetto selezionato.
|
||||
Open a document to mark its fold lines. Apri un documento per segnarne le linee di piega.
|
||||
Remove Fold Line Role Rimuovi tipo di linea
|
||||
Check Verifica
|
||||
Check Fold Lines Verifica linee di piega
|
||||
@msg No cut lines are in the selection. Nella selezione non ci sono linee di taglio.
|
||||
@msg No cut lines are in the document. Nel documento non ci sono linee di taglio.
|
||||
@msg The cut lines do not enclose an area. Le linee di taglio non racchiudono alcuna area.
|
||||
@msg A cut line ends without meeting another cut line. Una linea di taglio termina senza incontrare un’altra linea di taglio.
|
||||
@msg A gap between cut lines was closed. È stato chiuso uno spazio tra linee di taglio.
|
||||
@msg The fold lines are too complex to check. Le linee di piega sono troppo complesse da verificare.
|
||||
@msg A cut line and a crease lie on top of each other. Una linea di taglio e una di cordonatura sono sovrapposte.
|
||||
@msg No cut lines are among the given objects. Tra gli oggetti indicati non ci sono linee di taglio.
|
||||
@msg Two fold lines lie on top of each other. Due linee di piega sono sovrapposte.
|
||||
@msg A crease ends inside a panel. Una linea di cordonatura termina all’interno di un pannello.
|
||||
@msg A crease does not divide two panels. Una linea di cordonatura non divide due pannelli.
|
||||
@msg A crease lies outside the cut outline, wholly or in part. Una linea di cordonatura si trova del tutto o in parte fuori dal contorno di taglio.
|
||||
@msg The pieces of a hinge are not on one straight line. I tratti di una cerniera non sono su un’unica linea retta.
|
||||
@msg A gap between cut lines is too narrow to tell apart. Uno spazio tra linee di taglio è troppo stretto per essere distinto.
|
||||
@msg A cut-out area holds other fold lines or another blank. Un’area ritagliata contiene altre linee di piega o un altro fustellato.
|
||||
@msg A panel is not joined to the rest by a crease. Un pannello non è unito al resto da alcuna linea di cordonatura.
|
||||
@msg A fold line is on a non-printing layer. Una linea di piega si trova su un livello non stampabile.
|
||||
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Pannelli: {panels}, cerniere: {hinges}, errori: {errors}, avvisi: {warnings}
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -9449,3 +9449,23 @@ breakText Glyphs 字形
|
||||
No objects are selected. オブジェクトが選択されていません。
|
||||
Open a document to mark its fold lines. ドキュメントを開くと折り線を設定できます。
|
||||
Remove Fold Line Role 線種を解除
|
||||
Check チェック
|
||||
Check Fold Lines 折り線をチェック
|
||||
@msg No cut lines are in the selection. 選択範囲にカット線がありません。
|
||||
@msg No cut lines are in the document. ドキュメントにカット線がありません。
|
||||
@msg The cut lines do not enclose an area. カット線が領域を囲んでいません。
|
||||
@msg A cut line ends without meeting another cut line. カット線が他のカット線と接しないまま終わっています。
|
||||
@msg A gap between cut lines was closed. カット線間の隙間を閉じました。
|
||||
@msg The fold lines are too complex to check. 折り線が複雑すぎるためチェックできません。
|
||||
@msg A cut line and a crease lie on top of each other. カット線と筋入れ線が重なっています。
|
||||
@msg No cut lines are among the given objects. 指定したオブジェクトにカット線がありません。
|
||||
@msg Two fold lines lie on top of each other. 折り線が 2 本重なっています。
|
||||
@msg A crease ends inside a panel. 筋入れ線がパネルの内側で終わっています。
|
||||
@msg A crease does not divide two panels. 筋入れ線が 2 つのパネルを分けていません。
|
||||
@msg A crease lies outside the cut outline, wholly or in part. 筋入れ線の全体または一部がカットの輪郭の外側にあります。
|
||||
@msg The pieces of a hinge are not on one straight line. ヒンジの各部分が 1 本の直線上にありません。
|
||||
@msg A gap between cut lines is too narrow to tell apart. カット線間の隙間が狭すぎて区別できません。
|
||||
@msg A cut-out area holds other fold lines or another blank. 切り抜かれた領域に他の折り線または別の展開図があります。
|
||||
@msg A panel is not joined to the rest by a crease. パネルがどの筋入れ線でも他とつながっていません。
|
||||
@msg A fold line is on a non-printing layer. 折り線が印刷しないレイヤーにあります。
|
||||
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} パネル: {panels}、ヒンジ: {hinges}、エラー: {errors}、警告: {warnings}
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -10016,4 +10016,24 @@ font-script Japanese იაპონური
|
||||
No objects are selected. ობიექტები არ არის მონიშნული.
|
||||
Open a document to mark its fold lines. გახსენით დოკუმენტი მისი მოკეცვის ხაზების მოსანიშნად.
|
||||
Remove Fold Line Role ხაზის ტიპის მოხსნა
|
||||
Check შემოწმება
|
||||
Check Fold Lines მოკეცვის ხაზების შემოწმება
|
||||
@msg No cut lines are in the selection. მონიშვნაში ჭრის ხაზები არ არის.
|
||||
@msg No cut lines are in the document. დოკუმენტში ჭრის ხაზები არ არის.
|
||||
@msg The cut lines do not enclose an area. ჭრის ხაზები არცერთ არეს არ შემოფარგლავს.
|
||||
@msg A cut line ends without meeting another cut line. ჭრის ხაზი მთავრდება ისე, რომ სხვა ჭრის ხაზს არ ხვდება.
|
||||
@msg A gap between cut lines was closed. ჭრის ხაზებს შორის ღრეჩო დაიხურა.
|
||||
@msg The fold lines are too complex to check. მოკეცვის ხაზები შესამოწმებლად ზედმეტად რთულია.
|
||||
@msg A cut line and a crease lie on top of each other. ჭრის ხაზი და ბიგის ხაზი ერთმანეთზე დევს.
|
||||
@msg No cut lines are among the given objects. მითითებულ ობიექტებში ჭრის ხაზები არ არის.
|
||||
@msg Two fold lines lie on top of each other. მოკეცვის ორი ხაზი ერთმანეთზე დევს.
|
||||
@msg A crease ends inside a panel. ბიგის ხაზი პანელის შიგნით მთავრდება.
|
||||
@msg A crease does not divide two panels. ბიგის ხაზი ორ პანელს არ ყოფს.
|
||||
@msg A crease lies outside the cut outline, wholly or in part. ბიგის ხაზი მთლიანად ან ნაწილობრივ ჭრის კონტურის გარეთაა.
|
||||
@msg The pieces of a hinge are not on one straight line. ანჯამის ნაწილები ერთ სწორ ხაზზე არ დევს.
|
||||
@msg A gap between cut lines is too narrow to tell apart. ჭრის ხაზებს შორის ღრეჩო ზედმეტად ვიწროა გასარჩევად.
|
||||
@msg A cut-out area holds other fold lines or another blank. ამოჭრილი არე სხვა მოკეცვის ხაზებს ან სხვა ნამზადს შეიცავს.
|
||||
@msg A panel is not joined to the rest by a crease. პანელი დანარჩენს არცერთი ბიგის ხაზით არ უერთდება.
|
||||
@msg A fold line is on a non-printing layer. მოკეცვის ხაზი არასაბეჭდ შრეზეა.
|
||||
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} პანელები: {panels}, ანჯამები: {hinges}, შეცდომები: {errors}, გაფრთხილებები: {warnings}
|
||||
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer უნდა იყოს "singleLine", "everyLine", "standardSingleLine" ან "standardEveryLine"
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -9345,3 +9345,23 @@ breakText Glyphs 글리프
|
||||
No objects are selected. 선택한 개체가 없습니다.
|
||||
Open a document to mark its fold lines. 접는 선을 지정하려면 문서를 여세요.
|
||||
Remove Fold Line Role 선 종류 제거
|
||||
Check 검사
|
||||
Check Fold Lines 접는 선 검사
|
||||
@msg No cut lines are in the selection. 선택 영역에 재단선이 없습니다.
|
||||
@msg No cut lines are in the document. 문서에 재단선이 없습니다.
|
||||
@msg The cut lines do not enclose an area. 재단선이 영역을 둘러싸지 않습니다.
|
||||
@msg A cut line ends without meeting another cut line. 재단선이 다른 재단선과 만나지 않고 끝납니다.
|
||||
@msg A gap between cut lines was closed. 재단선 사이의 틈을 닫았습니다.
|
||||
@msg The fold lines are too complex to check. 접는 선이 너무 복잡해서 검사할 수 없습니다.
|
||||
@msg A cut line and a crease lie on top of each other. 재단선과 오시선이 겹쳐 있습니다.
|
||||
@msg No cut lines are among the given objects. 지정한 개체에 재단선이 없습니다.
|
||||
@msg Two fold lines lie on top of each other. 접는 선 두 개가 겹쳐 있습니다.
|
||||
@msg A crease ends inside a panel. 오시선이 패널 안에서 끝납니다.
|
||||
@msg A crease does not divide two panels. 오시선이 두 패널을 나누지 않습니다.
|
||||
@msg A crease lies outside the cut outline, wholly or in part. 오시선의 전체 또는 일부가 재단 윤곽선 밖에 있습니다.
|
||||
@msg The pieces of a hinge are not on one straight line. 힌지의 조각들이 한 직선 위에 있지 않습니다.
|
||||
@msg A gap between cut lines is too narrow to tell apart. 재단선 사이의 틈이 너무 좁아 구별할 수 없습니다.
|
||||
@msg A cut-out area holds other fold lines or another blank. 잘라 낸 영역에 다른 접는 선이나 다른 전개도가 있습니다.
|
||||
@msg A panel is not joined to the rest by a crease. 패널이 어떤 오시선으로도 나머지와 연결되어 있지 않습니다.
|
||||
@msg A fold line is on a non-printing layer. 접는 선이 인쇄되지 않는 레이어에 있습니다.
|
||||
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} 패널: {panels}, 힌지: {hinges}, 오류: {errors}, 경고: {warnings}
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -9783,3 +9783,23 @@ breakText Glyphs Glyphs
|
||||
No objects are selected. Er zijn geen objecten geselecteerd.
|
||||
Open a document to mark its fold lines. Open een document om de vouwlijnen te markeren.
|
||||
Remove Fold Line Role Lijnsoort verwijderen
|
||||
Check Controleren
|
||||
Check Fold Lines Vouwlijnen controleren
|
||||
@msg No cut lines are in the selection. De selectie bevat geen snijlijnen.
|
||||
@msg No cut lines are in the document. Het document bevat geen snijlijnen.
|
||||
@msg The cut lines do not enclose an area. De snijlijnen sluiten geen gebied in.
|
||||
@msg A cut line ends without meeting another cut line. Een snijlijn eindigt zonder een andere snijlijn te raken.
|
||||
@msg A gap between cut lines was closed. Een opening tussen snijlijnen is gesloten.
|
||||
@msg The fold lines are too complex to check. De vouwlijnen zijn te complex om te controleren.
|
||||
@msg A cut line and a crease lie on top of each other. Een snijlijn en een rillijn liggen over elkaar.
|
||||
@msg No cut lines are among the given objects. De opgegeven objecten bevatten geen snijlijnen.
|
||||
@msg Two fold lines lie on top of each other. Twee vouwlijnen liggen over elkaar.
|
||||
@msg A crease ends inside a panel. Een rillijn eindigt binnen een paneel.
|
||||
@msg A crease does not divide two panels. Een rillijn verdeelt geen twee panelen.
|
||||
@msg A crease lies outside the cut outline, wholly or in part. Een rillijn ligt geheel of gedeeltelijk buiten de snijcontour.
|
||||
@msg The pieces of a hinge are not on one straight line. De delen van een scharnier liggen niet op één rechte lijn.
|
||||
@msg A gap between cut lines is too narrow to tell apart. Een opening tussen snijlijnen is te smal om te onderscheiden.
|
||||
@msg A cut-out area holds other fold lines or another blank. Een uitgesneden gebied bevat andere vouwlijnen of een andere uitslag.
|
||||
@msg A panel is not joined to the rest by a crease. Een paneel is door geen rillijn met de rest verbonden.
|
||||
@msg A fold line is on a non-printing layer. Een vouwlijn staat op een laag die niet wordt afgedrukt.
|
||||
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Panelen: {panels}, scharnieren: {hinges}, fouten: {errors}, waarschuwingen: {warnings}
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -9603,3 +9603,23 @@ breakText Glyphs Glify
|
||||
No objects are selected. Nie zaznaczono żadnych obiektów.
|
||||
Open a document to mark its fold lines. Otwórz dokument, aby oznaczyć jego linie zgięcia.
|
||||
Remove Fold Line Role Usuń rodzaj linii
|
||||
Check Sprawdź
|
||||
Check Fold Lines Sprawdź linie zgięcia
|
||||
@msg No cut lines are in the selection. W zaznaczeniu nie ma linii cięcia.
|
||||
@msg No cut lines are in the document. W dokumencie nie ma linii cięcia.
|
||||
@msg The cut lines do not enclose an area. Linie cięcia nie obejmują żadnego obszaru.
|
||||
@msg A cut line ends without meeting another cut line. Linia cięcia kończy się, nie stykając się z inną linią cięcia.
|
||||
@msg A gap between cut lines was closed. Zamknięto przerwę między liniami cięcia.
|
||||
@msg The fold lines are too complex to check. Linie zgięcia są zbyt złożone, aby je sprawdzić.
|
||||
@msg A cut line and a crease lie on top of each other. Linia cięcia i linia bigowania leżą na sobie.
|
||||
@msg No cut lines are among the given objects. Wśród podanych obiektów nie ma linii cięcia.
|
||||
@msg Two fold lines lie on top of each other. Dwie linie zgięcia leżą na sobie.
|
||||
@msg A crease ends inside a panel. Linia bigowania kończy się wewnątrz panelu.
|
||||
@msg A crease does not divide two panels. Linia bigowania nie rozdziela dwóch paneli.
|
||||
@msg A crease lies outside the cut outline, wholly or in part. Linia bigowania leży całkowicie lub częściowo poza konturem cięcia.
|
||||
@msg The pieces of a hinge are not on one straight line. Części zawiasu nie leżą na jednej linii prostej.
|
||||
@msg A gap between cut lines is too narrow to tell apart. Przerwa między liniami cięcia jest zbyt wąska, aby ją rozróżnić.
|
||||
@msg A cut-out area holds other fold lines or another blank. Wycięty obszar zawiera inne linie zgięcia lub inny wykrój.
|
||||
@msg A panel is not joined to the rest by a crease. Panel nie jest połączony z resztą żadną linią bigowania.
|
||||
@msg A fold line is on a non-printing layer. Linia zgięcia znajduje się na warstwie niedrukowanej.
|
||||
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Panele: {panels}, zawiasy: {hinges}, błędy: {errors}, ostrzeżenia: {warnings}
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -9821,3 +9821,23 @@ swatch Yellow Green Verde-amarelado
|
||||
No objects are selected. Nenhum objeto selecionado.
|
||||
Open a document to mark its fold lines. Abra um documento para marcar suas linhas de dobra.
|
||||
Remove Fold Line Role Remover Tipo de Linha
|
||||
Check Verificar
|
||||
Check Fold Lines Verificar Linhas de Dobra
|
||||
@msg No cut lines are in the selection. Não há linhas de corte na seleção.
|
||||
@msg No cut lines are in the document. Não há linhas de corte no documento.
|
||||
@msg The cut lines do not enclose an area. As linhas de corte não delimitam nenhuma área.
|
||||
@msg A cut line ends without meeting another cut line. Uma linha de corte termina sem encontrar outra linha de corte.
|
||||
@msg A gap between cut lines was closed. Uma lacuna entre linhas de corte foi fechada.
|
||||
@msg The fold lines are too complex to check. As linhas de dobra são complexas demais para verificar.
|
||||
@msg A cut line and a crease lie on top of each other. Uma linha de corte e uma de vinco estão sobrepostas.
|
||||
@msg No cut lines are among the given objects. Não há linhas de corte entre os objetos indicados.
|
||||
@msg Two fold lines lie on top of each other. Duas linhas de dobra estão sobrepostas.
|
||||
@msg A crease ends inside a panel. Uma linha de vinco termina dentro de um painel.
|
||||
@msg A crease does not divide two panels. Uma linha de vinco não divide dois painéis.
|
||||
@msg A crease lies outside the cut outline, wholly or in part. Uma linha de vinco está total ou parcialmente fora do contorno de corte.
|
||||
@msg The pieces of a hinge are not on one straight line. As partes de uma dobradiça não estão em uma única linha reta.
|
||||
@msg A gap between cut lines is too narrow to tell apart. Uma lacuna entre linhas de corte é estreita demais para ser distinguida.
|
||||
@msg A cut-out area holds other fold lines or another blank. Uma área recortada contém outras linhas de dobra ou outra planificação.
|
||||
@msg A panel is not joined to the rest by a crease. Um painel não está unido ao restante por nenhuma linha de vinco.
|
||||
@msg A fold line is on a non-printing layer. Uma linha de dobra está em uma camada não imprimível.
|
||||
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Painéis: {panels}, dobradiças: {hinges}, erros: {errors}, avisos: {warnings}
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -9842,5 +9842,25 @@ shape Open Открытый
|
||||
No objects are selected. Объекты не выделены.
|
||||
Open a document to mark its fold lines. Откройте документ, чтобы отметить его линии сгиба.
|
||||
Remove Fold Line Role Убрать тип линии
|
||||
Check Проверить
|
||||
Check Fold Lines Проверить линии сгиба
|
||||
@msg No cut lines are in the selection. В выделении нет линий реза.
|
||||
@msg No cut lines are in the document. В документе нет линий реза.
|
||||
@msg The cut lines do not enclose an area. Линии реза не ограничивают никакую область.
|
||||
@msg A cut line ends without meeting another cut line. Линия реза заканчивается, не встречая другую линию реза.
|
||||
@msg A gap between cut lines was closed. Зазор между линиями реза закрыт.
|
||||
@msg The fold lines are too complex to check. Линии сгиба слишком сложны для проверки.
|
||||
@msg A cut line and a crease lie on top of each other. Линия реза и линия биговки лежат друг на друге.
|
||||
@msg No cut lines are among the given objects. Среди указанных объектов нет линий реза.
|
||||
@msg Two fold lines lie on top of each other. Две линии сгиба лежат друг на друге.
|
||||
@msg A crease ends inside a panel. Линия биговки заканчивается внутри панели.
|
||||
@msg A crease does not divide two panels. Линия биговки не разделяет две панели.
|
||||
@msg A crease lies outside the cut outline, wholly or in part. Линия биговки целиком или частично лежит за пределами контура реза.
|
||||
@msg The pieces of a hinge are not on one straight line. Части шарнира не лежат на одной прямой.
|
||||
@msg A gap between cut lines is too narrow to tell apart. Зазор между линиями реза слишком узок, чтобы его различить.
|
||||
@msg A cut-out area holds other fold lines or another blank. Вырезанная область содержит другие линии сгиба или другую развёртку.
|
||||
@msg A panel is not joined to the rest by a crease. Панель не соединена с остальными ни одной линией биговки.
|
||||
@msg A fold line is on a non-printing layer. Линия сгиба находится на непечатаемом слое.
|
||||
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Панели: {panels}, шарниры: {hinges}, ошибки: {errors}, предупреждения: {warnings}
|
||||
@msg {w} × {h} pixels is too large for PSD (at most {MAX_SIDE} pixels a side): lower the resolution {w} × {h} пикселей — слишком большой размер для PSD (не более {MAX_SIDE} пикселей по стороне): уменьшите разрешение
|
||||
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer должен быть "singleLine", "everyLine", "standardSingleLine" или "standardEveryLine"
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -9431,4 +9431,24 @@ digits Hindi Hindi
|
||||
No objects are selected. Inga objekt är markerade.
|
||||
Open a document to mark its fold lines. Öppna ett dokument för att markera dess falslinjer.
|
||||
Remove Fold Line Role Ta bort linjetyp
|
||||
Check Kontrollera
|
||||
Check Fold Lines Kontrollera falslinjer
|
||||
@msg No cut lines are in the selection. Det finns inga skärlinjer i markeringen.
|
||||
@msg No cut lines are in the document. Det finns inga skärlinjer i dokumentet.
|
||||
@msg The cut lines do not enclose an area. Skärlinjerna omsluter inget område.
|
||||
@msg A cut line ends without meeting another cut line. En skärlinje slutar utan att möta en annan skärlinje.
|
||||
@msg A gap between cut lines was closed. Ett mellanrum mellan skärlinjer stängdes.
|
||||
@msg The fold lines are too complex to check. Falslinjerna är för komplexa för att kontrollera.
|
||||
@msg A cut line and a crease lie on top of each other. En skärlinje och en biglinje ligger ovanpå varandra.
|
||||
@msg No cut lines are among the given objects. Det finns inga skärlinjer bland de angivna objekten.
|
||||
@msg Two fold lines lie on top of each other. Två falslinjer ligger ovanpå varandra.
|
||||
@msg A crease ends inside a panel. En biglinje slutar inuti en panel.
|
||||
@msg A crease does not divide two panels. En biglinje delar inte två paneler.
|
||||
@msg A crease lies outside the cut outline, wholly or in part. En biglinje ligger helt eller delvis utanför skärkonturen.
|
||||
@msg The pieces of a hinge are not on one straight line. Delarna av ett gångjärn ligger inte på en rak linje.
|
||||
@msg A gap between cut lines is too narrow to tell apart. Ett mellanrum mellan skärlinjer är för smalt för att skilja ut.
|
||||
@msg A cut-out area holds other fold lines or another blank. Ett utskuret område innehåller andra falslinjer eller ett annat ämne.
|
||||
@msg A panel is not joined to the rest by a crease. En panel är inte förbunden med resten av någon biglinje.
|
||||
@msg A fold line is on a non-printing layer. En falslinje ligger på ett lager som inte skrivs ut.
|
||||
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Paneler: {panels}, gångjärn: {hinges}, fel: {errors}, varningar: {warnings}
|
||||
@msg {w} × {h} pixels is too large for PSD (at most {MAX_SIDE} pixels a side): lower the resolution {w} × {h} pixlar är för stort för PSD (högst {MAX_SIDE} pixlar per sida): sänk upplösningen
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -9704,3 +9704,23 @@ breakText Glyphs Glifler
|
||||
No objects are selected. Hiçbir nesne seçili değil.
|
||||
Open a document to mark its fold lines. Katlama çizgilerini işaretlemek için bir belgeyi açın.
|
||||
Remove Fold Line Role Çizgi Türünü Kaldır
|
||||
Check Denetle
|
||||
Check Fold Lines Katlama Çizgilerini Denetle
|
||||
@msg No cut lines are in the selection. Seçimde kesim çizgisi yok.
|
||||
@msg No cut lines are in the document. Belgede kesim çizgisi yok.
|
||||
@msg The cut lines do not enclose an area. Kesim çizgileri bir alanı çevrelemiyor.
|
||||
@msg A cut line ends without meeting another cut line. Bir kesim çizgisi başka bir kesim çizgisiyle buluşmadan bitiyor.
|
||||
@msg A gap between cut lines was closed. Kesim çizgileri arasındaki bir boşluk kapatıldı.
|
||||
@msg The fold lines are too complex to check. Katlama çizgileri denetlenemeyecek kadar karmaşık.
|
||||
@msg A cut line and a crease lie on top of each other. Bir kesim çizgisi ile bir pilyaj çizgisi üst üste.
|
||||
@msg No cut lines are among the given objects. Belirtilen nesneler arasında kesim çizgisi yok.
|
||||
@msg Two fold lines lie on top of each other. İki katlama çizgisi üst üste.
|
||||
@msg A crease ends inside a panel. Bir pilyaj çizgisi bir panelin içinde bitiyor.
|
||||
@msg A crease does not divide two panels. Bir pilyaj çizgisi iki paneli ayırmıyor.
|
||||
@msg A crease lies outside the cut outline, wholly or in part. Bir pilyaj çizgisi tamamen veya kısmen kesim konturunun dışında.
|
||||
@msg The pieces of a hinge are not on one straight line. Bir menteşenin parçaları tek bir düz çizgi üzerinde değil.
|
||||
@msg A gap between cut lines is too narrow to tell apart. Kesim çizgileri arasındaki bir boşluk ayırt edilemeyecek kadar dar.
|
||||
@msg A cut-out area holds other fold lines or another blank. Kesilip çıkarılmış bir alan başka katlama çizgileri veya başka bir açınım içeriyor.
|
||||
@msg A panel is not joined to the rest by a crease. Bir panel geri kalanlara hiçbir pilyaj çizgisiyle bağlı değil.
|
||||
@msg A fold line is on a non-printing layer. Bir katlama çizgisi yazdırılmayan bir katmanda.
|
||||
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Paneller: {panels}, menteşeler: {hinges}, hatalar: {errors}, uyarılar: {warnings}
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -9357,3 +9357,23 @@ breakText Glyphs Гліфи
|
||||
No objects are selected. Об’єкти не виділено.
|
||||
Open a document to mark its fold lines. Відкрийте документ, щоб позначити його лінії згину.
|
||||
Remove Fold Line Role Прибрати тип лінії
|
||||
Check Перевірити
|
||||
Check Fold Lines Перевірити лінії згину
|
||||
@msg No cut lines are in the selection. У виділенні немає ліній різу.
|
||||
@msg No cut lines are in the document. У документі немає ліній різу.
|
||||
@msg The cut lines do not enclose an area. Лінії різу не обмежують жодної області.
|
||||
@msg A cut line ends without meeting another cut line. Лінія різу закінчується, не зустрівши іншої лінії різу.
|
||||
@msg A gap between cut lines was closed. Зазор між лініями різу закрито.
|
||||
@msg The fold lines are too complex to check. Лінії згину надто складні для перевірки.
|
||||
@msg A cut line and a crease lie on top of each other. Лінія різу та лінія біговки лежать одна на одній.
|
||||
@msg No cut lines are among the given objects. Серед указаних об’єктів немає ліній різу.
|
||||
@msg Two fold lines lie on top of each other. Дві лінії згину лежать одна на одній.
|
||||
@msg A crease ends inside a panel. Лінія біговки закінчується всередині панелі.
|
||||
@msg A crease does not divide two panels. Лінія біговки не розділяє двох панелей.
|
||||
@msg A crease lies outside the cut outline, wholly or in part. Лінія біговки повністю або частково лежить поза контуром різу.
|
||||
@msg The pieces of a hinge are not on one straight line. Частини шарніра не лежать на одній прямій.
|
||||
@msg A gap between cut lines is too narrow to tell apart. Зазор між лініями різу надто вузький, щоб його розрізнити.
|
||||
@msg A cut-out area holds other fold lines or another blank. Вирізана область містить інші лінії згину або іншу розгортку.
|
||||
@msg A panel is not joined to the rest by a crease. Панель не з’єднана з рештою жодною лінією біговки.
|
||||
@msg A fold line is on a non-printing layer. Лінія згину лежить на шарі, що не друкується.
|
||||
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Панелі: {panels}, шарніри: {hinges}, помилки: {errors}, попередження: {warnings}
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7467,6 +7467,26 @@ breakText Glyphs Glyph
|
||||
No objects are selected. Không có đối tượng nào được chọn.
|
||||
Open a document to mark its fold lines. Mở tài liệu để đánh dấu các đường gấp của nó.
|
||||
Remove Fold Line Role Bỏ loại đường
|
||||
Check Kiểm tra
|
||||
Check Fold Lines Kiểm tra đường gấp
|
||||
@msg No cut lines are in the selection. Vùng chọn không có đường cắt nào.
|
||||
@msg No cut lines are in the document. Tài liệu không có đường cắt nào.
|
||||
@msg The cut lines do not enclose an area. Các đường cắt không bao quanh vùng nào.
|
||||
@msg A cut line ends without meeting another cut line. Một đường cắt kết thúc mà không gặp đường cắt khác.
|
||||
@msg A gap between cut lines was closed. Đã đóng một khe hở giữa các đường cắt.
|
||||
@msg The fold lines are too complex to check. Các đường gấp quá phức tạp để kiểm tra.
|
||||
@msg A cut line and a crease lie on top of each other. Một đường cắt và một đường cấn nằm chồng lên nhau.
|
||||
@msg No cut lines are among the given objects. Các đối tượng đã chỉ định không có đường cắt nào.
|
||||
@msg Two fold lines lie on top of each other. Hai đường gấp nằm chồng lên nhau.
|
||||
@msg A crease ends inside a panel. Một đường cấn kết thúc bên trong một mặt.
|
||||
@msg A crease does not divide two panels. Một đường cấn không chia tách hai mặt.
|
||||
@msg A crease lies outside the cut outline, wholly or in part. Một đường cấn nằm hoàn toàn hoặc một phần ngoài đường viền cắt.
|
||||
@msg The pieces of a hinge are not on one straight line. Các đoạn của một bản lề không nằm trên một đường thẳng.
|
||||
@msg A gap between cut lines is too narrow to tell apart. Khe hở giữa các đường cắt quá hẹp để phân biệt.
|
||||
@msg A cut-out area holds other fold lines or another blank. Một vùng bị cắt bỏ chứa các đường gấp khác hoặc một khuôn trải khác.
|
||||
@msg A panel is not joined to the rest by a crease. Một mặt không được nối với phần còn lại bằng đường cấn nào.
|
||||
@msg A fold line is on a non-printing layer. Một đường gấp nằm trên lớp không in.
|
||||
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Mặt: {panels}, bản lề: {hinges}, lỗi: {errors}, cảnh báo: {warnings}
|
||||
|
||||
# Messages of the effects, 3D, image export, color profiles, swatch exchange files, color books and DXF import.
|
||||
@msg 3D effects require finite coordinates within 100 million points Hiệu ứng 3D yêu cầu tọa độ hữu hạn trong phạm vi 100 triệu điểm
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 205 and column 5.
|
@@ -9588,4 +9588,24 @@ breakText Glyphs 字形
|
||||
No objects are selected. 未选择任何对象。
|
||||
Open a document to mark its fold lines. 打开文档以标记其折线。
|
||||
Remove Fold Line Role 移除线条类型
|
||||
Check 检查
|
||||
Check Fold Lines 检查折线
|
||||
@msg No cut lines are in the selection. 所选内容中没有切割线。
|
||||
@msg No cut lines are in the document. 文档中没有切割线。
|
||||
@msg The cut lines do not enclose an area. 切割线未围成任何区域。
|
||||
@msg A cut line ends without meeting another cut line. 一条切割线未与其他切割线相接就结束了。
|
||||
@msg A gap between cut lines was closed. 已闭合切割线之间的间隙。
|
||||
@msg The fold lines are too complex to check. 折线过于复杂,无法检查。
|
||||
@msg A cut line and a crease lie on top of each other. 一条切割线与一条压痕线重叠。
|
||||
@msg No cut lines are among the given objects. 指定的对象中没有切割线。
|
||||
@msg Two fold lines lie on top of each other. 两条折线重叠。
|
||||
@msg A crease ends inside a panel. 一条压痕线在面板内部结束。
|
||||
@msg A crease does not divide two panels. 一条压痕线没有分隔两个面板。
|
||||
@msg A crease lies outside the cut outline, wholly or in part. 一条压痕线全部或部分位于切割轮廓之外。
|
||||
@msg The pieces of a hinge are not on one straight line. 铰链的各段不在一条直线上。
|
||||
@msg A gap between cut lines is too narrow to tell apart. 切割线之间的间隙太窄,无法区分。
|
||||
@msg A cut-out area holds other fold lines or another blank. 一个镂空区域包含其他折线或另一个展开图。
|
||||
@msg A panel is not joined to the rest by a crease. 一个面板没有通过任何压痕线与其余部分相连。
|
||||
@msg A fold line is on a non-printing layer. 一条折线位于不打印的图层上。
|
||||
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} 面板:{panels},铰链:{hinges},错误:{errors},警告:{warnings}
|
||||
@msg {w} × {h} pixels is too large for PSD (at most {MAX_SIDE} pixels a side): lower the resolution {w} × {h} 像素对 PSD 而言过大 (每边最多 {MAX_SIDE} 像素):请降低分辨率
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -9398,4 +9398,24 @@ breakText Glyphs 字符
|
||||
No objects are selected. 未選取任何物件。
|
||||
Open a document to mark its fold lines. 開啟文件以標記其摺線。
|
||||
Remove Fold Line Role 移除線條類型
|
||||
Check 檢查
|
||||
Check Fold Lines 檢查摺線
|
||||
@msg No cut lines are in the selection. 選取範圍中沒有切割線。
|
||||
@msg No cut lines are in the document. 文件中沒有切割線。
|
||||
@msg The cut lines do not enclose an area. 切割線未圍成任何區域。
|
||||
@msg A cut line ends without meeting another cut line. 一條切割線未與其他切割線相接就結束了。
|
||||
@msg A gap between cut lines was closed. 已封閉切割線之間的間隙。
|
||||
@msg The fold lines are too complex to check. 摺線過於複雜,無法檢查。
|
||||
@msg A cut line and a crease lie on top of each other. 一條切割線與一條壓痕線重疊。
|
||||
@msg No cut lines are among the given objects. 指定的物件中沒有切割線。
|
||||
@msg Two fold lines lie on top of each other. 兩條摺線重疊。
|
||||
@msg A crease ends inside a panel. 一條壓痕線在面板內部結束。
|
||||
@msg A crease does not divide two panels. 一條壓痕線沒有分隔兩個面板。
|
||||
@msg A crease lies outside the cut outline, wholly or in part. 一條壓痕線全部或部分位於切割輪廓之外。
|
||||
@msg The pieces of a hinge are not on one straight line. 鉸鏈的各段不在一條直線上。
|
||||
@msg A gap between cut lines is too narrow to tell apart. 切割線之間的間隙太窄,無法區分。
|
||||
@msg A cut-out area holds other fold lines or another blank. 一個鏤空區域包含其他摺線或另一個展開圖。
|
||||
@msg A panel is not joined to the rest by a crease. 一個面板沒有透過任何壓痕線與其餘部分相連。
|
||||
@msg A fold line is on a non-printing layer. 一條摺線位於不列印的圖層上。
|
||||
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} 面板:{panels},鉸鏈:{hinges},錯誤:{errors},警告:{warnings}
|
||||
@msg {what} would print on more than {MAX_TILES} tiles: scale it down {what} 會列印在超過 {MAX_TILES} 個拼貼上:請縮小
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -195,6 +195,11 @@ pub fn invoke(app: &mut VectorcraftApp, id: &str, p: Value) {
|
||||
}
|
||||
return;
|
||||
}
|
||||
// Check Fold Lines shows its summary and lists its issues in the Fold Lines panel.
|
||||
if id == crate::addons::packaging::CHECK {
|
||||
crate::addons::packaging::check(app, p);
|
||||
return;
|
||||
}
|
||||
// A Paste the user gives decodes a bitmap off the UI thread ([`crate::placing::adopt_for_paste`]).
|
||||
app.placing.for_user = id.starts_with("edit.paste");
|
||||
let r = app.run(id, p);
|
||||
|
||||
+53
-3
@@ -13065,9 +13065,10 @@ there is no step. → `{symbols: [name…], ids: [instance id…], skipped: [{la
|
||||
## Packaging Tools add-on
|
||||
|
||||
Packaging Tools is a built-in add-on for the dielines of boxes and other folded packaging. Its commands are
|
||||
`addon.packaging.setRole`, `addon.packaging.roles` and `addon.packaging.setRoleSwatch`. In the desktop app, Object ›
|
||||
Plug-ins › Packaging Tools › Fold Lines opens the Fold Lines panel, and Make Cut Line, Make Crease Line, Make Partial Cut
|
||||
Line and Make Perforation Line run `addon.packaging.setRole` on the selection.
|
||||
`addon.packaging.setRole`, `addon.packaging.roles`, `addon.packaging.setRoleSwatch` and `addon.packaging.check`. In the
|
||||
desktop app, Object › Plug-ins › Packaging Tools › Fold Lines opens the Fold Lines panel, Make Cut Line, Make Crease Line,
|
||||
Make Partial Cut Line and Make Perforation Line run `addon.packaging.setRole` on the selection, and Check Fold Lines runs
|
||||
`addon.packaging.check`.
|
||||
|
||||
### Fold line roles
|
||||
|
||||
@@ -13114,6 +13115,55 @@ panel's menu opens it as Role Swatches….
|
||||
{"name":"run_command","arguments":{"command":"addon.packaging.setRole","params":{"role":"crease"}}}
|
||||
```
|
||||
|
||||
### Check Fold Lines
|
||||
|
||||
`addon.packaging.check` (`{ids?, select?: false, tolerance?: 0.1}`) finds the blanks, panels and hinges that the fold
|
||||
lines make and lists what is wrong with them. It checks the fold lines among the objects (the selection by default),
|
||||
through groups and clip groups, or every fold line of the document while nothing is selected and `ids` is left out.
|
||||
Hidden lines are left out in every case, also inside a selected group. `tolerance` is in points, from 0.01 to 10; a value outside that range, or one that is not a number or a length
|
||||
such as `"2 mm"`, is an error. The command does not change the document and records no undo step.
|
||||
|
||||
- Cut lines bound the material. Each connected piece of cut lines that encloses material is one blank. Its outline is its
|
||||
largest closed cut line, and a closed cut line inside the outline is a hole, so a slot drawn as a rectangle across the
|
||||
outline leaves the same material as a notch drawn in it. Open cut lines that meet end to end count as one closed cut
|
||||
line, so an outline or a slot drawn as several open cut lines works as well.
|
||||
- Crease, Partial Cut and Perforation lines divide a blank into panels. The pieces of them that lie between the same two
|
||||
panels form one hinge.
|
||||
- The end of a cut line that comes within `tolerance` of another cut line is joined to it with a short line, and the
|
||||
check reports the gap.
|
||||
|
||||
The issues come in this order. `noCut`, `open`, `looseEnd`, `tooComplex` and `cutOverCrease` are errors; the others are
|
||||
warnings.
|
||||
|
||||
| Code | Reported when |
|
||||
|---|---|
|
||||
| `noCut` | No cut line is among the objects. The message names the selection, the objects `ids` gives, or the document. |
|
||||
| `open` | The cut lines enclose no area. |
|
||||
| `looseEnd` | An end of a cut line meets no other fold line within `tolerance`, and no gap is closed at it. `at` is the end. |
|
||||
| `gap` | An end of a cut line lies within `tolerance` of another cut line without touching it; the panels are built with the gap closed. `at` is the end. |
|
||||
| `tooComplex` | The lines have more than 65,536 segments, or a blank has more than 256 panels. |
|
||||
| `cutOverCrease` | A cut line and a crease, partial cut or perforation lie on top of each other. |
|
||||
| `duplicate` | Two cut lines, two crease, partial cut or perforation lines (of the same role or not), or two subpaths of one line, lie on top of each other. |
|
||||
| `danglingCrease` | A crease ends inside a panel. |
|
||||
| `noSplit` | A crease divides no two panels. |
|
||||
| `outside` | A crease lies outside every blank, or runs outside it for `tolerance` or more. |
|
||||
| `notStraight` | The pieces of a hinge are not on one straight line within `tolerance`. |
|
||||
| `sliver` | A gap between lines inside a blank is narrower than 0.01 pt. |
|
||||
| `ambiguous` | A hole holds creases, or a blank lies inside another blank's hole. |
|
||||
| `loosePanel` | A panel is joined to its blank's largest panel by no chain of hinges. |
|
||||
| `nonPrinting` | A fold line is on a layer that does not print. |
|
||||
|
||||
Result: `{ok, blanks, panels, hinges, holes, issues: [{severity, code, message, ids, at?}], scope}`. `ok` is true when
|
||||
no issue is an error. `message` is in English, and the Fold Lines panel shows it in the interface language. `ids` names
|
||||
the objects each issue is about. With `select: true`, those objects become the selection; when no issue names an
|
||||
object, the selection stays as it is. The Fold Lines panel's Check button runs the same check, shows a summary line
|
||||
(panels, hinges, errors and warnings) and lists the issues; clicking an issue or its Select button selects its objects.
|
||||
The list is shown until the document changes.
|
||||
|
||||
```json
|
||||
{"name":"run_command","arguments":{"command":"addon.packaging.check","params":{"tolerance":0.5,"select":true}}}
|
||||
```
|
||||
|
||||
## Image Tools add-on
|
||||
|
||||
Image Tools is a built-in add-on for placed images: its commands are `addon.image.removeBackground`,
|
||||
|
||||
Reference in New Issue
Block a user