Skip to main content

ClashSession

Struct ClashSession 

Source
pub struct ClashSession { /* private fields */ }
Expand description

A clash session: stores per-element geometry, element AABBs, and caches the per-element triangle BVHs that the narrow phase needs.

Implementations§

Source§

impl ClashSession

Source

pub fn new() -> Self

Source

pub fn ingest( &mut self, positions: &[f32], pos_ranges: &[u32], indices: &[u32], idx_ranges: &[u32], aabbs: &[f32], )

Ingest N elements from flat arenas.

  • positions: concatenated per-element vertex coords (x, y, z, ...).
  • pos_ranges: 2 per element = [float_offset, float_len].
  • indices: concatenated per-element LOCAL (0-based within that element’s vertices) triangle indices.
  • idx_ranges: 2 per element = [idx_offset, idx_len].
  • aabbs: 6 per element = [minx, miny, minz, maxx, maxy, maxz].

Vertex/AABB coords are f32-sourced; they are stored and computed in f64.

Source

pub fn run_rule( &self, group_a: &[u32], group_b: &[u32], mode: u8, tolerance: f64, clearance: f64, report_touch: bool, ) -> RuleResult

Run one rule.

group_a / group_b are GLOBAL element indices. An empty group_b requests a self-clash within group_a (pairs with i < j by position in group_a). mode: 0 = hard, 1 = clearance. Records carry GLOBAL element indices.

Trait Implementations§

Source§

impl Default for ClashSession

Source§

fn default() -> Self

Returns the “default value” for a type. 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> 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, 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.