fix(web): restore wasm build broken by SECTION + file association
The v0.7.0 web (GitHub Pages) release failed to compile under --no-default-features. Two symbols leaked into the wasm build: * `solid_section` (SECTION command) used truck-meshalgo directly (`triangulation`/`extract_interference`), but that crate is gated behind the `solid3d` feature which is off on wasm. Gate the function with `#[cfg(feature = "solid3d")]` and add a stub for builds without it, mirroring `solid_model::boolean`. * `register_as_handler` was `#[cfg(not(wasm32))]` while its caller `set_default_app_blocking` was not, so wasm couldn't resolve it. Drop the wasm gate; the existing non-win/lin/mac arm already returns `Ok` on wasm, matching `unregister_handler`. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
da76918320
commit
ea35479dd9
2 changed files with 9 additions and 1 deletions
|
|
@ -469,6 +469,7 @@ impl super::OpenCADStudio {
|
|||
/// SECTION — draw the cross-section outline where an axis-aligned plane
|
||||
/// (X/Y/Z = `axis` at `value`) cuts the one selected solid, as Line entities.
|
||||
/// Reuses the mesh-interference analyzer to find the cut segments.
|
||||
#[cfg(feature = "solid3d")]
|
||||
pub(super) fn solid_section(&mut self, axis: usize, value: f64) -> Task<Message> {
|
||||
use acadrust::types::Vector3;
|
||||
use acadrust::Line;
|
||||
|
|
@ -576,6 +577,14 @@ impl super::OpenCADStudio {
|
|||
Task::none()
|
||||
}
|
||||
|
||||
/// Without `solid3d` (e.g. wasm) there is no mesh-interference kernel.
|
||||
#[cfg(not(feature = "solid3d"))]
|
||||
pub(super) fn solid_section(&mut self, _axis: usize, _value: f64) -> Task<Message> {
|
||||
self.command_line
|
||||
.push_error("SECTION: solid modelling is unavailable in this build.");
|
||||
Task::none()
|
||||
}
|
||||
|
||||
/// PYRAMID — create an `n`-sided pyramid (regular polygon base of the given
|
||||
/// circumradius, apex at `height`) as a tessellated mesh, reusing the same
|
||||
/// face→Shell→mesh path as LOFT. Each face is independent, so no closed-shell
|
||||
|
|
|
|||
Loading…
Reference in a new issue