diff --git a/TODO.md b/TODO.md index a4525572..2c30d4c0 100644 --- a/TODO.md +++ b/TODO.md @@ -373,7 +373,10 @@ Wer zu einer ID mehr wissen will (Entscheide, Tests, Bilder), sucht dort nach `* geht vor. 11.11. Nachbesserung: grob = Sturz unten und Brüstung oben im Wandschnitt FLACH (kein Anschlag, keine Nase, kein Schichteinzug [168]; `Visibility.flat_openings` aus `section_look == Line`, im Cache-Schlüssel, `section/bands.rs` `section_reveal`, `parallel_reveal_cuts`); Grundriss grob: Leibung gerade, keine Anschlag-Nasen (Wand-Nasen in - `walls.rs`, Tür-Nasen in `plan/openings.rs`). Offen: Ansicht-Details (Rahmen/Laibung) nach Stufe; nicht in der Tauri-App geprüft. + `walls.rs`, Tür-Nasen in `plan/openings.rs`). 11.11. (3): Ansicht nach Detailgrad (`plan/elevation/mod.rs`, `opening_detail`): grob = nur Öffnungsumriss mit Glas-/Blattfläche (kein + Rahmen, Fensterbank, Teilung, Laibungsschatten, Flügelsymbole), mittel = Rahmen + Teilung und Laibungsschatten, aber ohne Fensterbank, fein wie bisher; + Storenkasten über der Öffnung nur mit `windows.shadingBox`. Ressourcen-Tab: „Schnittdetail Tür/Fenster" als Wahl „Wie Detailgrad / + Voll / Vereinfacht" mit Tooltip. 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` diff --git a/doc/ARCHITEKTUR.md b/doc/ARCHITEKTUR.md index 5e3d0e98..36190354 100644 --- a/doc/ARCHITEKTUR.md +++ b/doc/ARCHITEKTUR.md @@ -330,7 +330,7 @@ Werkzeugleiste (Detailgrad-Wahl = Liste der Stufen) und die Ansichtsvorlage (Ebe Ebenen-Felder, die selbst Darstellung sind (`cutHatch`, `floorFinish`, `showTerrain`, `shadows`), gehen der Modelldarstellung vor, wenn sie gesetzt sind. Angebunden (Etappe 1): Türen und Fenster (`plan/walls.rs::opening_symbol`, `plan/openings.rs`; Fenster-Öffnungslinien auch in der Ansicht, -`plan/elevation/openings.rs`), Treppen (`plan/stairs.rs`, filtert das Symbol nach Linienklasse — das +`plan/elevation/openings.rs`; Ansicht nach Detailgrad ([184]) in `plan/elevation/mod.rs` über `Options::opening_detail`), Treppen (`plan/stairs.rs`, filtert das Symbol nach Linienklasse — das Symbol selbst in `stair_symbol.rs` bleibt unberührt), Wandschichten und Schichteinzug (`plan/walls.rs::layer_targets`), Schnittflächen, Bodenbelag und Gelände. Etappe 2: diff --git a/src-tauri/core/src/plan/elevation/mod.rs b/src-tauri/core/src/plan/elevation/mod.rs index a5c3a614..f81ccabf 100644 --- a/src-tauri/core/src/plan/elevation/mod.rs +++ b/src-tauri/core/src/plan/elevation/mod.rs @@ -311,14 +311,41 @@ pub fn elevation_primitives_with(p: &Project, level: &LevelSpec, shadows: bool, let all = p.openings.as_deref().unwrap_or(&[]); 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. - // [184] Ohne ausdrückliche Wahl folgt sie dem Detailgrad der Öffnung wie Grundriss und Schnitt (grob/vereinfacht: keine). + // [184] Darstellung der Öffnungen nach Detailgrad, EINE Auflösung wie Grundriss und Schnitt (`opening_detail`): + // grob = nur Öffnungsumriss mit Glas-/Blattfläche (kein Rahmen, keine Teilung, keine Laibung, keine Bank); + // mittel = Rahmen, Teilung und Laibungsschatten, aber ohne Fensterbank; fein = volles Profil. + // Die Fensterteilung (Flügel, Sprossen, Kämpfer) folgt sonst dem Detailgrad (grob: keine) oder `elevationDivision`. 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) { + let Some(o) = p.openings.as_deref().unwrap_or(&[]).iter().find(|o| o.id == op.id) else { continue }; + let door = o.kind == ElementKind::Door; + op.look = mvo.opening_detail(door, o.detail_level); + if !door && !win.elevation_division.unwrap_or(op.look != crate::plan::style::Detail::Grob) { op.divisions.clear(); op.sash_rects.clear(); } + if op.look != crate::plan::style::Detail::Fein { + op.sill.clear(); + } + if op.look == crate::plan::style::Detail::Grob { + op.divisions.clear(); + op.sash_rects.clear(); + op.symbol.clear(); + op.frame = None; + if op.shape.is_none() { + // Glas und Blatt ersetzt die Füllung des Umrisses. + op.glass_only = !op.glass.is_empty(); + op.glass.clear(); + op.door_leaf.clear(); + } + } + // [184] Storenkasten in der Ansicht nur mit `windows.shadingBox` (Basis aus, wie Grundriss und Schnitt). + if !door && win.shading_box && op.shape.is_none() { + let sh = p.window_type(o).and_then(|t| t.shading.as_ref()).filter(|s| s.create); + let h = sh.map_or(0.0, |s| s.r#box.height.max(0.0)); + if h > 1e-4 { + op.shading = Some([op.pts[3], op.pts[2], [op.pts[2][0], op.pts[2][1] + h], [op.pts[3][0], op.pts[3][1] + h]]); + } + } } // [171] Formöffnung: Fassaden-Schraffur auch auf den Füllstücken zwischen Umriss und Rechteck-Loch der Wand // (sonst bleibt um ein Rundfenster ein ungemustertes Quadrat). @@ -644,7 +671,18 @@ pub fn elevation_primitives_with(p: &Project, level: &LevelSpec, shadows: bool, let glass_fill = ov.as_ref().and_then(|o| o.fill.as_deref()).unwrap_or(if mono { GLASS_FILL_MONO } else { GLASS_FILL_COLOR }); let leaf_fill = ov.as_ref().and_then(|o| o.fill.as_deref()).unwrap_or(if mono { "#ffffff" } else { DOOR_LEAF_FILL_COLOR }); let frame_pts = op.shape.as_ref().map_or(op.frame.as_ref().map_or(&op.pts[..], |f| &f[..]), |(o, _, _, _)| &o[..]); - push(poly_prim(to_vec(frame_pts), if mono { "#ffffff" } else { FRAME_FILL_COLOR }, ink, frame_mm, id)); + // [184] Grob: der Umriss trägt selbst die Glas- bzw. Blattfläche (kein Rahmen). + let outline_fill = if op.look == crate::plan::style::Detail::Grob && op.shape.is_none() { + if op.glass_only { glass_fill } else { leaf_fill } + } else if mono { + "#ffffff" + } else { + FRAME_FILL_COLOR + }; + push(poly_prim(to_vec(frame_pts), outline_fill, ink, frame_mm, id)); + if let Some(b) = &op.shading { + push(poly_prim(to_vec(b), if mono { "#ffffff" } else { FRAME_FILL_COLOR }, ink, edge_mm, id)); + } if let Some((_, g, _, _)) = &op.shape { push(poly_prim(to_vec(g), glass_fill, ink, edge_mm, id)); } @@ -660,7 +698,7 @@ pub fn elevation_primitives_with(p: &Project, level: &LevelSpec, shadows: bool, for r in &op.door_leaf { push(poly_prim(to_vec(r), leaf_fill, ink, edge_mm, id)); } - if shadows && op.shape.is_none() { + if shadows && op.shape.is_none() && op.look != crate::plan::style::Detail::Grob { let q = &op.pts; let lerp = |a: Pt, b: Pt, t: f64| -> Pt { [a[0] + (b[0] - a[0]) * t, a[1] + (b[1] - a[1]) * t] }; let quad_at = |fa: f64, fz: f64| lerp(lerp(q[0], q[1], fa), lerp(q[3], q[2], fa), fz); diff --git a/src-tauri/core/src/plan/elevation/openings.rs b/src-tauri/core/src/plan/elevation/openings.rs index cf6ec5de..b8609b49 100644 --- a/src-tauri/core/src/plan/elevation/openings.rs +++ b/src-tauri/core/src/plan/elevation/openings.rs @@ -18,6 +18,12 @@ pub(super) struct ProjOpening { pub(super) shape: Option<(Vec, Vec, Vec>, String)>, /// [105] Rahmen-Umriss, wenn er über die Rohbauöffnung hinausgeht (Zargenspiegel, Bekleidung). pub(super) frame: Option<[Pt; 4]>, + /// [184] Detailgrad der Darstellung (Element > Modelldarstellung > Massstab; `mod.rs` setzt ihn nach dem Sammeln). + pub(super) look: crate::plan::style::Detail, + /// [184] Storenkasten über der Öffnung (nur mit `windows.shadingBox`). + pub(super) shading: Option<[Pt; 4]>, + /// [184] Grob: Umriss füllt mit Glas (statt Türblatt), weil die Öffnung verglast war. + pub(super) glass_only: bool, } /// Türzarge in der Ansicht ([105]) von der sichtbaren Seite: `outer` = über die Rohbaukante hinaus @@ -289,7 +295,7 @@ pub(super) fn collect_openings(p: &Project, frame: &[f64; 9], win: &crate::plan: if shape.is_some() { // Formöffnung ([G3]): ohne Flügel-/Sprossenteilung, Türblatt und Symbole (Rechteck-Raster). let round = p.openings.as_deref().unwrap_or(&[]).iter().any(|o| o.id == ids[k] && !crate::opening_shape::has_flat_bottom(o)); - out.push(ProjOpening { pts, depth, glass: Vec::new(), door_leaf: Vec::new(), divisions: Vec::new(), sash_rects: Vec::new(), sill: if round { Vec::new() } else { sill }, symbol: Vec::new(), id: ids[k].to_string(), shape, frame: None }); + out.push(ProjOpening { pts, depth, glass: Vec::new(), door_leaf: Vec::new(), divisions: Vec::new(), sash_rects: Vec::new(), sill: if round { Vec::new() } else { sill }, symbol: Vec::new(), id: ids[k].to_string(), shape, frame: None, look: crate::plan::style::Detail::Fein, shading: None, glass_only: false }); continue; } let mut sash_rects = sash_rects; @@ -307,7 +313,7 @@ pub(super) fn collect_openings(p: &Project, frame: &[f64; 9], win: &crate::plan: sash_rects.push(r(bd.clear / w, 1.0 - bd.clear / w, 1.0 - bd.clear / h)); } } - out.push(ProjOpening { pts, depth, glass, door_leaf, divisions, sash_rects, sill, symbol, id: ids[k].to_string(), shape, frame: pts_frame }); + out.push(ProjOpening { pts, depth, glass, door_leaf, divisions, sash_rects, sill, symbol, id: ids[k].to_string(), shape, frame: pts_frame, look: crate::plan::style::Detail::Fein, shading: None, glass_only: false }); } surface_openings(p, frame, &mut out); out @@ -346,6 +352,6 @@ pub(super) fn surface_openings(p: &Project, frame: &[f64; 9], out: &mut Vec - - diff --git a/src/i18n/de.ts b/src/i18n/de.ts index ab71ef22..1945f429 100644 --- a/src/i18n/de.ts +++ b/src/i18n/de.ts @@ -1223,6 +1223,10 @@ export const de = { "resources.modelViews.base.view": "wie Ansicht", "resources.modelViews.builtin": "Eingebaute Stufe (nur Detailgrad) — zum Anpassen duplizieren.", "resources.modelViews.asBase": "wie Basis", + "resources.modelViews.asDetail": "Wie Detailgrad", + "resources.modelViews.detail.full": "Voll", + "resources.modelViews.detail.simple": "Vereinfacht", + "resources.modelViews.tip.sectionDetail": "Wie Fenster und Türen im Schnitt aussehen. Wie Detailgrad: grob = Strich, mittel = einfacher Rahmen, fein = volles Profil. Voll: immer volles Profil mit Sturz, Kämpfer und Bank. Vereinfacht: höchstens einfacher Rahmen.", "resources.modelViews.on": "an", "resources.modelViews.off": "aus", "resources.modelViews.section.doors": "Türen", @@ -1236,9 +1240,9 @@ export const de = { "resources.modelViews.section.sectionMarks": "Schnittmarken", "resources.modelViews.section.elevation": "Ansicht", "resources.modelViews.opt.doors.threshold": "Schwelle (Grundriss)", - "resources.modelViews.opt.doors.sectionDetail": "Zarge und Sturz im Schnitt", + "resources.modelViews.opt.doors.sectionDetail": "Schnittdetail Tür", "resources.modelViews.opt.windows.lintelLine": "Sturzlinie (Grundriss)", - "resources.modelViews.opt.windows.sectionDetail": "Rahmen, Sturz, Bank im Schnitt", + "resources.modelViews.opt.windows.sectionDetail": "Schnittdetail Fenster", "resources.modelViews.opt.windows.elevationDivision": "Fensterteilung (Ansicht)", "resources.modelViews.opt.stairs.sectionBeyond": "Treppe hinter dem Schnitt", "resources.modelViews.opt.stairs.runStartMm": "Lauflinie Versatz Anfang (mm Papier)", diff --git a/src/i18n/en.ts b/src/i18n/en.ts index 36c5ed68..38d4ab81 100644 --- a/src/i18n/en.ts +++ b/src/i18n/en.ts @@ -1217,6 +1217,10 @@ export const en: Record = { "resources.modelViews.base.view": "as view", "resources.modelViews.builtin": "Built-in level (detail level only) — duplicate it to customise.", "resources.modelViews.asBase": "as base", + "resources.modelViews.asDetail": "Same as detail level", + "resources.modelViews.detail.full": "Full", + "resources.modelViews.detail.simple": "Simplified", + "resources.modelViews.tip.sectionDetail": "How windows and doors look in section. Same as detail level: coarse = single line, medium = simple frame, fine = full profile. Full: always the full profile with lintel, transom and sill. Simplified: at most a simple frame.", "resources.modelViews.on": "on", "resources.modelViews.off": "off", "resources.modelViews.section.doors": "Doors", @@ -1230,9 +1234,9 @@ export const en: Record = { "resources.modelViews.section.sectionMarks": "Section marks", "resources.modelViews.section.elevation": "Elevation", "resources.modelViews.opt.doors.threshold": "Threshold (plan)", - "resources.modelViews.opt.doors.sectionDetail": "Frame and lintel in section", + "resources.modelViews.opt.doors.sectionDetail": "Door section detail", "resources.modelViews.opt.windows.lintelLine": "Lintel line (plan)", - "resources.modelViews.opt.windows.sectionDetail": "Frame, lintel, sill in section", + "resources.modelViews.opt.windows.sectionDetail": "Window section detail", "resources.modelViews.opt.windows.elevationDivision": "Window division (elevation)", "resources.modelViews.opt.stairs.sectionBeyond": "Stair beyond the section", "resources.modelViews.opt.stairs.runStartMm": "Walking line start offset (paper mm)", diff --git a/src/plan/__golden__/komplex-ansicht-ansicht-sued.txt b/src/plan/__golden__/komplex-ansicht-ansicht-sued.txt index 691463ae..09357e2d 100644 --- a/src/plan/__golden__/komplex-ansicht-ansicht-sued.txt +++ b/src/plan/__golden__/komplex-ansicht-ansicht-sued.txt @@ -1,12 +1,12 @@ viewBox -4.2 0 38 18.478 -bytes 178085 +bytes 175617 circle 4 g 1 line 521 path 2 -polygon 774 +polygon 754 polyline 161 rect 1 svg 1 text 4 -hash 587f4d87add7ecf0 +hash ebd823ab8ac843c7 diff --git a/src/plan/__golden__/muster-ansicht-ansicht-sued.txt b/src/plan/__golden__/muster-ansicht-ansicht-sued.txt index af860449..95ec2988 100644 --- a/src/plan/__golden__/muster-ansicht-ansicht-sued.txt +++ b/src/plan/__golden__/muster-ansicht-ansicht-sued.txt @@ -1,9 +1,9 @@ viewBox 0.1 0 6.8 7.586 -bytes 5005 +bytes 4771 g 1 line 7 -polygon 32 +polygon 30 polyline 4 rect 1 svg 1 -hash 14856a9e9c0c8513 +hash 027bcc5f19d4d4e7 diff --git a/src/state/modelViews.test.ts b/src/state/modelViews.test.ts index 54098323..cc38df5c 100644 --- a/src/state/modelViews.test.ts +++ b/src/state/modelViews.test.ts @@ -127,7 +127,8 @@ describe("modelViews", () => { const elev = (q: Project) => JSON.stringify(generateElevationPlan(q, q.drawingLevels.find((l) => l.id === "ansicht-sued")!)?.primitives.length); const ohne = elev(noShadow(sampleProject)); expect(ohne).not.toBe(elev(sampleProject)); - let e = noShadow(withMv()); + // [184] Basis „mittel" wie der Massstab des Musterhauses (fein zeichnet in der Ansicht zusätzlich die Fensterbank). + let e = noShadow(applyOps(sampleProject, addModelViewOps(newModelView("mv1", "Werkplan", "mittel")))); e = applyOps(e, setModelViewOptionOps(e, "mv1", "elevation", "shadows", true)); e = applyOps(e, selectModelViewOps(e, "ansicht-sued", "mv1")); expect(elev(e)).toBe(elev(sampleProject)); diff --git a/src/state/modelViews.ts b/src/state/modelViews.ts index 9cb63b31..361939c9 100644 --- a/src/state/modelViews.ts +++ b/src/state/modelViews.ts @@ -160,6 +160,8 @@ export interface ModelViewField { key: string; /** Werte als Liste (Auswahl) oder `"bool"`/`"number"`. */ values: readonly (string | number)[] | "bool" | "number"; + /** [184] Dreifach-Wahl „Wie Detailgrad / Voll / Vereinfacht" statt „wie Basis / an / aus" (Beschriftung + Tooltip). */ + detailChoice?: boolean; } export const MODEL_VIEW_FIELDS: readonly ModelViewField[] = [ @@ -169,7 +171,7 @@ export const MODEL_VIEW_FIELDS: readonly ModelViewField[] = [ { section: "doors", key: "frame", values: "bool" }, { section: "doors", key: "leaf", values: ["line", "rect"] }, { section: "doors", key: "threshold", values: ["off", "liftSlide", "all"] }, - { section: "doors", key: "sectionDetail", values: "bool" }, + { section: "doors", key: "sectionDetail", values: "bool", detailChoice: true }, { section: "windows", key: "sashSymbols", values: "bool" }, { section: "windows", key: "planSwingArcs", values: "bool" }, { section: "windows", key: "sill", values: "bool" }, @@ -177,7 +179,7 @@ export const MODEL_VIEW_FIELDS: readonly ModelViewField[] = [ { section: "windows", key: "simplified", values: "bool" }, { section: "windows", key: "shadingBox", values: "bool" }, { section: "windows", key: "lintelLine", values: "bool" }, - { section: "windows", key: "sectionDetail", values: "bool" }, + { section: "windows", key: "sectionDetail", values: "bool", detailChoice: true }, { section: "windows", key: "elevationDivision", values: "bool" }, { section: "stairs", key: "walkLine", values: "bool" }, { section: "stairs", key: "arrow", values: "bool" }, diff --git a/src/ui/resourceManager/ModelViewsTab.tsx b/src/ui/resourceManager/ModelViewsTab.tsx index 6bac0061..adb45ee2 100644 --- a/src/ui/resourceManager/ModelViewsTab.tsx +++ b/src/ui/resourceManager/ModelViewsTab.tsx @@ -51,6 +51,7 @@ function OptionRow({ mv, f, h }: { mv: ModelViewOption; f: ModelViewField; h: Mo