Skip to main content

SweepClosure

Struct SweepClosure 

Source
pub struct SweepClosure {
    pub holonomy: f64,
    pub requested_twist: f64,
    pub applied_twist: f64,
    pub curve_shift: usize,
}
Expand description

What a CLOSED sweep did to make its section meet itself after one lap — the applied twist the frame-closure policy REPORTS.

THE POLICY. Carried once round a closed path, the section frame comes back ROLLED about the start tangent by the path’s HOLONOMY. That angle is not a defect of the sampling: the frame is parallel transport of the section’s axes in the path’s normal plane, which is parallel transport on the unit sphere along the path’s TANGENT INDICATRIX, so by Gauss–Bonnet the roll is the solid angle that indicatrix encloses, modulo 2π. A planar path’s indicatrix runs along one great circle and encloses a hemisphere — 2π, the identity — which is why a planar ring closes on its own; a spatial one generally does not. (A curve lying ON a sphere reads zero too: the radial direction is itself rotation-minimizing along any such curve. Its enclosed solid angle is not its holonomy; its indicatrix’s is.)

The sweep closes the ring with the SMALLEST roll that does it: the counter-twist −holonomy, wrapped to (−π, π].

  • SMOOTH lane: laid down LINEARLY IN ARC LENGTH over the stations, the wrap step from the last station back to station 0 included, so every span — the seam span too — rolls at the same rate and the closed loft sees no seam at all. A uniform rate is the distribution with the smallest peak rate and the smallest ∫(roll rate)² ds.
  • CORNERED lane (sweep_topology/miter.rs): shared over the SEGMENTS in proportion to their length, each share laid down over its segment’s untrimmed middle — a roll AT a mitre would pull the shared loop apart — and nothing at all when the untwisted lap already closes within the lane’s own weld floor.

A REQUESTED twist rides on top of that counter-twist and is laid down the same way, so applied_twist = requested_twist − holonomy (or requested_twist alone where no counter-twist is needed). It closes only as a rotational symmetry of the section about the path, 2π·n/k for a section with k of them, and is refused by name otherwise (crate::SWEEP_TWIST_CLOSURE_REFUSAL). A FRACTIONAL turn on a symmetric section lands each wall on a different section curve than it left: curve_shift.

holonomy is what the untwisted frame measures; applied_twist is what was laid down. All three angles are radians, right-handed about the path tangent.

Fields§

§holonomy: f64

The roll the UNTWISTED frame returns with after one lap, right-handed about the start tangent, wrapped to (−π, π]. Zero for a planar path.

§requested_twist: f64

The twist the caller asked for, snapped to the section symmetry it closes on (it matched at round-off). Zero for an untwisted sweep.

§applied_twist: f64

The twist laid down over the lap: the requested twist plus the counter-twist −holonomy, which is zero where the lane closes without one (a planar path, or a frame whose untwisted lap already closes within the weld floor).

§curve_shift: usize

How far along the section’s curve list one lap carries each curve: the wall leaving section curve j arrives on curve (j + curve_shift) mod m. Zero for no twist and for a whole number of turns. The curves are counted in the order the builder carries them, which on the MITRE lane is the section’s order after its winding is made counter-clockwise about the path.

Trait Implementations§

Source§

impl Clone for SweepClosure

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 SweepClosure

Source§

impl Debug for SweepClosure

Source§

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

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

impl PartialEq for SweepClosure

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 SweepClosure

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