Skip to main content

Tree

Struct Tree 

Source
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

Source

pub fn from_tmd_str(input: &str) -> Result<Self>

Parse a TreeMaker v3, v4, or v5 document from its ASCII stream format.

Source

pub fn to_tmd5_string(&self) -> String

Serialize this tree to canonical TreeMaker v5 text.

Source

pub fn export_v4_string(&self) -> String

Export this tree to TreeMaker v4 text for compatibility.

Source

pub fn summary(&self) -> TreeSummary

Return a stable structural and status summary.

Source

pub fn is_feasible(&self) -> bool

Return the current feasibility flag.

Source

pub fn cp_status(&self) -> CPStatus

Return the current high-level crease-pattern status.

Source

pub fn cp_status_report(&self) -> CPStatusReport

Return crease-pattern status plus bad part IDs where TreeMaker reports them.

Source

pub fn optimize_scale(&mut self) -> Result<OptimizationReport>

Run TreeMaker’s ALM scale optimizer.

Source

pub fn optimize_edges(&mut self) -> Result<OptimizationReport>

Run TreeMaker’s ALM edge-strain maximization optimizer.

Source

pub fn optimize_strain(&mut self) -> Result<OptimizationReport>

Run TreeMaker’s ALM strain minimization optimizer.

Source

pub fn build_tree_polys(&mut self) -> Result<()>

Build TreeMaker polygons without building full crease-pattern contents.

Source

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 Clone for Tree

Source§

fn clone(&self) -> Tree

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Tree

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Tree

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for Tree

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. 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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,