mirror of
https://github.com/bherbruck/solidcraft.git
synced 2026-11-10 18:55:14 +00:00
solidcore-tess: drop the plan reports SolidCraft's mesher never writes
`PlanStats::over_tolerance` (faces a memory bound limited) and `PlanStats::edges_capped` (edges a sampling bound stopped), with their record types `OverTolerance`, `Cap`, `CappedEdge` and `EdgeCap`, came from solidcore-tess's own planner, which the move replaced. SolidCraft's mesher has no such reports, so after the move they were always empty, read as "nothing was limited" whatever happened. They are removed; nothing reads them. The other fields are written: the face counts, `lenient` and `unmeshed` by the mesher, `averaged_poles` by the pole pass, `unsampled_edges` and `kept_strict` by the per-face refusals. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+1
-1
@@ -41,7 +41,7 @@ pub use mesher::{MAX_ANGLE_BOUNDARY, plan};
|
||||
pub use par::guarded;
|
||||
pub use plan::{FacePlan, TessPlan};
|
||||
pub use pole::{AveragedPole, PoleNode, PoleRule};
|
||||
pub use stats::{Cap, CappedEdge, EdgeCap, OverTolerance, PlanStats, RefusedEdge, RefusedFace};
|
||||
pub use stats::{PlanStats, RefusedEdge, RefusedFace};
|
||||
pub use tolerance::{DISPLAY_ANGLE, MeshTolerance};
|
||||
|
||||
/// Why a body could not be planned. The messages are the ones the mesher has always reported.
|
||||
|
||||
-84
@@ -23,19 +23,10 @@ pub struct PlanStats {
|
||||
/// Edges that bound no face and could not be sampled: left out of the plan (an empty
|
||||
/// polyline), so the rest of the body is still meshed, each with why.
|
||||
pub unsampled_edges: Vec<RefusedEdge>,
|
||||
/// Faces a memory bound of the planner limited: their grid thinned below the lines their
|
||||
/// tolerance asked for, or their sag refinement stopped at the points it may add. Each is
|
||||
/// still meshed, named here with the sag its triangles reach and the bounds that limited it,
|
||||
/// so a mesh that leaves the tolerance is never so unreported.
|
||||
pub over_tolerance: Vec<OverTolerance>,
|
||||
/// Edges whose sampling at a coarser facet angle, for a face crowded with segments, failed:
|
||||
/// each keeps its nodes at the rules' own level (valid, only finer), no face is refused, and
|
||||
/// the edge is named here with the coarser sampling's error.
|
||||
pub kept_strict: Vec<RefusedEdge>,
|
||||
/// Edges whose sampling stopped at a bound ([`EdgeCap`]) with a segment still wanting a
|
||||
/// split: their chords may lie off them by more than the tolerance (no refinement follows an
|
||||
/// edge's sampling), each named with the bound and how far its chords lie off.
|
||||
pub edges_capped: Vec<CappedEdge>,
|
||||
/// Poles of higher order (no normal at the point) whose limit normal the kernel refused
|
||||
/// for one of their triangles (a pole of order four or more, or another refusal): each is
|
||||
/// meshed on the planner's layout, its normal the area-weighted mean of the face's
|
||||
@@ -45,81 +36,6 @@ pub struct PlanStats {
|
||||
pub averaged_poles: Vec<crate::AveragedPole>,
|
||||
}
|
||||
|
||||
/// An edge a bound of its sampling stopped (see [`PlanStats::edges_capped`]).
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
pub struct CappedEdge {
|
||||
/// The edge's index in the record.
|
||||
pub edge: usize,
|
||||
/// The bound: [`EdgeCap::Nodes`] where both were met.
|
||||
pub cap: EdgeCap,
|
||||
/// The farthest any of the edge's chords lies from its curve (mm), at their quarter points
|
||||
/// and middles (a sampled lower bound: exact where a chord's farthest point is its middle,
|
||||
/// as on a circle; below it at a corner between them). The segments exceeding their rules
|
||||
/// most are halved first, so at the node bound it is spread along the edge. A line's
|
||||
/// chords lie on it: 0.
|
||||
pub sag: f64,
|
||||
/// The most any of its chords exceeds its rules: the largest of its sag over the tolerance,
|
||||
/// its length over the side asked, its turn over a quarter turn and over the facet angle
|
||||
/// (past 1 for a rule broken; a line's, its sides' length over the side asked).
|
||||
pub excess: f64,
|
||||
/// The chord tolerance the edge was sampled to (mm).
|
||||
pub tol: f64,
|
||||
/// Whether `sag` is within `tol`: the chords follow the curve, and only a side's length or
|
||||
/// turn is past its rule (as at a corner the facet angle never settles at, or a line).
|
||||
pub within: bool,
|
||||
}
|
||||
|
||||
/// A bound of an edge's sampling.
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||
pub enum EdgeCap {
|
||||
/// The edge has the most nodes an edge may have (`MAX_EDGE_NODES`, 20 000): for a line,
|
||||
/// its sides are longer than the side asked.
|
||||
Nodes,
|
||||
/// A segment was halved as often as one may be (24 times).
|
||||
Depth,
|
||||
}
|
||||
|
||||
/// A face a memory bound limited (see [`PlanStats::over_tolerance`]).
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
pub struct OverTolerance {
|
||||
/// The face's index in the record.
|
||||
pub face: usize,
|
||||
/// The farthest its triangles lie from its surface (mm), measured as the sag refinement
|
||||
/// measures them: at each triangle's middle and its sides' middles, along the surface's
|
||||
/// normal there, wherever the surface evaluates.
|
||||
pub sag: f64,
|
||||
/// The measurements `sag` could not make (one per middle per triangle, so a side shared by
|
||||
/// two triangles counts twice): the surface has no point there.
|
||||
pub unmeasured: usize,
|
||||
/// The chord tolerance the face was planned to (mm).
|
||||
pub tol: f64,
|
||||
/// Whether every middle was measured and `sag` is within `tol` after all: the refinement
|
||||
/// made up what a thinned grid left (for [`Cap::Refine`], which stops with a side still
|
||||
/// over, normally not, unless a flip after the refinement laid that side down).
|
||||
pub within: bool,
|
||||
/// The bounds that limited it, one or both.
|
||||
pub caps: Vec<Cap>,
|
||||
}
|
||||
|
||||
/// A memory bound of the planner.
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||
pub enum Cap {
|
||||
/// The face's grid was thinned to fit `MAX_FACE_GRID` points: the
|
||||
/// lines along u and v its division gave, and those kept. `asked` is the division's own
|
||||
/// count, itself bounded (at most `MAX_LINES` lines, 20 halvings an interval); `kept` is before
|
||||
/// any further thinning a cut grid makes for its traces. The sag refinement's measure of the
|
||||
/// final triangles ([`OverTolerance::sag`]) covers both.
|
||||
GridThinned {
|
||||
/// The lines along u and v the division gave.
|
||||
asked: [usize; 2],
|
||||
/// The lines kept.
|
||||
kept: [usize; 2],
|
||||
},
|
||||
/// The sag refinement added all the points it may (`MAX_REFINE`) with triangles still off
|
||||
/// the surface by more than the tolerance.
|
||||
Refine,
|
||||
}
|
||||
|
||||
/// An edge the planner could not sample: its index in the record and why.
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub struct RefusedEdge {
|
||||
|
||||
Reference in New Issue
Block a user