Skip to main content

WasmBrepSolid

Struct WasmBrepSolid 

Source
pub struct WasmBrepSolid { /* private fields */ }

Implementations§

Source§

impl WasmBrepSolid

Source

pub fn new(solid_json: &str) -> Result<WasmBrepSolid, JsValue>

Source

pub fn from_buffer( data: &[f64], names_json: &str, ) -> Result<WasmBrepSolid, JsValue>

Construct from the flat f64 codec instead of JSON — same arena validation as the JSON constructor.

Source

pub fn to_buffer(&self) -> Result<WasmSolidBuffer, JsValue>

Source

pub fn to_json(&self) -> Result<String, JsValue>

Source

pub fn validate_json(&self) -> Result<String, JsValue>

Source

pub fn mass_properties_json(&self) -> Result<String, JsValue>

Source

pub fn full_mass_properties_json(&self) -> Result<String, JsValue>

Source

pub fn full_mass_properties_with_density_json( &self, density: f64, ) -> Result<String, JsValue>

Full mass properties scaled to a physical density (Golovanov §8.11): mass = density * volume, inertia and the principal moments scale by density, while volume, surface area, centroid, and the principal axes are density-independent. Returns the DensityMassProperties JSON.

Source

pub fn tessellate_json( &self, slabs_per_span_u: usize, steps_per_span_v: usize, ) -> Result<String, JsValue>

Source

pub fn transform_json( &self, matrix: &[f64], reverse_orientation: bool, ) -> Result<String, JsValue>

Source

pub fn transform_buffer( &self, matrix: &[f64], reverse_orientation: bool, ) -> Result<WasmSolidBuffer, JsValue>

Source

pub fn boolean_buffer( &self, other: &WasmBrepSolid, operation: &str, tolerance: f64, merge_coplanar_faces: bool, ) -> Result<WasmSolidBuffer, JsValue>

Source

pub fn offset_shell_buffer( &self, opening_face_ids: &[f64], distance: f64, ) -> Result<WasmSolidBuffer, JsValue>

Source

pub fn tessellate_watertight_buffers( &self, chord_tolerance: f64, ) -> Result<WasmMeshBuffers, JsValue>

Source

pub fn tessellate_watertight_face_stride_buffers( &self, chord_tolerance: f64, stride: usize, offset: usize, ) -> Result<WasmMeshBuffers, JsValue>

Tessellate only the faces whose global sequential index i satisfies i % stride == offset (a face subset), so a heavy solid can be meshed in parallel across worker instances (dispatch stride calls, offsets 0..stride-1, concatenate the fragments on the caller side). No closed-shell validation — a fragment is not a closed mesh; the caller validates the concatenated whole. See tessellate_brep_watertight_face_stride.

Source

pub fn sample_edges_buffer( &self, chord_tolerance: f64, ) -> Result<Vec<f64>, JsValue>

Compute + serialize every edge’s shared samples once, so the face-range split can hand the same buffer to each worker instead of recomputing sample_all_edges in all of them. See sample_edges_encoded.

Source

pub fn tessellate_watertight_face_stride_with_samples_buffers( &self, chord_tolerance: f64, stride: usize, offset: usize, samples: &[f64], ) -> Result<WasmMeshBuffers, JsValue>

Face-stride tessellation using pre-computed edge samples (from sample_edges_buffer), skipping the redundant per-worker resampling.

Source

pub fn tessellate_buffers( &self, slabs_per_span_u: usize, steps_per_span_v: usize, ) -> Result<WasmMeshBuffers, JsValue>

Source

pub fn boolean_json( &self, other: &WasmBrepSolid, operation: &str, tolerance: f64, merge_coplanar_faces: bool, ) -> Result<String, JsValue>

Source

pub fn offset_shell_json( &self, opening_face_ids: &[f64], distance: f64, ) -> Result<String, JsValue>

Source

pub fn delete_face_and_heal_buffer( &self, face_id: f64, ) -> Result<WasmSolidBuffer, JsValue>

Golovanov §6.12 direct editing — delete a transition face (chamfer / fillet / simple 4-sided face) and heal the hole by extending and re-intersecting its neighbours. face_id is the wire id of the face to remove.

Source

pub fn delete_face_and_heal_json(&self, face_id: f64) -> Result<String, JsValue>

Source

pub fn move_faces_json( &self, face_ids: &[f64], dx: f64, dy: f64, dz: f64, ) -> Result<String, JsValue>

Golovanov §6.12 direct editing — translate a face group rigidly by (dx, dy, dz) and heal the adjacency by re-intersecting the planar neighbours. Mirrors delete_face_and_heal_json; face_ids follows offset_shell_json’s integer-id validation.

Source

pub fn export_step( &self, name: &str, unit: &str, timestamp: &str, ) -> Result<String, JsValue>

Source

pub fn sew_json(&self, tolerance: f64) -> Result<String, JsValue>

Standalone heal/sew: pair coincident one-use boundary edges (open chains and closed rims), merge the shells they join, and re-orient the result outward. Best-effort — unsewable gaps stay open and are counted in the returned report. Returns { "solid": …, "report": … }.

Trait Implementations§

Source§

impl From<WasmBrepSolid> for JsValue

Source§

fn from(value: WasmBrepSolid) -> Self

Converts to this type from the input type.
Source§

impl FromWasmAbi for WasmBrepSolid

Source§

type Abi = WasmPtr<WasmRefCell<WasmBrepSolid>>

The Wasm ABI type that this converts from when coming back out from the ABI boundary.
Source§

unsafe fn from_abi(js: Self::Abi) -> Self

Recover a Self from Self::Abi. Read more
Source§

impl IntoWasmAbi for WasmBrepSolid

Source§

type Abi = WasmPtr<WasmRefCell<WasmBrepSolid>>

The Wasm ABI type that this converts into when crossing the ABI boundary.
Source§

fn into_abi(self) -> Self::Abi

Convert self into Self::Abi so that it can be sent across the wasm ABI boundary.
Source§

impl LongRefFromWasmAbi for WasmBrepSolid

Source§

type Abi = WasmPtr<WasmRefCell<WasmBrepSolid>>

Same as RefFromWasmAbi::Abi
Source§

type Anchor = RcRef<WasmBrepSolid>

Same as RefFromWasmAbi::Anchor
Source§

unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor

Same as RefFromWasmAbi::ref_from_abi
Source§

impl NullableFromWasmAbi for WasmBrepSolid

Source§

fn is_null(abi: &Self::MaybeAbi) -> bool

Tests the ABI value for Nullable::Null.
Source§

impl NullableIntoWasmAbi for WasmBrepSolid

Source§

fn null() -> Self::MaybeAbi

Returns the ABI value for Nullable::Null, which JS reads as null. Read more
Source§

impl OptionFromWasmAbi for WasmBrepSolid

Source§

fn is_none(abi: &Self::Abi) -> bool

Tests whether the argument is a “none” instance. If so it will be deserialized as None, and otherwise it will be passed to FromWasmAbi.
Source§

impl OptionIntoWasmAbi for WasmBrepSolid

Source§

fn none() -> Self::Abi

Returns an ABI instance indicating “none”, which JS will interpret as the None branch of this option. Read more
Source§

impl RefFromWasmAbi for WasmBrepSolid

Source§

type Abi = WasmPtr<WasmRefCell<WasmBrepSolid>>

The Wasm ABI type references to Self are recovered from.
Source§

type Anchor = RcRef<WasmBrepSolid>

The type that holds the reference to Self for the duration of the invocation of the function that has an &Self parameter. This is required to ensure that the lifetimes don’t persist beyond one function call, and so that they remain anonymous.
Source§

unsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor

Recover a Self::Anchor from Self::Abi. Read more
Source§

impl RefMutFromWasmAbi for WasmBrepSolid

Source§

type Abi = WasmPtr<WasmRefCell<WasmBrepSolid>>

Same as RefFromWasmAbi::Abi
Source§

type Anchor = RcRefMut<WasmBrepSolid>

Same as RefFromWasmAbi::Anchor
Source§

unsafe fn ref_mut_from_abi(js: Self::Abi) -> Self::Anchor

Same as RefFromWasmAbi::ref_from_abi
Source§

impl SupportsConstructor for WasmBrepSolid

Source§

impl SupportsInstanceProperty for WasmBrepSolid

Source§

impl SupportsStaticProperty for WasmBrepSolid

Source§

impl TryFromJsValue for WasmBrepSolid

Source§

fn try_from_js_value(value: JsValue) -> Result<Self, JsValue>

Performs the conversion.
Source§

fn try_from_js_value_ref(value: &JsValue) -> Option<Self>

Performs the conversion.
Source§

const NULLABLE: bool = false

Whether Self accepts null as a distinct value space, as Nullable<T> does. An enclosing Option then passes null through instead of reading it as None, so Option<T> is itself nullable exactly when T is not. JsValue does not set this: it accepts null as one value among all of them, not as a distinct space, and Option<JsValue> reads it as None like the ABI does. This is the JS-value side of NullableFromWasmAbi, which claims null at the ABI.
Source§

impl VectorFromWasmAbi for WasmBrepSolid

Source§

impl VectorIntoWasmAbi for WasmBrepSolid

Source§

impl WasmDescribe for WasmBrepSolid

Source§

impl WasmDescribeVector for WasmBrepSolid

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> MaybeFromWasmAbi for T

Source§

type MaybeAbi = <T as FromWasmAbi>::Abi

The ABI of Option<Self>.
Source§

unsafe fn from_maybe_abi(js: <T as FromWasmAbi>::Abi) -> T

Recovers a value from the Option<Self> ABI, once is_none has ruled None out. Read more
Source§

unsafe fn try_from_maybe_abi( js: <T as FromWasmAbi>::Abi, ) -> Result<T, &'static str>

Source§

fn is_none(js: &<T as FromWasmAbi>::Abi) -> bool

Tests the ABI value for None.
Source§

impl<T> MaybeIntoWasmAbi for T

Source§

type MaybeAbi = <T as IntoWasmAbi>::Abi

The ABI of Option<Self>.
Source§

fn into_maybe_abi(self) -> <T as IntoWasmAbi>::Abi

Converts a value into the Option<Self> ABI.
Source§

fn none() -> <T as IntoWasmAbi>::Abi

Returns the ABI value for None, which JS reads as undefined. Read more
Source§

impl<T> ReturnWasmAbi for T
where T: IntoWasmAbi,

Source§

type Abi = <T as IntoWasmAbi>::Abi

Same as IntoWasmAbi::Abi
Source§

fn return_abi(self) -> <T as ReturnWasmAbi>::Abi

Same as IntoWasmAbi::into_abi, except that it may throw and never return in the case of Err.
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