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: boolMerge 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: f64The 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: boolRecognize curved regions as cylinders, cones, spheres and tori, at
the coplanar distance. Needs merge_coplanar.
crease: f64The 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: boolKeep 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: boolAfter 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: boolAfter 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
impl Clone for MeshSolidOptions
impl Copy for MeshSolidOptions
Source§impl Debug for MeshSolidOptions
impl Debug for MeshSolidOptions
Source§impl Default for MeshSolidOptions
impl Default for MeshSolidOptions
Source§impl PartialEq for MeshSolidOptions
impl PartialEq for MeshSolidOptions
impl StructuralPartialEq for MeshSolidOptions
Auto Trait Implementations§
impl Freeze for MeshSolidOptions
impl RefUnwindSafe for MeshSolidOptions
impl Send for MeshSolidOptions
impl Sync for MeshSolidOptions
impl Unpin for MeshSolidOptions
impl UnsafeUnpin for MeshSolidOptions
impl UnwindSafe for MeshSolidOptions
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> Scalar for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.