From b48b1839773eb40b74c7453a3d06999cb39cbf51 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 10 Nov 2026 11:20:26 +0000 Subject: [PATCH] =?UTF-8?q?[95][105]=20Hebeschiebet=C3=BCr-Bandseite=20und?= =?UTF-8?q?=20Br=C3=BCstungsfeld=20in=20der=20Ansicht,=20=C3=96ffnungslini?= =?UTF-8?q?en=20und=20Sturzlinie=20w=C3=A4hlbar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [95] Ansicht: Hebeschiebetür mit festem Feld auf der Bandseite, Schiebefeld mit Pfeil zum festen Feld, Flügelrahmen, überlappender Stoss. Fenster-Brüstungsfeld unter einem Riegel (bottomPanelHeight, bottomSashes) in Ansicht und 3D. Öffnungslinien (sashSymbols, Ansicht) und Aufschlagbogen der Drehflügel im Grundriss (planSwingArcs) am Fenstertyp und an der Öffnung. [105] Linientyp der Sturzlinien (lintelLineStyle) an Türtyp und Öffnung. UI: Objekt-Info, Ressourcen-Tabs, Fenster-Dialog; i18n de/en. Golden komplex Ansicht (+Flügelrahmen der Hebeschiebetüren) bewusst nachgeführt. --- TODO.md | 11 +- scripts/gen-opening-test-project.ts | 11 +- src-tauri/core/src/model/generated.rs | 51 ++++++ src-tauri/core/src/model3d/openings.rs | 27 ++-- src-tauri/core/src/opening_geom.rs | 15 ++ src-tauri/core/src/openings3d.rs | 74 ++++++++- src-tauri/core/src/plan/elevation/openings.rs | 17 ++ src-tauri/core/src/plan/elevation_geom.rs | 153 +++++++++++++++--- src-tauri/core/src/plan/openings.rs | 55 ++++++- src-tauri/core/src/plan/section/openings.rs | 1 + src-tauri/core/src/plan/walls.rs | 21 +++ src-tauri/core/src/selection_info.rs | 3 + src/i18n/de.ts | 12 ++ src/i18n/en.ts | 12 ++ src/model/types.generated.ts | 29 ++++ src/panels/host.ts | 6 + src/panels/objectInfo/OpeningSections.tsx | 52 ++++++ .../komplex-ansicht-ansicht-sued.txt | 8 +- src/state/panelHost/elementAttributesHost.ts | 3 + src/state/selectionInfo.ts | 5 + src/ui/OpeningEditorDialog.tsx | 16 ++ src/ui/resourceManager/DoorStylesTab.tsx | 11 ++ src/ui/resourceManager/WindowStylesTab.tsx | 29 ++++ 23 files changed, 578 insertions(+), 44 deletions(-) diff --git a/TODO.md b/TODO.md index 05ef024a..0a1017c3 100644 --- a/TODO.md +++ b/TODO.md @@ -222,15 +222,20 @@ Wer zu einer ID mehr wissen will (Entscheide, Tests, Bilder), sucht dort nach `* - ◐ **[94]** Fenster/Türen: Konstruktionsdetails. Brüstung als eigenes Bauteil; Anschlag/Leibung in den Ressourcen-Tabs (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 +- ◐ **[95]** Fenster/Türen: mehr Bauarten. (10.11.) Hebeschiebetür in der Ansicht mit Bandseite: festes Feld auf der + Bandseite (`hinge`), Schiebefeld mit Pfeil zum festen Feld, beide Flügelrahmen, Stoss überlappend. Fenster-Brüstungsfeld + unter einem Riegel (`bottomPanelHeight`, Einteilung `bottomSashes`): Ansicht und 3D (Riegel, Pfosten, eigene Scheibe). + Öffnungslinien wählbar (`sashSymbols`: Dreh-/Kipp-Dreiecke in der Ansicht; `planSwingArcs`: Aufschlagbogen der + Drehflügel im Grundriss) am Fenstertyp und an der Öffnung (Objekt-Info, Ressourcen, Fenster-Dialog). Offen: Brüstungsfeld + nicht im Schnitt (Riegel nicht geschnitten), nicht im IFC; Öffnungslinien im 3D immer an; nicht in der Tauri-App geprüft. · S - ◐ **[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 + Dreiviertelbogen. Sturzlinie wählbar (`lintelLineStyle` an Türtyp/Öffnung: gestrichelt, punktiert, durchgehend, keine; + Strichmuster [153]); Öffnungswinkel bleibt in der Objekt-Info (`swingAngle`). 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 diff --git a/scripts/gen-opening-test-project.ts b/scripts/gen-opening-test-project.ts index 7ee1d0b1..7b913045 100644 --- a/scripts/gen-opening-test-project.ts +++ b/scripts/gen-opening-test-project.ts @@ -115,7 +115,7 @@ doorTypes.push( 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-Z-out", "d-zarge", 2.6, { openingDir: "out", lintelLineStyle: "punktiert" }], ["T-B-in", "d-block-aussen", 4.6, { openingDir: "in" }], ["T-B-out", "d-block-aussen", 6.6, { openingDir: "out", swing: "right" }], ]; @@ -123,6 +123,15 @@ 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)); } +// [95] Fenster mit Brüstungsfeld unter einem Riegel (zwei feste Felder), Aufschlagbogen im Grundriss. +windowTypes.push(winBase("w-bruestung", "F Brüstungsfeld, Aufschlagbogen", undefined, { + wingCount: 2, + bottomPanelHeight: 0.5, + bottomSashes: [{ kind: "fluegel", autoWidth: true, opening: "fest" }, { kind: "pfosten", postWidth: 0.06 }, { kind: "fluegel", autoWidth: true, opening: "fest" }], + planSwingArcs: true, + defaultSillHeight: 0.3, +})); +openings.push({ id: "FBR", type: "opening", hostWallId: "AW3", categoryCode: "21", kind: "window", typeId: "w-bruestung", position: 8.0, width: 1.4, height: 1.9, sillHeight: 0.3, detailLevel: "fein" } as Opening); 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); diff --git a/src-tauri/core/src/model/generated.rs b/src-tauri/core/src/model/generated.rs index 623e7637..a32f9720 100644 --- a/src-tauri/core/src/model/generated.rs +++ b/src-tauri/core/src/model/generated.rs @@ -982,6 +982,10 @@ pub struct DoorType { #[serde(rename = "lintelHeight", default, skip_serializing_if = "Option::is_none")] #[ts(optional)] pub lintel_height: Option, + /// Linientyp der Sturzlinien im Grundriss ([105]); fehlt ⇒ gestrichelt. + #[serde(rename = "lintelLineStyle", default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub lintel_line_style: Option, /// Rahmen-Detail ([105]): Blendrahmen je Seite, Flügelrahmen, Pfosten/Kämpfer, Zusatzprofile, /// Anschlag je Seite. Fehlt ⇒ wie bisher (`frameWidth`, `rebateDepth`). #[serde(rename = "frameDetail", default, skip_serializing_if = "Option::is_none")] @@ -1314,6 +1318,24 @@ pub struct WindowType { #[serde(rename = "transomSashes", default, skip_serializing_if = "Option::is_none")] #[ts(optional)] pub transom_sashes: Option>, + /// Brüstungsfeld unten ([95]): Höhe ab Öffnungs-Unterkante bis Mitte des Riegels (Meter), darunter + /// ein festes Feld. 0/fehlt ⇒ keins (bisher). + #[serde(rename = "bottomPanelHeight", default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub bottom_panel_height: Option, + /// Einteilung des Brüstungsfelds (Pfosten/Riegel wie {@link transomSashes}, je Feld fest oder + /// öffenbar). Fehlt ⇒ ein festes Glasfeld. + #[serde(rename = "bottomSashes", default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub bottom_sashes: Option>, + /// Öffnungslinien der Flügel in der Ansicht (Dreh-/Kipp-Dreiecke, [95]). Fehlt ⇒ an. + #[serde(rename = "sashSymbols", default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub sash_symbols: Option, + /// Aufschlagbogen der Drehflügel im Grundriss (zur Innenseite, [95]). Fehlt ⇒ aus. + #[serde(rename = "planSwingArcs", default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub plan_swing_arcs: Option, /// Auf-/Untersicht-Andeutung im Grundriss (mittel/fein): eine Referenzlinie an /// der gewählten Fläche(n) — sinnvoll, wenn die Öffnung die Schnittebene NICHT /// regulär durchschneidet (z. B. bodentiefes Fenster oder hoch sitzendes @@ -2855,6 +2877,23 @@ pub enum OpeningHinge { Unknown, } +/// Linientyp der Sturzlinien einer Tür im Grundriss ([105]; Strichmuster in Papier-mm wie [153]). +#[derive(Debug, Clone, Copy, PartialEq, Eq, Default, Serialize, Deserialize, TS)] +pub enum LintelLineStyle { + #[default] + #[serde(rename = "gestrichelt")] + Gestrichelt, + #[serde(rename = "punktiert")] + Punktiert, + #[serde(rename = "durchgehend")] + Durchgehend, + #[serde(rename = "keine")] + Keine, + #[serde(other)] + #[ts(skip)] + Unknown, +} + /// Schwenkrichtung der Tür relativ zur Wandachse. #[derive(Debug, Clone, Copy, PartialEq, Eq, Default, Serialize, Deserialize, TS)] pub enum SwingSide { @@ -3084,6 +3123,18 @@ pub struct Opening { #[serde(rename = "lintelLines", default, skip_serializing_if = "Option::is_none")] #[ts(optional, inline)] pub lintel_lines: Option, + /// Linientyp der Sturzlinien im Grundriss ([105]); fehlt ⇒ wie Türtyp, sonst gestrichelt. + #[serde(rename = "lintelLineStyle", default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub lintel_line_style: Option, + /// Fenster: Öffnungslinien in der Ansicht ein/aus (übersteuert den Fenstertyp, [95]). + #[serde(rename = "sashSymbols", default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub sash_symbols: Option, + /// Fenster: Aufschlagbogen der Drehflügel im Grundriss ein/aus (übersteuert den Fenstertyp, [95]). + #[serde(rename = "planSwingArcs", default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub plan_swing_arcs: Option, /// Referenz auf einen Bauteil-Typ (Bibliothek): {@link DoorType} bei /// `kind: "door"`, {@link WindowType} bei `kind: "window"`. Fehlt sie, gilt /// das heutige Inline-Verhalten (rückwärtskompatibel). Typ-Defaults liefern diff --git a/src-tauri/core/src/model3d/openings.rs b/src-tauri/core/src/model3d/openings.rs index 321d8823..6beed944 100644 --- a/src-tauri/core/src/model3d/openings.rs +++ b/src-tauri/core/src/model3d/openings.rs @@ -114,16 +114,23 @@ fn write_opening(w: &mut FlatWriter, p: &Project, op: &Opening) { ]); } let transom = wt.transom_sashes.as_deref().unwrap_or(&[]); - w.num(transom.len() as f64); - for s in transom { - w.nums(&[ - if s.kind == SashDefKind::Fluegel { 0.0 } else { 1.0 }, - flag(s.auto_width == Some(false)), - opt(s.width), - opt(s.post_width), - opening_kind_code(s.opening), - flag(s.hinge_side != Some(SashDefHingeSide::Right)), - ]); + let bottom = wt.bottom_sashes.as_deref().unwrap_or(&[]); + for (k, list) in [transom, bottom].into_iter().enumerate() { + if k == 1 { + // [95] Brüstungsfeld: Höhe bis Riegelmitte, dann seine Einteilung. + w.num(wt.bottom_panel_height.filter(|v| v.is_finite()).unwrap_or(0.0)); + } + w.num(list.len() as f64); + for s in list { + w.nums(&[ + if s.kind == SashDefKind::Fluegel { 0.0 } else { 1.0 }, + flag(s.auto_width == Some(false)), + opt(s.width), + opt(s.post_width), + opening_kind_code(s.opening), + flag(s.hinge_side != Some(SashDefHingeSide::Right)), + ]); + } } return; } diff --git a/src-tauri/core/src/opening_geom.rs b/src-tauri/core/src/opening_geom.rs index 421ffecd..6e467783 100644 --- a/src-tauri/core/src/opening_geom.rs +++ b/src-tauri/core/src/opening_geom.rs @@ -205,6 +205,9 @@ pub struct WindowSpec { pub inset_mid: bool, /// Rahmenbreite an der Leibung beim Wandende ([105]); NaN = wie `frame_width`. pub frame_width_end: f64, + /// Aufschlagbogen je Flügel ([95], gleich lang wie `sashes` oder leer): 0 keiner, 1 Band am Anfang, + /// 2 Band am Ende. + pub swing: Vec, } #[derive(Clone, Copy, PartialEq, Eq, Debug)] @@ -222,6 +225,8 @@ pub struct WindowSymbol { pub sash_frames: Vec>, pub meeting_marks: Vec>, pub jamb_marks: Vec>, + /// Aufschlag der Drehflügel nach innen ([95]): Band, geschlossenes Ende, offenes Ende (90°), Radius. + pub swing_arcs: Vec<(V, V, V, f64)>, } fn or_zero(x: f64) -> f64 { @@ -350,6 +355,16 @@ pub fn window_symbol( if clear_to - clear_from <= 1e-6 { continue; } + // [95] Aufschlagbogen zur Innenseite (hohe Versätze) ab der Rahmen-Innenfläche. + if let Some(&code) = spec.swing.get(si).filter(|_| spec.swing.len() == spec.sashes.len()) { + if code == 1.0 || code == 2.0 { + let (h_u, c_u) = if code == 1.0 { (clear_from, clear_to) } else { (clear_to, clear_from) }; + let hinge = add(along(js, je, h_u), scale(n, frame_outer_n)); + let closed = add(along(js, je, c_u), scale(n, frame_outer_n)); + let r = clear_to - clear_from; + sym.swing_arcs.push((hinge, closed, add(hinge, scale(n, r)), r)); + } + } if !fein { continue; } diff --git a/src-tauri/core/src/openings3d.rs b/src-tauri/core/src/openings3d.rs index 221f6f9f..0110dd39 100644 --- a/src-tauri/core/src/openings3d.rs +++ b/src-tauri/core/src/openings3d.rs @@ -161,6 +161,9 @@ pub struct WindowTypeIn { pub shading: Option<[f64; 3]>, /// Einteilung des Oberlichts (Pfosten/Riegel, [95]); leer ⇒ ein festes Feld. pub transom_sashes: Vec, + /// Brüstungsfeld unten ([95]): Höhe ab Öffnungs-UK bis Riegelmitte (0 = keins) und Einteilung. + pub bottom_height: f64, + pub bottom_sashes: Vec, /// Kasten im Sturz (verdeckt, kein Quader) statt vorgesetzt. pub shading_sturz: bool, /// Führungsschienen in der Leibung (Kasten im Sturz, nicht Markise). @@ -472,6 +475,8 @@ struct FrameParams<'a> { glazed_fraction: f64, sashes: std::borrow::Cow<'a, [SashIn]>, transom_sashes: &'a [SashIn], + bottom_height: f64, + bottom_sashes: &'a [SashIn], half_thickness: f64, draw_sill: bool, draw_interior_sill: bool, @@ -526,6 +531,8 @@ fn resolve_frame(o: &OpeningIn) -> Option> { glazed_fraction: jmax(0.05, jmin(1.0, or(d.glazing_ratio, 1.0))), sashes: std::borrow::Cow::Borrowed(&[]), transom_sashes: &[], + bottom_height: 0.0, + bottom_sashes: &[], half_thickness: half, draw_sill: false, draw_interior_sill: false, @@ -575,6 +582,8 @@ fn resolve_frame(o: &OpeningIn) -> Option> { glazed_fraction: 1.0, sashes, transom_sashes: &w.transom_sashes, + bottom_height: if w.bottom_height > EPS { w.bottom_height } else { 0.0 }, + bottom_sashes: &w.bottom_sashes, half_thickness: half, draw_sill: w.sill_board != SillBoard::None && w.sill_board != SillBoard::Inner, draw_interior_sill: w.sill_board == SillBoard::Inner || w.sill_board == SillBoard::Both, @@ -700,7 +709,7 @@ fn frame_meshes(em: &mut Emitter, o: &OpeningIn, p: &FrameParams, detail: Detail } let sash_from = rf0 + fl; let sash_to = rt0 - fr; - let sash_bottom = rb0 + if p.has_sill { fb } else { 0.0 }; + let mut sash_bottom = rb0 + if p.has_sill { fb } else { 0.0 }; let mut sash_top = rtop0 - ft; // Oberlicht-Band (über dem Riegel) für dessen Einteilung. let mut transom_band: Option<(f64, f64)> = None; @@ -710,9 +719,17 @@ fn frame_meshes(em: &mut Emitter, o: &OpeningIn, p: &FrameParams, detail: Detail transom_band = Some((split_z + tw / 2.0, sash_top)); sash_top = split_z - tw / 2.0; } - // Pfosten im Oberlicht (mittel/fein). - if let (true, Some((tb, tt))) = (sashes_on, transom_band) { - for (s, cf, ct) in sash_spans(p.transom_sashes, sash_from, sash_to) { + // Brüstungsfeld unter dem Riegel ([95]). + let mut bottom_band: Option<(f64, f64)> = None; + if let Some(split_z) = bottom_split(zb0, p.bottom_height, sash_bottom, sash_top, tw) { + em.axis_box(sash_from, sash_to, split_z - tw / 2.0, split_z + tw / 2.0, p.n_min, p.n_max, Part::Frame); + bottom_band = Some((sash_bottom, split_z - tw / 2.0)); + sash_bottom = split_z + tw / 2.0; + } + // Pfosten im Oberlicht und im Brüstungsfeld (mittel/fein). + for (list, band) in [(p.transom_sashes, transom_band), (p.bottom_sashes, bottom_band)] { + let (true, Some((tb, tt))) = (sashes_on, band) else { continue }; + for (s, cf, ct) in sash_spans(list, sash_from, sash_to) { if s.kind == SashKind::Post { em.axis_box(cf, ct, tb, tt, p.n_min, p.n_max, Part::Frame); } @@ -763,6 +780,9 @@ fn frame_meshes(em: &mut Emitter, o: &OpeningIn, p: &FrameParams, detail: Detail if let Some((tb, tt)) = transom_band { bands.push((p.transom_sashes, tb, tt)); } + if let Some((bb, bt)) = bottom_band { + bands.push((p.bottom_sashes, bb, bt)); + } for (band_sashes, band_bottom, band_top) in bands { if sashes_on && !band_sashes.is_empty() && sash_to - sash_from > EPS && band_top - band_bottom > EPS { let segs = sash_spans(band_sashes, sash_from, sash_to); @@ -885,6 +905,13 @@ fn glass_panes(em: &mut Emitter, o: &OpeningIn, p: &FrameParams) { }; let frac = jmax(0.05, jmin(1.0, p.glazed_fraction)); let glazed_bottom = |b: f64, t: f64| t - frac * (t - b); + // Brüstungsfeld ([95]): eigene Scheibe unter dem Riegel, das Hauptfeld beginnt darüber. + let mut sash_bottom = sash_bottom; + let tw = dd.map_or(fw, |d| dv(d.transom_width, fw)); + if let Some(split_z) = bottom_split(o.z_bottom, p.bottom_height, sash_bottom, sash_top_full, tw) { + push(em, sash_bottom, split_z - tw / 2.0); + sash_bottom = split_z + tw / 2.0; + } if p.transom_height > EPS { let split_z = clamp_range(o.z_top - p.transom_height, sash_bottom, sash_top_full); let main_top = split_z - fw / 2.0; @@ -897,6 +924,13 @@ fn glass_panes(em: &mut Emitter, o: &OpeningIn, p: &FrameParams) { } } +/// Riegelmitte des Brüstungsfelds ([95]) zwischen `bottom` und `top`; `None`, wenn keins gesetzt ist oder +/// es das Flügelfeld (mind. 10 cm) bzw. sich selbst (mind. 2 cm) nicht mehr zuliesse. +fn bottom_split(z_bottom: f64, height: f64, bottom: f64, top: f64, tw: f64) -> Option { + let z = z_bottom + height; + (height > EPS && z - tw / 2.0 > bottom + 0.02 && z + tw / 2.0 < top - 0.1).then_some(z) +} + /// Türblatt im Hauptfeld (Vollblatt bzw. blinder Rest unter der Teilverglasung, `doorLeafPanels`). fn door_leaf(em: &mut Emitter, o: &OpeningIn, p: &FrameParams) { let fw = p.frame_width; @@ -1118,7 +1152,8 @@ pub fn wall_mesh_passes(w: &WallIn, detail: Detail) -> [Vec; 3] { // BandEnde` // Fenster: `glazingPanes, mullionRows, mullionCols, sillBoard (0 aussen/fehlt, 1 keine, // 2 innen, 3 beide), Rollladen (0/1), Breite, Höhe, Tiefe, imSturz, Schienen, Flügelzahl-Default, -// Öffnungsart-Default, nFlügel, Flügel…, nOberlicht, Flügel… ([95])` +// Öffnungsart-Default, nFlügel, Flügel…, nOberlicht, Flügel… ([95]), Brüstungsfeld-Höhe, +// nBrüstung, Flügel…` // Flügel = `Art (0 Flügel, 1 Pfosten, 2 andere), festeBreite, width, postWidth, Öffnungsart, // BandLinks` // Öffnungsart: 0 fehlt, 1 dreh, 2 kipp, 3 drehkipp, 4 fest, 5 schiebe, 6 andere. NaN = fehlt. @@ -1189,6 +1224,8 @@ fn decode_type(r: &mut Reader, door: bool) -> Option { let default_opening = opening_kind(r.num()?); let sashes = decode_sashes(r)?; let transom_sashes = decode_sashes(r)?; + let bottom_height = r.num()?; + let bottom_sashes = decode_sashes(r)?; KindIn::Window(WindowTypeIn { glazing_panes, mullion_rows, @@ -1196,6 +1233,8 @@ fn decode_type(r: &mut Reader, door: bool) -> Option { sill_board, sashes, transom_sashes, + bottom_height, + bottom_sashes, default_wing_count, default_opening, shading: if create { Some(shading_box) } else { None }, @@ -1327,6 +1366,8 @@ mod tests { sill_board: sill, sashes: vec![], transom_sashes: vec![], + bottom_height: 0.0, + bottom_sashes: vec![], default_wing_count: 1.0, default_opening: SashOpening::TurnTilt, shading: None, @@ -1565,6 +1606,29 @@ mod tests { assert_eq!(n(&parts(&ty, Detail::Fine), Part::Shading), 2, "im Sturz: nur zwei Führungsschienen"); } + /// [95] Brüstungsfeld: Riegel (ein Rahmenquader) und eigene Scheibe darunter; Pfosten im Feld. + #[test] + fn bruestungsfeld_mit_riegel() { + let count = |ty: &TypeIn, part: Part| opening_meshes(&[wall(op(false, Some(ty.clone())))], Detail::Fine).iter().filter(|m| m.part == part).count(); + let mut ty = window_type(SillBoard::None); + let (frames, glass) = (count(&ty, Part::Frame), count(&ty, Part::Glass)); + if let KindIn::Window(w) = &mut ty.kind { + w.bottom_height = 0.4; + } + assert_eq!(count(&ty, Part::Frame), frames + 1, "Riegel"); + assert!(count(&ty, Part::Glass) > glass, "Scheibe im Brüstungsfeld"); + let sash = |kind: SashKind| SashIn { kind, fixed_width: false, width: f64::NAN, post_width: f64::NAN, opening: SashOpening::Fixed, hinge_left: true }; + if let KindIn::Window(w) = &mut ty.kind { + w.bottom_sashes = vec![sash(SashKind::Sash), sash(SashKind::Post), sash(SashKind::Sash)]; + } + assert_eq!(count(&ty, Part::Frame), frames + 2, "Riegel + Pfosten"); + // Zu hoch für das Flügelfeld: nichts. + if let KindIn::Window(w) = &mut ty.kind { + w.bottom_height = 1.25; + } + assert_eq!(count(&ty, Part::Frame), frames); + } + /// [95] Oberlicht-Einteilung (Pfosten + Kippflügel) und Türarten in 3D. #[test] fn oberlicht_einteilung_und_tuerarten() { diff --git a/src-tauri/core/src/plan/elevation/openings.rs b/src-tauri/core/src/plan/elevation/openings.rs index 53cb4fab..f5f07fb6 100644 --- a/src-tauri/core/src/plan/elevation/openings.rs +++ b/src-tauri/core/src/plan/elevation/openings.rs @@ -131,6 +131,8 @@ pub(super) fn collect_openings(p: &Project, frame: &[f64; 9]) -> Vec 4.0, _ => 1.0, }, + // Hebeschiebetür: festes Feld auf der Bandseite (2 Anfang, 6 Ende). + Some(DoorTypeKind::Hebeschiebe) if op.hinge.is_some_and(|s| s == OpeningHinge::End) => 6.0, Some(DoorTypeKind::Hebeschiebe) => 2.0, Some(DoorTypeKind::Pendel) => 3.0, _ => 0.0, @@ -163,6 +165,9 @@ pub(super) fn collect_openings(p: &Project, frame: &[f64; 9]) -> Vec = Vec::new(); @@ -213,6 +218,18 @@ pub(super) fn collect_openings(p: &Project, frame: &[f64; 9]) -> Vec Quad { /// Vorgabe): Rahmenbreite links/rechts/oben/unten (sonst `o[12]`), Anschlag links/rechts/oben (sonst /// `o[18]`), Verbreiterungsprofil links/rechts, Fensterbank-/Storen-Anschlussprofil (0 = keins), /// Türblatt-Einzug ab Rohbaukante seitlich/oben (sonst 4 % der Breite bzw. 3 % der Höhe). -const REC: usize = 35; +const REC: usize = 37; /// Projiziert die zum Betrachter zeigende Wand-Langseite der Öffnung; `None` ohne sichtbare Seite. fn project_opening_rect(f: &Frame, o: &[f64]) -> Option<(Quad, f64)> { @@ -1090,7 +1093,7 @@ fn sash_band(out: &mut OpeningOut, o: &[f64], sashes: &[f64], pts: &Quad, w: f64 } } -fn layout_opening(o: &[f64], sashes: &[f64], transom_sashes: &[f64], pts: &Quad) -> OpeningOut { +fn layout_opening(o: &[f64], sashes: &[f64], transom_sashes: &[f64], bottom_sashes: &[f64], pts: &Quad) -> OpeningOut { let mut out = OpeningOut::default(); let (from, to, z_bottom, z_top) = (o[5], o[6], o[7], o[8]); let w = to - from; @@ -1138,12 +1141,8 @@ fn layout_opening(o: &[f64], sashes: &[f64], transom_sashes: &[f64], pts: &Quad) 0.97 }; let kind = o[20]; - if kind == 2.0 { - // Hebeschiebetür: zwei Glasfelder, Pfeil auf dem Schiebefeld (zur Mitte hin). - out.glass.push(rect(pts, 0.04, 0.5, 0.03, top)); - out.glass.push(rect(pts, 0.5, 0.96, 0.03, top)); - out.divisions.push((quad_at(pts, 0.5, 0.0), quad_at(pts, 0.5, top))); - slide_arrow(&mut out, pts, 0.85, 0.6, top * 0.5, top); + if kind == 2.0 || kind == 6.0 { + lift_slide_view(&mut out, pts, (w, h), top, kind == 6.0); return out; } // Tür: Blatt-Fläche, bei Glasblatt mit Teilverglasung (Kämpferhöhe von OBEN). @@ -1195,7 +1194,24 @@ fn layout_opening(o: &[f64], sashes: &[f64], transom_sashes: &[f64], pts: &Quad) let transom = max(0.0, o[13]); let f_tr = if transom > EPS && transom < h - fw { 1.0 - transom / h } else { 0.0 }; let field_top = if f_tr > 0.0 { f_tr - fz_t / 2.0 } else { top - fz_t }; - sash_band(&mut out, o, sashes, pts, w, h, (a0, a1), fw, fz, field_top, o[14], o[15]); + // Brüstungsfeld unter einem Riegel ([95]): Höhe ab Öffnungs-Unterkante bis Riegelmitte, Riegel in + // Kämpferbreite; darunter festes Glas bzw. die Einteilung `bottom_sashes`. + let bottom = if o[34].is_finite() { max(0.0, o[34]) } else { 0.0 }; + let f_b = bottom / max(h, 1e-6); + let fz_main = if bottom > EPS && f_b - fz_t / 2.0 > fz + 0.02 && f_b + fz_t / 2.0 < field_top - 0.05 { + if bottom_sashes.is_empty() { + out.glass.push(rect(pts, a0, a1, fz, f_b - fz_t / 2.0)); + } else { + sash_band(&mut out, o, bottom_sashes, pts, w, h, (a0, a1), fw, fz, f_b - fz_t / 2.0, f64::NAN, f64::NAN); + } + for z in [f_b - fz_t / 2.0, f_b + fz_t / 2.0] { + out.divisions.push((quad_at(pts, a0, z), quad_at(pts, a1, z))); + } + f_b + fz_t / 2.0 + } else { + fz + }; + sash_band(&mut out, o, sashes, pts, w, h, (a0, a1), fw, fz_main, field_top, o[14], o[15]); if o[16] != 0.0 { let ov1 = 0.02 / max(w, 1e-6); let ov2 = 0.05 / max(w, 1e-6); @@ -1216,6 +1232,27 @@ fn layout_opening(o: &[f64], sashes: &[f64], transom_sashes: &[f64], pts: &Quad) out } +/// Hebeschiebetür in der Ansicht ([95]): festes Feld auf der Bandseite (`fixed_end`: am Ende der +/// Öffnung, sonst am Anfang), Schiebefeld daneben, beide mit Flügelrahmen (7 cm), in der Mitte um +/// 3 cm überlappend (Stoss als zwei Linien). Laufrichtung: Pfeil auf dem Schiebefeld zum festen Feld; +/// das feste Feld bleibt ohne Symbol (feststehend). +fn lift_slide_view(out: &mut OpeningOut, pts: &Quad, (w, h): (f64, f64), top: f64, fixed_end: bool) { + let ov = min(0.1, 0.03 / max(w, 1e-6)); + let (fixed, slide) = if fixed_end { ((0.5 - ov, 0.96), (0.04, 0.5 + ov)) } else { ((0.04, 0.5 + ov), (0.5 - ov, 0.96)) }; + let (su, sv) = (min(0.1, 0.07 / max(w, 1e-6)), min(0.1, 0.07 / max(h, 1e-6))); + let (b0, b1) = (0.03, top); + for (a0, a1) in [fixed, slide] { + out.sash_rects.push(rect(pts, a0, a1, b0, b1)); + out.glass.push(rect(pts, a0 + su, a1 - su, b0 + sv, b1 - sv)); + } + for u in [0.5 - ov, 0.5 + ov] { + out.divisions.push((quad_at(pts, u, b0), quad_at(pts, u, b1))); + } + let (s0, s1) = slide; + let (tail, head) = if fixed_end { (s0 + (s1 - s0) * 0.25, s0 + (s1 - s0) * 0.75) } else { (s1 - (s1 - s0) * 0.25, s1 - (s1 - s0) * 0.75) }; + slide_arrow(out, pts, tail, head, top * 0.5, top); +} + /// Schiebe-Pfeil (Schaft + zwei Widerhaken) von `tail` nach `head` (Anteile der Breite) auf Höhe `zc`. fn slide_arrow(out: &mut OpeningOut, pts: &Quad, tail: f64, head: f64, zc: f64, top: f64) { let barb = (head - tail) * 0.22; @@ -1275,6 +1312,13 @@ pub fn openings(frame: &[f64], inp: &[f64]) -> Vec { } let transom_sashes = &inp[i + 1..i + 1 + 6 * nt as usize]; i += 1 + 6 * nt as usize; + // Brüstungsfeld-Einteilung ([95]): `[n, Flügel × n]`. + let nb = inp.get(i).copied().unwrap_or(f64::NAN); + if !(nb >= 0.0) || nb.fract() != 0.0 || i + 1 + 6 * nb as usize > inp.len() { + return Vec::new(); + } + let bottom_sashes = &inp[i + 1..i + 1 + 6 * nb as usize]; + i += 1 + 6 * nb as usize; let geo = &o[..9]; if geo.iter().any(|v| !v.is_finite()) { return Vec::new(); @@ -1303,7 +1347,11 @@ pub fn openings(frame: &[f64], inp: &[f64]) -> Vec { for p in &pts { f.extend([p.0, p.1]); } - let out = layout_opening(o, sashes, transom_sashes, &pts); + let mut out = layout_opening(o, sashes, transom_sashes, bottom_sashes, &pts); + // Öffnungslinien (Dreh-/Kipp-Dreiecke) am Fenster abgeschaltet ([95]). + if o[9] == 0.0 && o[35].is_finite() && (o[35] as i64) & 1 != 0 { + out.symbol.clear(); + } push_quads(&mut f, &out.glass); push_quads(&mut f, &out.door_leaf); push_lines(&mut f, &out.divisions); @@ -1582,8 +1630,8 @@ mod tests_ts { let frame = [0.0, 0.0, -3.0, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0]; let rec = |rebate: f64, side: f64| { let mut b = vec![1.0, 0.0, 0.0, 5.0, 0.0, 0.3, 1.0, 2.2, 0.9, 2.3, 0.0, 0.0, f64::NAN, 0.06, 0.0, f64::NAN, f64::NAN, 1.0, 1.0, rebate, side, 0.0]; - b.extend([f64::NAN; 13]); - b.extend([0.0, 0.0]); + b.extend([f64::NAN; 15]); + b.extend([0.0, 0.0, 0.0]); b }; let width = |f: &[f64]| { @@ -1604,7 +1652,7 @@ mod tests_ts { let frame = [0.0, 0.0, -3.0, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0]; let rec = |door: f64, transom: f64, kind: f64, transom_sashes: &[[f64; 6]]| { let mut b = vec![1.0, 0.0, 0.0, 5.0, 0.0, 0.3, 1.0, 2.2, 0.0, 2.3, door, 0.0, f64::NAN, 0.06, transom, f64::NAN, f64::NAN, 1.0, 1.0, 0.0, 1.0, kind]; - b.extend([f64::NAN; 13]); + b.extend([f64::NAN; 15]); if door == 0.0 { b.extend([1.0, 0.0, f64::NAN, 1.0, f64::NAN, 3.0, 1.0]); } else { @@ -1614,6 +1662,7 @@ mod tests_ts { for t in transom_sashes { b.extend(t); } + b.push(0.0); b }; // Listen ab Index 12: glas, tuerblatt, teilungen, fluegel, bank, symbol. @@ -1638,16 +1687,82 @@ mod tests_ts { assert!(split[5] >= plain[5] + 2, "Kipp-Symbol im Oberlicht"); } + /// [95] Hebeschiebetür: festes Feld auf der Bandseite, Schiebefeld mit Pfeil zum festen Feld, beide + /// mit Flügelrahmen; Bandseite Ende (6) spiegelt. + #[test] + fn hebeschiebe_bandseite_und_laufrichtung() { + let frame = [0.0, 0.0, -3.0, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0]; + let rec = |kind: f64| { + let mut b = vec![1.0, 0.0, 0.0, 5.0, 0.0, 0.3, 1.0, 3.4, 0.0, 2.3, 1.0, 1.0, f64::NAN, 0.08, 0.0, f64::NAN, f64::NAN, 1.0, 1.0, 0.0, 1.0, kind]; + b.extend([f64::NAN; 15]); + b.extend([0.0, 0.0, 0.0]); + b + }; + let lists = |f: &[f64]| { + let mut i = 12; + let mut out = Vec::new(); + for size in [8, 8, 4, 8, 8, 4] { + let c = f[i] as usize; + out.push(f[i + 1..i + 1 + c * size].to_vec()); + i += 1 + c * size; + } + out + }; + for (kind, fixed_end) in [(2.0, false), (6.0, true)] { + let l = lists(&openings(&frame, &rec(kind))); + assert_eq!(l[0].len() / 8, 2, "zwei Glasfelder"); + assert_eq!(l[3].len() / 8, 2, "zwei Flügelrahmen"); + assert_eq!(l[5].len() / 4, 3, "ein Pfeil"); + // Pfeil (x 1.0 … 3.4): Schaft vom Schiebefeld zum festen Feld. + let (tail, head) = (l[5][0], l[5][2]); + let mid = 2.2; + if fixed_end { + assert!(tail < mid && head > tail, "Schiebefeld am Anfang, läuft zum Ende: {tail} {head}"); + } else { + assert!(tail > mid && head < tail, "Schiebefeld am Ende, läuft zum Anfang: {tail} {head}"); + } + } + } + + /// [95] Brüstungsfeld unten: Riegel (zwei Linien) und festes Glas darunter; Öffnungslinien abschaltbar. + #[test] + fn bruestungsfeld_und_oeffnungslinien_aus() { + let frame = [0.0, 0.0, -3.0, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0]; + let n = f64::NAN; + let with = |bottom: f64, flags: f64| { + let mut b = rec105(0.0, [n; 13]); + b[35] = bottom; + b[36] = flags; + openings(&frame, &b) + }; + let count = |f: &[f64], k: usize| { + let mut i = 12; + for size in [8, 8, 4, 8, 8, 4].iter().take(k) { + i += 1 + f[i] as usize * size; + } + f[i] as usize + }; + let plain = with(n, n); + let panel = with(0.4, n); + assert_eq!(count(&panel, 0), count(&plain, 0) + 1, "Glas im Brüstungsfeld"); + assert_eq!(count(&panel, 2), count(&plain, 2) + 2, "Riegel als zwei Linien"); + assert!(count(&plain, 5) > 0); + assert_eq!(count(&with(n, 1.0), 5), 0, "Öffnungslinien aus"); + // Zu hoch (über das Flügelfeld): kein Brüstungsfeld. + assert_eq!(count(&with(1.3, n), 0), count(&plain, 0)); + } + /// Fenster-Datensatz für die [105]-Tests: `extra` = Werte ab Index 21 (13 Stück). fn rec105(door: f64, extra: [f64; 13]) -> Vec { let mut b = vec![1.0, 0.0, 0.0, 5.0, 0.0, 0.3, 1.0, 2.2, 0.9, 2.3, door, 0.0, f64::NAN, 0.06, 0.0, f64::NAN, f64::NAN, 1.0, 1.0, 0.0, 1.0, 0.0]; b.extend(extra); + b.extend([f64::NAN; 2]); if door == 0.0 { b.extend([1.0, 0.0, f64::NAN, 1.0, f64::NAN, 3.0, 1.0]); } else { b.push(0.0); } - b.push(0.0); + b.extend([0.0, 0.0]); b } @@ -1730,9 +1845,9 @@ mod tests_ts { let n = f64::NAN; let mut b = rec105(0.0, [n; 13]); // Flügelliste ersetzen: Flügel, Pfosten 10 cm, Flügel; ohne Oberlicht. - let k = b.len() - 8; + let k = b.len() - 9; b.truncate(k); - b.extend([3.0, 0.0, n, 1.0, n, 3.0, 1.0, 1.0, 0.1, 1.0, n, 0.0, 1.0, 0.0, n, 1.0, n, 3.0, 0.0, 0.0]); + b.extend([3.0, 0.0, n, 1.0, n, 3.0, 1.0, 1.0, 0.1, 1.0, n, 0.0, 1.0, 0.0, n, 1.0, n, 3.0, 0.0, 0.0, 0.0]); let f = openings(&frame, &b); let vert: Vec = divisions(&f).iter().filter(|d| (d[0] - d[2]).abs() < 1e-9 && (d[1] - d[3]).abs() > 0.5).map(|d| d[0]).collect(); // Rahmen 6 cm, lichte Breite 1.08, je Flügel 0.49: Pfosten von 1.55 bis 1.65. @@ -1746,8 +1861,8 @@ mod tests_ts { let frame = [0.0, 0.0, -3.0, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0]; let rec = |kind: f64| { let mut b = vec![1.0, 0.0, 0.0, 5.0, 0.0, 0.3, 1.0, 2.2, 0.0, 2.3, 1.0, 0.0, f64::NAN, 0.06, 0.0, f64::NAN, f64::NAN, 1.0, 1.0, 0.0, 1.0, kind]; - b.extend([f64::NAN; 13]); - b.extend([0.0, 0.0]); + b.extend([f64::NAN; 15]); + b.extend([0.0, 0.0, 0.0]); b }; // Symbol-Linien (letzte Liste ab Index 12): glas, tuerblatt, teilungen, fluegel, bank, symbol. diff --git a/src-tauri/core/src/plan/openings.rs b/src-tauri/core/src/plan/openings.rs index 35faa890..f4ecdca2 100644 --- a/src-tauri/core/src/plan/openings.rs +++ b/src-tauri/core/src/plan/openings.rs @@ -140,6 +140,16 @@ fn plan_opening_inner(buf: &[f64]) -> Option> { 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); + // [105] Strichcode der Sturzlinien (1 gestrichelt, 0 durchgehend, 3 punktiert, −1 keine). + let lintel_dash = r.num().unwrap_or(1.0); + let lintel = if lintel_dash < 0.0 { 0 } else { lintel }; + let lintel_dash = if lintel_dash.is_finite() && lintel_dash >= 0.0 { lintel_dash } else { 1.0 }; + // [95] Aufschlagbogen der Fensterflügel: je Flügel 0/1 (Band Anfang)/2 (Band Ende). + let n_arcs = r.count().unwrap_or(0); + let mut swing_codes = Vec::with_capacity(n_arcs.min(64)); + for _ in 0..n_arcs.min(64) { + swing_codes.push(r.num().unwrap_or(0.0)); + } if ![sx, sy, ex, ey, total, ref_off, position, width].iter().all(|x| x.is_finite()) { return None; } @@ -234,11 +244,11 @@ fn plan_opening_inner(buf: &[f64]) -> Option> { let line = |off: f64| (add(jamb_start, scale(wn, off)), add(jamb_end, scale(wn, off))); if lintel == 1 || lintel == 3 { let (a, b) = line(outer_off); - o.line(C_LINTEL, hair, 1.0, 1.0, a, b); + o.line(C_LINTEL, hair, 1.0, lintel_dash, a, b); } if lintel == 2 || lintel == 3 { let (a, b) = line(inner_off); - o.line(C_LINTEL, hair, 1.0, 1.0, a, b); + o.line(C_LINTEL, hair, 1.0, lintel_dash, a, b); } } return Some(finish(o)); @@ -254,6 +264,7 @@ fn plan_opening_inner(buf: &[f64]) -> Option> { inset_inner: win_inset_side == 1.0, inset_mid: win_inset_side == 2.0, frame_width_end, + swing: swing_codes, }) } else { None @@ -301,6 +312,12 @@ fn plan_opening_inner(buf: &[f64]) -> Option> { for (a, b) in &sym.glass_lines { o.line(C_GLASS, super::style::GLASS_LINE_MM, 0.0, 0.0, *a, *b); } + // [95] Aufschlagbogen der Drehflügel (wählbar am Fenstertyp/an der Öffnung). + for &(hinge, closed_end, open_end, radius) in &sym.swing_arcs { + o.line(C_SASH, hair, 4.0, 0.0, hinge, open_end); + let (from, to) = short_arc(&DoorLeaf { hinge, open_end, closed_end, radius }); + o.arc(hair, hinge, from, to, radius); + } if detail == Detail::Fein { if let Some((js, je)) = opening_jambs(&w, position, width) { let outer_n = f_lo; @@ -943,6 +960,40 @@ mod tests { } } + /// [105] Linientyp der Sturzlinien aus dem Anhang: punktiert (3), durchgehend (0), keine (−1). + #[test] + fn sturzlinien_linientyp_waehlbar() { + let lintels = |code: f64| { + let mut b = input(true, 1.0, false, &[]); + b.extend([NAN, NAN, NAN, NAN, code]); + lines(&plan_opening(&b)).into_iter().filter(|l| l.0 == C_LINTEL).map(|l| l.1).collect::>() + }; + assert_eq!(lintels(1.0), vec![1.0, 1.0]); + assert_eq!(lintels(3.0), vec![3.0, 3.0]); + assert_eq!(lintels(0.0), vec![0.0, 0.0]); + assert!(lintels(-1.0).is_empty()); + // Ohne Anhang wie bisher gestrichelt. + let b = input(true, 1.0, false, &[]); + assert!(lines(&plan_opening(&b)).iter().filter(|l| l.0 == C_LINTEL).all(|l| l.1 == 1.0)); + } + + /// [95] Aufschlagbogen der Fensterflügel: je Drehflügel ein Strich + Bogen zur Innenseite. + #[test] + fn fensterfluegel_aufschlagbogen() { + let wing = [0.0, 1.0, NAN, NAN, 1.0]; + let arcs = |codes: &[f64]| { + let mut b = input(false, 1.0, true, &[wing, wing]); + b.extend([NAN, NAN, NAN, NAN, 1.0, codes.len() as f64]); + b.extend(codes); + tags(&plan_opening(&b)).iter().filter(|t| **t == 3.0).count() + }; + assert_eq!(arcs(&[]), 0); + assert_eq!(arcs(&[1.0, 2.0]), 2); + assert_eq!(arcs(&[1.0, 0.0]), 1); + // Falsche Länge: nichts. + assert_eq!(arcs(&[1.0]), 0); + } + /// [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/section/openings.rs b/src-tauri/core/src/plan/section/openings.rs index 993cc669..af516d5a 100644 --- a/src-tauri/core/src/plan/section/openings.rs +++ b/src-tauri/core/src/plan/section/openings.rs @@ -121,6 +121,7 @@ fn window_cut(p: &Project, wall: &Wall, o: &Opening, c: &CrossSection) -> Result inset_inner: t.inset_face == Some(WindowTypeInsetFace::Innen), inset_mid: t.inset_face == Some(WindowTypeInsetFace::Mitte), frame_width_end: f64::NAN, + swing: Vec::new(), }); // [105] Rahmen-Detail: Lage/Tiefe übersteuert, Breite oben/unten, Anschlussprofile. let det = crate::opening_detail::frame_of(p, o).filter(|f| f.detailed); diff --git a/src-tauri/core/src/plan/walls.rs b/src-tauri/core/src/plan/walls.rs index 54997645..a0b431fd 100644 --- a/src-tauri/core/src/plan/walls.rs +++ b/src-tauri/core/src/plan/walls.rs @@ -642,6 +642,27 @@ fn opening_symbol(c: &Ctx, out: &mut Vec, w: &Wall, o: &Opening, colo // 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; 3], |(x, off, t)| [x, off, if detail == Detail::Fein { t } else { f64::NAN }])); + // [105] Linientyp der Sturzlinien (Öffnung vor Türtyp): Strichcode wie `dash_of`, −1 = keine. + b.push(match o.lintel_line_style.or(dt.and_then(|t| t.lintel_line_style)) { + Some(LintelLineStyle::Durchgehend) => 0.0, + Some(LintelLineStyle::Punktiert) => 3.0, + Some(LintelLineStyle::Keine) => -1.0, + _ => 1.0, + }); + // [95] Aufschlagbogen der Drehflügel (Fenster, Öffnung vor Typ): je Flügel 0 keiner, 1 Band am Anfang, + // 2 Band am Ende. + let arcs = wt.is_some_and(|t| o.plan_swing_arcs.or(t.plan_swing_arcs) == Some(true)); + b.push(if arcs { sash_list.len() as f64 } else { 0.0 }); + if arcs { + for s in &sash_list { + let turn = s.kind == SashDefKind::Fluegel && matches!(s.opening, Some(OpeningKind::Dreh | OpeningKind::Drehkipp)); + b.push(match (turn, s.hinge_side) { + (false, _) => 0.0, + (true, Some(SashDefHingeSide::Right)) => 2.0, + _ => 1.0, + }); + } + } let f = crate::plan::openings::plan_opening(&b); if f.is_empty() { return Ok(()); diff --git a/src-tauri/core/src/selection_info.rs b/src-tauri/core/src/selection_info.rs index b606454c..214b6786 100644 --- a/src-tauri/core/src/selection_info.rs +++ b/src-tauri/core/src/selection_info.rs @@ -851,6 +851,9 @@ fn opening_selection(lk: &Lookup, o: &Value) -> Result { .raw("wingCount", o, "wingCount") .raw("doorType", o, "doorType") .raw("lintelLines", o, "lintelLines") + .raw("lintelLineStyle", o, "lintelLineStyle") + .raw("sashSymbols", o, "sashSymbols") + .raw("planSwingArcs", o, "planSwingArcs") .raw("typeId", o, "typeId") .raw("detailLevel", o, "detailLevel") .v("zBottom", zb) diff --git a/src/i18n/de.ts b/src/i18n/de.ts index 516f4ea3..adb49a74 100644 --- a/src/i18n/de.ts +++ b/src/i18n/de.ts @@ -734,6 +734,8 @@ export const de = { "oed.cornerJoin.horizontal": "Riegel durchlaufend", "oed.cornerJoin.gehrung": "Gehrung", "oed.f.transomHeight": "Oberlichthöhe (m)", + "oed.f.bottomPanelHeight": "Brüstungsfeld bis Riegelmitte (m)", + "oed.f.bottomPanelFields": "Brüstungsfeld: Felder", "oed.f.transomFields": "Oberlicht-Felder", "oed.f.transomOpening": "Oberlicht-Öffnung", "oed.f.mullionRows": "Kämpfer-/Sprossenzeilen", @@ -828,6 +830,16 @@ export const de = { "objinfo.opening.lintelLines.innen": "Innen", "objinfo.opening.lintelLines.aussen": "Außen", "objinfo.opening.lintelLines.beide": "Beide", + "objinfo.opening.lintelLineStyle": "Sturzlinie", + "objinfo.opening.lintelLineStyle.gestrichelt": "Gestrichelt", + "objinfo.opening.lintelLineStyle.punktiert": "Punktiert", + "objinfo.opening.lintelLineStyle.durchgehend": "Durchgehend", + "objinfo.opening.lintelLineStyle.keine": "Keine", + "objinfo.opening.fromType": "Wie Typ", + "objinfo.opening.on": "Ein", + "objinfo.opening.off": "Aus", + "objinfo.opening.sashSymbols": "Öffnungslinien (Ansicht)", + "objinfo.opening.planSwingArcs": "Aufschlagbogen (Grundriss)", "objinfo.opening.detailLevel": "Detailstufe", "objinfo.detailLevel.view": "Ansicht (Standard)", "objinfo.opening.frameLine": "Rahmen (Schnitt)", diff --git a/src/i18n/en.ts b/src/i18n/en.ts index 7ca92845..29362cf6 100644 --- a/src/i18n/en.ts +++ b/src/i18n/en.ts @@ -733,6 +733,8 @@ export const en: Record = { "oed.cornerJoin.horizontal": "Rails through", "oed.cornerJoin.gehrung": "Mitre", "oed.f.transomHeight": "Transom height (m)", + "oed.f.bottomPanelHeight": "Bottom panel to transom bar centre (m)", + "oed.f.bottomPanelFields": "Bottom panel: fields", "oed.f.transomFields": "Transom fields", "oed.f.transomOpening": "Transom opening", "oed.f.mullionRows": "Transom/muntin rows", @@ -826,6 +828,16 @@ export const en: Record = { "objinfo.opening.lintelLines.innen": "Inside", "objinfo.opening.lintelLines.aussen": "Outside", "objinfo.opening.lintelLines.beide": "Both", + "objinfo.opening.lintelLineStyle": "Lintel line", + "objinfo.opening.lintelLineStyle.gestrichelt": "Dashed", + "objinfo.opening.lintelLineStyle.punktiert": "Dotted", + "objinfo.opening.lintelLineStyle.durchgehend": "Solid", + "objinfo.opening.lintelLineStyle.keine": "None", + "objinfo.opening.fromType": "As type", + "objinfo.opening.on": "On", + "objinfo.opening.off": "Off", + "objinfo.opening.sashSymbols": "Opening lines (elevation)", + "objinfo.opening.planSwingArcs": "Swing arcs (plan)", "objinfo.opening.detailLevel": "Detail level", "objinfo.detailLevel.view": "View (default)", "objinfo.opening.frameLine": "Frame (cut)", diff --git a/src/model/types.generated.ts b/src/model/types.generated.ts index 2b583e80..9c0eafe1 100644 --- a/src/model/types.generated.ts +++ b/src/model/types.generated.ts @@ -649,6 +649,8 @@ export type DoorType = { * gezeichnet. 0/fehlt ⇒ kein eigener Sturz (bisher). */ lintelHeight?: number; + /** Linientyp der Sturzlinien im Grundriss ([105]); fehlt ⇒ gestrichelt. */ + lintelLineStyle?: LintelLineStyle; /** * Rahmen-Detail ([105]): Blendrahmen je Seite, Flügelrahmen, Pfosten/Kämpfer, Zusatzprofile, * Anschlag je Seite. Fehlt ⇒ wie bisher (`frameWidth`, `rebateDepth`). @@ -1909,6 +1911,11 @@ export type LineStyleOverride = { weight?: number; }; +/** + * Linientyp der Sturzlinien einer Tür im Grundriss ([105]; Strichmuster in Papier-mm wie [153]). + */ +export type LintelLineStyle = "gestrichelt" | "punktiert" | "durchgehend" | "keine"; + /** Zeichen-Marks eines Runs. Alle optional; fehlend = „nicht gesetzt". */ export type Marks = { bold?: boolean; @@ -2070,6 +2077,14 @@ export type Opening = { * "beide" → beide Linien (Default wenn nicht gesetzt) */ lintelLines?: "keine" | "innen" | "aussen" | "beide"; + /** Linientyp der Sturzlinien im Grundriss ([105]); fehlt ⇒ wie Türtyp, sonst gestrichelt. */ + lintelLineStyle?: LintelLineStyle; + /** Fenster: Öffnungslinien in der Ansicht ein/aus (übersteuert den Fenstertyp, [95]). */ + sashSymbols?: boolean; + /** + * Fenster: Aufschlagbogen der Drehflügel im Grundriss ein/aus (übersteuert den Fenstertyp, [95]). + */ + planSwingArcs?: boolean; /** * Referenz auf einen Bauteil-Typ (Bibliothek): {@link DoorType} bei * `kind: "door"`, {@link WindowType} bei `kind: "window"`. Fehlt sie, gilt @@ -3832,6 +3847,20 @@ export type WindowType = { * {@link sashes}, je Feld fest oder öffenbar (meist Kipp). Fehlt ⇒ ein festes Feld (bisher). */ transomSashes?: Array; + /** + * Brüstungsfeld unten ([95]): Höhe ab Öffnungs-Unterkante bis Mitte des Riegels (Meter), darunter + * ein festes Feld. 0/fehlt ⇒ keins (bisher). + */ + bottomPanelHeight?: number; + /** + * Einteilung des Brüstungsfelds (Pfosten/Riegel wie {@link transomSashes}, je Feld fest oder + * öffenbar). Fehlt ⇒ ein festes Glasfeld. + */ + bottomSashes?: Array; + /** Öffnungslinien der Flügel in der Ansicht (Dreh-/Kipp-Dreiecke, [95]). Fehlt ⇒ an. */ + sashSymbols?: boolean; + /** Aufschlagbogen der Drehflügel im Grundriss (zur Innenseite, [95]). Fehlt ⇒ aus. */ + planSwingArcs?: boolean; /** * Auf-/Untersicht-Andeutung im Grundriss (mittel/fein): eine Referenzlinie an * der gewählten Fläche(n) — sinnvoll, wenn die Öffnung die Schnittebene NICHT diff --git a/src/panels/host.ts b/src/panels/host.ts index 23739697..12db63a3 100644 --- a/src/panels/host.ts +++ b/src/panels/host.ts @@ -469,6 +469,12 @@ export interface PanelHostValue { onSetOpeningDoorType: (doorType: "normal" | "wandoeffnung") => void; /** Setzt die Sturzlinien-Darstellung der Tür. */ onSetOpeningLintelLines: (lintelLines: "keine" | "innen" | "aussen" | "beide") => void; + /** Darstellung ([105]/[95]): Sturzlinien-Linientyp, Fenster-Öffnungslinien, Aufschlagbogen; `undefined` = wie Typ. */ + onSetOpeningDisplay: (patch: { + lintelLineStyle?: "gestrichelt" | "punktiert" | "durchgehend" | "keine"; + sashSymbols?: boolean; + planSwingArcs?: boolean; + }) => void; /** Übersteuert die Detailstufe dieser Öffnung; `undefined` = Ansichts-Detailstufe gilt. */ onSetOpeningDetailLevel: (detailLevel: DetailLevel | undefined) => void; /** Dach-/Deckenfenster ([103]): Lage in der Wirtsfläche (Mittelpunkt im Grundriss, Drehung). */ diff --git a/src/panels/objectInfo/OpeningSections.tsx b/src/panels/objectInfo/OpeningSections.tsx index 1aec8482..63d99d02 100644 --- a/src/panels/objectInfo/OpeningSections.tsx +++ b/src/panels/objectInfo/OpeningSections.tsx @@ -153,6 +153,17 @@ export function OpeningSection({ fallbackWeight={OPENING_LINE_DEFAULT_WEIGHT} onChange={host.onSetOpeningSillLineStyle} /> + {/* [95] Öffnungslinien der Flügel: Ansicht (Dreh-/Kipp-Dreiecke) und Grundriss (Aufschlagbogen). */} + host.onSetOpeningDisplay({ sashSymbols: v })} + /> + host.onSetOpeningDisplay({ planSwingArcs: v })} + /> )} @@ -189,6 +200,27 @@ export function OpeningSection({ width={130} /> + {/* [105] Linientyp der Sturzlinien (Strichmuster in Papier-mm wie [153]); leer = wie Türtyp. */} +
+ {t("objinfo.opening.lintelLineStyle")} + + host.onSetOpeningDisplay({ + lintelLineStyle: v === "" ? undefined : (v as "gestrichelt" | "punktiert" | "durchgehend" | "keine"), + }) + } + options={[ + { value: "", label: t("objinfo.opening.fromType") }, + { value: "gestrichelt", label: t("objinfo.opening.lintelLineStyle.gestrichelt") }, + { value: "punktiert", label: t("objinfo.opening.lintelLineStyle.punktiert") }, + { value: "durchgehend", label: t("objinfo.opening.lintelLineStyle.durchgehend") }, + { value: "keine", label: t("objinfo.opening.lintelLineStyle.keine") }, + ]} + title={t("objinfo.opening.lintelLineStyle")} + width={130} + /> +
{t("objinfo.opening.hinge")} ); } + +/** Ja/Nein mit „wie Typ“ (fehlt) — für Übersteuerungen an der Öffnung ([95]). */ +function TriStateField({ label, value, onChange }: { label: string; value: boolean | undefined; onChange: (v: boolean | undefined) => void }) { + return ( +
+ {label} + onChange(v === "" ? undefined : v === "an")} + options={[ + { value: "", label: t("objinfo.opening.fromType") }, + { value: "an", label: t("objinfo.opening.on") }, + { value: "aus", label: t("objinfo.opening.off") }, + ]} + title={label} + width={130} + /> +
+ ); +} diff --git a/src/plan/__golden__/komplex-ansicht-ansicht-sued.txt b/src/plan/__golden__/komplex-ansicht-ansicht-sued.txt index 8c4cac37..790d0060 100644 --- a/src/plan/__golden__/komplex-ansicht-ansicht-sued.txt +++ b/src/plan/__golden__/komplex-ansicht-ansicht-sued.txt @@ -1,11 +1,11 @@ viewBox -4.2 0 37.045 17.378 -bytes 193364 +bytes 194058 circle 4 g 1 -line 556 -polygon 1026 +line 558 +polygon 1030 polyline 44 rect 1 svg 1 text 4 -hash 32b9045a8708e6ad +hash af1939f5cc86a341 diff --git a/src/state/panelHost/elementAttributesHost.ts b/src/state/panelHost/elementAttributesHost.ts index 3c9dc57d..d74458fd 100644 --- a/src/state/panelHost/elementAttributesHost.ts +++ b/src/state/panelHost/elementAttributesHost.ts @@ -135,6 +135,9 @@ export function buildElementAttributesHost(c: FlatHostOpts) { onSetOpeningLintelLines: (lintelLines) => { if (selection?.kind === "opening") updateOpening(selection.id, { lintelLines }); }, + onSetOpeningDisplay: (patch) => { + if (selection?.kind === "opening") updateOpening(selection.id, patch); + }, onSetOpeningHost: (patch) => { if (selection?.kind === "opening") updateOpening(selection.id, patch); }, diff --git a/src/state/selectionInfo.ts b/src/state/selectionInfo.ts index b2d89dfd..87619cd8 100644 --- a/src/state/selectionInfo.ts +++ b/src/state/selectionInfo.ts @@ -228,6 +228,11 @@ export interface OpeningInfo { doorType?: "normal" | "wandoeffnung"; /** Nur Tür: Sturzlinien (keine/innen/aussen/beide). Fehlt → "beide". */ lintelLines?: "keine" | "innen" | "aussen" | "beide"; + /** Nur Tür: Linientyp der Sturzlinien ([105]). Fehlt → wie Türtyp (gestrichelt). */ + lintelLineStyle?: "gestrichelt" | "punktiert" | "durchgehend" | "keine"; + /** Nur Fenster: Öffnungslinien in der Ansicht / Aufschlagbogen im Grundriss ([95]); fehlt → wie Typ. */ + sashSymbols?: boolean; + planSwingArcs?: boolean; /** Zugewiesener Tür-/Fenstertyp (Bibliothek, `Opening.typeId`) oder undefined. */ typeId?: string; /** Per-Element-Übersteuerung der Detailstufe; fehlt → Ansichts-Detailstufe gilt. */ diff --git a/src/ui/OpeningEditorDialog.tsx b/src/ui/OpeningEditorDialog.tsx index a0db5ead..6ed6c49d 100644 --- a/src/ui/OpeningEditorDialog.tsx +++ b/src/ui/OpeningEditorDialog.tsx @@ -708,6 +708,22 @@ function FluegelPanel({ /> )} + {/* [95] Brüstungsfeld unten (unter einem Riegel), Einteilung wie das Oberlicht. */} + patchWt({ bottomPanelHeight: n || undefined })} + /> + {(wt.bottomPanelHeight ?? 0) > 0 && ( + s.kind === "fluegel").length)} + step={1} + min={1} + onCommit={(n) => patchWt({ bottomSashes: transomSashes(Math.max(1, Math.min(6, Math.round(n))), "fest") })} + /> + )} )} + {/* [105] Linientyp der Sturzlinien im Grundriss. */} + + patch({ lintelLineStyle: lintelLineStyle === "gestrichelt" ? undefined : lintelLineStyle })} + options={(["gestrichelt", "punktiert", "durchgehend", "keine"] as const).map((v) => ({ + value: v, + label: t(`objinfo.opening.lintelLineStyle.${v}`), + }))} + /> + + {/* [95] Brüstungsfeld unten (Höhe bis Riegelmitte) und Öffnungslinien. */} + + patch({ bottomPanelHeight: bottomPanelHeight || undefined })} + step={0.01} + min={0} + /> + + + patch({ sashSymbols: v === "aus" ? false : undefined })} + options={[ + { value: "an", label: t("objinfo.opening.on") }, + { value: "aus", label: t("objinfo.opening.off") }, + ]} + /> + + + patch({ planSwingArcs: v === "an" ? true : undefined })} + options={[ + { value: "an", label: t("objinfo.opening.on") }, + { value: "aus", label: t("objinfo.opening.off") }, + ]} + /> +