[K4] S2: IFC-Export in Rust (export_ifc.rs, js_fmt.rs, geo_rebase.rs), byte-genau zur TS-Fassung; exportIfc.ts nur noch Fassade

This commit is contained in:
karim committed 2026-10-28 02:19:53 +01:00
1 parent e53fb21eb6
commit aaa7fae812
10 files changed
+1056 -919

No files matched your search

+14
View File
@@ -90,3 +90,17 @@ pub fn doc_query_args(h: u32, name: &str, args: &[f64], text: &str) -> String {
pub fn doc_drawing_line_verts(h: u32) -> Vec<f32> {
with_doc(h, |d| d.project().ok().map(|p| crate::model3d::drawing_line_verts(&p))).flatten().unwrap_or_default()
}
/// IFC4-Datei des Projekts (`now_ms`: Zeitpunkt des Exports); Fehler mit vorangestelltem `\u{1}`.
#[wasm_bindgen]
pub fn doc_export_ifc(h: u32, now_ms: f64) -> String {
let result = with_doc(h, |d| {
let p = d.project().map_err(|e| format!("Projekt passt nicht zum Kern-Modell: {e}"))?;
crate::export_ifc::export_ifc_spf(p, now_ms)
})
.unwrap_or_else(|| Err("Dokument nicht offen".to_string()));
match result {
Ok(text) => text,
Err(e) => format!("\u{1}{e}"),
}
}
+15
View File
@@ -0,0 +1,15 @@
//! Bindungen kleiner IFC-Bausteine (`crate::export_ifc`); die Datei selbst liefert `doc_export_ifc`.
use wasm_bindgen::prelude::wasm_bindgen;
/// Deterministische 22-stellige IFC-GUID aus einer Element-ID.
#[wasm_bindgen]
pub fn ifc_guid(id: &str) -> String {
crate::export_ifc::ifc_guid(id)
}
/// STEP-String-Literal (ISO 10303-21) mit Escapes.
#[wasm_bindgen]
pub fn ifc_string(s: &str) -> String {
crate::export_ifc::ifc_string(s)
}
+1
View File
@@ -24,6 +24,7 @@ mod plan_stairs;
mod plan_walls;
mod plan_openings;
mod delaunay;
mod export_ifc;
mod document;
mod mesh_section;
mod plan_elevation;