From 4b12a1ffefa84e7a16d790dd75551aeb7e3b8127 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 10 Nov 2026 10:49:20 +0000 Subject: [PATCH] =?UTF-8?q?[105]=20T=C3=BCrblatt=20im=20Falz:=20Zarge/Bloc?= =?UTF-8?q?krahmen=20mit=20Profil,=20Blatt=20auf=20der=20Aufschlagseite=20?= =?UTF-8?q?in=20Grundriss,=20Schnitt,=20Ansicht,=203D,=20IFC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Zarge (Vorgabe) und Blockrahmen bei Dreh-/Pendeltüren über door_frame_of mit eigenem Profil (Falz auf der Aufschlagseite, Zarge mit Bekleidung beidseitig). Grundriss: Blatt dreht an der Falzkante, fein als Rechteck mit Blattdicke; kurzer Aufschlagbogen auch nach aussen; das Rahmenband quer über die Öffnung entfällt bei Drehtüren. IFC: Blatt bündig mit der Rahmenfläche der Aufschlagseite, Rahmen im Blattband um den Falz ausgespart; Rahmenlage aus dem Profil. Goldens (Ansicht/3D Muster, 3D komplex, CLI-Ansicht) bewusst nachgeführt. --- TODO.md | 10 ++- scripts/gen-opening-test-project.ts | 24 ++++++ src-tauri/core/src/ifc_data.rs | 57 ++++++++++++- src-tauri/core/src/opening_detail.rs | 53 +++++++++++- src-tauri/core/src/plan/elevation/openings.rs | 4 +- src-tauri/core/src/plan/elevation/tests.rs | 5 +- src-tauri/core/src/plan/openings.rs | 83 ++++++++++++++++++- src-tauri/core/src/plan/walls.rs | 15 ++-- src-tauri/fileio/src/ifc_export/tests.rs | 11 +-- src-tauri/fileio/src/ifc_openings.rs | 76 +++++++++++++---- src/cli/__golden__/ansicht.svg | 5 +- src/export/exportIfc.validate.test.ts | 9 +- src/plan/__golden__/komplex-model3d.txt | 10 +-- .../muster-ansicht-ansicht-sued.txt | 6 +- src/plan/__golden__/muster-model3d.txt | 10 +-- src/plan/generatePlan.doorwindow.test.ts | 18 ++-- src/plan/toWalls3d.test.ts | 18 ++-- 17 files changed, 340 insertions(+), 74 deletions(-) diff --git a/TODO.md b/TODO.md index 7a3f6559..05ef024a 100644 --- a/TODO.md +++ b/TODO.md @@ -224,8 +224,14 @@ Wer zu einer ID mehr wissen will (Entscheide, Tests, Bilder), sucht dort nach `* (nur im Bearbeiten-Dialog). · M - ◐ **[95]** Fenster/Türen: mehr Bauarten. Hebeschiebetür-Bandseite in der Ansicht; Brüstungs-/Riegel-Einteilung unten (nur Oberlicht). · S -- ◐ **[105]** Fenster/Türen: Rahmen-Detail, Anschlag je Seite, Zargen. Türblatt im 3D mittig statt im Falz; Grundriss-Türblatt - an der Wandachse; Pfosten-Breite wirkt nur im 3D; Ressourcen-Tabs ohne die neuen Felder. · M +- ◐ **[105]** Fenster/Türen: Rahmen-Detail, Anschlag je Seite, Zargen. (10.11.) Zarge (Vorgabe) und Blockrahmen bei Dreh-/ + Pendeltüren mit eigenem Profil (`opening_detail::door_frame_of`): Zarge über die ganze Leibung, Falz 1.5 × 4 cm auf der + Aufschlagseite, Bekleidung beidseitig; Blockrahmen nach Typlage hinter dem Maueranschlag. Blatt im Falz der Aufschlagseite in + Grundriss (Drehpunkt an der Falzkante, fein als Rechteck mit Blattdicke), Schnitt, Ansicht, 3D und IFC (`fileio` + `fill_geometry`: Blatt bündig mit der Rahmenfläche, Rahmen im Blattband um den Falz ausgespart). Das schmale Rahmenband quer + über die Öffnung entfällt bei Drehtüren (bleibt bei Schiebetüren); nach aussen aufgehende Türen mit Viertel- statt + Dreiviertelbogen. Offen: Pendeltür ohne eigenes Profil (liegt ebenfalls im Falz); nicht in der Tauri-App/auf dem Mac + (Metal, 3D-Bild) angesehen. · S - ◐ **[106]** Schichteinzug je Wandschicht. Plantabelle (`sheet_table.rs`) ohne Leibungsspalten; Stufen-Fläche der Nachbarschicht beim Rücksprung nicht gezählt; Dachfenster ohne Schichteinzug; Schnitt parallel zur Wand durch Formöffnungs-Leibungen; 3D ohne Schichten zeigt an Leibungen keinen Rücksprung. · M diff --git a/scripts/gen-opening-test-project.ts b/scripts/gen-opening-test-project.ts index 6c576b42..7ee1d0b1 100644 --- a/scripts/gen-opening-test-project.ts +++ b/scripts/gen-opening-test-project.ts @@ -105,5 +105,29 @@ levels.push(section("S-DF", 19.2, -1, 7)); levels.push({ id: "a-dach", name: "Ansicht-Dach-Sued", kind: "elevation", visible: true, locked: false, linePoints: [{ x: 15, y: -3 }, { x: 23, y: -3 }], directionSign: 1, levelMarks: false } as DrawingLevel); levels.push({ id: "a-aussen", name: "Ansicht-Aussen", kind: "elevation", visible: true, locked: false, linePoints: [{ x: 0, y: -2 }, { x: 15, y: -2 }], directionSign: 1, levelMarks: false } as DrawingLevel); +// [105] Klassische Zarge/Blockrahmen (Rahmenband): Blatt im Falz auf der Aufschlagseite, nach innen +// und nach aussen aufgehend; [95] Hebeschiebetür (Bandseite = festes Feld) in einer Aussenwand. +doorTypes.push( + { id: "d-zarge", name: "Tür Zarge", kind: "dreh", leafCount: 1, leafStyle: "glatt", frameThickness: 0.05, frameKind: "zarge", frameWidth: 0.06, defaultWidth: 0.9, defaultHeight: 2.05 }, + { id: "d-block-aussen", name: "Tür Blockrahmen aussen", kind: "dreh", leafCount: 1, leafStyle: "glatt", frameThickness: 0.05, frameKind: "blockrahmen", frameWidth: 0.07, frameDepth: 0.08, defaultWidth: 0.9, defaultHeight: 2.05 }, + { id: "d-hs", name: "Hebeschiebetür", kind: "hebeschiebe", leafCount: 2, leafStyle: "glas", frameThickness: 0.08, frameWidth: 0.08, frameDepth: 0.16, insetFace: "aussen", insetFromFace: 0.18, defaultWidth: 2.4, defaultHeight: 2.3 }, +); +walls.push(wall("IW2", "iw", 0, 12, 8, 12), wall("AW3", "aw", 0, 16, 10, 16)); +const extraDoors: [string, string, number, Partial][] = [ + ["T-Z-in", "d-zarge", 0.6, { openingDir: "in" }], + ["T-Z-out", "d-zarge", 2.6, { openingDir: "out" }], + ["T-B-in", "d-block-aussen", 4.6, { openingDir: "in" }], + ["T-B-out", "d-block-aussen", 6.6, { openingDir: "out", swing: "right" }], +]; +for (const [id, typeId, pos, extra] of extraDoors) { + openings.push({ id, type: "opening", hostWallId: "IW2", categoryCode: "21", kind: "door", typeId, position: pos, width: 0.9, height: 2.05, sillHeight: 0, swing: "left", detailLevel: "fein", ...extra } as Opening); + levels.push(section(`S-${id}`, pos + 0.45, 11, 13)); +} +openings.push({ id: "HS1", type: "opening", hostWallId: "AW3", categoryCode: "21", kind: "door", typeId: "d-hs", position: 1, width: 2.4, height: 2.3, sillHeight: 0, detailLevel: "fein" } as Opening); +openings.push({ id: "HS2", type: "opening", hostWallId: "AW3", categoryCode: "21", kind: "door", typeId: "d-hs", position: 5, width: 2.4, height: 2.3, sillHeight: 0, hinge: "end", detailLevel: "fein" } as Opening); +levels.push({ id: "a-hs-aussen", name: "Ansicht-HS-Aussen", kind: "elevation", visible: true, locked: false, linePoints: [{ x: 0, y: 18 }, { x: 10, y: 18 }], directionSign: -1, levelMarks: false } as DrawingLevel); +levels.push({ id: "a-hs-innen", name: "Ansicht-HS-Innen", kind: "elevation", visible: true, locked: false, linePoints: [{ x: 0, y: 14 }, { x: 10, y: 14 }], directionSign: 1, levelMarks: false } as DrawingLevel); +levels.push({ id: "a-iw2", name: "Ansicht-IW2", kind: "elevation", visible: true, locked: false, linePoints: [{ x: 0, y: 11 }, { x: 8, y: 11 }], directionSign: 1, levelMarks: false } as DrawingLevel); + const project = { ...emptyProject, id: "opening-details", name: "Fenster/Tür-Details", drawingLevels: levels, walls, openings, windowTypes, doorTypes, roofs } as unknown as Project; writeFileSync(process.argv[2] ?? "opening-details.obp", JSON.stringify(project, null, 1)); diff --git a/src-tauri/core/src/ifc_data.rs b/src-tauri/core/src/ifc_data.rs index 78797bf8..062b0c41 100644 --- a/src-tauri/core/src/ifc_data.rs +++ b/src-tauri/core/src/ifc_data.rs @@ -545,7 +545,7 @@ fn fill_params(p: &Project, o: &Opening) -> FillParams { let is_door = o.kind == ElementKind::Door; let dt = if is_door { p.door_type(o) } else { None }; let wt = if is_door { None } else { p.window_type(o) }; - FillParams { + let mut fp = FillParams { frame_depth: dt.map_or(wt.and_then(|t| t.frame_depth), |t| t.frame_depth), inset: dt.map_or(wt.and_then(|t| t.inset_from_face), |t| t.inset_from_face).or_else(|| crate::opening_detail::default_frame_inset(p, o)), inset_outside: match (dt, wt) { @@ -585,7 +585,43 @@ fn fill_params(p: &Project, o: &Opening) -> FillParams { transom_height: dt.and_then(|t| t.transom_height).unwrap_or(0.0), glazed: dt.is_some_and(|t| t.leaf_style == DoorTypeLeafStyle::Glas), glazing_ratio: dt.and_then(|t| t.glazing_ratio), + }; + // [105] Türzarge mit Profil: Rahmenlage quer = Profil in der Wand (Zarge über die ganze Leibung, + // Blockrahmen nach Typ); das Blatt sitzt dann wie im 3D im Falz der Aufschlagseite. + if let Some((lo, hi)) = door_frame_extent(p, o) { + fp.frame_depth = Some(hi - lo); + fp.inset = Some(lo); + fp.inset_outside = true; } + fp +} + +/// Querlage `(lo, hi)` ab der Aussenfläche der Zarge/des Rahmens einer Tür mit Profil ([105]), ohne +/// Bekleidung und Spiegel vor den Wandflächen; `None` ohne Profil oder ganz vor der Wand (Blendrahmen). +fn door_frame_extent(p: &Project, o: &Opening) -> Option<(f64, f64)> { + use crate::opening_detail as od; + let df = od::door_frame_of(p, o)?; + let wall = p.walls.iter().find(|w| w.id == o.host_wall_id)?; + let total = p.wall_thickness(wall, 0.2); + if !(total > 1e-6) { + return None; + } + let innen = od::aufschlag_innen(o); + let (mut d0, mut d1) = (f64::INFINITY, f64::NEG_INFINITY); + for (part, poly) in od::door_frame_profile(&df, total, innen) { + if part == od::FramePart::Casing { + continue; + } + for q in poly { + let d = q[1].max(0.0).min(total); + d0 = d0.min(d); + d1 = d1.max(d); + } + } + if !(d1 - d0 > 1e-3) { + return None; + } + Some(if innen { (total - d1, total - d0) } else { (d0, d1) }) } /// FILL schreiben: Wandachse, Achs-Intervall und Höhen der Öffnung, Querausdehnung der Wand @@ -1893,6 +1929,25 @@ mod tests { assert_eq!((x.door_kind, x.leaf_count, x.hinge_at_start), (1.0, 1.0, false)); } + /// [105] Zarge (Profil über die ganze Leibung) und Blockrahmen: Rahmenlage der Füllung aus dem Profil, + /// damit IFC das Blatt wie das 3D im Falz der Aufschlagseite trägt. + #[test] + fn tuer_zarge_rahmenlage_aus_dem_profil() { + let mut p = Project::default(); + p.wall_types.push(WallType { id: "iw".into(), layers: vec![Layer { thickness: 0.15, ..Default::default() }], ..Default::default() }); + p.walls.push(Wall { id: "W".into(), wall_type_id: "iw".into(), end: Vec2 { x: 5.0, y: 0.0 }, height: 2.6, ..Default::default() }); + p.door_types = Some(vec![DoorType { id: "dt".into(), frame_kind: Some(DoorTypeFrameKind::Zarge), frame_width: Some(0.06), ..Default::default() }]); + let x = fill_params(&p, &opening(ElementKind::Door, Some("dt"))); + assert_eq!((x.frame_depth, x.inset, x.inset_outside), (Some(0.15), Some(0.0), true)); + p.door_types = Some(vec![DoorType { id: "dt".into(), frame_kind: Some(DoorTypeFrameKind::Blockrahmen), frame_depth: Some(0.08), inset_face: Some(DoorTypeInsetFace::Innen), inset_from_face: Some(0.02), ..Default::default() }]); + let x = fill_params(&p, &opening(ElementKind::Door, Some("dt"))); + let (d, i) = (x.frame_depth.unwrap(), x.inset.unwrap()); + assert!((d - 0.08).abs() < 1e-12 && (i - 0.05).abs() < 1e-12 && x.inset_outside, "{d} {i}"); + // Hebeschiebetür behält das Rahmenband des Typs. + p.door_types = Some(vec![DoorType { id: "dt".into(), kind: DoorTypeKind::Hebeschiebe, frame_depth: Some(0.16), ..Default::default() }]); + assert_eq!(fill_params(&p, &opening(ElementKind::Door, Some("dt"))).frame_depth, Some(0.16)); + } + #[test] fn klassifikation_ebkph_und_ebenen() { assert_eq!(ebkph_group(Kind::Wall), Some(("C", "Konstruktion Gebäude"))); diff --git a/src-tauri/core/src/opening_detail.rs b/src-tauri/core/src/opening_detail.rs index 5b136a88..f187b3ee 100644 --- a/src-tauri/core/src/opening_detail.rs +++ b/src-tauri/core/src/opening_detail.rs @@ -521,7 +521,7 @@ pub struct DoorFrame { pub steel: bool, } -/// Zarge der Tür, wenn ihre Art eine eigene Zeichnung hat (Zarge alt bleibt beim bisherigen Pfad). +/// Zarge der Tür, wenn ihre Art eine eigene Zeichnung hat (Zarge/Blockrahmen nur bei Dreh-/Pendeltüren). pub fn door_frame_of(p: &Project, o: &Opening) -> Option { if o.kind != ElementKind::Door { return None; @@ -531,8 +531,12 @@ pub fn door_frame_of(p: &Project, o: &Opening) -> Option { return None; } let kind = o.door_frame_kind.or(t.frame_kind).unwrap_or_default(); - // Zarge und Blockrahmen behalten das bisherige Rahmenband ([94]). - if matches!(kind, DoorTypeFrameKind::Zarge | DoorTypeFrameKind::Blockrahmen | DoorTypeFrameKind::Unknown) { + if kind == DoorTypeFrameKind::Unknown { + return None; + } + // Zarge und Blockrahmen: Profil mit Falz für Dreh-/Pendeltüren (Blatt im Falz der Aufschlagseite); + // Schiebe-, Hebeschiebe- und Taschentüren behalten das bisherige Rahmenband ([94]). + if matches!(kind, DoorTypeFrameKind::Zarge | DoorTypeFrameKind::Blockrahmen) && !matches!(t.kind, DoorTypeKind::Dreh | DoorTypeKind::Pendel | DoorTypeKind::Unknown) { return None; } let (a, b) = (t.door_frame.as_ref(), o.door_frame.as_ref()); @@ -598,6 +602,14 @@ pub fn door_frame_profile(f: &DoorFrame, total: f64, aufschlag_innen: bool) -> V let rect = |x0: f64, x1: f64, d0: f64, d1: f64| vec![[x0, d0], [x1, d0], [x1, d1], [x0, d1]]; let mut out = Vec::new(); match f.kind { + DoorTypeFrameKind::Zarge => { + // Holzzarge über die ganze Leibung, Falz auf der Aufschlagseite, Bekleidung (Umgriff) auf beiden + // Wandflächen wie im 3D bisher (2 cm über die Rohbaukante, 13 mm stark, Falz frei). + let (ov, ct) = (0.02, 0.013); + out.push((FramePart::Frame, vec![[0.0, 0.0], [fw - fzw, 0.0], [fw - fzw, fzd], [fw, fzd], [fw, t], [0.0, t]])); + out.push((FramePart::Casing, rect(-ov, fw - fzw, -ct, 0.0))); + out.push((FramePart::Casing, rect(-ov, fw, t, t + ct))); + } DoorTypeFrameKind::Umfassungszarge => { let c = ZARGE_GAP; let path = [[-f.spiegel, 0.0], [c, 0.0], [c, fzd], [c + fzw, fzd], [c + fzw, t], [-f.spiegel, t]]; @@ -823,7 +835,12 @@ mod tests { assert!(!r.is_empty(), "{k:?}"); } } + // [105] Zarge und Blockrahmen: eigenes Profil mit Falz für Dreh-/Pendeltüren, sonst das Rahmenband. p.door_types = Some(vec![mk(DoorTypeFrameKind::Zarge)]); + assert_eq!(door_frame_of(&p, &o).map(|f| f.kind), Some(DoorTypeFrameKind::Zarge)); + p.door_types = Some(vec![DoorType { kind: DoorTypeKind::Hebeschiebe, ..mk(DoorTypeFrameKind::Zarge) }]); + assert!(door_frame_of(&p, &o).is_none()); + p.door_types = Some(vec![DoorType { kind: DoorTypeKind::Schiebe, ..mk(DoorTypeFrameKind::Blockrahmen) }]); assert!(door_frame_of(&p, &o).is_none()); // Umfassungszarge: Spiegel beidseitig über die Wandflächen hinaus. p.door_types = Some(vec![mk(DoorTypeFrameKind::Umfassungszarge)]); @@ -837,6 +854,36 @@ mod tests { assert_eq!(prof.iter().filter(|(k, _)| *k == FramePart::Casing).count(), 2); } + /// [105] Klassische Zarge (umfassend, Bekleidung beidseitig) und Blockrahmen: Falz auf der + /// Aufschlagseite, das Blatt liegt darin — nach innen wie nach aussen aufgehend. + #[test] + fn zarge_und_blockrahmen_blatt_im_falz_der_aufschlagseite() { + let mut p = Project::default(); + let o_in = Opening { kind: ElementKind::Door, type_id: Some("d".into()), ..Default::default() }; + let o_out = Opening { opening_dir: Some(OpeningOpeningDir::Out), ..o_in.clone() }; + assert!(aufschlag_innen(&o_in) && !aufschlag_innen(&o_out)); + // Zarge: Rahmen über die ganze Wanddicke, Falz 1.5 × 4 cm an der Aufschlagfläche (d = 0). + p.door_types = Some(vec![DoorType { id: "d".into(), frame_kind: Some(DoorTypeFrameKind::Zarge), frame_width: Some(0.06), ..Default::default() }]); + let f = door_frame_of(&p, &o_in).unwrap(); + assert!(!f.steel); + let prof = door_frame_profile(&f, 0.15, true); + let (_, frame) = prof.iter().find(|(k, _)| *k == FramePart::Frame).unwrap(); + let (dmin, dmax) = frame.iter().fold((f64::MAX, f64::MIN), |(a, b), q| (a.min(q[1]), b.max(q[1]))); + assert!(dmin.abs() < 1e-12 && (dmax - 0.15).abs() < 1e-12); + assert!((profile_clear_x(&prof) - 0.06).abs() < 1e-12); + assert!(frame.iter().any(|q| (q[0] - 0.045).abs() < 1e-12 && (q[1] - 0.04).abs() < 1e-12), "Falzecke"); + assert_eq!(prof.iter().filter(|(k, _)| *k == FramePart::Casing).count(), 2); + assert_eq!(leaf_band(&f, 0.15, true), (0.0, 0.04)); + // Blockrahmen mittig (8 cm in 30 cm): Blatt auf der Aufschlagseite des Rahmens, je nach Richtung. + p.door_types = Some(vec![DoorType { id: "d".into(), frame_kind: Some(DoorTypeFrameKind::Blockrahmen), frame_width: Some(0.07), frame_depth: Some(0.08), inset_face: Some(DoorTypeInsetFace::Mitte), ..Default::default() }]); + let f = door_frame_of(&p, &o_in).unwrap(); + let (a0, a1) = leaf_band(&f, 0.3, true); + let (b0, b1) = leaf_band(&f, 0.3, false); + // Aufschlag-Koordinaten: ab der jeweiligen Aufschlagfläche bis an die Rahmenfläche 11 cm. + assert!((a0 - 0.11).abs() < 1e-12 && (a1 - 0.15).abs() < 1e-12); + assert!((b0 - 0.11).abs() < 1e-12 && (b1 - 0.15).abs() < 1e-12); + } + /// Projekt: Aussenwand (Putz, Dämmung, Backstein, Putz) mit einer Öffnung des Typs `t`. fn wand_mit(win: Option, door: Option) -> Project { let mut p = Project::default(); diff --git a/src-tauri/core/src/plan/elevation/openings.rs b/src-tauri/core/src/plan/elevation/openings.rs index 094dc919..53cb4fab 100644 --- a/src-tauri/core/src/plan/elevation/openings.rs +++ b/src-tauri/core/src/plan/elevation/openings.rs @@ -158,8 +158,8 @@ pub(super) fn collect_openings(p: &Project, frame: &[f64; 9]) -> Vec b.extend([bd.leaf, bd.leaf]), None => b.extend([nan; 2]), } - if band.is_some() { - // Zargen ohne Wandnase: der Anschlag gehört zur Zarge. + if dframe.as_ref().is_some_and(|d| d.kind != DoorTypeFrameKind::Blockrahmen) { + // Zargen ohne Wandnase: der Anschlag gehört zur Zarge (Blockrahmen sitzt hinter dem Maueranschlag). let k = b.len() - 13 - 3; b[k] = 0.0; } diff --git a/src-tauri/core/src/plan/elevation/tests.rs b/src-tauri/core/src/plan/elevation/tests.rs index 83a76bb3..4a9e719a 100644 --- a/src-tauri/core/src/plan/elevation/tests.rs +++ b/src-tauri/core/src/plan/elevation/tests.rs @@ -392,8 +392,11 @@ fn zargenspiegel_in_der_ansicht() { } q }; + // [105] Zarge (Vorgabe): Bekleidung 2 cm über die Rohbaukante; Blockrahmen in der Leibung. let plain = frame_w(&door(None)); - assert!((plain - o1.width).abs() < 1e-6, "{plain}"); + assert!((plain - o1.width - 0.04).abs() < 1e-6, "{plain}"); + let block = frame_w(&door(Some(DoorTypeFrameKind::Blockrahmen))); + assert!((block - o1.width).abs() < 1e-6, "{block}"); let zarge = frame_w(&door(Some(DoorTypeFrameKind::Umfassungszarge))); assert!((zarge - o1.width - 0.1).abs() < 1e-6, "{zarge}"); p.openings = None; diff --git a/src-tauri/core/src/plan/openings.rs b/src-tauri/core/src/plan/openings.rs index 7dbdbfd3..35faa890 100644 --- a/src-tauri/core/src/plan/openings.rs +++ b/src-tauri/core/src/plan/openings.rs @@ -138,6 +138,8 @@ fn plan_opening_inner(buf: &[f64]) -> Option> { // Versatz quer zur Achse; NaN = an der Wandachse). let frame_width_end = r.num().unwrap_or(f64::NAN); let (hinge_x, hinge_off) = (r.num().unwrap_or(f64::NAN), r.num().unwrap_or(f64::NAN)); + // Blattdicke (fein): Blatt im Falz als Rechteck statt Strich; NaN = Strich. + let leaf_thick = r.num().unwrap_or(f64::NAN); if ![sx, sy, ex, ey, total, ref_off, position, width].iter().all(|x| x.is_finite()) { return None; } @@ -188,8 +190,19 @@ fn plan_opening_inner(buf: &[f64]) -> Option> { }; for leaf in leaves(&door) { o.line(C_LEAF, hair, 0.0, 0.0, leaf.hinge, leaf.open_end); + if falz && leaf_thick > 1e-4 && leaf_thick < leaf.radius / 2.0 { + // Blattdicke: von der Aufschlagfläche (Drehpunkt) zur Gegenseite, quer zum offenen Blatt. + let t = leaf_thickness_dir(&leaf); + let (a, b) = (add(leaf.hinge, scale(t, leaf_thick)), add(leaf.open_end, scale(t, leaf_thick))); + o.line(C_LEAF, hair, 0.0, 0.0, leaf.open_end, b); + o.line(C_LEAF, hair, 0.0, 0.0, b, a); + o.line(C_LEAF, hair, 0.0, 0.0, a, leaf.hinge); + } if !overview { - o.arc(hair, leaf.hinge, leaf.closed_end, leaf.open_end, leaf.radius); + // Bögen laufen gegen den Uhrzeigersinn von `from` nach `to`: kurzen Bogen wählen + // (nach aussen aufgehende Türen sonst mit Dreiviertelkreis). + let (from, to) = short_arc(&leaf); + o.arc(hair, leaf.hinge, from, to, leaf.radius); } } if door_kind == 3 { @@ -198,9 +211,7 @@ fn plan_opening_inner(buf: &[f64]) -> Option> { for leaf in leaves(&other) { o.line(C_LEAF, hair, 0.0, 3.0, leaf.hinge, leaf.open_end); if !overview { - // Bögen laufen gegen den Uhrzeigersinn von `from` nach `to`: kurzen Bogen wählen. - let (a, b) = (sub(leaf.closed_end, leaf.hinge), sub(leaf.open_end, leaf.hinge)); - let (from, to) = if a.x * b.y - a.y * b.x >= 0.0 { (leaf.closed_end, leaf.open_end) } else { (leaf.open_end, leaf.closed_end) }; + let (from, to) = short_arc(&leaf); o.arc(hair, leaf.hinge, from, to, leaf.radius); } } @@ -478,6 +489,30 @@ fn lift_slide(o: &mut Out, js: V, je: V, n: V, lo: f64, hi: f64, hinge_end: bool arrow(o, add(along(js, je, from), scale(n, an)), add(along(js, je, to), scale(n, an)), n, hair); } +/// Endpunkte des Aufschlagbogens gegen den Uhrzeigersinn (der kurze Bogen zwischen zu und offen). +fn short_arc(leaf: &DoorLeaf) -> (V, V) { + let (a, b) = (sub(leaf.closed_end, leaf.hinge), sub(leaf.open_end, leaf.hinge)); + if a.x * b.y - a.y * b.x >= 0.0 { + (leaf.closed_end, leaf.open_end) + } else { + (leaf.open_end, leaf.closed_end) + } +} + +/// Richtung der Blattdicke am offenen Blatt: quer zum Blatt, zur geschlossenen Lage hin (das Blatt +/// dreht um seine Aufschlagfläche; geschlossen liegt die Dicke in der Wand, offen zur Öffnung hin). +fn leaf_thickness_dir(leaf: &DoorLeaf) -> V { + let d = sub(leaf.open_end, leaf.hinge); + let l = hypot2(d.x, d.y).max(1e-12); + let perp = v(-d.y / l, d.x / l); + let c = sub(leaf.closed_end, leaf.hinge); + if perp.x * c.x + perp.y * c.y >= 0.0 { + perp + } else { + scale(perp, -1.0) + } +} + fn finish(o: Out) -> Vec { let mut out = Vec::with_capacity(o.buf.len() + 1); out.push(o.n as f64); @@ -868,6 +903,46 @@ mod tests { assert!((cx - 1.012).abs() < 1e-9 && (cy.abs() - 0.15).abs() < 1e-9 && (r - 0.876).abs() < 1e-9, "{cx} {cy} {r}"); } + /// [105] Fein mit Blattdicke: Blatt im Falz als Rechteck (Strich + drei Kanten), Dicke quer zum + /// offenen Blatt zur Öffnung hin; ohne Falz bleibt der Strich. + #[test] + fn tuerblatt_fein_als_rechteck_mit_dicke() { + let mut b = input(true, 2.0, false, &[]); + let leaf_lines = |f: &[f64]| lines(f).into_iter().filter(|l| l.0 == C_LEAF).collect::>(); + assert_eq!(leaf_lines(&plan_opening(&b)).len(), 1); + b.extend([NAN, 0.045, 0.15, 0.04]); + let l = leaf_lines(&plan_opening(&b)); + assert_eq!(l.len(), 4, "{l:?}"); + // Offenes Blatt steht quer zur Wand am Drehpunkt x = 1.045; Dicke nach +x (zur Öffnung hin). + let xs: Vec = l.iter().flat_map(|q| [q.2, q.4]).collect(); + assert!(xs.iter().all(|x| *x > 1.045 - 1e-9 && *x < 1.085 + 1e-9), "{xs:?}"); + assert!(xs.iter().any(|x| (x - 1.085).abs() < 1e-9)); + } + + /// Nach aussen aufgehende Tür: Bogen gegen den Uhrzeigersinn über den kurzen Weg (Viertelkreis). + #[test] + fn aufschlagbogen_nach_aussen_ist_viertelkreis() { + for dir in [0.0, 1.0] { + let mut b = input(true, 1.0, false, &[]); + b[11] = dir; + let f = plan_opening(&b); + let (mut i, mut arc) = (1, None); + for _ in 0..f[0] as usize { + match f[i] as i64 { + 1 => i += 5 + 2 * f[i + 4] as usize, + 3 => { + arc = Some((v(f[i + 2], f[i + 3]), v(f[i + 4], f[i + 5]), v(f[i + 6], f[i + 7]))); + i += 9; + } + _ => i += 9, + } + } + let (c, from, to) = arc.unwrap(); + let (a, bb) = (sub(from, c), sub(to, c)); + assert!(a.x * bb.y - a.y * bb.x > 0.0, "gegen den Uhrzeigersinn, kurz (dir {dir})"); + } + } + /// [105] Pfosten mit eigener Breite: ein Rahmenblock über die Pfostenbreite (statt zwei Anschläge). #[test] fn pfosten_mit_breite_im_grundriss() { diff --git a/src-tauri/core/src/plan/walls.rs b/src-tauri/core/src/plan/walls.rs index 87586390..54997645 100644 --- a/src-tauri/core/src/plan/walls.rs +++ b/src-tauri/core/src/plan/walls.rs @@ -514,9 +514,9 @@ fn opening_symbol(c: &Ctx, out: &mut Vec, w: &Wall, o: &Opening, colo use crate::opening_detail as od; let innen = od::aufschlag_innen(o); let clear = od::profile_clear_x(&od::door_frame_profile(df, total, innen)); - let (d0, _) = od::leaf_band(df, total, innen); + let (d0, d1) = od::leaf_band(df, total, innen); let off = ref_off - total / 2.0 + if innen { total - d0 } else { d0 }; - ((clear - df.falz_width).max(0.0), off) + ((clear - df.falz_width).max(0.0), off, (d1 - d0).abs()) }); let (o_pos, o_wid) = if ext_l + ext_r > 1e-6 && o.width - ext_l - ext_r > 0.05 { (o.position + ext_l, o.width - ext_l - ext_r) } else { (o.position, o.width) }; let mut b: Vec = vec![w.start.x, w.start.y, w.end.x, w.end.y, total, ref_off, o_pos, o_wid, b01(door), detail_code]; @@ -597,7 +597,11 @@ fn opening_symbol(c: &Ctx, out: &mut Vec, w: &Wall, o: &Opening, colo b.push(o.sill_line_style.as_ref().and_then(|l| l.weight).unwrap_or(SYMBOL_LINE_MM)); // Details ([94]): Anschlag, Fensterbank, Storenkasten. // Anschlag: je Seite verschieden ⇒ zeichnet `opening_detail_plan`. - let rebate_sides = det.as_ref().map(|f| f.rebate).filter(|r| (r.left - r.right).abs() > 1e-9 || dframe.is_some()); + // Mit Zargen-Profil (auch Blockrahmen hinter dem Maueranschlag, [105]) immer dort. + let rebate_sides = match dframe { + Some(_) => crate::opening_detail::frame_of(p, o).map(|f| f.rebate), + None => det.as_ref().map(|f| f.rebate).filter(|r| (r.left - r.right).abs() > 1e-9), + }; b.push(match (&det, rebate_sides) { (_, Some(_)) => 0.0, (Some(f), None) => f.rebate.left, @@ -634,9 +638,10 @@ fn opening_symbol(c: &Ctx, out: &mut Vec, w: &Wall, o: &Opening, colo b01(s.opening.is_some_and(|k| k != OpeningKind::Fest)), ]); } - // [105] Anhang: Rahmenbreite rechts (Fenster), Drehpunkt des Türblatts im Falz (Einzug, Versatz). + // [105] Anhang: Rahmenbreite rechts (Fenster), Drehpunkt des Türblatts im Falz (Einzug, Versatz) und + // Blattdicke (nur fein: Blatt als Rechteck). b.push(det.as_ref().filter(|f| wt.is_some() && (f.sides.right - f.sides.left).abs() > 1e-9).map_or(f64::NAN, |f| f.sides.right)); - b.extend(hinge.map_or([f64::NAN; 2], |(x, off)| [x, off])); + b.extend(hinge.map_or([f64::NAN; 3], |(x, off, t)| [x, off, if detail == Detail::Fein { t } else { f64::NAN }])); let f = crate::plan::openings::plan_opening(&b); if f.is_empty() { return Ok(()); diff --git a/src-tauri/fileio/src/ifc_export/tests.rs b/src-tauri/fileio/src/ifc_export/tests.rs index e96b5b1f..9526e71d 100644 --- a/src-tauri/fileio/src/ifc_export/tests.rs +++ b/src-tauri/fileio/src/ifc_export/tests.rs @@ -629,15 +629,16 @@ fn tuer_hat_getrennte_koerper_mit_stilen_und_operation() { check_structure(&ifc); let door = first_line(&ifc, "IFCDOOR"); assert!(door.contains(".DOOR.,.SINGLE_SWING_LEFT.,$);"), "{door}"); - // Sechs Körper (Zarge 3, Kämpfer, Oberlicht-Glas, Blatt) in EINER Darstellung, je ein - // IfcStyledItem, drei Stile (Rahmen, Blatt, Glas). - assert_eq!(count(&ifc, "IFCSTYLEDITEM"), 6); + // Zwölf Körper in EINER Darstellung, je ein IfcStyledItem, drei Stile (Rahmen, Blatt, Glas): Zarge und + // Kämpfer je Querband (vor dem Blatt 2 Pfosten + Sturz + Kämpfer; im Blattband [105] um den Falz + // ausgespart: 4 Pfostenstücke + Sturz + Kämpfer), Oberlicht-Glas, Blatt. + assert_eq!(count(&ifc, "IFCSTYLEDITEM"), 12); assert_eq!(count(&ifc, "IFCSURFACESTYLE"), 3); assert_eq!(count(&ifc, "IFCSURFACESTYLERENDERING"), 3); assert!(ifc.contains("IFCSURFACESTYLE('Glas',.BOTH.,")); assert!(ifc.contains("IFCSURFACESTYLERENDERING(#")); - let shapes = ifc.lines().filter(|l| l.contains("IFCSHAPEREPRESENTATION") && l.contains("'SweptSolid'") && l.matches('#').count() == 8).count(); - assert!(shapes >= 1, "Darstellung mit 6 Körpern fehlt"); + let shapes = ifc.lines().filter(|l| l.contains("IFCSHAPEREPRESENTATION") && l.contains("'SweptSolid'") && l.matches('#').count() == 14).count(); + assert!(shapes >= 1, "Darstellung mit 12 Körpern fehlt"); // Füllungs-Placement mit Richtung (0,1,0) relativ zur Öffnung; Ursprung lokal. assert!(ifc.contains("IFCCARTESIANPOINT((1.45,0.0,0.0))")); } diff --git a/src-tauri/fileio/src/ifc_openings.rs b/src-tauri/fileio/src/ifc_openings.rs index 8ab6e8ad..e1ad0c1b 100644 --- a/src-tauri/fileio/src/ifc_openings.rs +++ b/src-tauri/fileio/src/ifc_openings.rs @@ -22,6 +22,9 @@ pub const DEFAULT_FRAME_WIDTH: f64 = 0.06; pub const DEFAULT_FRAME_DEPTH: f64 = 0.07; pub const DOOR_LEAF_THICK: f64 = 0.04; +/// Falzbreite der Zarge/des Rahmens: so weit greift das Türblatt seitlich und oben über die lichte Kante +/// (wie `opening_detail::door_frame_of` im Kern, Vorgabe 15 mm). +pub const DOOR_FALZ_WIDTH: f64 = 0.015; /// Glaspaket-Dicke je Scheibenzahl (1, 2, 3). pub const GLASS_PACKAGE_THICKNESS: [f64; 3] = [0.006, 0.024, 0.036]; /// Glasanteil des Türblatts, wenn der Typ keinen angibt. @@ -329,29 +332,54 @@ pub fn fill_geometry(p: &FillParams) -> FillGeometry { return FillGeometry { origin, u: door_u, kind: None, parts: Vec::new() }; } - // Zarge: Pfosten links/rechts über die ganze Höhe und Sturz (keine Schwelle). - add(0, p.from, a_in0, b0, b1, 0.0, h); - add(0, a_in1, p.to, b0, b1, 0.0, h); - add(0, a_in0, a_in1, b0, b1, h - fw, h); + // Blatt im Falz ([105], Dreh-/Pendeltür): Blattfläche bündig mit der Rahmenfläche der Aufschlagseite, + // seitlich und oben um die Falzbreite in den Rahmen (dort ausgespart); Schiebetüren mittig wie bisher. + let swing = matches!(p.door_kind, DoorKind::Swing | DoorKind::DoubleSwing); + let lt = js_min(DOOR_LEAF_THICK, b1 - b0); + let (l0, l1) = if !swing { + (b_mid - lt / 2.0, b_mid + lt / 2.0) + } else if p.swing_sign * p.dir_sign > 0.0 { + (b1 - lt, b1) + } else { + (b0, b0 + lt) + }; + let falz = if swing { js_min(DOOR_FALZ_WIDTH, fw / 2.0) } else { 0.0 }; + // Rahmen-Querbänder: im Blattband um den Falz schmaler, sonst volle Breite. + let bands: Vec<(f64, f64, f64)> = if falz > 0.0 { vec![(b0, l0, 0.0), (l0, l1, falz), (l1, b1, 0.0)] } else { vec![(b0, b1, 0.0)] }; - // Oberlicht: fester Glasstreifen über einem Kämpfer (Riegel in Rahmenbreite) innerhalb der Öffnungshöhe. + // Zarge: Pfosten links/rechts über die ganze Höhe und Sturz (keine Schwelle); im Blattband bis zur + // Blatt-Oberkante um den Falz schmaler, Sturz/Kämpfer dort um den Falz höher. let th = p.transom_height; let has_transom = th > MIN_DIM && th < h - fw - 0.5; let leaf_top = if has_transom { h - fw - th - fw } else { h - fw }; + for &(c0, c1, f) in &bands { + if f > 0.0 { + add(0, p.from, a_in0 - f, c0, c1, 0.0, leaf_top + f); + add(0, a_in1 + f, p.to, c0, c1, 0.0, leaf_top + f); + add(0, p.from, a_in0, c0, c1, leaf_top + f, h); + add(0, a_in1, p.to, c0, c1, leaf_top + f, h); + } else { + add(0, p.from, a_in0, c0, c1, 0.0, h); + add(0, a_in1, p.to, c0, c1, 0.0, h); + } + add(0, a_in0, a_in1, c0, c1, if has_transom { h - fw } else { h - fw + f }, h); + // Oberlicht: Kämpfer (Riegel in Rahmenbreite) innerhalb der Öffnungshöhe. + if has_transom { + add(0, a_in0, a_in1, c0, c1, leaf_top + f, leaf_top + fw); + } + } if has_transom { - add(0, a_in0, a_in1, b0, b1, leaf_top, leaf_top + fw); let gt = js_min(GLASS_PACKAGE_THICKNESS[1], b1 - b0); add(2, a_in0, a_in1, b_mid - gt / 2.0, b_mid + gt / 2.0, leaf_top + fw, h - fw); } - // Türblatt/-blätter im lichten Mass der Zarge, mittig in der Rahmentiefe. - let lt = js_min(DOOR_LEAF_THICK, b1 - b0); - let l0 = b_mid - lt / 2.0; - let l1 = b_mid + lt / 2.0; + // Türblatt/-blätter im lichten Mass der Zarge (plus Falz), in der Rahmentiefe auf der Aufschlagseite. + let leaf_top = leaf_top + falz; + let l_mid = (l0 + l1) / 2.0; let leaf_spans: Vec<(f64, f64)> = if p.leaf_count >= 2.0 { - vec![(a_in0, (a_in0 + a_in1) / 2.0), ((a_in0 + a_in1) / 2.0, a_in1)] + vec![(a_in0 - falz, (a_in0 + a_in1) / 2.0), ((a_in0 + a_in1) / 2.0, a_in1 + falz)] } else { - vec![(a_in0, a_in1)] + vec![(a_in0 - falz, a_in1 + falz)] }; let ratio = js_min(0.9, js_max(0.05, p.glazing_ratio.unwrap_or(DEFAULT_GLAZING_RATIO))); for (x0, x1) in leaf_spans { @@ -372,7 +400,7 @@ pub fn fill_geometry(p: &FillParams) -> FillGeometry { add(1, x0, px0, l0, l1, pz0, pz1); add(1, px1, x1, l0, l1, pz0, pz1); let gt = js_min(GLASS_PACKAGE_THICKNESS[1], lt * 0.6); - add(2, px0, px1, b_mid - gt / 2.0, b_mid + gt / 2.0, pz0, pz1); + add(2, px0, px1, l_mid - gt / 2.0, l_mid + gt / 2.0, pz0, pz1); } // OperationType: Blattzahl und Scharnierseite. IFC blickt von der Aufschlagseite (+Y des Füllungssystems) @@ -524,12 +552,24 @@ mod tests { #[test] fn tuer_zarge_blatt_glas_oberlicht() { let g = fill_geometry(&door()); - assert_eq!(role(&g, 0).len(), 3); + // [105] Rahmen (7 cm an der Aussenfläche −0.2) in zwei Querbändern: vor dem Blatt voll, im Blattband + // (Aufschlag nach +Y: an der Rahmenfläche −0.13) um den Falz ausgespart. + assert_eq!(role(&g, 0).len(), 3 + 5); let leaf = role(&g, 1); assert_eq!(leaf.len(), 1); let lb = bbox(&leaf[0].pts); - assert!(close(lb.y1 - lb.y0, DOOR_LEAF_THICK) && close(lb.x1 - lb.x0, 1.0 - 2.0 * DEFAULT_FRAME_WIDTH)); - assert!(leaf[0].z_rel == 0.0 && close(leaf[0].depth, 2.1 - DEFAULT_FRAME_WIDTH)); + let f = DOOR_FALZ_WIDTH; + assert!(close(lb.y1 - lb.y0, DOOR_LEAF_THICK) && close(lb.x1 - lb.x0, 1.0 - 2.0 * DEFAULT_FRAME_WIDTH + 2.0 * f)); + assert!(close(lb.y1, -0.2 + DEFAULT_FRAME_DEPTH), "Blattfläche bündig mit der Rahmenfläche der Aufschlagseite"); + assert!(leaf[0].z_rel == 0.0 && close(leaf[0].depth, 2.1 - DEFAULT_FRAME_WIDTH + f)); + // Rahmen + Blatt füllen den Querschnitt ohne Überlappung (Volumen = Rahmenring + lichtes Blatt). + let frame_vol = volume(&role(&g, 0)); + let ring = (2.0 * DEFAULT_FRAME_WIDTH * 2.1 + (1.0 - 2.0 * DEFAULT_FRAME_WIDTH) * DEFAULT_FRAME_WIDTH) * DEFAULT_FRAME_DEPTH; + let falz_vol = (2.0 * f * (2.1 - DEFAULT_FRAME_WIDTH + f) + (1.0 - 2.0 * DEFAULT_FRAME_WIDTH) * f) * DOOR_LEAF_THICK; + assert!(close(frame_vol, ring - falz_vol), "{frame_vol} {}", ring - falz_vol); + // Nach aussen aufgehend: Blatt an der anderen Rahmenfläche. + let g = fill_geometry(&FillParams { dir_sign: -1.0, ..door() }); + assert!(close(bbox(&role(&g, 1)[0].pts).y0, -0.2)); assert!(role(&g, 2).is_empty()); // Zweiflügelig. let g = fill_geometry(&FillParams { leaf_count: 2.0, ..door() }); @@ -539,7 +579,7 @@ mod tests { let glass = role(&g, 2); assert_eq!(glass.len(), 1); let gb = bbox(&glass[0].pts); - let (lw, lh) = (1.0 - 2.0 * DEFAULT_FRAME_WIDTH, 2.1 - DEFAULT_FRAME_WIDTH); + let (lw, lh) = (1.0 - 2.0 * DEFAULT_FRAME_WIDTH + 2.0 * f, 2.1 - DEFAULT_FRAME_WIDTH + f); assert!(close((gb.x1 - gb.x0) * glass[0].depth / (lw * lh), 0.36)); let leaf = role(&g, 1); assert_eq!(leaf.len(), 4); @@ -549,7 +589,7 @@ mod tests { let glass = role(&g, 2); assert!(close(glass[0].depth, 0.4) && close(glass[0].z_rel + glass[0].depth, 2.1 - DEFAULT_FRAME_WIDTH)); let leaf = role(&g, 1)[0]; - assert!(close(leaf.z_rel + leaf.depth, 2.1 - DEFAULT_FRAME_WIDTH - 0.4 - DEFAULT_FRAME_WIDTH)); + assert!(close(leaf.z_rel + leaf.depth, 2.1 - DEFAULT_FRAME_WIDTH - 0.4 - DEFAULT_FRAME_WIDTH + f)); // Reine Wandöffnung. let g = fill_geometry(&FillParams { door_kind: DoorKind::WallOpening, ..door() }); assert!(g.kind.is_none() && g.parts.is_empty()); diff --git a/src/cli/__golden__/ansicht.svg b/src/cli/__golden__/ansicht.svg index 8a392f93..b9b9954b 100644 --- a/src/cli/__golden__/ansicht.svg +++ b/src/cli/__golden__/ansicht.svg @@ -46,8 +46,9 @@ - - + + + diff --git a/src/export/exportIfc.validate.test.ts b/src/export/exportIfc.validate.test.ts index 9fb2c950..b3b33368 100644 --- a/src/export/exportIfc.validate.test.ts +++ b/src/export/exportIfc.validate.test.ts @@ -358,9 +358,10 @@ print(json.dumps({"n": len(c), "solids": len(body.Items), "volume": us.get_volum expect(d.filled).toBe(1); // Wand entlang +Y: n = (−1, 0); swing links/innen → Aufschlag −X; Scharnier am Ende, zweiflügelig → DOUBLE_DOOR_SINGLE_SWING. expect(d.op).toBe("DOUBLE_DOOR_SINGLE_SWING"); - // Rahmen: 3 Teile; Blätter: 2 × (4 Rahmenteile) mit Stil „Türblatt"; Glas: 2. + // Rahmen: Zarge über die Wanddicke in zwei Querbändern ([105]: 3 Teile vor dem Blatt, 5 im Blattband um + // den Falz ausgespart); Blätter: 2 × (4 Rahmenteile) mit Stil „Türblatt"; Glas: 2. const roles = d.items.map((i) => i.styles[0]); - expect(roles.filter((r) => r === "Rahmen").length).toBe(3); + expect(roles.filter((r) => r === "Rahmen").length).toBe(8); expect(roles.filter((r) => r === "Türblatt").length).toBe(8); expect(roles.filter((r) => r === "Glas").length).toBe(2); // Lage: Achse y 2…3.6 (Öffnung ab 1 m), quer zur Wand (x) innerhalb der Wanddicke 2.8…3.2, Boden z = 0. @@ -370,8 +371,8 @@ print(json.dumps({"n": len(c), "solids": len(body.Items), "volume": us.get_volum expect(d.bbox[1]).toBeLessThanOrEqual(3.2 + 1e-6); expect(d.bbox[4]).toBeCloseTo(0, 6); expect(d.bbox[5]).toBeCloseTo(2.1, 6); - // Glasanteil je Blatt = 50 % der Blattfläche (Blatt 0.74 × 2.04 je Flügel). - const leafArea = 0.74 * (2.1 - 0.06); + // Glasanteil je Blatt = 50 % der Blattfläche (Blatt 0.755 × 2.055 je Flügel, je 1.5 cm im Falz). + const leafArea = (0.74 + 0.015) * (2.1 - 0.06 + 0.015); const glassVol = d.items.filter((i) => i.styles[0] === "Glas").reduce((a, i) => a + i.volume, 0); expect(glassVol).toBeCloseTo(2 * leafArea * 0.5 * 0.024, 6); }); diff --git a/src/plan/__golden__/komplex-model3d.txt b/src/plan/__golden__/komplex-model3d.txt index ce3426de..7b898081 100644 --- a/src/plan/__golden__/komplex-model3d.txt +++ b/src/plan/__golden__/komplex-model3d.txt @@ -1,5 +1,5 @@ -meshes [1952] -meshes[].color [3] x1952 +meshes [1954] +meshes[].color [3] x1954 meshes[].indices [108] x6 meshes[].indices [144] x55 meshes[].indices [156642] @@ -7,7 +7,7 @@ meshes[].indices [1584] meshes[].indices [180] meshes[].indices [192] x3 meshes[].indices [348] x6 -meshes[].indices [36] x1858 +meshes[].indices [36] x1860 meshes[].indices [396] meshes[].indices [564] meshes[].indices [60] x9 @@ -20,7 +20,7 @@ meshes[].positions [108] x30 meshes[].positions [120] meshes[].positions [180] x9 meshes[].positions [216] -meshes[].positions [24] x1826 +meshes[].positions [24] x1828 meshes[].positions [252] x2 meshes[].positions [264] meshes[].positions [288] x7 @@ -60,4 +60,4 @@ walls[].start [2] x1489 walls[].startCut [4] x1164 walls[].topDrop [2] x103 walls[].topPlane [3] x259 -hash f77d51f089e28986 +hash f7059eb7178065e2 diff --git a/src/plan/__golden__/muster-ansicht-ansicht-sued.txt b/src/plan/__golden__/muster-ansicht-ansicht-sued.txt index 1cf10352..d7bb272f 100644 --- a/src/plan/__golden__/muster-ansicht-ansicht-sued.txt +++ b/src/plan/__golden__/muster-ansicht-ansicht-sued.txt @@ -1,9 +1,9 @@ viewBox 0.1 0 6.8 7.586 -bytes 7959 +bytes 8069 g 1 line 7 -polygon 57 +polygon 58 polyline 6 rect 1 svg 1 -hash 2b77ecb148e762fe +hash 3c16e358822ab2fd diff --git a/src/plan/__golden__/muster-model3d.txt b/src/plan/__golden__/muster-model3d.txt index 033c2b9f..1d90a9c0 100644 --- a/src/plan/__golden__/muster-model3d.txt +++ b/src/plan/__golden__/muster-model3d.txt @@ -1,10 +1,10 @@ -meshes [44] -meshes[].color [3] x44 -meshes[].indices [36] x42 +meshes [47] +meshes[].color [3] x47 +meshes[].indices [36] x45 meshes[].indices [540] meshes[].indices [60] meshes[].positions [120] -meshes[].positions [24] x42 +meshes[].positions [24] x45 meshes[].positions [360] roofLayers [2] roofLayers[].color [3] x2 @@ -28,4 +28,4 @@ walls[].start [2] x59 walls[].startCut [4] x47 walls[].topDrop [2] x6 walls[].topPlane [3] x6 -hash d9b519437e8b0665 +hash a131fee4170591f5 diff --git a/src/plan/generatePlan.doorwindow.test.ts b/src/plan/generatePlan.doorwindow.test.ts index f03f03e7..43c5111b 100644 --- a/src/plan/generatePlan.doorwindow.test.ts +++ b/src/plan/generatePlan.doorwindow.test.ts @@ -142,20 +142,27 @@ describe("generatePlan — Tür-/Fenstertyp-Rahmenband (opening-frame)", () => { ], { doorTypes: [doorType], windowTypes: [windowType] }, ); - // Tür: ein geschlossenes Rechteck aus 4 Kanten. Fenster: KEIN Band (sonst - // doppeltes, verschachteltes Rechteck über dem windowSymbol-Rahmen). - expect(linesOfClass(p, "opening-frame", "T1").length).toBe(4); + // [105] Drehtür: KEIN Rahmenband quer über die Öffnung mehr, der Blockrahmen steht als Profil mit + // Falz an beiden Leibungen. Fenster: KEIN Band (windowSymbol zeichnet den Rahmen). + expect(linesOfClass(p, "opening-frame", "T1").length).toBe(0); expect(linesOfClass(p, "opening-frame", "F1").length).toBe(0); + const profiles = generatePlan(p, "eg", visible, undefined, "mittel").primitives.filter((pr) => pr.kind === "polygon" && pr.openingId === "T1" && (pr as { stroke?: string }).stroke !== "none"); + expect(profiles.length).toBeGreaterThanOrEqual(2); + // Schiebetür behält das Rahmenband (Rechteck aus 4 Kanten). + const slide = project([{ ...baseDoor, typeId: "dt-s" }], { doorTypes: [{ ...doorType, id: "dt-s", kind: "schiebe" }] }); + expect(linesOfClass(slide, "opening-frame", "T1").length).toBe(4); }); it("Blockrahmen-Tür zeichnet eine kräftigere Linie als eine Zargen-Tür", () => { - const zargeDoor: DoorType = { ...doorType, id: "dt-zarge", frameKind: "zarge" }; + // Rahmenband nur noch bei Schiebetüren ([105]: Drehtüren mit Profil an den Leibungen). + const blockDoor: DoorType = { ...doorType, kind: "schiebe" }; + const zargeDoor: DoorType = { ...blockDoor, id: "dt-zarge", frameKind: "zarge" }; const p = project( [ { ...baseDoor, id: "T1", typeId: "dt1" }, { ...baseDoor, id: "T2", position: 3.0, typeId: "dt-zarge" }, ], - { doorTypes: [doorType, zargeDoor] }, + { doorTypes: [blockDoor, zargeDoor] }, ); const blockWeight = linesOfClass(p, "opening-frame", "T1")[0].weightMm; const zargeWeight = linesOfClass(p, "opening-frame", "T2")[0].weightMm; @@ -203,6 +210,7 @@ describe("generatePlan — Schichteinzug (insetFromFace/insetFace)", () => { // Am Tür-Zargenband geprüft (das Fenster nutzt jetzt windowSymbol statt Band). const insetDoor: DoorType = { ...doorType, + kind: "schiebe", id: "dt-inset", frameKind: "zarge", insetFromFace: 0.05, diff --git a/src/plan/toWalls3d.test.ts b/src/plan/toWalls3d.test.ts index 2ac2c854..93ba6b63 100644 --- a/src/plan/toWalls3d.test.ts +++ b/src/plan/toWalls3d.test.ts @@ -1197,10 +1197,10 @@ describe("VW-fein-Öffnungsdetails: Fensterbank, DIN-Symbole, verschachtelte Fl for (const mesh of meshes) for (let i = 2; i < mesh.positions.length; i += 3) m = Math.max(m, mesh.positions[i]); return m; }; - // Vollblatt (glatt): genau EIN Blatt-Panel, bis unter den Sturz (2.0 − fw). + // Vollblatt (glatt): genau EIN Blatt-Panel, bis in den Falz der Zarge (2.0 − fw + 1.5 cm Falz, [105]). const solid = projectToModel3d(doorProject(baseDoor)).meshes.filter(isLeaf); expect(solid.length).toBe(1); - expect(zTop(solid)).toBeCloseTo(2.0 - 0.06, 6); + expect(zTop(solid)).toBeCloseTo(2.0 - 0.06 + 0.015, 6); // Auch bei grob vorhanden (Füllung ist kein „fein"-Detail). expect(projectToModel3d(doorProject(baseDoor), { detail: "grob" }).meshes.filter(isLeaf).length).toBe(1); // Teilverglasung (glas, glazingRatio 0.4): Blatt nur im unteren 60%-Rest. @@ -1208,7 +1208,7 @@ describe("VW-fein-Öffnungsdetails: Fensterbank, DIN-Symbole, verschachtelte Fl doorProject({ ...baseDoor, id: "door-leaf-glas", leafStyle: "glas", glazingRatio: 0.4 }), ).meshes.filter(isLeaf); expect(glazed.length).toBe(1); - const fieldTop = 2.0 - 0.06; + const fieldTop = 2.0 - 0.06 + 0.015; // [105] bis in den Falz expect(zTop(glazed)).toBeCloseTo(fieldTop - 0.4 * fieldTop, 6); // Ganzglastür (glazingRatio 1): kein blinder Rest -> kein Blatt. expect( @@ -1313,13 +1313,13 @@ describe("VW-fein-Öffnungsdetails: Fensterbank, DIN-Symbole, verschachtelte Fl }); const frames = (frameKind: "zarge" | "blockrahmen"): number => projectToModel3d(doorProject(frameKind)).meshes.filter(isFrame).length; - // Zarge: Basis-Rahmen (2 Pfosten + Sturz, kein threshold) + 2 Wandseiten × 3 - // Bekleidungs-Riegel = 3 + 6 = 9. Blockrahmen: nur Basis = 3. - expect(frames("blockrahmen")).toBe(3); - expect(frames("zarge")).toBe(9); - // Umgriff nur mittel/fein, nicht grob. + // [105] Profil mit Falz an beiden Leibungen und am Sturz (je 2 Quader: Rahmen vor/im Falz) — + // Blockrahmen 3 × 2 = 6; Zarge zusätzlich die Bekleidung (Umgriff) auf beiden Wandseiten: 6 + 6 = 12. + expect(frames("blockrahmen")).toBe(6); + expect(frames("zarge")).toBe(12); + // Zarge/Umgriff nur mittel/fein, nicht grob. expect(projectToModel3d(doorProject("zarge"), { detail: "grob" }).meshes.filter(isFrame).length).toBe(0); - expect(projectToModel3d(doorProject("zarge"), { detail: "mittel" }).meshes.filter(isFrame).length).toBe(9); + expect(projectToModel3d(doorProject("zarge"), { detail: "mittel" }).meshes.filter(isFrame).length).toBe(12); }); it("Echtes Schwellenprofil: nur Tür mit `threshold`, eigenes SILL_RGB-Band über die Wanddicke", () => {