Skip to main content

ShellVectorArea

Struct ShellVectorArea 

Source
pub struct ShellVectorArea {
Show 16 fields pub shell: u64, pub faces: usize, pub closed: bool, pub reference: Vec3, pub trim_residual: Vec3, pub edge_residual: Vec3, pub edge_length: f64, pub boundary_length: f64, pub bar: f64, pub quadrature_error: f64, pub trim_closure_gap: f64, pub edge_closure_gap: f64, pub spans: usize, pub spans_at_depth_limit: usize, pub gave_up: bool, pub face_areas: Vec<FaceVectorArea>,
}
Expand description

One shell’s vector-area closure: shell_vector_areas’ per-shell verdict.

Fields§

§shell: u64§faces: usize§closed: bool

Every non-degenerate edge this shell’s coedges use is used EXACTLY TWICE by them. ∫ n dA = 0 is a statement about a closed shell only, so an open one is measured and reported but never flagged: its residual is its open boundary’s own vector area, which is a fact about the sheet rather than a defect.

§reference: Vec3

The point every arm is taken from — the centre of the bounding box of the vertices this shell’s edges use. The residual is independent of it to |R| * closure_gap (below), and a local reference is what keeps a far-translated part’s face terms from dwarfing the number being read, the same reason mass_properties::shell_volume_reference exists.

§trim_residual: Vec3

Σ_faces (1/2) ∮ (r − R) × dr over the TRIMS. Exactly zero on a sound closed shell, and otherwise the sum of every face’s departure from the edges it shares.

§edge_residual: Vec3

The same sum over the EDGE curves. Every edge’s integral is computed ONCE and added with each coedge’s sign, so on a shell where every edge is used twice with opposite senses the curve terms cancel to rounding and what is left is the loops’ closing chords alone. It is therefore a BOOKKEEPING check rather than an accuracy one: it moves off zero when the shell is open, when an edge is used twice the SAME way, or when the edge curves do not meet at the vertices they share.

§edge_length: f64

Total arc length of the shell’s non-degenerate edges, each counted ONCE.

§boundary_length: f64

Total arc length walked by the faces’ loops — 2 * edge_length on a closed shell.

§bar: f64

The comparand: PCURVE_REFINEMENT_TOLERANCE * edge_length. See the section docs for the derivation and for why the strict bound is twice this.

§quadrature_error: f64

The summed |half-vs-whole| difference at every accepted span — an OVER-estimate of this shell’s quadrature error, and the error bar the residual is read against. A residual is a measurement only while it is far above this.

§trim_closure_gap: f64

Total length of the chords that close the TRIM loops — how far the sampled trims fail to meet each other at the vertices they share, over the whole shell. Two trims arriving at one vertex are fitted independently, so a few 1e-9 per vertex is ordinary; the chords are integrated (they are part of the region the mass integrator’s own trim polygon bounds), so this is reported as a fact about the record rather than as an error term.

§edge_closure_gap: f64

The same for the EDGE loops: how far consecutive edge curves fail to meet at their shared vertex. validate() checks each curve against its vertex (IssueKind::CurveVertexGap); this is what the gaps are worth to the shell’s closure.

§spans: usize

Spans integrated: the pcurve’s own knot spans, cut at the surface’s knot levels, bisected to convergence, plus the edge curves’ own. The cost of the whole check is this times one eight-station rule.

§spans_at_depth_limit: usize

How many of those spans were accepted at the DEPTH LIMIT rather than because they converged. Their last half-vs-whole difference is in quadrature_error like any other, so the error bar stays honest, but a shell with many of these is paying the full recursion on an integrand the bisection cannot resolve — a kink rather than a curve — and the cost is the symptom.

§gave_up: bool

The scan ABANDONED this shell on VECTOR_AREA_SPAN_BUDGET with whole faces still unread.

Its trim_residual is then a PARTIAL SUM over the faces that were reached, and a partial sum of a boundary integral is not a smaller version of the answer — it is the vector area of an arbitrary subset of the shell, which on a 1004-face gear reads 6.08e+3 where the whole shell reads 1.16e-5. Self::residual returns NaN for such a shell so that number cannot be read as either a residual or an open boundary’s area.

§face_areas: Vec<FaceVectorArea>

Per face, in record order.

Implementations§

Source§

impl ShellVectorArea

Source

pub fn reading(&self) -> ClosureReading

The typed outcome — what this shell’s scan actually came back with.

Source

pub fn residual(&self) -> f64

|trim_residual|, and NaN when the scan gave up on this shell: see Self::gave_up. A partial sum is not a residual. Prefer Self::reading, which cannot be compared by accident.

Source

pub fn is_over_bar(&self) -> bool

The predicate: a CLOSED shell whose trims enclose a vector area no fit at the refinement floor can account for. False for a shell the scan did not measure — ask Self::reading to tell those apart.

Source

pub fn worst_faces(&self, count: usize) -> Vec<&FaceVectorArea>

The faces that own the residual, worst departure first.

Source

pub fn worst_face_name(&self) -> Option<String>

The worst face’s name, or its id when it has none.

Trait Implementations§

Source§

impl Clone for ShellVectorArea

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 Debug for ShellVectorArea

Source§

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

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

impl Serialize for ShellVectorArea

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§

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 = !

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.
Source§

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more