pub struct Tree {Show 26 fields
pub source_version: String,
pub paper_width: TmFloat,
pub paper_height: TmFloat,
pub scale: TmFloat,
pub has_symmetry: bool,
pub sym_loc: Point,
pub sym_angle: TmFloat,
pub is_feasible: bool,
pub is_polygon_valid: bool,
pub is_polygon_filled: bool,
pub is_vertex_depth_valid: bool,
pub is_facet_data_valid: bool,
pub is_local_root_connectable: bool,
pub needs_cleanup: bool,
pub nodes: Vec<Node>,
pub edges: Vec<Edge>,
pub paths: Vec<Path>,
pub polys: Vec<Poly>,
pub vertices: Vec<Vertex>,
pub creases: Vec<Crease>,
pub facets: Vec<Facet>,
pub conditions: Vec<Condition>,
pub owned_nodes: Vec<usize>,
pub owned_edges: Vec<usize>,
pub owned_paths: Vec<usize>,
pub owned_polys: Vec<usize>,
}Expand description
Complete TreeMaker model state.
Fields§
§source_version: String§paper_width: TmFloat§paper_height: TmFloat§scale: TmFloat§has_symmetry: bool§sym_loc: Point§sym_angle: TmFloat§is_feasible: bool§is_polygon_valid: bool§is_polygon_filled: bool§is_vertex_depth_valid: bool§is_facet_data_valid: bool§is_local_root_connectable: bool§needs_cleanup: bool§nodes: Vec<Node>§edges: Vec<Edge>§paths: Vec<Path>§polys: Vec<Poly>§vertices: Vec<Vertex>§creases: Vec<Crease>§facets: Vec<Facet>§conditions: Vec<Condition>§owned_nodes: Vec<usize>§owned_edges: Vec<usize>§owned_paths: Vec<usize>§owned_polys: Vec<usize>Implementations§
Source§impl Tree
impl Tree
Sourcepub fn from_tmd_str(input: &str) -> Result<Self>
pub fn from_tmd_str(input: &str) -> Result<Self>
Parse a TreeMaker v3, v4, or v5 document from its ASCII stream format.
Sourcepub fn to_tmd5_string(&self) -> String
pub fn to_tmd5_string(&self) -> String
Serialize this tree to canonical TreeMaker v5 text.
Sourcepub fn export_v4_string(&self) -> String
pub fn export_v4_string(&self) -> String
Export this tree to TreeMaker v4 text for compatibility.
Sourcepub fn summary(&self) -> TreeSummary
pub fn summary(&self) -> TreeSummary
Return a stable structural and status summary.
Sourcepub fn is_feasible(&self) -> bool
pub fn is_feasible(&self) -> bool
Return the current feasibility flag.
Sourcepub fn cp_status_report(&self) -> CPStatusReport
pub fn cp_status_report(&self) -> CPStatusReport
Return crease-pattern status plus bad part IDs where TreeMaker reports them.
Sourcepub fn optimize_scale(&mut self) -> Result<OptimizationReport>
pub fn optimize_scale(&mut self) -> Result<OptimizationReport>
Run TreeMaker’s ALM scale optimizer.
Sourcepub fn optimize_edges(&mut self) -> Result<OptimizationReport>
pub fn optimize_edges(&mut self) -> Result<OptimizationReport>
Run TreeMaker’s ALM edge-strain maximization optimizer.
Sourcepub fn optimize_strain(&mut self) -> Result<OptimizationReport>
pub fn optimize_strain(&mut self) -> Result<OptimizationReport>
Run TreeMaker’s ALM strain minimization optimizer.
Sourcepub fn build_tree_polys(&mut self) -> Result<()>
pub fn build_tree_polys(&mut self) -> Result<()>
Build TreeMaker polygons without building full crease-pattern contents.
Sourcepub fn build_polys_and_crease_pattern(&mut self) -> Result<()>
pub fn build_polys_and_crease_pattern(&mut self) -> Result<()>
Build polygons, vertices, creases, facets, facet order, color, and fold data.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Tree
impl<'de> Deserialize<'de> for Tree
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Tree
impl RefUnwindSafe for Tree
impl Send for Tree
impl Sync for Tree
impl Unpin for Tree
impl UnsafeUnpin for Tree
impl UnwindSafe for Tree
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more