mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-17 10:46:46 +00:00
Object › Plug-ins › Packaging Tools › Check Fold Lines, and the Fold Lines panel's Check button, check the fold lines of the selection, or of the document while nothing is selected (`addon.packaging.check`). - Cut lines bound the material: each connected piece that encloses an area is one blank, its largest closed cut line is the outline, and a closed cut line inside it is a hole. A slot drawn as a rectangle across the outline leaves the same material as a notch drawn in it, and an outline drawn as several open cut lines works too. - Creases, partial cuts and perforations divide a blank into panels; the pieces between the same two panels form one hinge. - 15 issue codes, errors and warnings, each naming its lines; cut line ends within a tolerance (0.1 pt, 0.01 to 10) are joined and reported as a gap. With `select`, the lines the issues name are selected. - The panel lists the issues in the interface language, with a summary line; clicking an issue or its Select button selects its lines. The list is kept until the document changes. `vectorcraft_pathops::adjacency` maps paths as live_paint does and keeps, for each edge, every input it lies on and the faces on both sides; the blank model is `vectorcraft_three_d::fold::blanks`. The engine now depends on vectorcraft-three-d directly. Docs: docs/mcp.md (Check Fold Lines), crates/pathops/README.md, ROADMAP.
50 lines
2.2 KiB
Rust
50 lines
2.2 KiB
Rust
//! VectorCraft path operations: booleans (Pathfinder), shape builder regions, offset, outline stroke,
|
|
//! simplify and the other Object → Path commands.
|
|
//!
|
|
//! Booleans are curve-preserving: `linesweeper`'s robust sweep-line works directly on cubic
|
|
//! Béziers, and the pieces it splits curves into are refitted afterwards so results carry few
|
|
//! anchors. See the crate README for the API overview.
|
|
#![forbid(unsafe_code)]
|
|
|
|
pub mod addons;
|
|
mod boolean;
|
|
mod budget;
|
|
mod edit;
|
|
mod fit;
|
|
mod offset;
|
|
mod pathfinder;
|
|
mod planar;
|
|
mod sweep_axis;
|
|
mod trap;
|
|
|
|
pub use boolean::{
|
|
BoolOp, DEFAULT_PRECISION, area, boolean, boolean_n, normalize, try_area, try_boolean, try_boolean_n, try_normalize, try_unite_all,
|
|
try_unite_all_with, unite_all, unite_all_with,
|
|
};
|
|
pub use edit::{
|
|
AverageAxis, SIMPLIFY_LEVEL, SMOOTH_AUTO_LEVEL, SimplifiedPart, SimplifyOptions, add_anchor_points, auto_simplify_level, average, join,
|
|
remove_anchor, remove_anchors, remove_redundant_points, simplify, simplify_level_tolerance, simplify_part, simplify_with, smooth, smooth_level,
|
|
smooth_options, split_into_grid,
|
|
};
|
|
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::{
|
|
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};
|
|
|
|
/// Errors from fallible operations.
|
|
#[derive(Clone, Copy, Debug, PartialEq, Eq, thiserror::Error)]
|
|
pub enum PathOpsError {
|
|
#[error("input contains NaN or infinite coordinates")]
|
|
NonFinite,
|
|
#[error("input path could not be closed")]
|
|
OpenPath,
|
|
#[error("the shapes are too degenerate to combine")]
|
|
Degenerate,
|
|
#[error("the shapes cross themselves and each other too often to combine")]
|
|
TooComplex,
|
|
}
|