Skip to main content

MeshSolidOptions

Struct MeshSolidOptions 

Source
pub struct MeshSolidOptions {
    pub merge_coplanar: bool,
    pub coplanar_angle: f64,
    pub coplanar_distance: Option<f64>,
    pub quantum: Option<f64>,
    pub weld: Option<f64>,
    pub recognize: bool,
    pub crease: f64,
    pub keep_vertices: bool,
    pub sweeps: bool,
    pub patches: bool,
}
Expand description

How solid_from_mesh builds.

Fields§

§merge_coplanar: bool

Merge adjacent coplanar triangles into one planar face, and collinear boundary segments into one edge. Without it every triangle is a face and every mesh edge an edge.

§coplanar_angle: f64

The angle, in radians, below which two triangles’ normals count as parallel for merging.

§coplanar_distance: Option<f64>

How far a triangle’s corner may sit off a face’s plane, or a merged edge’s intermediate vertex off its line, and still be merged. None takes the largest of twice the mesh’s quantum, a millionth of its bounding box’s diagonal, one and a half times how far its vertices stand off the flat faces they lie on (measured across nearly coplanar edges), and the weld distance. With recognize, a distance given below two and a half times that scatter (or twice the quantum) is raised to it, and the report says so: no surface fitted to the vertices holds them closer. The vertices and edges of a merged face widen their tolerances to cover what they stand off it.

§quantum: Option<f64>

How far the mesh’s own encoding may have moved a vertex: the rounding of its coordinates (see single_precision_quantum for a mesh held in f32, and the STL reader’s for a file). A vertex that far off its surface is on it; None knows nothing of the encoding.

§weld: Option<f64>

Vertices closer than this are welded into one before building; an STL repeats every vertex once per triangle that uses it. None is the confusion tolerance.

§recognize: bool

Recognize curved regions as cylinders, cones, spheres and tori, at the coplanar distance. Needs merge_coplanar.

§crease: f64

The angle, in radians, from which a turn between two triangles is a crease (an edge of the model) rather than the surface curving on: thirty degrees by default. A mesh drawn coarser than this round a curve reads as facets.

§keep_vertices: bool

Keep every mesh vertex a vertex of the solid: collinear boundary segments stay edges of their own. A solid built without recognition to be refined later (refine_solid) keeps the samples that recognition reads, where merged edges along a curved stretch’s facets would have dropped all but their ends.

§sweeps: bool

After the canonical surfaces, rebuild a smooth region none of them fits as an extrusion of a fitted profile (its normals all square to one direction) or a surface of revolution (its normals all meeting one axis), verified at every vertex. Needs recognize.

§patches: bool

After the sweeps, rebuild a smooth region nothing else fits as one fitted B-spline patch, where the region is one disk bounded by one loop and the patch verifies: every vertex within the coplanar distance of it, every triangle’s interior within that and its own sag, both ways, and the patch’s normal regular and agreeing with every triangle’s. Its chart is a nearly fitting canonical surface’s where one fits within ten times the distance, and otherwise the mean-value map of the region onto a square. Curved regions the smooth area encloses (meeting nothing outside it except across creases), as a fine mesh of a free-form surface is cut into, are tried with the smooth regions they join as one region first, and kept apart where that patch does not verify. A region that is not a disk, is too narrow to hold a patch across it, or whose patch does not verify stays faceted and is counted (MeshSolidReport::patches_not_disk, MeshSolidReport::patches_narrow, MeshSolidReport::patches_unverified). A patch whose seams cannot be built falls back to facets as any recognized face does. Needs recognize.

Trait Implementations§

Source§

impl Clone for MeshSolidOptions

Source§

fn clone(&self) -> Self

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 Copy for MeshSolidOptions

Source§

impl Debug for MeshSolidOptions

Source§

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

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

impl Default for MeshSolidOptions

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for MeshSolidOptions

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for MeshSolidOptions

Auto Trait Implementations§

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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,

§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
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 = !

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

fn try_from(value: U) -> Result<T, !>

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.