Files
OneCAD-Draft/src/scene/convert/mod.rs
T
Hakan SevenandClaude Opus 4.8 b2e20c95fe feat(wasm): compile the library for wasm32 (issue #45 groundwork)
First step toward a web build: the library now compiles for
wasm32-unknown-unknown with --no-default-features.

- Add a `solid3d` feature (default on) gating truck-meshalgo /
  truck-shapeops / lzma-sys. These pull vtkio → xz2 → lzma-sys (C),
  which cannot cross-compile to wasm. Without the feature the 3-D
  solid path (tessellation, booleans, ACIS import) becomes no-ops;
  2-D CAD is unaffected. Native builds keep the feature by default.
- Move native-only crates (ureq, open) to non-wasm target deps and
  add cfg shims: update-check is a no-op on wasm, and a new `sys`
  module provides open_url + handle_path (rfd FileHandle → PathBuf;
  synthesizes a name-based path on the web).

Native build + all 75 tests unchanged. Browser runtime wiring
(entry point, trunk, real file I/O) is a follow-up.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-06-16 13:01:19 +03:00

24 lines
651 B
Rust

pub mod acad_to_truck;
#[cfg(feature = "solid3d")]
pub mod acis_to_truck;
/// Without `solid3d` (e.g. wasm) ACIS/SAT meshing is unavailable; the entry
/// point stays so callers compile, returning no mesh.
#[cfg(not(feature = "solid3d"))]
pub mod acis_to_truck {
use crate::scene::model::mesh_model::MeshLodSet;
use acadrust::entities::acis::SatDocument;
pub fn tessellate_sat_truck(
_sat: &SatDocument,
_name: String,
_color: [f32; 4],
_facet_res: f64,
) -> Option<MeshLodSet> {
None
}
}
pub mod truck_tess;
pub mod tessellate;
pub mod tess_util;
pub mod solid3d_tess;
pub mod spline_tess;