Skip to main content

Crate treemaker_core

Crate treemaker_core 

Source
Expand description

Headless TreeMaker 5.0.1 model engine.

treemaker-core is a Rust port of the model-only TreeMaker engine: stream I/O, tree/path feasibility, ALM optimization, polygon construction, crease pattern construction, and CP diagnostics. It does not include GUI, wxWidgets, printing, menus, or proprietary optimizer backends.

The primary entry point is Tree.

use treemaker_core::Tree;

let text = std::fs::read_to_string("model.tmd5")?;
let mut tree = Tree::from_tmd_str(&text)?;

let summary = tree.summary();
println!("nodes={}, paths={}", summary.nodes, summary.paths);

tree.optimize_scale()?;
tree.build_polys_and_crease_pattern()?;

std::fs::write("out.tmd5", tree.to_tmd5_string())?;

Numeric optimization parity is tolerance-based. The behavioral baseline is TreeMaker 5.0.1 with the distributable ALM backend.

Structs§

CPStatusReport
Detailed crease-pattern status report with offending part IDs when available.
Condition
TreeMaker condition wrapper.
Crease
Crease-pattern crease.
Edge
TreeMaker edge record.
Facet
Crease-pattern facet.
Node
TreeMaker node record.
OptimizationReport
Report returned by optimization operations.
Path
TreeMaker path record between a pair of nodes.
Point
Two-dimensional point in paper coordinates.
Poly
Polygon or subpolygon generated during crease-pattern construction.
Tree
Complete TreeMaker model state.
TreeSummary
Stable summary of a Tree suitable for CLI/wasm output and regression tests.
Vertex
Crease-pattern vertex.

Enums§

CPStatus
High-level crease-pattern status, matching TreeMaker’s GetCPStatus().
ConditionKind
Supported TreeMaker condition variants.
OptimizationKind
Optimizer kind used for an OptimizationReport.
OwnerRef
Owner reference using TreeMaker’s 1-based external indices.
TreeError
Structured error returned by parsing, validation, optimization, and build operations.

Type Aliases§

Result
Crate-local result type.
TmFloat
Floating-point type used by TreeMaker geometry and optimization.