Skip to main content

Isovolume

Struct Isovolume 

Source
pub struct Isovolume<const D: usize> { /* private fields */ }
Expand description

Encloses {p : f(p) <= 0} within the sampled domain; Self::clipped detects contact with its boundary.

Implementations§

Source§

impl<const D: usize> Isovolume<D>

Source

pub fn extract( min: [f32; D], max: [f32; D], resolution: usize, sdf: impl Fn([f32; D]) -> f32, ) -> Self

Requires a 1-Lipschitz signed distance; resolution counts cells along the longest axis.

Source

pub fn piece_count(&self) -> usize

Source

pub fn occupied_cells(&self) -> usize

Source

pub fn cell_size(&self) -> f32

Source

pub fn enclosure_margin(&self) -> f32

Upper bound on how far the cover extends past the true surface.

Source

pub fn volume(&self) -> f32

Exact volume of the union of the pieces: that union is the marked cell set.

Source

pub fn clipped(&self) -> bool

True when a marked cell touched the sampled domain’s boundary.

Source

pub fn piece_bounds(&self, index: usize) -> ([f32; D], [f32; D])

Corner-to-corner, in the grid frame.

Source

pub fn contains(&self, p: [f32; D]) -> bool

Linear in piece count: a verification query, not a broadphase.

Source§

impl Isovolume<3>

Source

pub fn colliders(&self) -> Vec<(Vec3, Shape)>

Pose is extrinsic per the Shape contract, so the hull is origin-centred.

Source§

impl Isovolume<4>

Source

pub fn colliders(&self) -> Vec<(Vec4, Shape)>

Trait Implementations§

Source§

impl<const D: usize> Clone for Isovolume<D>

Source§

fn clone(&self) -> Isovolume<D>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<const D: usize> Debug for Isovolume<D>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<const D: usize> Freeze for Isovolume<D>

§

impl<const D: usize> RefUnwindSafe for Isovolume<D>

§

impl<const D: usize> Send for Isovolume<D>

§

impl<const D: usize> Sync for Isovolume<D>

§

impl<const D: usize> Unpin for Isovolume<D>

§

impl<const D: usize> UnsafeUnpin for Isovolume<D>

§

impl<const D: usize> UnwindSafe for Isovolume<D>

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.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more