pub struct WasmBrepSolid { /* private fields */ }Implementations§
Source§impl WasmBrepSolid
impl WasmBrepSolid
pub fn new(solid_json: &str) -> Result<WasmBrepSolid, JsValue>
Sourcepub fn from_buffer(
data: &[f64],
names_json: &str,
) -> Result<WasmBrepSolid, JsValue>
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.
pub fn to_buffer(&self) -> Result<WasmSolidBuffer, JsValue>
pub fn to_json(&self) -> Result<String, JsValue>
pub fn validate_json(&self) -> Result<String, JsValue>
pub fn mass_properties_json(&self) -> Result<String, JsValue>
pub fn full_mass_properties_json(&self) -> Result<String, JsValue>
Sourcepub fn full_mass_properties_with_density_json(
&self,
density: f64,
) -> Result<String, JsValue>
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.
pub fn tessellate_json( &self, slabs_per_span_u: usize, steps_per_span_v: usize, ) -> Result<String, JsValue>
pub fn transform_json( &self, matrix: &[f64], reverse_orientation: bool, ) -> Result<String, JsValue>
pub fn transform_buffer( &self, matrix: &[f64], reverse_orientation: bool, ) -> Result<WasmSolidBuffer, JsValue>
pub fn boolean_buffer( &self, other: &WasmBrepSolid, operation: &str, tolerance: f64, merge_coplanar_faces: bool, ) -> Result<WasmSolidBuffer, JsValue>
pub fn offset_shell_buffer( &self, opening_face_ids: &[f64], distance: f64, ) -> Result<WasmSolidBuffer, JsValue>
pub fn tessellate_watertight_buffers( &self, chord_tolerance: f64, ) -> Result<WasmMeshBuffers, JsValue>
Sourcepub fn tessellate_watertight_face_stride_buffers(
&self,
chord_tolerance: f64,
stride: usize,
offset: usize,
) -> Result<WasmMeshBuffers, JsValue>
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.
Sourcepub fn sample_edges_buffer(
&self,
chord_tolerance: f64,
) -> Result<Vec<f64>, JsValue>
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.
Sourcepub fn tessellate_watertight_face_stride_with_samples_buffers(
&self,
chord_tolerance: f64,
stride: usize,
offset: usize,
samples: &[f64],
) -> Result<WasmMeshBuffers, JsValue>
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.
pub fn tessellate_buffers( &self, slabs_per_span_u: usize, steps_per_span_v: usize, ) -> Result<WasmMeshBuffers, JsValue>
pub fn boolean_json( &self, other: &WasmBrepSolid, operation: &str, tolerance: f64, merge_coplanar_faces: bool, ) -> Result<String, JsValue>
pub fn offset_shell_json( &self, opening_face_ids: &[f64], distance: f64, ) -> Result<String, JsValue>
Sourcepub fn delete_face_and_heal_buffer(
&self,
face_id: f64,
) -> Result<WasmSolidBuffer, JsValue>
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.
pub fn delete_face_and_heal_json(&self, face_id: f64) -> Result<String, JsValue>
Sourcepub fn move_faces_json(
&self,
face_ids: &[f64],
dx: f64,
dy: f64,
dz: f64,
) -> Result<String, JsValue>
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.
pub fn export_step( &self, name: &str, unit: &str, timestamp: &str, ) -> Result<String, JsValue>
Sourcepub fn sew_json(&self, tolerance: f64) -> Result<String, JsValue>
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
impl From<WasmBrepSolid> for JsValue
Source§fn from(value: WasmBrepSolid) -> Self
fn from(value: WasmBrepSolid) -> Self
Source§impl FromWasmAbi for WasmBrepSolid
impl FromWasmAbi for WasmBrepSolid
Source§impl IntoWasmAbi for WasmBrepSolid
impl IntoWasmAbi for WasmBrepSolid
Source§impl LongRefFromWasmAbi for WasmBrepSolid
impl LongRefFromWasmAbi for WasmBrepSolid
Source§type Abi = WasmPtr<WasmRefCell<WasmBrepSolid>>
type Abi = WasmPtr<WasmRefCell<WasmBrepSolid>>
RefFromWasmAbi::AbiSource§type Anchor = RcRef<WasmBrepSolid>
type Anchor = RcRef<WasmBrepSolid>
RefFromWasmAbi::AnchorSource§unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor
unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor
RefFromWasmAbi::ref_from_abiSource§impl OptionFromWasmAbi for WasmBrepSolid
impl OptionFromWasmAbi for WasmBrepSolid
Source§impl OptionIntoWasmAbi for WasmBrepSolid
impl OptionIntoWasmAbi for WasmBrepSolid
Source§impl RefFromWasmAbi for WasmBrepSolid
impl RefFromWasmAbi for WasmBrepSolid
Source§type Abi = WasmPtr<WasmRefCell<WasmBrepSolid>>
type Abi = WasmPtr<WasmRefCell<WasmBrepSolid>>
Self are recovered from.Source§type Anchor = RcRef<WasmBrepSolid>
type Anchor = RcRef<WasmBrepSolid>
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§impl RefMutFromWasmAbi for WasmBrepSolid
impl RefMutFromWasmAbi for WasmBrepSolid
Source§type Abi = WasmPtr<WasmRefCell<WasmBrepSolid>>
type Abi = WasmPtr<WasmRefCell<WasmBrepSolid>>
RefFromWasmAbi::AbiSource§type Anchor = RcRefMut<WasmBrepSolid>
type Anchor = RcRefMut<WasmBrepSolid>
RefFromWasmAbi::AnchorSource§unsafe fn ref_mut_from_abi(js: Self::Abi) -> Self::Anchor
unsafe fn ref_mut_from_abi(js: Self::Abi) -> Self::Anchor
RefFromWasmAbi::ref_from_abiimpl SupportsConstructor for WasmBrepSolid
impl SupportsInstanceProperty for WasmBrepSolid
impl SupportsStaticProperty for WasmBrepSolid
Source§impl TryFromJsValue for WasmBrepSolid
impl TryFromJsValue for WasmBrepSolid
Source§impl VectorFromWasmAbi for WasmBrepSolid
impl VectorFromWasmAbi for WasmBrepSolid
type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[WasmBrepSolid]>
Source§impl VectorIntoWasmAbi for WasmBrepSolid
impl VectorIntoWasmAbi for WasmBrepSolid
type Abi = <Box<[JsValue]> as IntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[WasmBrepSolid]>) -> Self::Abi
Source§impl WasmDescribeVector for WasmBrepSolid
impl WasmDescribeVector for WasmBrepSolid
Auto Trait Implementations§
impl !RefUnwindSafe for WasmBrepSolid
impl !Sync for WasmBrepSolid
impl Freeze for WasmBrepSolid
impl Send for WasmBrepSolid
impl Unpin for WasmBrepSolid
impl UnsafeUnpin for WasmBrepSolid
impl UnwindSafe for WasmBrepSolid
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
IntoWasmAbi::AbiSource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err.