Merge branch 'worktree-agent-ad6caef3a083a697c' into claude/practical-noether-1hb2s1

# Conflicts:
#	src/plan/__golden__/komplex-ansicht-ansicht-sued.txt
#	src/plan/__golden__/komplex-model3d.txt
This commit is contained in:
Claude committed 2026-11-10 11:21:49 +00:00
commit 2e533b719a
35 files changed
+916 -118

No files matched your search

+15 -4
View File
@@ -236,10 +236,21 @@ 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
- ◐ **[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
- ◐ **[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. 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
Formöffnungs-Leibungen; 3D ohne Schichten zeigt an Leibungen keinen Rücksprung. · M
+33
View File
@@ -105,5 +105,38 @@ 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<Opening>][] = [
["T-Z-in", "d-zarge", 0.6, { openingDir: "in" }],
["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" }],
];
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);
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));
+56 -1
View File
@@ -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")));
+51
View File
@@ -982,6 +982,10 @@ pub struct DoorType {
#[serde(rename = "lintelHeight", default, skip_serializing_if = "Option::is_none")]
#[ts(optional)]
pub lintel_height: Option<f64>,
/// 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<LintelLineStyle>,
/// 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<Vec<SashDef>>,
/// 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<f64>,
/// 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<Vec<SashDef>>,
/// Ö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<bool>,
/// 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<bool>,
/// 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<OpeningLintelLines>,
/// 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<LintelLineStyle>,
/// 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<bool>,
/// 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<bool>,
/// 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
+17 -10
View File
@@ -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;
}
+50 -3
View File
@@ -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<DoorFrame> {
if o.kind != ElementKind::Door {
return None;
@@ -531,8 +531,12 @@ pub fn door_frame_of(p: &Project, o: &Opening) -> Option<DoorFrame> {
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<WindowType>, door: Option<DoorType>) -> Project {
let mut p = Project::default();
+15
View File
@@ -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<f64>,
}
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
@@ -222,6 +225,8 @@ pub struct WindowSymbol {
pub sash_frames: Vec<Vec<V>>,
pub meeting_marks: Vec<Vec<V>>,
pub jamb_marks: Vec<Vec<V>>,
/// 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;
}
+69 -5
View File
@@ -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<SashIn>,
/// Brüstungsfeld unten ([95]): Höhe ab Öffnungs-UK bis Riegelmitte (0 = keins) und Einteilung.
pub bottom_height: f64,
pub bottom_sashes: Vec<SashIn>,
/// 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<FrameParams<'_>> {
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<FrameParams<'_>> {
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<f64> {
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<BoxMesh>; 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<TypeIn> {
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<TypeIn> {
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() {
+19 -2
View File
@@ -131,6 +131,8 @@ pub(super) fn collect_openings(p: &Project, frame: &[f64; 9]) -> Vec<ProjOpening
_ if op.hinge.is_some_and(|s| s != OpeningHinge::Start) => 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,
@@ -158,11 +160,14 @@ pub(super) fn collect_openings(p: &Project, frame: &[f64; 9]) -> Vec<ProjOpening
Some(bd) => 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;
}
// [95] Brüstungsfeld unten und Öffnungslinien ein/aus (Öffnung vor Typ).
b.push(wt.and_then(|t| t.bottom_panel_height).unwrap_or(f64::NAN));
b.push(if !door && op.sash_symbols.or(wt.and_then(|t| t.sash_symbols)) == Some(false) { 1.0 } else { 0.0 });
let mullion = det.as_ref().map_or(f64::NAN, |f| f.mullion_width);
// Flügel: (pfosten, postWidth, autoWidth, width, opening, hingeLeft).
let mut sashes: Vec<[f64; 6]> = Vec::new();
@@ -213,6 +218,18 @@ pub(super) fn collect_openings(p: &Project, frame: &[f64; 9]) -> Vec<ProjOpening
if s.hinge_side.unwrap_or(SashDefHingeSide::Left) == SashDefHingeSide::Left { 1.0 } else { 0.0 },
]);
}
let bottom = if door { &[][..] } else { wt.and_then(|t| t.bottom_sashes.as_deref()).unwrap_or(&[]) };
b.push(bottom.len() as f64);
for s in bottom {
b.extend([
if s.kind == SashDefKind::Pfosten { 1.0 } else { 0.0 },
s.post_width.unwrap_or(f64::NAN),
if s.auto_width == Some(false) { 0.0 } else { 1.0 },
s.width.unwrap_or(f64::NAN),
s.opening.map_or(0.0, sash_kind),
if s.hinge_side.unwrap_or(SashDefHingeSide::Left) == SashDefHingeSide::Left { 1.0 } else { 0.0 },
]);
}
ids.push(&op.id);
bands.push(band);
shapes.push(crate::opening_shape::opening_outline(op, to - from, ot - ob).map(|poly| {
+4 -1
View File
@@ -433,8 +433,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;
+134 -19
View File
@@ -38,7 +38,10 @@
//! rahmenbreite, kaempferHoehe, sprossenZeilen (NaN = 1), sprossenSpalten (NaN = 1),
//! bankAn, typArt (0 fest, 1 dreh, 2 kipp, 3 drehkipp, 4 schiebe),
//! anschlag (Meter, 0 keiner), anschlagSeite (1 aussen | −1 innen; [94]),
//! tuerArt (0 Dreh | 1 Schiebe/Tasche, Pfeil zum Anfang | 2 Hebeschiebe | 3 Pendel | 4 Schiebe/Tasche zum Ende | 5 zweiflügelig; [95]), nFluegel, (pfosten, pfostenBreite (NaN), autoBreite (0/1), breite (NaN), art (-1 = typArt), bandLinks) × nFluegel
//! tuerArt (0 Dreh | 1 Schiebe/Tasche, Pfeil zum Anfang | 2 Hebeschiebe, festes Feld am Anfang | 3 Pendel | 4 Schiebe/Tasche zum Ende | 5 zweiflügelig | 6 Hebeschiebe, festes Feld am Ende; [95]),
//! [105]-Detail (13 Werte), brüstungsfeld (Höhe bis Riegelmitte, NaN/0 = keins; [95]), flags (1 = ohne Öffnungslinien),
//! nFluegel, (pfosten, pfostenBreite (NaN), autoBreite (0/1), breite (NaN), art (-1 = typArt), bandLinks) × nFluegel,
//! nOberlicht, Flügel × nOberlicht, nBrüstung, Flügel × nBrüstung
//! ```
//! → `[n, (ok, tiefe, istTuer, 8 Ecken, Listen) × n]`; `ok` 0 = nicht sichtbar (sonst nichts mehr).
//! Listen in dieser Reihenfolge, je `[anzahl, Einträge]`: glas, tuerblatt (Vierecke à 8 Werte),
@@ -933,7 +936,7 @@ fn rect(q: &Quad, fa0: f64, fa1: f64, fz0: f64, fz1: f64) -> 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<f64> {
}
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<f64> {
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<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, 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<f64> = 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.
+132 -6
View File
@@ -138,6 +138,18 @@ fn plan_opening_inner(buf: &[f64]) -> Option<Vec<f64>> {
// 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);
// [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;
}
@@ -188,8 +200,19 @@ fn plan_opening_inner(buf: &[f64]) -> Option<Vec<f64>> {
};
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 +221,7 @@ fn plan_opening_inner(buf: &[f64]) -> Option<Vec<f64>> {
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);
}
}
@@ -223,11 +244,11 @@ fn plan_opening_inner(buf: &[f64]) -> Option<Vec<f64>> {
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));
@@ -243,6 +264,7 @@ fn plan_opening_inner(buf: &[f64]) -> Option<Vec<f64>> {
inset_inner: win_inset_side == 1.0,
inset_mid: win_inset_side == 2.0,
frame_width_end,
swing: swing_codes,
})
} else {
None
@@ -290,6 +312,12 @@ fn plan_opening_inner(buf: &[f64]) -> Option<Vec<f64>> {
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;
@@ -478,6 +506,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<f64> {
let mut out = Vec::with_capacity(o.buf.len() + 1);
out.push(o.n as f64);
@@ -868,6 +920,80 @@ 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::<Vec<_>>();
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<f64> = 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] 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::<Vec<_>>()
};
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() {
@@ -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);
+31 -5
View File
@@ -514,9 +514,9 @@ fn opening_symbol(c: &Ctx, out: &mut Vec<Primitive>, 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<f64> = 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<Primitive>, 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,31 @@ fn opening_symbol(c: &Ctx, out: &mut Vec<Primitive>, 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 }]));
// [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(());
+3
View File
@@ -851,6 +851,9 @@ fn opening_selection(lk: &Lookup, o: &Value) -> Result<J, String> {
.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)
+6 -5
View File
@@ -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))"));
}
+58 -18
View File
@@ -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());
+3 -2
View File
@@ -46,8 +46,9 @@
<polygon points="5,7.08564 6.1725,7.08564 6.1725,4.48564 5,4.48564" fill="#ffffff" stroke="none" stroke-width="0"/>
<polygon points="1,4.48564 6,4.48564 6,2.05885 1,2.05885" fill="#ffffff" stroke="none" stroke-width="0"/>
<polygon points="1,2.28635 6,2.28635 6,2.05885 1,2.05885" fill="#8f959e" stroke="none" stroke-width="0"/>
<polygon points="1.8,7.08564 2.7,7.08564 2.7,4.98564 1.8,4.98564" fill="#dcdcdc" stroke="#2b3039" stroke-width="0.013"/>
<polygon points="1.836,7.08564 2.664,7.08564 2.664,5.04864 1.836,5.04864" fill="#ececec" stroke="#2b3039" stroke-width="0.013"/>
<polygon points="1.78,7.08564 2.72,7.08564 2.72,4.96564 1.78,4.96564" fill="#dcdcdc" stroke="#2b3039" stroke-width="0.013"/>
<polygon points="1.8,7.08564 2.7,7.08564 2.7,4.98564 1.8,4.98564" fill="none" stroke="#2b3039" stroke-width="0.013"/>
<polygon points="1.86,7.08564 2.64,7.08564 2.64,5.04564 1.86,5.04564" fill="#ececec" stroke="#2b3039" stroke-width="0.013"/>
<polygon points="1.8,5.06564 2.7,5.06564 2.7,4.98564 1.8,4.98564" fill="#a7adb5" stroke="none" stroke-width="0"/>
<polygon points="1.8,7.08564 1.88,7.08564 1.88,5.06564 1.8,5.06564" fill="#a7adb5" stroke="none" stroke-width="0"/>
<polygon points="4,6.18564 5,6.18564 5,4.98564 4,4.98564" fill="#dcdcdc" stroke="#2b3039" stroke-width="0.013"/>

Before

Width:  |  Height:  |  Size: 8.4 KiB

After

Width:  |  Height:  |  Size: 8.5 KiB

+5 -4
View File
@@ -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);
});
+12
View File
@@ -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)",
+12
View File
@@ -733,6 +733,8 @@ export const en: Record<TranslationKey, string> = {
"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<TranslationKey, string> = {
"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)",
+29
View File
@@ -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<SashDef>;
/**
* 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<SashDef>;
/** Ö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
+6
View File
@@ -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). */
+52
View File
@@ -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). */}
<TriStateField
label={t("objinfo.opening.sashSymbols")}
value={opening.sashSymbols}
onChange={(v) => host.onSetOpeningDisplay({ sashSymbols: v })}
/>
<TriStateField
label={t("objinfo.opening.planSwingArcs")}
value={opening.planSwingArcs}
onChange={(v) => host.onSetOpeningDisplay({ planSwingArcs: v })}
/>
</>
)}
@@ -189,6 +200,27 @@ export function OpeningSection({
width={130}
/>
</div>
{/* [105] Linientyp der Sturzlinien (Strichmuster in Papier-mm wie [153]); leer = wie Türtyp. */}
<div className="objinfo-field">
<span className="objinfo-flabel">{t("objinfo.opening.lintelLineStyle")}</span>
<Dropdown
value={opening.lintelLineStyle ?? ""}
onChange={(v) =>
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}
/>
</div>
<div className="objinfo-field">
<span className="objinfo-flabel">{t("objinfo.opening.hinge")}</span>
<Dropdown
@@ -395,3 +427,23 @@ function LineStyleRow({
</div>
);
}
/** 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 (
<div className="objinfo-field">
<span className="objinfo-flabel">{label}</span>
<Dropdown
value={value === undefined ? "" : value ? "an" : "aus"}
onChange={(v) => 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}
/>
</div>
);
}
@@ -1,12 +1,11 @@
viewBox -4.2 0 37.045 17.378
bytes 192060
bytes 194058
circle 4
g 1
line 547
path 2
polygon 1024
line 558
polygon 1030
polyline 44
rect 1
svg 1
text 4
hash 03d0f8659228b186
hash af1939f5cc86a341
+5 -6
View File
@@ -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
@@ -49,7 +49,6 @@ slabs[].outline [4] x49
slabs[].outline [51] x5
slabs[].outline[] [2] x806
walls [1489]
walls[].arcCenter [2] x832
walls[].color [3] x1489
walls[].end [2] x1489
walls[].endCut [4] x1162
@@ -61,4 +60,4 @@ walls[].start [2] x1489
walls[].startCut [4] x1164
walls[].topDrop [2] x103
walls[].topPlane [3] x259
hash 0f1bbada215a282f
hash f7059eb7178065e2
@@ -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
+5 -5
View File
@@ -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
+13 -5
View File
@@ -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,
+9 -9
View File
@@ -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", () => {
@@ -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);
},
+5
View File
@@ -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. */
+16
View File
@@ -708,6 +708,22 @@ function FluegelPanel({
/>
</>
)}
{/* [95] Brüstungsfeld unten (unter einem Riegel), Einteilung wie das Oberlicht. */}
<NumField
label={t("oed.f.bottomPanelHeight")}
value={wt.bottomPanelHeight ?? 0}
min={0}
onCommit={(n) => patchWt({ bottomPanelHeight: n || undefined })}
/>
{(wt.bottomPanelHeight ?? 0) > 0 && (
<NumField
label={t("oed.f.bottomPanelFields")}
value={Math.max(1, (wt.bottomSashes ?? []).filter((s) => s.kind === "fluegel").length)}
step={1}
min={1}
onCommit={(n) => patchWt({ bottomSashes: transomSashes(Math.max(1, Math.min(6, Math.round(n))), "fest") })}
/>
)}
<NumField
label={t("oed.f.mullionRows")}
value={wt.mullionRows ?? 1}
+11
View File
@@ -172,6 +172,17 @@ export function DoorStylesTab({
/>
</FieldRow>
)}
{/* [105] Linientyp der Sturzlinien im Grundriss. */}
<FieldRow label={t("objinfo.opening.lintelLineStyle")}>
<SelectField
value={door.lintelLineStyle ?? "gestrichelt"}
onChange={(lintelLineStyle) => patch({ lintelLineStyle: lintelLineStyle === "gestrichelt" ? undefined : lintelLineStyle })}
options={(["gestrichelt", "punktiert", "durchgehend", "keine"] as const).map((v) => ({
value: v,
label: t(`objinfo.opening.lintelLineStyle.${v}`),
}))}
/>
</FieldRow>
<FieldRow label={t("resources.field.transomHeight")}>
<NumberField
value={door.transomHeight ?? 0}
@@ -184,6 +184,35 @@ export function WindowStylesTab({
</option>
</select>
</FieldRow>
{/* [95] Brüstungsfeld unten (Höhe bis Riegelmitte) und Öffnungslinien. */}
<FieldRow label={t("oed.f.bottomPanelHeight")}>
<NumberField
value={win.bottomPanelHeight ?? 0}
onChange={(bottomPanelHeight) => patch({ bottomPanelHeight: bottomPanelHeight || undefined })}
step={0.01}
min={0}
/>
</FieldRow>
<FieldRow label={t("objinfo.opening.sashSymbols")}>
<SelectField
value={win.sashSymbols === false ? "aus" : "an"}
onChange={(v) => patch({ sashSymbols: v === "aus" ? false : undefined })}
options={[
{ value: "an", label: t("objinfo.opening.on") },
{ value: "aus", label: t("objinfo.opening.off") },
]}
/>
</FieldRow>
<FieldRow label={t("objinfo.opening.planSwingArcs")}>
<SelectField
value={win.planSwingArcs ? "an" : "aus"}
onChange={(v) => patch({ planSwingArcs: v === "an" ? true : undefined })}
options={[
{ value: "an", label: t("objinfo.opening.on") },
{ value: "aus", label: t("objinfo.opening.off") },
]}
/>
</FieldRow>
<FieldRow label={t("resources.field.transomHeight")}>
<NumberField
value={win.transomHeight ?? 0}