SolidCraft: an open-source parametric 3D CAD application built in pure Rust. Desktop, web, and automation through MCP.
cadmpeg 0.6.3: FreeCAD and Rhino import in the browser too (#4482)
Jackson Oursland612d9d08ddab
diff --git a/ATTRIBUTION.md b/ATTRIBUTION.mdindex 2a009592cf..a9f62fd8cc 100644--- a/ATTRIBUTION.md+++ b/ATTRIBUTION.md@@ -529,9 +529,9 @@ crates/engine/src/tests/gltf_import.rs); no third-party models are committed.## FreeCAD and Rhino import libraryFreeCAD `.FCStd` and Rhino `.3dm` files are read with [cadmpeg](https://github.com/cadmpeg/cadmpeg)-0.6.1 (Apache-2.0), linked as the crates `cadmpeg-core`, `cadmpeg-ir`, `cadmpeg-registry`,+0.6.3 (Apache-2.0), linked as the crates `cadmpeg-core`, `cadmpeg-ir`, `cadmpeg-registry`,`cadmpeg-container`, `cadmpeg-codec-freecad`, `cadmpeg-codec-rhino` and `cadmpeg-codec-step`-in native builds (`crates/io/src/native_cad.rs`). Only those open-format codecs are built: no+in native and browser builds (`crates/io/src/native_cad.rs`). Only those open-format codecs are built: nodefault features, so cadmpeg's codecs for commercial CAD formats and its ShapeManager/ACIScodec are not compiled in. Its licence text is in THIRD-PARTY-LICENSES.txt; no code from it iscopied into SolidCraft.diff --git a/Cargo.lock b/Cargo.lockindex a555b0983a..c95c2c52ef 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -590,9 +590,9 @@ checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04"[[package]]name = "cadmpeg-codec-freecad"-version = "0.6.1"+version = "0.6.3"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "2a5257265c2549cf59a8457b3c7aadcc96c95abe20205232553766993a808812"+checksum = "3c4a8fa61748cbb3ce80838b00a8cebfe553460583941f5aba6e2b97c16b4d37"dependencies = ["cadmpeg-container","cadmpeg-core",@@ -601,14 +601,14 @@ dependencies = ["serde","serde_json","tempfile",- "zip 8.6.0",+ "zip",][[package]]name = "cadmpeg-codec-rhino"-version = "0.6.1"+version = "0.6.3"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "7d88b42fb91c7e5af4c75c0433029771f7e3233a0b72ec3d0b2e5ff2c72bed07"+checksum = "d7af41440d4c1d69e88e612de02cc3c9bad79d03429531e640ac924fef53c6bf"dependencies = ["cadmpeg-container","cadmpeg-core",@@ -625,53 +625,53 @@ dependencies = [[[package]]name = "cadmpeg-codec-step"-version = "0.6.1"+version = "0.6.3"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "e83a52258c129a683f77fb360ca30af54ae34339625ad890be12621128a5811c"+checksum = "35e1b6d17cf26b31f59f2edab8ef5c29d2a33216c581fd913f012ad4869bd559"dependencies = ["base64","cadmpeg-container","cadmpeg-core","cadmpeg-ir","encoding_rs",+ "serde","serde_json","thiserror 2.0.21",- "zip 8.6.0",+ "zip",][[package]]name = "cadmpeg-container"-version = "0.6.1"+version = "0.6.3"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "c110508cd9155e905f52906de505dfd42dc70a0321f5e90b5f68c28ba207686e"+checksum = "5ab7bcef48ac7480b4917820272d85cd2c9533e17904e15b0e4d22f19a6045bd"dependencies = ["cadmpeg-core","crc32fast","flate2",- "zip 8.6.0",- "zstd 0.14.2",+ "zip",][[package]]name = "cadmpeg-core"-version = "0.6.1"+version = "0.6.3"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "21b1147e51a74e7c52da5b393a0344597238cdc622fac6443eb2fd526759f6fa"+checksum = "e86bb7a40521832504bb1f5953a1c706b2c52aad73bf6d84e1b35e5cb0beae3f"dependencies = ["flate2","memchr","roxmltree",+ "ruzstd","serde","serde_json","thiserror 2.0.21",- "zstd 0.14.2",][[package]]name = "cadmpeg-ir"-version = "0.6.1"+version = "0.6.3"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "71ff19f019f013d97e353bb802c5d2e253c2859aaa5422009aa933dc2f2e7dbc"+checksum = "b570a1a8c579e407a9fd7bb10fa1900f8827f1d578b8fcb4ea2a056b5f323c72"dependencies = ["base64","cadmpeg-core",@@ -684,9 +684,9 @@ dependencies = [[[package]]name = "cadmpeg-registry"-version = "0.6.1"+version = "0.6.3"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "66046f1a694926707bea8944f861e699964b04c68972708588f97e14ccee3c5d"+checksum = "b2be23469a9bca0b684f1811118fffb581ebd32ded08e6cc8b0716a41f8c1377"dependencies = ["cadmpeg-codec-freecad","cadmpeg-codec-rhino",@@ -3786,6 +3786,15 @@ version = "1.0.23"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f"+[[package]]+name = "ruzstd"+version = "0.9.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "69e4ce4a039f42bf25920b95667e4d789e98749ab11bbb8d2c2936f788421bb5"+dependencies = [+ "twox-hash",+]+[[package]]name = "same-file"version = "1.0.6"@@ -4336,7 +4345,7 @@ dependencies = ["solidcraft-geom","solidcraft-kernel","thiserror 2.0.21",- "zip 9.0.4",+ "zip",][[package]]@@ -4426,7 +4435,7 @@ dependencies = ["ttf-parser","web-time","winreg",- "zip 9.0.4",+ "zip",][[package]]@@ -4880,6 +4889,12 @@ version = "0.25.1"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "d2df906b07856748fa3f6e0ad0cbaa047052d4a7dd609e231c4f72cee8c36f31"+[[package]]+name = "twox-hash"+version = "2.1.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "86a801b3cea342a06d468c8710662aa29e5e05e4f5c0d62f00bbb7f2ad7941c2"+[[package]]name = "type-map"version = "0.5.1"@@ -6254,20 +6269,6 @@ dependencies = ["syn 3.0.6",]-[[package]]-name = "zip"-version = "8.6.0"-source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "2d04a6b5381502aa6087c94c669499eb1602eb9c5e8198e534de571f7154809b"-dependencies = [- "crc32fast",- "flate2",- "indexmap",- "memchr",- "typed-path",- "zstd 0.13.3",-]-[[package]]name = "zip"version = "9.0.4"@@ -6307,52 +6308,6 @@ dependencies = ["simd-adler32",]-[[package]]-name = "zstd"-version = "0.13.3"-source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "e91ee311a569c327171651566e07972200e76fcfe2242a4fa446149a3881c08a"-dependencies = [- "zstd-safe 7.3.0",-]--[[package]]-name = "zstd"-version = "0.14.2"-source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "057cfd910cfac363a0ada849592624b4c9ff2e10bef504c3433810d78ed96f93"-dependencies = [- "zstd-safe 8.1.0",-]--[[package]]-name = "zstd-safe"-version = "7.3.0"-source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "64d80649ab6db9d9f6f9c80a40becd948eda4714a0a5ac8c4d157a32231c7882"-dependencies = [- "zstd-sys",-]--[[package]]-name = "zstd-safe"-version = "8.1.0"-source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "bdd44c6a7284e91f3717755b24315a302edd9153a01f753c3cba3d765e8eafac"-dependencies = [- "zstd-sys",-]--[[package]]-name = "zstd-sys"-version = "2.1.1+zstd.1.5.7"-source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "aeec9eaf2dffbbd09201e23bd0ffcbaa33bb8e9266a10734fd7ed90a85eca078"-dependencies = [- "cc",- "pkg-config",-]-[[package]]name = "zune-core"version = "0.5.3"diff --git a/Cargo.toml b/Cargo.tomlindex 8f7d309e71..22af805d7c 100644--- a/Cargo.toml+++ b/Cargo.toml@@ -67,13 +67,13 @@ encoding_rs = "0.8"# read by crates/io itself, so no image decoding or file access comes with it.gltf = { version = "1.4", default-features = false, features = ["names"] }-# FreeCAD and Rhino import (Apache-2.0, pure Rust apart from zstd; native builds only).+# FreeCAD and Rhino import (Apache-2.0, pure Rust; native and browser builds).# Pinned: its IR and codec APIs change between minor versions. Open formats only: no default# features, so cadmpeg's codecs for commercial formats (f3d, sldprt, inventor, catia, creo, nx)# and its ShapeManager/ACIS `sat` codec are not compiled in. `step` is the writer we restate through.-cadmpeg-core = "=0.6.1"-cadmpeg-ir = "=0.6.1"-cadmpeg-registry = { version = "=0.6.1", default-features = false, features = ["fcstd", "rhino", "step"] }+cadmpeg-core = "=0.6.3"+cadmpeg-ir = "=0.6.3"+cadmpeg-registry = { version = "=0.6.3", default-features = false, features = ["fcstd", "rhino", "step"] }# fonts (sketch text outlines; MIT OR Apache-2.0, pure Rust)ttf-parser = { version = "0.25", default-features = false, features = ["std"] }diff --git a/ROADMAP.md b/ROADMAP.mdindex 33c0b1d473..fb2ec29fcb 100644--- a/ROADMAP.md+++ b/ROADMAP.md@@ -53,7 +53,7 @@ PCB / Package, Render, Animation, Simulation, Manufacture/CAM, Drawings.| M1 | Sketch depth: command coverage implemented — projection/intersect/include as linked geometry (auto-project on faces, lost-reference warnings, break link), full SKETCH create/modify set (slots, polygons, tangent arcs/circles, ellipse, fit/control splines, conic, text, trim/extend/break, fillet/chamfer, offset, mirror, patterns, move/scale, blend curve, centerline), constraints incl. curvature and polygon with over-constraint refusal, Shift-picked line midpoints in Horizontal/Vertical using persisted points and ordinary constraints (#2087), driven/arc-length/linear-diameter dimensions, AutoConstrain, DXF/SVG insert, 3D sketch curves (Project To Surface, Intersection Curve, Isoparametric Curve, Spun Profile), exact free-form profiles (B-spline/NURBS edges, any spline degree, curves cut by crossings), sweeps and pipes along 3D sketch curves, canvases and decals, curvature combs. Exact free-form Extend and certified associative offsets now preserve geometry and IDs through edits, deletion and reopen. Occurrence-frame 3D wires now store explicit coordinate spaces and retain points and analytic fits through moves, refresh, undo and reopen. Constructive sketch solving (Owen 1991, Fudos & Hoffmann 1997) ahead of the numerical solver: points and rigid clusters are placed on the branch the sketch had, so dimension edits and drags keep their solution; edits that would turn a sketch over are refused; drags re-solve only the sketch per frame. Remaining workflow repairs: mixed offset junctions, legacy natural-spline seams, and damaged legacy wire links lacking frame provenance | in progress | 4 || M2 | Robust modelling: coplanar booleans in the kernel, holes (placed on faces and on sketch points), threads (cosmetic, then modelled), patterns, mirror, shell, draft, split, construction geometry | in progress | 16 || M3 | General fillets and chamfers (curved edges, chains, vertex blends); saddle rolling-ball surfaces now use continuous seam sections and arc-length fitting with shared contact boundaries and bounded accuracy checks; tiny rim edges remain selected instead of nearby wall seams when filleting (#2498) | in progress | 30 |-| M4 | Files: STEP import (done — [docs/step-import.md](docs/step-import.md)), FreeCAD/Rhino solids through cadmpeg (done, desktop and CLI), 3MF export and 3MF/STL import as mesh bodies (done), 3MF with B-rep face tags ([docs/formats/3mf-face-tags.md](docs/formats/3mf-face-tags.md), done), constant-section parametric mesh reconstruction, DXF sketches, OBJ import | in progress | 6 |+| M4 | Files: STEP import (done — [docs/step-import.md](docs/step-import.md)), FreeCAD/Rhino solids through cadmpeg (done, desktop, browser and CLI), 3MF export and 3MF/STL import as mesh bodies (done), 3MF with B-rep face tags ([docs/formats/3mf-face-tags.md](docs/formats/3mf-face-tags.md), done), constant-section parametric mesh reconstruction, DXF sketches, OBJ import | in progress | 6 || M5 | Persistent naming of faces and edges (docs/book/src/dev/naming.md): faces named from their exact kernel-reported history (sketch curve sides, caps, revolve sections, primitive sides, blends, shell inner walls, pattern/mirror copies; split pieces told apart by the faces around them, lumps of a cut body named after their faces), edges by their faces; fillets/chamfers, sketches on faces, shell/draft/offset/replace faces, hole placements, joint origins and face appearances resolve by name first and warn when the entity split or vanished: done. sheet metal edges by base sketch line and flange side, shell inner faces, sweep and loft roles: done. kernel-reported face history: done (merged faces answer to every name; operations without history yet fall back to geometric names, flagged unverified; format 14 keeps older designs' geometric names). Left: history through sheet metal, plastic, surface and emboss features; FaceSource certificates through history | in progress | 20 || M6 | UI depth: selection feedback and origin (done), timeline editing (done: hover and selection highlight modifier faces, including fillets and chamfers; edit feature, history marker drag, dependency-checked single and multi-item reorder, suppress, rename, delete with dependents, re-resolved references; redefining selections refreshes persistent edge/face references while retaining feature identity and dimension names; responsive feature history with width-driven icons/names/title, snapping width resize, bottom/left/browser-stack docking, shared-column collapse, rollback bar, multi-selection and persistent folders), right-docked dialogs (done), live previews for every feature dialog (done), keyboard-first commands with on-canvas value boxes and sketch inline dimensions (done), drag manipulators with automatic join/cut (done: extrude incl. two sides, fillet, shell, hole depth, move, pattern spacing, revolve rotator, extrude taper), dark theme (done), right-click menu with Repeat (done), measure tool (done), section analysis (done), selection filter (done), drag-solve of sketch points (done); appearance controls now preserve body/face/component targeting, named transparent looks, reuse/search and override removal; preferences | in progress | 6 || M7 | Thin extrude (walls along open or closed curves: centre, inside, outside or two sides; mitred corners, crossing walls joined; #721), sweep, loft (incl. to a point), rib and web (to next / depth), emboss (planar faces and exact radial emboss/deboss of bounded orthogonal profiles on complete exterior cylinders/sleeves), thread (cosmetic, and modelled M3–M20 outside and inside: the ISO profile screwed in as a faceted cut), coil (smooth B-spline helical walls), pipe, pattern on path, patterns of bodies and components, replace face (parallel), align, remove, feature copy/paste: done. Unique eligible cylindrical targets are inferred for new Emboss features. Left: general curved-face emboss and exact (unfaceted) modelled threads | in progress | 12 |diff --git a/apps/solidcraft-web/src/disk.rs b/apps/solidcraft-web/src/disk.rsindex 19af6aa5f5..c9aa086cf1 100644--- a/apps/solidcraft-web/src/disk.rs+++ b/apps/solidcraft-web/src/disk.rs@@ -294,7 +294,7 @@ mod web {let options = Object::new();let _ = Reflect::set(&options, &"multiple".into(), &JsValue::FALSE);let extensions = Array::new();- for e in [".solidcraft", ".solvecraft", ".json", ".step", ".stp", ".3mf", ".stl", ".obj", ".glb", ".gltf"] {+ for e in [".solidcraft", ".solvecraft", ".json", ".step", ".stp", ".3mf", ".stl", ".obj", ".glb", ".gltf", ".fcstd", ".3dm"] {extensions.push(&e.into());}let accept = Object::new();diff --git a/apps/solidcraft-web/src/files.rs b/apps/solidcraft-web/src/files.rsindex 4bedaed404..5e7d67fcc0 100644--- a/apps/solidcraft-web/src/files.rs+++ b/apps/solidcraft-web/src/files.rs@@ -499,8 +499,9 @@ fn input_picker(files: &Rc<Files>, intent: Intent) {let Some(doc) = web_sys::window().and_then(|w| w.document()) else { return };let Ok(input) = doc.create_element("input").map(|e| e.unchecked_into::<web_sys::HtmlInputElement>()) else { return };input.set_type("file");- // Everything the browser build imports, from the format registry (no cadmpeg formats here).- let accept = solidcraft_engine::io::formats::open_extensions(false).iter().map(|e| format!(".{e}")).collect::<Vec<_>>().join(",");+ // Everything the browser build imports, from the format registry: cadmpeg is pure Rust, so+ // FreeCAD and Rhino files are part of it.+ let accept = solidcraft_engine::io::formats::open_extensions(true).iter().map(|e| format!(".{e}")).collect::<Vec<_>>().join(",");input.set_accept(&accept);// Attached (hidden) while it is open: some browsers ignore a click on a detached input.let _ = input.set_attribute("style", "display:none");diff --git a/crates/io/Cargo.toml b/crates/io/Cargo.tomlindex fac7296ffa..840aafba3b 100644--- a/crates/io/Cargo.toml+++ b/crates/io/Cargo.toml@@ -22,14 +22,12 @@ serde_json = { workspace = true }sha2 = { workspace = true }chardetng = { workspace = true }encoding_rs = { workspace = true }+# FreeCAD and Rhino import (pure Rust, so the browser build has it too).+cadmpeg-core = { workspace = true }+cadmpeg-ir = { workspace = true }+cadmpeg-registry = { workspace = true }# A plain fsync where a network share refuses Apple's full flush (src/safe_write.rs); already in# the tree through tempfile.[target.'cfg(target_vendor = "apple")'.dependencies]rustix = { version = "1", default-features = false, features = ["std", "fs"] }--# FreeCAD and Rhino import. Not in the browser build: it compiles the zstd C library.-[target.'cfg(not(target_arch = "wasm32"))'.dependencies]-cadmpeg-core = { workspace = true }-cadmpeg-ir = { workspace = true }-cadmpeg-registry = { workspace = true }diff --git a/crates/io/src/formats.rs b/crates/io/src/formats.rsindex 114daccec2..a75c5d78c8 100644--- a/crates/io/src/formats.rs+++ b/crates/io/src/formats.rs@@ -45,7 +45,8 @@ pub struct ImportSpec {/// Options offered at import time; each `param` is a parameter of `doc.open` and of the/// matching `file.insert_*` command.pub options: &'static [OptionSpec],- /// Read through cadmpeg, which is not built for wasm (see `crate::native_cad`).+ /// Read through cadmpeg (FreeCAD `.FCStd`, Rhino `.3dm`). Every current host builds it;+ /// `native = false` leaves these rows out for a host that cannot.pub native_only: bool,}@@ -452,9 +453,13 @@ mod tests {assert!(for_path("nodot").is_none());}+ /// cadmpeg is pure Rust now, so the browser build offers its rows too; `native = false`+ /// stays for a host that cannot build it.#[test]- fn wasm_filtering_hides_the_cadmpeg_rows() {+ fn a_host_without_cadmpeg_leaves_its_rows_out() {assert!(importable(true).any(|f| f.id == "fcstd"));+ assert!(open_extensions(true).contains(&"fcstd"));+ assert!(open_extensions(true).contains(&"3dm"));assert!(importable(false).all(|f| f.id != "fcstd" && f.id != "3dm"));assert!(!open_extensions(false).contains(&"fcstd"));assert!(open_extensions(false).contains(&"igs"));diff --git a/crates/io/src/native_cad.rs b/crates/io/src/native_cad.rsindex 2e6230a17d..87c521c1ac 100644--- a/crates/io/src/native_cad.rs+++ b/crates/io/src/native_cad.rs@@ -9,9 +9,6 @@//! This module is the importer seam: the one place cadmpeg is called, returning STEP text plus//! warnings. A cadmpeg-based STEP reader could be added here later and chosen by a setting, to//! compare with our own STEP reader, without changing that reader.-//!-//! cadmpeg is not built for the browser (it compiles the zstd C library); there these formats-//! return "not supported in the browser yet"./// File extensions read through cadmpeg (lower case).pub const NATIVE_CAD_EXTS: [&str; 2] = ["fcstd", "3dm"];@@ -23,7 +20,6 @@ pub fn is_native_cad_path(path: &str) -> bool {/// Restate a FreeCAD or Rhino file (`file` is its name) as STEP text, with the losses/// and warnings cadmpeg reported. Panics inside cadmpeg become errors.-#[cfg(not(target_arch = "wasm32"))]pub fn native_cad_to_step(bytes: &[u8], file: &str) -> Result<(String, Vec<String>), String> {let name = std::path::Path::new(file).file_name().map(|s| s.to_string_lossy().to_string()).unwrap_or_else(|| file.to_string());solidcraft_kernel::guard("cadmpeg import", || convert::to_step(&name, bytes).map_err(solidcraft_kernel::KernelError::Invalid)).map_err(@@ -34,17 +30,10 @@ pub fn native_cad_to_step(bytes: &[u8], file: &str) -> Result<(String, Vec<Strin)}-/// Restate a FreeCAD or Rhino file as STEP: not available in the browser yet.-#[cfg(target_arch = "wasm32")]-pub fn native_cad_to_step(_bytes: &[u8], file: &str) -> Result<(String, Vec<String>), String> {- Err(format!("{file}: not supported in the browser yet (FreeCAD and Rhino files open in the desktop app)"))-}--#[cfg(not(target_arch = "wasm32"))]mod convert {use std::io::Cursor;- use cadmpeg_core::decode::{DecodeArena, DecodeContext, DecodeMode, DecodePolicy, ResourceLimits, View};+ use cadmpeg_core::decode::{DecodeArena, DecodeContext, DecodeDepth, DecodeMode, DecodePolicy, ResourceLimits, View};use cadmpeg_ir::codec::write::{EncodeInput, target::TargetRequest};use cadmpeg_ir::codec::{DecodeFailure, DecodeOptions, DecodeResult};use cadmpeg_ir::validate::validate_neutral_for_decode;@@ -53,19 +42,14 @@ mod convert {/// The codecs we accept (cadmpeg codec ids), whatever else the registry recognises.const ACCEPTED: [&str; 2] = ["fcstd", "rhino"];- /// Caps for hostile input: cadmpeg's tight `service` profile, with our STEP size limit.+ /// Caps for hostile input: cadmpeg's tight `service` profile, with our STEP size limit on+ /// the input. The service profile already admits a detailed part's 8 million entities:+ /// cadmpeg 0.6.3 dropped the collection-item budget that refused one at a million (#1783)+ /// and the work-unit budget that went with it.pub(super) fn policy() -> DecodePolicy {DecodePolicy {mode: DecodeMode::Salvage,- // Service caps on size, with room for the work a large assembly's decode takes and- // for the collections of a detailed part (a part with thousands of faces holds more- // than the service profile's million items).- limits: ResourceLimits {- max_input_bytes: crate::MAX_STEP_BYTES as u64,- max_work_units: 2_000_000_000,- max_collection_items: 8_000_000,- ..ResourceLimits::service()- },+ limits: ResourceLimits { max_input_bytes: crate::MAX_STEP_BYTES as u64, ..ResourceLimits::service() },}}@@ -100,8 +84,9 @@ mod convert {return Err(format!("{name}: {format} files are not supported (FreeCAD .FCStd and Rhino .3dm only)"));}- // Decode in memory under the caps.- let options = DecodeOptions { container_only: false, policy };+ // Decode in memory under the caps, as deep as the STEP writer reads: solids and products,+ // not the design history, which the import does not keep.+ let options = DecodeOptions { depth: DecodeDepth::Geometry, policy };let decoded = codec.decode(&mut Cursor::new(bytes), &options).map_err(|e| match e {DecodeFailure::Codec(e) => format!("{name}: could not read this {format} file: {e}"),other => format!("{name}: {other}"),@@ -150,7 +135,6 @@ mod convert {/// cadmpeg's STEP writer calls a product it has no name for `cadmpeg_model`; name it after the/// file instead (as plain STEP text: letters, digits, spaces, `-`, `_` and `.` only).-#[cfg(not(target_arch = "wasm32"))]fn name_unnamed_products(step: String, file: &str) -> String {const PLACEHOLDER: &str = "'cadmpeg_model'";let stem: String = std::path::Path::new(file)diff --git a/crates/io/src/native_cad/tests.rs b/crates/io/src/native_cad/tests.rsindex 88011624ea..0d2337a20a 100644--- a/crates/io/src/native_cad/tests.rs+++ b/crates/io/src/native_cad/tests.rs@@ -100,25 +100,15 @@ fn hostile_native_cad_never_panics() {}}-/// cadmpeg decodes under its tight `service` caps, with our STEP size limit on the input and-/// room for the work a large assembly takes (2·10⁹ units, half its desktop profile's) and the-/// collections of a detailed part (8·10⁶ items, half its desktop profile's).+/// cadmpeg decodes under its tight `service` caps, with our STEP size limit on the input.+/// cadmpeg 0.6.3 has no work-unit or collection-item budgets, and its service profile already+/// admits the 8 million entities a detailed part needed (#1783).#[test]fn decoding_is_capped() {let limits = convert::policy().limits;let service = cadmpeg_core::decode::ResourceLimits::service();- let desktop = cadmpeg_core::decode::ResourceLimits::desktop();assert_eq!(limits.max_input_bytes, crate::MAX_STEP_BYTES as u64);- assert_eq!(limits.max_work_units, 2_000_000_000);- assert!(limits.max_work_units < desktop.max_work_units);- assert_eq!(limits.max_collection_items, 8_000_000);- assert!(limits.max_collection_items < desktop.max_collection_items);- let same = cadmpeg_core::decode::ResourceLimits {- max_input_bytes: service.max_input_bytes,- max_work_units: service.max_work_units,- max_collection_items: service.max_collection_items,- ..limits- };+ let same = cadmpeg_core::decode::ResourceLimits { max_input_bytes: service.max_input_bytes, ..limits };assert_eq!(same, service);}diff --git a/deny.toml b/deny.tomlindex c5b57291cb..c24dbb4c7f 100644--- a/deny.toml+++ b/deny.toml@@ -3,14 +3,6 @@# The nightly command downgrades only this diagnostic with --warn unmaintained.unmaintained = "all"yanked = "warn"-# zip 8.6 comes only through cadmpeg-codec-freecad 0.6.1 (`zip = "^8"`); all three advisories-# are in ZipArchive::extract / ZipStreamReader::extract, which neither it nor solidcraft-io-# calls. Remove these when cadmpeg moves to zip 9.-ignore = [- { id = "RUSTSEC-2026-0367", reason = "zip 8 via cadmpeg-codec-freecad; extract() is never called" },- { id = "RUSTSEC-2026-0368", reason = "zip 8 via cadmpeg-codec-freecad; extract() is never called" },- { id = "RUSTSEC-2026-0369", reason = "zip 8 via cadmpeg-codec-freecad; extract() is never called" },-][bans]multiple-versions = "warn"diff --git a/docs/book/src/guide/files.md b/docs/book/src/guide/files.mdindex 0fba0b57c8..ff6e30c3f5 100644--- a/docs/book/src/guide/files.md+++ b/docs/book/src/guide/files.md@@ -6,7 +6,7 @@| `.json` (self-contained plain JSON design) | yes | yes || STEP (AP203, AP214, AP242) | solids, assemblies, units, names, colours | AP242 with names, colours and the component tree || IGES 5.3 | manifold solids, or trimmed surfaces sewn into solids | manifold solids with names and colours |-| FreeCAD `.FCStd`, Rhino `.3dm` | solids, through cadmpeg (desktop app only) | |+| FreeCAD `.FCStd`, Rhino `.3dm` | solids, through cadmpeg | || 3MF, STL, OBJ | mesh bodies | yes || glTF 2.0 (`.glb`, `.gltf` with its `.bin` files) | mesh bodies in the node tree's components, materials as appearances | || 3MF with face tags | as 3MF | each triangle tagged with its B-rep face, exact coordinates |diff --git a/docs/capabilities.md b/docs/capabilities.mdindex 9a93a46243..c35c052dc4 100644--- a/docs/capabilities.md+++ b/docs/capabilities.md@@ -70,7 +70,7 @@ and help is welcome: see [CONTRIBUTING.md](../CONTRIBUTING.md).that later features build on — open a `.step`/`.stp`/`.igs`/`.iges` file, insert one into adesign, or drop it on the window ([docs/step-import.md](step-import.md)); FreeCAD`.FCStd` and Rhino `.3dm` solids import the same way through- [cadmpeg](https://github.com/cadmpeg/cadmpeg) in the desktop app and CLI.+ [cadmpeg](https://github.com/cadmpeg/cadmpeg) in the desktop app, the browser app and the CLI.- **Render:** opaque surfaces can use metal fraction, roughness and dielectric IOR in theintegrated product viewport and CPU preview PNGs. Existing simple colors remain supported.Fixed direct lighting is a preview; HDRI, refraction and texture maps are not implemented.diff --git a/docs/step-import.md b/docs/step-import.mdindex 95a4364004..4a71b4d73b 100644--- a/docs/step-import.md+++ b/docs/step-import.md@@ -66,6 +66,6 @@ IGES 5.3 files (`.igs`/`.iges`) open, insert and drop the same way: `crates/kern## FreeCAD and Rhino-FreeCAD `.FCStd` and Rhino `.3dm` files open, insert and drop the same way, in the desktop app and the CLI. They are read with [cadmpeg](https://github.com/cadmpeg/cadmpeg) (Apache-2.0, `crates/io/src/native_cad.rs`): cadmpeg detects the format from the bytes, decodes it into its neutral model under resource caps, checks that model and writes it as STEP AP214, which the STEP reader then reads. The feature holds that STEP text, so the design reopens without the original file. The file's solids come in; its feature history, sketches and parameters do not. Losses cadmpeg reports become warnings on the feature, and a file without an importable solid is refused with a message. cadmpeg runs inside the panic guard. How much of a file is read follows cadmpeg's support for that format ([format support](https://github.com/cadmpeg/cadmpeg/blob/main/docs/format-support.md)).+FreeCAD `.FCStd` and Rhino `.3dm` files open, insert and drop the same way, in the desktop app, the browser app and the CLI. They are read with [cadmpeg](https://github.com/cadmpeg/cadmpeg) (Apache-2.0, `crates/io/src/native_cad.rs`): cadmpeg detects the format from the bytes, decodes it into its neutral model under resource caps, checks that model and writes it as STEP AP214, which the STEP reader then reads. The feature holds that STEP text, so the design reopens without the original file. The file's solids come in; its feature history, sketches and parameters do not. Losses cadmpeg reports become warnings on the feature, and a file without an importable solid is refused with a message. cadmpeg runs inside the panic guard. How much of a file is read follows cadmpeg's support for that format ([format support](https://github.com/cadmpeg/cadmpeg/blob/main/docs/format-support.md)).-Only codecs for open formats are compiled in: the workspace turns off cadmpeg's default features and enables `fcstd`, `rhino` and `step` (the writer). cadmpeg's codecs for commercial CAD formats are not built, and neither is its `sat` codec, which decodes ShapeManager streams with ACIS as one dialect, so ACIS `.sat`/`.sab` files are not read yet. `crates/io/src/native_cad.rs` is the one place cadmpeg is called; a cadmpeg-based STEP reader could be added there later behind a setting, to compare with the STEP reader above without changing it. The browser app does not read these formats yet: cadmpeg compiles the zstd C library, which the wasm build leaves out.+Only codecs for open formats are compiled in: the workspace turns off cadmpeg's default features and enables `fcstd`, `rhino` and `step` (the writer). cadmpeg's codecs for commercial CAD formats are not built, and neither is its `sat` codec, which decodes ShapeManager streams with ACIS as one dialect, so ACIS `.sat`/`.sab` files are not read yet. `crates/io/src/native_cad.rs` is the one place cadmpeg is called; a cadmpeg-based STEP reader could be added there later behind a setting, to compare with the STEP reader above without changing it.