[184] Schnitt/Ansicht: Fenster und Türen nach Detailgrad wie im Grundriss (grob = ein Strich, mittel einfach, fein voll; Storenkasten nur mit Option)
This commit is contained in:
9 files changed
+226
-68
No files matched your search
@@ -307,6 +307,15 @@ Wer zu einer ID mehr wissen will (Entscheide, Tests, Bilder), sucht dort nach `*
|
||||
|
||||
## Schnitt und Ansicht
|
||||
|
||||
- ◐ **[184]** Fenster/Türen im Schnitt und in der Ansicht nach Detailgrad wie im Grundriss (11.11., Wunsch Maintainer).
|
||||
EINE Auflösung `model_view::Options::opening_detail`/`section_look` (Element-Detailgrad > Stufe > Basis; Fenster
|
||||
„Vereinfacht" = grob; ohne Stufe der Massstab-Detailgrad des Grundrisses, mittel ab 1:200 = grob, `for_view_scaled`).
|
||||
Schnitt grob: NUR ein Strich in der Öffnung (Rahmenmitte), kein Rahmen/Fensterbank/Sturz-Fläche/Storen (Sturz und
|
||||
Brüstung = Wandschnitt); Tür grob: Öffnung + Blatt als ein Strich. Mittel: Rechteck-Rahmen oben/unten + Glaslinie,
|
||||
Fensterbank als einfache Fläche, Tür-Blatt als Fläche. Fein: volles Profil wie bisher. Storenkasten im Schnitt nur
|
||||
mit `windows.shadingBox` (Basis aus). `sectionDetail` der Stufe ist jetzt optional (ja = voll, nein = höchstens
|
||||
mittel, fehlt = Detailgrad). Ansicht: Fensterteilung folgt dem Detailgrad (grob/vereinfacht: keine), `elevationDivision`
|
||||
geht vor. Offen: Ansicht-Details (Rahmen/Laibung) nach Stufe; nicht in der Tauri-App geprüft.
|
||||
- ◐ **[178]** Deckenauflager an Aussenwänden (11.11., Wunsch Maintainer). Decke endet an der Aussenkante des Kerns
|
||||
([33] `layer_positions`), Aussendämmung/Putz laufen an der Stirn durch — abgeleitet, Umriss bleibt
|
||||
(`model3d/bearing.rs`: Platten-Umriss minus Aussenschicht-Streifen, wo vor der Wand keine Decke liegt → `emit_slabs`
|
||||
|
||||
@@ -2222,7 +2222,7 @@ pub struct ModelViewDoors {
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
pub threshold: Option<ModelViewThreshold>,
|
||||
/// Zarge, Blatt und Sturz im Schnitt (Basis: ja; nein = nur das Blatt).
|
||||
/// Zarge, Blatt und Sturz im Schnitt: ja = voll, nein = höchstens das Blatt; ohne Wert folgt es dem Detailgrad (grob: Blatt als Strich).
|
||||
#[serde(rename = "sectionDetail", default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
pub section_detail: Option<bool>,
|
||||
@@ -2277,11 +2277,11 @@ pub struct ModelViewWindows {
|
||||
#[serde(rename = "lintelLine", default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
pub lintel_line: Option<bool>,
|
||||
/// Rahmen, Kämpfer, Sturz, Fensterbank und Storen im Schnitt (Basis: ja; nein = Rahmen und Glas).
|
||||
/// Rahmen, Kämpfer, Sturz, Fensterbank im Schnitt: ja = voll, nein = höchstens einfacher Rahmen und Glas; ohne Wert folgt es dem Detailgrad (grob: ein Strich, mittel: einfach, fein: voll).
|
||||
#[serde(rename = "sectionDetail", default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
pub section_detail: Option<bool>,
|
||||
/// Fensterteilung (Flügel, Sprossen, Kämpfer) in der Ansicht (Basis: ja).
|
||||
/// Fensterteilung (Flügel, Sprossen, Kämpfer) in der Ansicht; ohne Wert folgt sie dem Detailgrad (grob: keine).
|
||||
#[serde(rename = "elevationDivision", default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
pub elevation_division: Option<bool>,
|
||||
|
||||
@@ -266,7 +266,7 @@ pub fn elevation_primitives_with(p: &Project, level: &LevelSpec, shadows: bool,
|
||||
// Ansichtsfarbe und -schraffur ([100]) der sichtbaren Bauteilseite.
|
||||
let (mut pattern_lines, mut pattern_styles) = surface_patterns(p, &mut faces, &frame, scale, mono);
|
||||
// [173] Öffnungslinien der Fenster nach der Modelldarstellung der Ebene (Element und Typ gehen vor).
|
||||
let mvo = crate::plan::model_view::for_view(p, level.model_view.as_deref(), crate::plan::style::Detail::Mittel, scale);
|
||||
let mvo = crate::plan::model_view::for_view_scaled(p, level.model_view.as_deref(), crate::plan::style::Detail::Mittel, scale);
|
||||
let win = &mvo.window;
|
||||
let mut openings = collect_openings(p, &frame, win);
|
||||
// [180] Öffnungen nach ihrer Klasse und der ihres Wirts (Wand, Dach): ausgeblendet ⇒ ohne Öffnung.
|
||||
@@ -281,8 +281,10 @@ pub fn elevation_primitives_with(p: &Project, level: &LevelSpec, shadows: bool,
|
||||
openings.retain(|op| all.iter().find(|o| o.id == op.id).is_none_or(|o| shown(&o.category_code) && host_shown(o)));
|
||||
}
|
||||
// [173] Fensterteilung (Flügel, Sprossen, Kämpfer) nach der Modelldarstellung.
|
||||
if !win.elevation_division {
|
||||
for op in openings.iter_mut().filter(|op| p.openings.as_deref().unwrap_or(&[]).iter().any(|o| o.id == op.id && o.kind != ElementKind::Door)) {
|
||||
// [184] Ohne ausdrückliche Wahl folgt sie dem Detailgrad der Öffnung wie Grundriss und Schnitt (grob/vereinfacht: keine).
|
||||
for op in openings.iter_mut() {
|
||||
let Some(o) = p.openings.as_deref().unwrap_or(&[]).iter().find(|o| o.id == op.id && o.kind != ElementKind::Door) else { continue };
|
||||
if !win.elevation_division.unwrap_or_else(|| mvo.opening_detail(false, o.detail_level) != crate::plan::style::Detail::Grob) {
|
||||
op.divisions.clear();
|
||||
op.sash_rects.clear();
|
||||
}
|
||||
|
||||
@@ -84,8 +84,9 @@ pub struct DoorOpts {
|
||||
pub leaf_rect: bool,
|
||||
/// Schwelle im Grundriss.
|
||||
pub threshold: Threshold,
|
||||
/// Zarge, Blatt und Sturz im Schnitt (sonst nur das Blatt).
|
||||
pub section_detail: bool,
|
||||
/// [184] Zarge, Blatt und Sturz im Schnitt: `Some(true)` voll, `Some(false)` höchstens vereinfacht (nur das
|
||||
/// Blatt); `None` = folgt dem Detailgrad (s. [`Options::section_look`]).
|
||||
pub section_detail: Option<bool>,
|
||||
}
|
||||
|
||||
/// Schwelle der Türen im Grundriss.
|
||||
@@ -133,10 +134,11 @@ pub struct WindowOpts {
|
||||
pub shading_box: bool,
|
||||
/// Sturzlinie im Grundriss.
|
||||
pub lintel_line: bool,
|
||||
/// Rahmen, Kämpfer, Sturz, Fensterbank und Storen im Schnitt (sonst Rahmen und Glas).
|
||||
pub section_detail: bool,
|
||||
/// Fensterteilung (Flügel, Sprossen, Kämpfer) in der Ansicht.
|
||||
pub elevation_division: bool,
|
||||
/// [184] Rahmen, Kämpfer, Sturz, Fensterbank im Schnitt: `Some(true)` voll, `Some(false)` höchstens vereinfacht
|
||||
/// (Rahmen und Glas); `None` = folgt dem Detailgrad (s. [`Options::section_look`]).
|
||||
pub section_detail: Option<bool>,
|
||||
/// Fensterteilung (Flügel, Sprossen, Kämpfer) in der Ansicht: `None` = folgt dem Detailgrad (grob/vereinfacht: keine).
|
||||
pub elevation_division: Option<bool>,
|
||||
}
|
||||
|
||||
impl WindowOpts {
|
||||
@@ -324,7 +326,51 @@ pub struct Options {
|
||||
pub dims: DimOpts,
|
||||
}
|
||||
|
||||
/// [184] Wie ein geschnittenes Fenster/eine geschnittene Tür im Schnitt aussieht (Stufen wie im Grundriss).
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord)]
|
||||
pub enum SectionLook {
|
||||
/// Grob: Leibungen offen, ein Strich in der Rahmenmitte (Tür: Blatt als Linie); kein Profil, kein Sturz.
|
||||
Line,
|
||||
/// Mittel: Rechteck-Rahmen und Glaslinie (Tür: Blatt), Fensterbank als einfache Fläche; kein Sturz, kein Kämpfer.
|
||||
Simple,
|
||||
/// Fein: volles Profil mit Sturz, Kämpfer, Fensterbank.
|
||||
Full,
|
||||
}
|
||||
|
||||
impl Options {
|
||||
/// [184] EINE Auflösung des Detailgrads einer Öffnung für Grundriss, Schnitt und Ansicht: Element-Detailgrad >
|
||||
/// Detailgrad der Ansicht (Modelldarstellung über Basis, im Grundriss massstabsabhängig); bei Fenstern übersteuert
|
||||
/// „Vereinfacht (3 Linien)" alles mit grob. Der Grundriss löst den Element-Detailgrad vorab auf
|
||||
/// ([`Options::element_detail`]) und wendet danach nur die „Vereinfacht"-Regel an (`element: None`).
|
||||
pub fn opening_detail(&self, door: bool, element: Option<DetailLevel>) -> Detail {
|
||||
if !door && self.window.simplified {
|
||||
Detail::Grob
|
||||
} else {
|
||||
self.element_detail(element)
|
||||
}
|
||||
}
|
||||
|
||||
/// Detailgrad eines Elements mit eigenem Detailgrad (sonst der der Ansicht).
|
||||
pub fn element_detail(&self, element: Option<DetailLevel>) -> Detail {
|
||||
element.and_then(detail_of).unwrap_or(self.detail)
|
||||
}
|
||||
|
||||
/// [184] Schnittdarstellung einer Öffnung: aus dem Detailgrad ([`Options::opening_detail`]; grob → Linie, mittel →
|
||||
/// einfach, fein → voll); die Option „Schnittdetail" der Stufe geht vor (ja = voll, nein = höchstens einfach).
|
||||
pub fn section_look(&self, door: bool, element: Option<DetailLevel>) -> SectionLook {
|
||||
let base = match self.opening_detail(door, element) {
|
||||
Detail::Grob => SectionLook::Line,
|
||||
Detail::Mittel => SectionLook::Simple,
|
||||
Detail::Fein => SectionLook::Full,
|
||||
};
|
||||
let opt = if door { self.door.section_detail } else { self.window.section_detail };
|
||||
match opt {
|
||||
Some(true) if door || !self.window.simplified => SectionLook::Full,
|
||||
Some(false) => base.min(SectionLook::Simple),
|
||||
_ => base,
|
||||
}
|
||||
}
|
||||
|
||||
/// Schnittflächen schraffiert: Ebene > Modelldarstellung > nein.
|
||||
pub fn cut_hatch(&self, level: Option<bool>) -> bool {
|
||||
level.or(self.wall.cut_hatch_mv).unwrap_or(false)
|
||||
@@ -376,6 +422,18 @@ pub fn for_view(p: &Project, id: Option<&str>, detail: Detail, scale: f64) -> Op
|
||||
resolve(id.and_then(|id| find(p, id)), detail, scale)
|
||||
}
|
||||
|
||||
/// [184] Wie [`for_view`], mit dem massstabsabhängigen Detailgrad des Grundrisses ([140]: „mittel" ab 1:200 wie „grob"):
|
||||
/// für Schnitt und Ansicht, deren Öffnungen wie im Grundriss aufgelöst werden.
|
||||
pub fn for_view_scaled(p: &Project, id: Option<&str>, detail: Detail, scale: f64) -> Options {
|
||||
let o = for_view(p, id, detail, scale);
|
||||
let (d, _) = super::domains::effective_detail(o.detail, scale);
|
||||
if d == o.detail {
|
||||
o
|
||||
} else {
|
||||
resolve(id.filter(|s| !s.is_empty()).and_then(|id| find(p, id)), d, scale)
|
||||
}
|
||||
}
|
||||
|
||||
fn layer_mode(m: Option<ModelViewLayers>) -> LayerMode {
|
||||
match m {
|
||||
Some(ModelViewLayers::All) => LayerMode::All,
|
||||
@@ -437,7 +495,7 @@ pub fn resolve(mv: Option<&ModelViewOption>, detail: Detail, scale: f64) -> Opti
|
||||
Some(ModelViewThreshold::All) => Threshold::All,
|
||||
_ => Threshold::Off,
|
||||
},
|
||||
section_detail: d.and_then(|d| d.section_detail).unwrap_or(true),
|
||||
section_detail: d.and_then(|d| d.section_detail),
|
||||
},
|
||||
window: WindowOpts {
|
||||
sash_symbols_mv: w.and_then(|w| w.sash_symbols),
|
||||
@@ -447,8 +505,8 @@ pub fn resolve(mv: Option<&ModelViewOption>, detail: Detail, scale: f64) -> Opti
|
||||
simplified: w.and_then(|w| w.simplified).unwrap_or(false),
|
||||
shading_box: w.and_then(|w| w.shading_box).unwrap_or(false),
|
||||
lintel_line: w.and_then(|w| w.lintel_line).unwrap_or(false),
|
||||
section_detail: w.and_then(|w| w.section_detail).unwrap_or(true),
|
||||
elevation_division: w.and_then(|w| w.elevation_division).unwrap_or(true),
|
||||
section_detail: w.and_then(|w| w.section_detail),
|
||||
elevation_division: w.and_then(|w| w.elevation_division),
|
||||
},
|
||||
stair: StairOpts {
|
||||
walk_line: s.and_then(|s| s.walk_line).unwrap_or(true),
|
||||
|
||||
@@ -160,7 +160,7 @@ fn schnitt_oeffnungsdetail() {
|
||||
t.lintel_height = Some(0.2);
|
||||
t.sill_board = Some(WindowTypeSillBoard::Beide);
|
||||
}
|
||||
let ops = |p: &Project| count(§ion(p, 50.0, "mittel"), |q| matches!(q, Primitive::Polygon { opening_id: Some(_), .. } | Primitive::Line { opening_id: Some(_), .. }));
|
||||
let ops = |p: &Project| count(§ion(p, 50.0, "fein"), |q| matches!(q, Primitive::Polygon { opening_id: Some(_), .. } | Primitive::Line { opening_id: Some(_), .. }));
|
||||
let n0 = ops(&p);
|
||||
let mut q = with_mv(p.clone(), serde_json::json!({"windows": {"sectionDetail": false}, "doors": {"sectionDetail": false}}));
|
||||
set_level_mv(&mut q, "schnitt-a", "mv");
|
||||
@@ -418,3 +418,45 @@ fn grundriss_dach_geschnitten_schichten() {
|
||||
p.roofs.as_mut().unwrap()[0].base_elevation = None;
|
||||
assert!(cut_polys(&p, 50.0).is_empty());
|
||||
}
|
||||
|
||||
/// [184] (Profil-Flächen, Linien) der geschnittenen Öffnung O1 im Schnitt.
|
||||
fn o1_parts(p: &Project, scale: f64, detail: &str) -> (usize, usize) {
|
||||
let s = section(p, scale, detail);
|
||||
let profiles = count(&s, |q| matches!(q, Primitive::Polygon { opening_id: Some(id), fill, .. } if id == "O1" && fill != "none"));
|
||||
let lines = count(&s, |q| matches!(q, Primitive::Line { opening_id: Some(id), .. } if id == "O1"));
|
||||
(profiles, lines)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn schnitt_fenster_stufen_wie_grundriss() {
|
||||
let mut p = through_window(sample());
|
||||
for t in p.window_types.iter_mut().flatten() {
|
||||
t.lintel_height = Some(0.2);
|
||||
t.sill_board = Some(WindowTypeSillBoard::Beide);
|
||||
}
|
||||
// 1:200 mittel gilt wie im Grundriss als grob: nur ein Strich, kein Profil.
|
||||
assert_eq!(o1_parts(&p, 200.0, "mittel"), (0, 1), "1:200 grob: ein Mittelstrich");
|
||||
assert_eq!(o1_parts(&p, 50.0, "grob"), (0, 1));
|
||||
// Mittel: einfacher Rahmen + Glaslinie + Fensterbank als Fläche; fein: volles Profil (mehr Flächen: Sturz).
|
||||
let (mp, ml) = o1_parts(&p, 50.0, "mittel");
|
||||
let (fp, fl) = o1_parts(&p, 50.0, "fein");
|
||||
assert!(mp >= 2 && ml == 1, "mittel: Rahmen {mp}, Linien {ml}");
|
||||
assert!(fp > mp && fl >= 1, "fein: Profil {fp} > mittel {mp}");
|
||||
// Stufe mit „Vereinfacht" macht auch bei 1:50 fein einen Strich.
|
||||
let mut q = with_mv(p.clone(), serde_json::json!({"baseDetail": "fein", "windows": {"simplified": true}}));
|
||||
set_level_mv(&mut q, "schnitt-a", "mv");
|
||||
assert_eq!(o1_parts(&q, 50.0, "fein"), (0, 1), "simplified: grob");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn schnitt_storenkasten_nur_mit_option() {
|
||||
let mut p = through_window(sample());
|
||||
for t in p.window_types.iter_mut().flatten() {
|
||||
t.shading = Some(serde_json::from_value(serde_json::json!({"create": true, "mount": "vorgesetzt", "box": {"width": 1.0, "height": 0.2, "depth": 0.15}})).unwrap());
|
||||
}
|
||||
let n = |p: &Project| o1_parts(p, 50.0, "fein").0;
|
||||
let n0 = n(&p);
|
||||
let mut q = with_mv(p.clone(), serde_json::json!({"baseDetail": "fein", "windows": {"shadingBox": true}}));
|
||||
set_level_mv(&mut q, "schnitt-a", "mv");
|
||||
assert!(n(&q) > n0, "Storenkasten nur mit Option ({} > {n0})", n(&q));
|
||||
}
|
||||
@@ -3,6 +3,7 @@
|
||||
//! `section_plan_buf()` (`query.rs`).
|
||||
|
||||
use super::*;
|
||||
use crate::plan::model_view::{Options, SectionLook};
|
||||
|
||||
const OPENING_INK: &str = "#1f242c";
|
||||
const FRAME_MM: f64 = 0.25;
|
||||
@@ -102,7 +103,8 @@ pub(crate) fn sashes_of_window_type(wt: &WindowType) -> Vec<crate::opening_geom:
|
||||
(0..n).map(|_| crate::opening_geom::Sash { post: false, auto_width: true, width: f64::NAN, post_width: f64::NAN, operable }).collect()
|
||||
}
|
||||
|
||||
fn window_cut(p: &Project, wall: &Wall, o: &Opening, c: &CrossSection, detail: bool) -> Result<Vec<Primitive>, String> {
|
||||
fn window_cut(p: &Project, wall: &Wall, o: &Opening, c: &CrossSection, look: SectionLook, shading_box: bool) -> Result<Vec<Primitive>, String> {
|
||||
let full = look == SectionLook::Full;
|
||||
let wt = p.window_type(o);
|
||||
let fw = max(0.02, wt.and_then(|t| t.frame_width).unwrap_or(DEFAULT_FRAME_WIDTH));
|
||||
let (_, n) = axis_frame(wall);
|
||||
@@ -171,9 +173,20 @@ fn window_cut(p: &Project, wall: &Wall, o: &Opening, c: &CrossSection, detail: b
|
||||
let (sp, sh) = det.as_ref().map_or((0.0, 0.0), |f| (min(f.sill_profile, h / 4.0), min(f.shading_profile, h / 4.0)));
|
||||
let (fwb, fwt) = det.as_ref().map_or((fwv, fwv), |f| (min(max(0.02, f.sides.bottom), h / 3.0), min(max(0.02, f.sides.top), h / 3.0)));
|
||||
let mut out = vec![opening_poly(rect(c.u_at(c.face_min), c.u_at(c.face_max), c.z_bottom, c.z_top), false, &o.id)];
|
||||
// [173] Ohne Detail (Modelldarstellung): Rahmen oben/unten und eine Glaslinie, kein Sturz, keine
|
||||
// Fensterbank, kein Kämpfer, keine Storen.
|
||||
if !detail {
|
||||
// [184] Grob: Leibungen offen (Wandschnitt) und ein Strich in der Rahmenmitte, kein Profil, kein Sturz,
|
||||
// keine Fensterbank, keine Storen: nur der Strich.
|
||||
if look == SectionLook::Line {
|
||||
let u = (u0 + u1) / 2.0;
|
||||
let mut l = line(v2(u, c.z_bottom), v2(u, c.z_top), "section-window-glass", GLASS_MM, OPENING_INK);
|
||||
if let Primitive::Line { opening_id, .. } = &mut l {
|
||||
*opening_id = Some(o.id.clone());
|
||||
}
|
||||
out.push(l);
|
||||
return Ok(out);
|
||||
}
|
||||
// [184] Mittel: einfacher Rahmen (Rechteck oben/unten) und eine Glaslinie; Fensterbank als einfache Fläche,
|
||||
// kein Sturz, kein Kämpfer.
|
||||
if !full {
|
||||
out.push(opening_poly(rect(u0, u1, c.z_bottom, c.z_bottom + fwv), true, &o.id));
|
||||
out.push(opening_poly(rect(u0, u1, c.z_top - fwv, c.z_top), true, &o.id));
|
||||
let u = (u0 + u1) / 2.0;
|
||||
@@ -182,6 +195,7 @@ fn window_cut(p: &Project, wall: &Wall, o: &Opening, c: &CrossSection, detail: b
|
||||
*opening_id = Some(o.id.clone());
|
||||
}
|
||||
out.push(l);
|
||||
sill_and_shading(&mut out, p, o, c, (f_min, f_max), look, shading_box);
|
||||
return Ok(out);
|
||||
}
|
||||
let (zb0, zt0) = (c.z_bottom + sp, c.z_top - sh);
|
||||
@@ -225,43 +239,62 @@ fn window_cut(p: &Project, wall: &Wall, o: &Opening, c: &CrossSection, detail: b
|
||||
}
|
||||
}
|
||||
if let Some(t) = wt {
|
||||
// Formöffnung ([G3]): kein Sturz-Querschnitt, kein Storenkasten (Bogen/Schräge statt Sturz).
|
||||
let shaped = crate::opening_shape::is_shaped(o);
|
||||
let shading = t.shading.as_ref().filter(|s| s.create && !shaped);
|
||||
let sturz_box = shading.filter(|s| s.mount == Some(WindowShadingMount::Sturz)).map_or(0.0, |s| max(0.0, s.r#box.depth));
|
||||
if !shaped {
|
||||
lintel_cut(&mut out, o, c, t.lintel_height, sturz_box);
|
||||
// Formöffnung ([G3]): kein Sturz-Querschnitt (Bogen/Schräge statt Sturz).
|
||||
if !crate::opening_shape::is_shaped(o) {
|
||||
lintel_cut(&mut out, o, c, t.lintel_height, sturz_box_depth(t, o, shading_box));
|
||||
}
|
||||
// Fensterbänke nur bei ausdrücklicher Wahl (bisherige Schnitte bleiben gleich).
|
||||
let zb = c.z_bottom;
|
||||
}
|
||||
sill_and_shading(&mut out, p, o, c, (f_min, f_max), look, shading_box);
|
||||
Ok(out)
|
||||
}
|
||||
|
||||
/// Tiefe des Storenkastens im Sturz (ab der Aussenfläche in die Wand), 0 = keiner (Option "Storenkasten" aus,
|
||||
/// Formöffnung oder Kasten vorgesetzt).
|
||||
fn sturz_box_depth(t: &WindowType, o: &Opening, shading_box: bool) -> f64 {
|
||||
let shading = t.shading.as_ref().filter(|s| s.create && shading_box && !crate::opening_shape::is_shaped(o));
|
||||
shading.filter(|s| s.mount == Some(WindowShadingMount::Sturz)).map_or(0.0, |s| max(0.0, s.r#box.depth))
|
||||
}
|
||||
|
||||
/// Fensterbaenke und Storenkasten im Schnitt. Fensterbaenke nur bei ausdruecklicher Wahl am Typ: fein mit Gefaelle,
|
||||
/// sonst als einfache Flaeche. Der Storenkasten nur mit der Option "Storenkasten" der Modelldarstellung (Basis aus,
|
||||
/// wie im Grundriss, [184]).
|
||||
fn sill_and_shading(out: &mut Vec<Primitive>, p: &Project, o: &Opening, c: &CrossSection, frame: (f64, f64), look: SectionLook, shading_box: bool) {
|
||||
let (f_min, f_max) = frame;
|
||||
let Some(t) = p.window_type(o) else { return };
|
||||
let zb = c.z_bottom;
|
||||
// Grob: keine Fensterbank (Wandschnitt genuegt).
|
||||
if look != SectionLook::Line {
|
||||
if matches!(t.sill_board, Some(WindowTypeSillBoard::Aussen | WindowTypeSillBoard::Beide)) {
|
||||
// Aussen: mit Gefälle, bis 4 cm vor die Aussenfläche.
|
||||
// Aussen: bis 4 cm vor die Aussenfläche, fein mit Gefälle.
|
||||
let out_s = min(f_min, c.face_min) - 0.04;
|
||||
let pts = vec![v2(c.u_at(f_min), zb), v2(c.u_at(out_s), zb - 0.015), v2(c.u_at(out_s), zb - 0.045), v2(c.u_at(f_min), zb - 0.03)];
|
||||
let pts = if look == SectionLook::Full {
|
||||
vec![v2(c.u_at(f_min), zb), v2(c.u_at(out_s), zb - 0.015), v2(c.u_at(out_s), zb - 0.045), v2(c.u_at(f_min), zb - 0.03)]
|
||||
} else {
|
||||
rect(c.u_at(f_min), c.u_at(out_s), zb - 0.03, zb)
|
||||
};
|
||||
out.push(opening_poly(pts, true, &o.id));
|
||||
}
|
||||
if matches!(t.sill_board, Some(WindowTypeSillBoard::Innen | WindowTypeSillBoard::Beide)) {
|
||||
let in_s = max(f_max, c.face_max) + 0.02;
|
||||
out.push(opening_poly(rect(c.u_at(f_max), c.u_at(in_s), zb - 0.025, zb), true, &o.id));
|
||||
}
|
||||
if let Some(sh) = shading {
|
||||
let h = max(0.0, sh.r#box.height);
|
||||
let d = max(0.0, sh.r#box.depth);
|
||||
if h > 1e-4 && d > 1e-4 {
|
||||
// Im Sturz: ab der Aussenfläche in die Wand; vorgesetzt: vor der Rahmen-Vorderkante.
|
||||
let (s0, s1) = if sturz_box > 0.0 { (c.face_min, c.face_min + d) } else { (f_min - d, f_min) };
|
||||
out.push(opening_poly(rect(c.u_at(s0), c.u_at(s1), c.z_top, c.z_top + h), true, &o.id));
|
||||
// Lamellen-/Rollpaket im Kasten.
|
||||
let m = min(0.02, d / 4.0);
|
||||
let mut pack = polygon(rect(c.u_at(s0 + m), c.u_at(s1 - m), c.z_top + m, c.z_top + h * 0.6), SHADING_PACK_FILL, OPENING_INK, crate::plan::style::SYMBOL_LINE_MM, no_hatch_base());
|
||||
if let Primitive::Polygon { opening_id, .. } = &mut pack {
|
||||
*opening_id = Some(o.id.clone());
|
||||
}
|
||||
out.push(pack);
|
||||
}
|
||||
}
|
||||
}
|
||||
Ok(out)
|
||||
let Some(sh) = t.shading.as_ref().filter(|s| s.create && shading_box && !crate::opening_shape::is_shaped(o)) else { return };
|
||||
let sturz = sh.mount == Some(WindowShadingMount::Sturz);
|
||||
let h = max(0.0, sh.r#box.height);
|
||||
let d = max(0.0, sh.r#box.depth);
|
||||
if h > 1e-4 && d > 1e-4 {
|
||||
// Im Sturz: ab der Aussenfläche in die Wand; vorgesetzt: vor der Rahmen-Vorderkante.
|
||||
let (s0, s1) = if sturz { (c.face_min, c.face_min + d) } else { (f_min - d, f_min) };
|
||||
out.push(opening_poly(rect(c.u_at(s0), c.u_at(s1), c.z_top, c.z_top + h), true, &o.id));
|
||||
// Lamellen-/Rollpaket im Kasten.
|
||||
let m = min(0.02, d / 4.0);
|
||||
let mut pack = polygon(rect(c.u_at(s0 + m), c.u_at(s1 - m), c.z_top + m, c.z_top + h * 0.6), SHADING_PACK_FILL, OPENING_INK, crate::plan::style::SYMBOL_LINE_MM, no_hatch_base());
|
||||
if let Primitive::Polygon { opening_id, .. } = &mut pack {
|
||||
*opening_id = Some(o.id.clone());
|
||||
}
|
||||
out.push(pack);
|
||||
}
|
||||
}
|
||||
|
||||
/// Sturz im Schnitt ([94]): eigener Querschnitt über der Öffnung (Beton grau), neben einem
|
||||
@@ -282,14 +315,23 @@ fn lintel_cut(out: &mut Vec<Primitive>, o: &Opening, c: &CrossSection, height: O
|
||||
out.push(pr);
|
||||
}
|
||||
|
||||
fn door_cut(p: &Project, o: &Opening, c: &CrossSection, detail: bool) -> Vec<Primitive> {
|
||||
fn door_cut(p: &Project, o: &Opening, c: &CrossSection, look: SectionLook) -> Vec<Primitive> {
|
||||
let mut out = vec![opening_poly(rect(c.u_at(c.face_min), c.u_at(c.face_max), c.z_bottom, c.z_top), false, &o.id)];
|
||||
// [173] Ohne Detail (Modelldarstellung): nur das Blatt in der Wandmitte (Wandöffnung: nur die Lücke).
|
||||
if !detail {
|
||||
// [184] Ohne Detail (Modelldarstellung): grob das Blatt als Linie, mittel als Fläche, beide in der Wandmitte
|
||||
// (Wandöffnung: nur die Lücke).
|
||||
if look != SectionLook::Full {
|
||||
let kind = p.door_type(o).map(|t| t.kind);
|
||||
if o.door_type != Some(OpeningDoorType::Wandoeffnung) && kind != Some(DoorTypeKind::Wandoeffnung) {
|
||||
let mid = (c.face_min + c.face_max) / 2.0;
|
||||
out.push(opening_poly(rect(c.u_at(mid - DOOR_LEAF_THICKNESS / 2.0), c.u_at(mid + DOOR_LEAF_THICKNESS / 2.0), c.z_bottom + 0.01, c.z_top), true, &o.id));
|
||||
if look == SectionLook::Line {
|
||||
let mut l = line(v2(c.u_at(mid), c.z_bottom), v2(c.u_at(mid), c.z_top), "section-window-glass", GLASS_MM, OPENING_INK);
|
||||
if let Primitive::Line { opening_id, .. } = &mut l {
|
||||
*opening_id = Some(o.id.clone());
|
||||
}
|
||||
out.push(l);
|
||||
} else {
|
||||
out.push(opening_poly(rect(c.u_at(mid - DOOR_LEAF_THICKNESS / 2.0), c.u_at(mid + DOOR_LEAF_THICKNESS / 2.0), c.z_bottom + 0.01, c.z_top), true, &o.id));
|
||||
}
|
||||
}
|
||||
return out;
|
||||
}
|
||||
@@ -357,13 +399,17 @@ fn door_frame_cut(out: &mut Vec<Primitive>, o: &Opening, c: &CrossSection, df: &
|
||||
}
|
||||
|
||||
/// `sectionOpeningPrimitives`.
|
||||
#[cfg(test)]
|
||||
pub fn section_opening_primitives(p: &Project, level: &LevelSpec, vis: &Visibility) -> Result<Vec<Primitive>, String> {
|
||||
section_opening_primitives_mv(p, level, vis, true, true)
|
||||
let mut o = crate::plan::model_view::resolve(None, crate::plan::style::Detail::Fein, 50.0);
|
||||
o.window.shading_box = true;
|
||||
section_opening_primitives_mv(p, level, vis, &o)
|
||||
}
|
||||
|
||||
/// [173] Wie [`section_opening_primitives`] mit dem Detail der Modelldarstellung: `doors`/`windows` = Zarge,
|
||||
/// Sturz, Kämpfer, Fensterbank und Storen zeigen (sonst nur Blatt bzw. Rahmen und Glas).
|
||||
pub fn section_opening_primitives_mv(p: &Project, level: &LevelSpec, vis: &Visibility, doors: bool, windows: bool) -> Result<Vec<Primitive>, String> {
|
||||
/// [173]/[184] Geschnittene Öffnungen nach der Modelldarstellung `mv` (Detailgrad wie im Grundriss, Rangfolge Element >
|
||||
/// Stufe > Basis, EINE Auflösung `Options::section_look`): grob Linie, mittel einfacher Rahmen, fein volles Profil;
|
||||
/// Storenkasten nach `windows.shadingBox`.
|
||||
pub fn section_opening_primitives_mv(p: &Project, level: &LevelSpec, vis: &Visibility, mv: &Options) -> Result<Vec<Primitive>, String> {
|
||||
let Some(plane) = level.plane() else { return Ok(Vec::new()) };
|
||||
if level.kind != "section" {
|
||||
return Ok(Vec::new());
|
||||
@@ -403,7 +449,7 @@ pub fn section_opening_primitives_mv(p: &Project, level: &LevelSpec, vis: &Visib
|
||||
None => (wall, o),
|
||||
};
|
||||
let Some(c) = cross_section(p, wall, o, p0, u)? else { continue };
|
||||
let prims = if o.kind == ElementKind::Window { window_cut(p, wall, o, &c, windows)? } else { door_cut(p, o, &c, doors) };
|
||||
let prims = if o.kind == ElementKind::Window { window_cut(p, wall, o, &c, mv.section_look(false, o.detail_level), mv.window.shading_box)? } else { door_cut(p, o, &c, mv.section_look(true, o.detail_level)) };
|
||||
let greyed = vis.greyed(&o.category_code);
|
||||
for pr in prims {
|
||||
out.push(if greyed { pr.with_greyed(true) } else { pr });
|
||||
|
||||
@@ -89,6 +89,7 @@ pub fn section_plan_buf(p: &Project, args: &[f64], text: &str) -> Result<Vec<u8>
|
||||
};
|
||||
let hidden = v.get("hiddenLines").and_then(|b| b.as_bool()).unwrap_or(false);
|
||||
let detail = Detail::parse(v.get("detail").and_then(|d| d.as_str()).unwrap_or("mittel"));
|
||||
let detail_arg = detail;
|
||||
// [173] Modelldarstellung: ausdrücklich angefragt (Blatt-Ausschnitt), sonst die der Ebene; ihre Basis
|
||||
// ersetzt den Detailgrad. Ohne Wahl wie bisher.
|
||||
let mv_id = v.get("modelView").and_then(|m| m.as_str()).filter(|m| !m.is_empty()).or(level.model_view.as_deref());
|
||||
@@ -110,11 +111,12 @@ pub fn section_plan_buf(p: &Project, args: &[f64], text: &str) -> Result<Vec<u8>
|
||||
trees.extend(unfold::bend_lines(&level, bounds));
|
||||
let prims = trees;
|
||||
w.group(&prims);
|
||||
let (door_detail, window_detail) = mvo.as_ref().map_or((true, true), |o| (o.door.section_detail, o.window.section_detail));
|
||||
// [184] Öffnungen wie im Grundriss: Detailgrad aus Stufe bzw. Massstab (mittel ab 1:200 grob).
|
||||
let open_mv = crate::plan::model_view::for_view_scaled(p, mv_id, detail_arg, scale);
|
||||
let mut ops = Vec::new();
|
||||
if openings {
|
||||
for (l, s) in &parts {
|
||||
ops.extend(unfold::clip_prims(section_opening_primitives_mv(p, l, &vis, door_detail, window_detail)?, s.as_ref()));
|
||||
ops.extend(unfold::clip_prims(section_opening_primitives_mv(p, l, &vis, &open_mv)?, s.as_ref()));
|
||||
}
|
||||
}
|
||||
crate::plan::extras::scale_line_weights(p, scale, &mut ops);
|
||||
|
||||
@@ -641,7 +641,7 @@ fn opening_symbol(c: &Ctx, out: &mut Vec<Primitive>, w: &Wall, o: &Opening, colo
|
||||
// [173] Modelldarstellung (bei eigenem Detailgrad der Öffnung über deren Basis).
|
||||
let mo = c.mv_for(detail);
|
||||
// [173] Fenster „vereinfacht" (3 Linien): wie grob, auch bei mittel/fein.
|
||||
let detail = if !door && mo.window.simplified { Detail::Grob } else { detail };
|
||||
let detail = mo.opening_detail(door, None);
|
||||
let detail_code = match detail {
|
||||
// [140] Übersicht (1:500 und kleiner): Türen ohne Aufschlag-Bogen (ausser die Modelldarstellung will ihn).
|
||||
Detail::Grob if c.a.scale >= super::domains::OVERVIEW_FROM && mo.door.swing_arc != Some(true) => -1.0,
|
||||
@@ -1159,12 +1159,7 @@ pub fn plan_walls(c: &Ctx, reference_lines: bool, out: &mut Vec<Primitive>, boun
|
||||
let ov = c.overrides(Some("opening"), &o.category_code, Some(&opening_label(o)));
|
||||
let olw = ov.lineweight.unwrap_or_else(|| c.cat(&o.category_code).map_or(LAYER_LINE_MM, |k| k.lw));
|
||||
let color = ov.color.as_deref().or(o.color.as_deref());
|
||||
let detail = match o.detail_level {
|
||||
Some(DetailLevel::Grob) => Detail::Grob,
|
||||
Some(DetailLevel::Mittel) => Detail::Mittel,
|
||||
Some(DetailLevel::Fein) => Detail::Fein,
|
||||
_ => c.a.detail,
|
||||
};
|
||||
let detail = c.mv().element_detail(o.detail_level);
|
||||
let wall_line = (e.color.as_deref().unwrap_or(POCHE_STROKE), lw * c.a.detail.outline_factor());
|
||||
let mut tmp = Vec::new();
|
||||
opening_symbol(c, &mut tmp, wv, o, color, c.greyed(&o.category_code), detail, olw, wall_line)?;
|
||||
|
||||
@@ -2059,7 +2059,9 @@ export type ModelViewDoors = {
|
||||
leaf?: ModelViewLeaf;
|
||||
/** Schwelle im Grundriss: aus, nur Hebeschiebetüren oder alle Türen (Basis: aus). */
|
||||
threshold?: ModelViewThreshold;
|
||||
/** Zarge, Blatt und Sturz im Schnitt (Basis: ja; nein = nur das Blatt). */
|
||||
/**
|
||||
* Zarge, Blatt und Sturz im Schnitt: ja = voll, nein = höchstens das Blatt; ohne Wert folgt es dem Detailgrad (grob: Blatt als Strich).
|
||||
*/
|
||||
sectionDetail?: boolean;
|
||||
};
|
||||
|
||||
@@ -2245,10 +2247,12 @@ export type ModelViewWindows = {
|
||||
*/
|
||||
lintelLine?: boolean;
|
||||
/**
|
||||
* Rahmen, Kämpfer, Sturz, Fensterbank und Storen im Schnitt (Basis: ja; nein = Rahmen und Glas).
|
||||
* Rahmen, Kämpfer, Sturz, Fensterbank im Schnitt: ja = voll, nein = höchstens einfacher Rahmen und Glas; ohne Wert folgt es dem Detailgrad (grob: ein Strich, mittel: einfach, fein: voll).
|
||||
*/
|
||||
sectionDetail?: boolean;
|
||||
/** Fensterteilung (Flügel, Sprossen, Kämpfer) in der Ansicht (Basis: ja). */
|
||||
/**
|
||||
* Fensterteilung (Flügel, Sprossen, Kämpfer) in der Ansicht; ohne Wert folgt sie dem Detailgrad (grob: keine).
|
||||
*/
|
||||
elevationDivision?: boolean;
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user