From 63a53f3fe10de0b9d751b76a93ca3468a2805234 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 5 Nov 2026 18:15:24 +0000 Subject: [PATCH 1/5] =?UTF-8?q?[140]=20Grundriss:=20d=C3=BCnne=20Wandschic?= =?UTF-8?q?hten=20im=20Detailgrad=20mittel=20ab=201:100=20in=20der=20Nachb?= =?UTF-8?q?arschicht=20zusammengefasst?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src-tauri/core/src/plan/walls.rs | 65 +++++++++++++++++++++++++++++++- 1 file changed, 63 insertions(+), 2 deletions(-) diff --git a/src-tauri/core/src/plan/walls.rs b/src-tauri/core/src/plan/walls.rs index 10cf4016..b149066b 100644 --- a/src-tauri/core/src/plan/walls.rs +++ b/src-tauri/core/src/plan/walls.rs @@ -164,6 +164,41 @@ fn v2(x: f64, y: f64) -> Vec2 { Vec2 { x, y } } +/// [140] Dünne Schichten unter dieser Papierdicke (mm) gehen im Detailgrad mittel ab 1:100 in der +/// Nachbarschicht auf (Putz, Parkett, Folien): sonst liegen Umriss, Fuge und Schraffur in 1:100 als +/// schwarzer Balken übereinander. In 1:50 und im Detailgrad fein bleiben alle Schichten. +pub const THIN_LAYER_PAPER_MM: f64 = 0.25; + +/// Ziel-Schicht je Schicht: dünne Schichten zeigen auf die nächste nicht dünne (bei gleichem Abstand +/// die dickere), alle anderen auf sich selbst. Fugen zwischen Schichten mit gleichem Ziel entfallen. +pub fn thin_layer_targets(thick: &[f64], detail: Detail, scale: f64) -> Vec { + let n = thick.len(); + let ident: Vec = (0..n).collect(); + if detail != Detail::Mittel || !(scale >= 75.0) { + return ident; + } + let thin: Vec = thick.iter().map(|t| !(t * 1000.0 / scale >= THIN_LAYER_PAPER_MM)).collect(); + if thin.iter().all(|t| *t) { + return ident; + } + (0..n) + .map(|i| { + if !thin[i] { + return i; + } + let left = (0..i).rev().find(|&j| !thin[j]); + let right = (i + 1..n).find(|&j| !thin[j]); + match (left, right) { + (Some(l), Some(r)) if i - l == r - i => if thick[l] >= thick[r] { l } else { r }, + (Some(l), Some(r)) => if i - l < r - i { l } else { r }, + (Some(l), None) => l, + (None, Some(r)) => r, + (None, None) => i, + } + }) + .collect() +} + /// Wand-Poché (`addWallPoche`). #[allow(clippy::too_many_arguments)] fn wall_poche(c: &Ctx, out: &mut Vec, e: &EffWall, gaps: &[(f64, f64)], cuts: &WallCuts, greyed: bool, wall_lw: f64, category: Option<&LayerCategory>, view_only: bool, reveals: &[f64], bend: Option<&Unroll>) -> Result<(), String> { @@ -179,6 +214,7 @@ fn wall_poche(c: &Ctx, out: &mut Vec, e: &EffWall, gaps: &[(f64, f64) let layer_mm = LAYER_JOINT_MM * detail.layer_factor(); let thick: Vec = wt.layers.iter().map(|l| l.thickness).collect(); let f = crate::plan::wall_poche::wall_poche(&encode_wall_poche(w, &thick, total, ref_off, gaps, cuts, detail == Detail::Grob, view_only, reveals)); + let target = thin_layer_targets(&thick, detail, c.a.scale); if f.is_empty() { return Ok(()); } @@ -187,7 +223,7 @@ fn wall_poche(c: &Ctx, out: &mut Vec, e: &EffWall, gaps: &[(f64, f64) if let Some(s) = styles.get(&li) { return Ok(s.clone()); } - let (hatch, fill) = layer_style(p, w, wt, li, category, angle)?; + let (hatch, fill) = layer_style(p, w, wt, target.get(li).copied().unwrap_or(li), category, angle)?; styles.insert(li, (hatch.clone(), fill.clone())); Ok((hatch, fill)) }; @@ -207,7 +243,7 @@ fn wall_poche(c: &Ctx, out: &mut Vec, e: &EffWall, gaps: &[(f64, f64) // im Uhrzeigersinn: Laufrichtung 0° bzw. 180° im Gegenuhrzeigersinn; gebogen wird das // Band danach in `bend_prims`). let local = if u.arc.sigma() > 0.0 { 180.0 } else { 0.0 }; - let (mut hatch, fill) = layer_style(p, w, wt, li, category, local)?; + let (mut hatch, fill) = layer_style(p, w, wt, target.get(li).copied().unwrap_or(li), category, local)?; hatch.polar = Some([u.arc.center.x, u.arc.center.y, u.arc.r]); out.push(wall_polygon(pts, &fill, "none", 0.0, hatch, greyed, Some(no_stroke), Some(&w.id), None)); continue; @@ -226,6 +262,11 @@ fn wall_poche(c: &Ctx, out: &mut Vec, e: &EffWall, gaps: &[(f64, f64) let a = v2(f[i + 3], f[i + 4]); let b = v2(f[i + 5], f[i + 6]); i += 7; + // [140] Fuge zwischen zusammengefassten Schichten bzw. quer über eine dünne Schicht entfällt. + let merged = |k: usize| target.get(k).is_some_and(|t| *t != k); + if (art == 1.0 && target.get(li).is_some() && target.get(li) == target.get(li + 1)) || (art == 0.0 && merged(li)) { + continue; + } if art == 0.0 { out.push(mk_line(a, b, "layer-joint-l", layer_mm, None, Some(stroke), greyed, None)); } else if art == 1.0 { @@ -1143,6 +1184,26 @@ pub(crate) mod tests { super::super::domains::plan_domains(p, &super::super::domains::PlanArgs::parse(1.0, &t).unwrap()).unwrap().walls } + /// [140] Dünne Schichten (Putz 2 cm) gehen in 1:100 (mittel) in der Nachbarschicht auf: keine + /// Schichtfuge zwischen Putz und Backstein, das Putzband trägt den Stil des Backsteins. In 1:50 + /// und im Detailgrad fein bleiben alle Schichten mit Fugen. + #[test] + fn duenne_schichten_je_massstab_zusammengefasst() { + let p = pocket_project(DoorTypeKind::Schiebe, None, 1.0); + let joints = |detail: f64, scale: f64| { + let t = serde_json::json!({ "floor": "eg", "show": ["20"], "grey": [], "scale": scale }).to_string(); + let prims = super::super::domains::plan_domains(&p, &super::super::domains::PlanArgs::parse(detail, &t).unwrap()).unwrap().walls; + prims.iter().filter(|q| matches!(q, Primitive::Line { cls, .. } if cls == "layer-joint")).count() + }; + assert_eq!(joints(1.0, 100.0), 0, "1:100 mittel: Putz ohne Fuge"); + assert!(joints(1.0, 50.0) >= 4, "1:50: alle Fugen"); + assert!(joints(2.0, 100.0) >= 4, "fein: alle Fugen"); + assert_eq!(thin_layer_targets(&[0.02, 0.12, 0.02], Detail::Mittel, 100.0), vec![1, 1, 1]); + assert_eq!(thin_layer_targets(&[0.02, 0.18, 0.003, 0.16, 0.015], Detail::Mittel, 100.0), vec![1, 1, 1, 3, 3]); + assert_eq!(thin_layer_targets(&[0.01, 0.01], Detail::Mittel, 100.0), vec![0, 1], "nur dünne: unverändert"); + assert_eq!(thin_layer_targets(&[0.02, 0.12], Detail::Fein, 100.0), vec![0, 1]); + } + fn area(pts: &[Vec2]) -> f64 { let n = pts.len(); (0..n).map(|i| pts[i].x * pts[(i + 1) % n].y - pts[(i + 1) % n].x * pts[i].y).sum::().abs() / 2.0 From 26cc1b82db8afa347c97416c8b47aea2e16b66b3 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 5 Nov 2026 18:21:02 +0000 Subject: [PATCH 2/5] =?UTF-8?q?[140]=20Plan:=20Achsen=20am=20Geb=C3=A4ude?= =?UTF-8?q?=20unterbrochen,=20Ansicht=20nur=20Stummel;=20mittel=20ab=201:2?= =?UTF-8?q?00=20automatisch=20grob,=20=C3=9Cbersicht=201:500;=20Raumstempe?= =?UTF-8?q?l=20in=20Tinte;=20Schatten=20heller;=20H=C3=B6henlinien=20ausge?= =?UTF-8?q?d=C3=BCnnt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src-tauri/core/src/plan/cache.rs | 2 +- src-tauri/core/src/plan/ceiling_plan.rs | 1 + src-tauri/core/src/plan/context.rs | 56 +++++++++++++++- src-tauri/core/src/plan/domains.rs | 85 ++++++++++++++++++++++--- src-tauri/core/src/plan/drawings.rs | 33 +++++++++- src-tauri/core/src/plan/dxf.rs | 1 + src-tauri/core/src/plan/extras.rs | 3 +- src-tauri/core/src/plan/grid_view.rs | 41 +++++++----- src-tauri/core/src/sheet_viewports.rs | 4 +- 9 files changed, 192 insertions(+), 34 deletions(-) diff --git a/src-tauri/core/src/plan/cache.rs b/src-tauri/core/src/plan/cache.rs index 6d7ade5b..90796dbe 100644 --- a/src-tauri/core/src/plan/cache.rs +++ b/src-tauri/core/src/plan/cache.rs @@ -133,7 +133,7 @@ impl Clone for PlanCache { /// Schlüssel eines Argument-Satzes ohne Sichtbarkeit/Dimmen (die wirken je Element). pub fn ctx_key(a: &PlanArgs) -> String { - format!("{}\u{1}{:?}\u{1}{}\u{1}{}\u{1}{}\u{1}{}\u{1}{}\u{1}{}", a.floor, a.detail, a.reference_lines, a.global, a.scale.to_bits(), a.for_print, a.compact, a.mono) + format!("{}\u{1}{:?}\u{1}{}\u{1}{}\u{1}{}\u{1}{}\u{1}{}\u{1}{}\u{1}{}", a.floor, a.detail, a.reference_lines, a.global, a.scale.to_bits(), a.for_print, a.compact, a.mono, a.auto_coarse) } /// Sichtbarkeit und Dimmen als vergleichbarer Text (Mengen sortiert). diff --git a/src-tauri/core/src/plan/ceiling_plan.rs b/src-tauri/core/src/plan/ceiling_plan.rs index 1b54eb50..d5e1f9fc 100644 --- a/src-tauri/core/src/plan/ceiling_plan.rs +++ b/src-tauri/core/src/plan/ceiling_plan.rs @@ -50,6 +50,7 @@ fn floor_args(a: &PlanArgs, floor: &str) -> PlanArgs { compact: a.compact, mono: a.mono, sun_when: None, + auto_coarse: a.auto_coarse, } } diff --git a/src-tauri/core/src/plan/context.rs b/src-tauri/core/src/plan/context.rs index 0464696b..a713c173 100644 --- a/src-tauri/core/src/plan/context.rs +++ b/src-tauri/core/src/plan/context.rs @@ -128,9 +128,11 @@ pub fn plan_context(c: &Ctx, out: &mut Vec) { } const TERRAIN_INK: &str = "#7a5b3a"; +/// [140] Kleinster Papierabstand (mm) zwischen Höhenlinien; enger werden Zwischenlinien ausgelassen. +const CONTOUR_MIN_GAP_MM: f64 = 0.6; /// [140] Aussenringe der Gebäudegrundfläche (Wände und Körper aller Geschosse vereinigt, ohne Innenhöfe/Räume). -fn building_rings(p: &Project) -> Vec> { +pub(super) fn building_rings(p: &Project) -> Vec> { crate::site_rules::building_footprint(p).into_iter().filter_map(|poly| poly.into_iter().next()).filter(|r| r.len() >= 3).collect() } @@ -147,7 +149,7 @@ fn inside(q: Vec2, ring: &[Vec2]) -> bool { } /// Teile der Strecke a–b ausserhalb aller `rings`. -fn outside(a: Vec2, b: Vec2, rings: &[Vec]) -> Vec<(Vec2, Vec2)> { +pub(super) fn outside(a: Vec2, b: Vec2, rings: &[Vec]) -> Vec<(Vec2, Vec2)> { let (dx, dy) = (b.x - a.x, b.y - a.y); let (lo_x, hi_x, lo_y, hi_y) = (a.x.min(b.x), a.x.max(b.x), a.y.min(b.y), a.y.max(b.y)); let mut ts = vec![0.0, 1.0]; @@ -193,7 +195,22 @@ fn terrain_contours(c: &Ctx, t: &TerrainMesh, out: &mut Vec, house: & let every = t.contour_index_every.filter(|v| v.is_finite() && *v >= 1.0).map_or(5, |v| v.round() as i64); let st = crate::excavation::site_terrain(c.p, t); let text_h = 0.002 * c.a.scale.max(1.0); - for l in crate::terrain::isolines(st.current(), iv, 0.0) { + let tin = st.current(); + let idx = crate::terrain::TinIndex::new(tin); + // [140] Papierabstand (mm) benachbarter Höhenlinien am Punkt: Äquidistanz / Gefälle des Dreiecks. + let spacing_mm = |x: f64, y: f64| -> f64 { + let Some(([a, b, cc], _)) = idx.bary_at(x, y) else { return f64::INFINITY }; + let (pa, pb, pc) = (tin.xy[a], tin.xy[b], tin.xy[cc]); + let (ux, uy, uz) = (pb[0] - pa[0], pb[1] - pa[1], tin.z[b] - tin.z[a]); + let (vx, vy, vz) = (pc[0] - pa[0], pc[1] - pa[1], tin.z[cc] - tin.z[a]); + let d = ux * vy - vx * uy; + if d.abs() < 1e-12 { + return f64::INFINITY; + } + let g = ((uz * vy - vz * uy) / d).hypot((ux * vz - vx * uz) / d); + if g > 1e-12 { iv / g * 1000.0 / c.a.scale.max(1.0) } else { f64::INFINITY } + }; + for l in crate::terrain::isolines(tin, iv, 0.0) { let k = (l.level / iv).round() as i64; let index = k.rem_euclid(every) == 0; // [140] Zähllinie mittel (0.18), Höhenlinie fein (0.1): Gelände bleibt unter dem Gebäude zurück. @@ -210,6 +227,14 @@ fn terrain_contours(c: &Ctx, t: &TerrainMesh, out: &mut Vec, house: & for i in 0..segs { let (a, b) = (l.pts[i], l.pts[(i + 1) % n]); let d = seg_len(i); + // [140] Zu eng (< 0.6 mm auf dem Papier): nur jede zweite, bei < 0.3 mm nur die Zähllinien. + if !index { + let s = spacing_mm((a[0] + b[0]) / 2.0, (a[1] + b[1]) / 2.0); + if s < CONTOUR_MIN_GAP_MM && (k.rem_euclid(2) != 0 || 2.0 * s < CONTOUR_MIN_GAP_MM) { + acc += d; + continue; + } + } // Anteile (Bruchteile 0..1) des Segments ausserhalb der Lücke. let mut spans = vec![(0.0, 1.0)]; if let (Some((g0, g1)), true) = (gap, d > 0.0) { @@ -444,6 +469,31 @@ mod tests { assert!(lines.iter().all(|(a, b)| !((a.x - 15.0).abs() < 1e-6 && (a.y + b.y) / 2.0 > 0.0 && (a.y + b.y) / 2.0 < 10.0)), "Höhenlinie im Haus"); } + /// [140] Steile Stellen (Stützmauer, Böschung): Höhenlinien enger als 0.6 mm auf dem Papier werden + /// ausgedünnt (jede zweite, sonst nur Zähllinien); im flachen Teil bleiben alle. + #[test] + fn hoehenlinien_ausgeduennt_wo_zu_eng() { + // x 0..10 flach (z = 0.1 x), x 10..11 steil (z 1 → 11). + let t = TerrainMesh { + id: "t".into(), + positions: vec![0.0, 0.0, 0.0, 10.0, 0.0, 1.0, 10.0, 10.0, 1.0, 0.0, 10.0, 0.0, 11.0, 0.0, 11.0, 11.0, 10.0, 11.0], + indices: vec![0.0, 1.0, 2.0, 0.0, 2.0, 3.0, 1.0, 4.0, 5.0, 1.0, 5.0, 2.0], + contour_interval: Some(0.1), + ..Default::default() + }; + let p = Project { context: Some(vec![ContextObject::TerrainMesh(t)]), ..Default::default() }; + let a = super::super::domains::PlanArgs::parse(1.0, r#"{"scale": 100}"#).unwrap(); + let mut out = Vec::new(); + plan_context(&Ctx::new(&p, &a), &mut out); + let xs: Vec = out.iter().filter_map(|q| match q { Primitive::Line { a, b, color: Some(c), .. } if c == TERRAIN_INK && (a.x - b.x).abs() < 1e-9 => Some(a.x), _ => None }).collect(); + let flat = xs.iter().filter(|x| **x > 0.5 && **x < 9.5).count(); + let steep: Vec = xs.iter().copied().filter(|x| *x > 10.05 && *x < 10.95).collect(); + assert_eq!(flat, 18, "flach: alle neun Linien (je zwei Dreiecke)"); + // Steil: Abstand 1 mm = 0.01 mm Papier → nur Zähllinien (jede 5.: z = 1.5, 2 … 10.5). + assert!(!steep.is_empty() && steep.len() <= 3 * 19, "{steep:?}"); + assert!(steep.iter().all(|x| { let z = 1.0 + (x - 10.0) * 10.0; ((z * 2.0).round() - z * 2.0).abs() < 1e-6 }), "nur Zähllinien: {steep:?}"); + } + /// [T6]/[68] Höhenlinien (Zähllinien dicker + beschriftet) und Baugrube (Sohle, Oberkante, Schraffur). #[test] fn hoehenlinien_und_baugrube() { diff --git a/src-tauri/core/src/plan/domains.rs b/src-tauri/core/src/plan/domains.rs index a17e2355..fb8020b9 100644 --- a/src-tauri/core/src/plan/domains.rs +++ b/src-tauri/core/src/plan/domains.rs @@ -50,6 +50,23 @@ pub struct PlanArgs { pub mono: bool, /// Zeitpunkt der Schattenstudie (Unix-ms; fehlt/ungültig = kein Schatten). pub sun_when: Option, + /// [140] Detailgrad „mittel" ab 1:200 automatisch als „grob" gezeichnet (Raumstempel bleiben, nur + /// knapper; ab 1:500 ohne Masslinien). + pub auto_coarse: bool, +} + +/// [140] Ab diesem Massstab (1:N) zeichnet der Detailgrad „mittel" wie „grob". +pub const AUTO_COARSE_FROM: f64 = 200.0; +/// [140] Ab diesem Massstab (1:N) im automatisch groben Plan: Raumstempel nur mit Namen, keine Masslinien. +pub const OVERVIEW_FROM: f64 = 500.0; + +/// [140] Wirksamer Detailgrad: „mittel" ab 1:200 wie „grob" (zweiter Wert: automatisch vergröbert). +pub fn effective_detail(requested: Detail, scale: f64) -> (Detail, bool) { + if requested == Detail::Mittel && scale >= AUTO_COARSE_FROM { + (Detail::Grob, true) + } else { + (requested, false) + } } impl PlanArgs { @@ -59,22 +76,26 @@ impl PlanArgs { pub fn parse(detail: f64, text: &str) -> Result { let v: serde_json::Value = serde_json::from_str(text).map_err(|e| format!("Plan-Argumente: {e}"))?; let set = |k: &str| -> HashSet { v.get(k).and_then(|a| a.as_array()).map(|a| a.iter().filter_map(|s| s.as_str().map(String::from)).collect()).unwrap_or_default() }; + let scale = v.get("scale").and_then(|b| b.as_f64()).unwrap_or(super::drawings::DEFAULT_SCALE_DENOMINATOR); + let requested = match detail as i64 { + 0 => Detail::Grob, + 2 => Detail::Fein, + _ => Detail::Mittel, + }; + let (detail, auto_coarse) = effective_detail(requested, scale); Ok(PlanArgs { floor: v.get("floor").and_then(|f| f.as_str()).unwrap_or_default().to_string(), - detail: match detail as i64 { - 0 => Detail::Grob, - 2 => Detail::Fein, - _ => Detail::Mittel, - }, + detail, show: set("show"), grey: set("grey"), reference_lines: v.get("referenceLines").and_then(|b| b.as_bool()).unwrap_or(false), global: v.get("global").and_then(|b| b.as_bool()).unwrap_or(false), - scale: v.get("scale").and_then(|b| b.as_f64()).unwrap_or(super::drawings::DEFAULT_SCALE_DENOMINATOR), + scale, for_print: v.get("forPrint").and_then(|b| b.as_bool()).unwrap_or(false), compact: v.get("compact").and_then(|b| b.as_bool()).unwrap_or(false), mono: v.get("mono").and_then(|b| b.as_bool()).unwrap_or(false), sun_when: v.get("sunWhen").and_then(|b| b.as_f64()), + auto_coarse, }) } } @@ -604,12 +625,20 @@ fn rooms(c: &Ctx, out: &mut Vec, bounds: &mut Bounds) { let pts: Vec<[f64; 2]> = room.boundary.iter().map(|v| [v.x, v.y]).collect(); let res = crate::room_area::evaluate(&pts, 0.0); out.push(polygon(room.boundary.clone(), &with_alpha(color, ROOM_FILL_ALPHA), color, LAYER_LINE_MM * c.a.detail.layer_factor(), no_hatch(), greyed, None, Pick::Room(&room.id))); - if c.a.detail == Detail::Grob { + if c.a.detail == Detail::Grob && !c.a.auto_coarse { continue; } let at = room.stamp_anchor.unwrap_or(pv(res.centroid)); let small = c.a.scale >= ROOM_STAMP_SMALL_FROM; + // [140] Übersicht (ab 1:500, automatisch grob): nur der Name. + let overview = c.a.auto_coarse && c.a.scale >= OVERVIEW_FROM; + // [140] Raumstempel in Tinte (Druck ohne Schwarz-Weiss); Farbe nur aus einer Darstellungsregel + // oder aus den Auszeichnungen des Stempel-Texts. + let text_color = ov.color.as_deref().unwrap_or(MONO_INK); let (doc, extra_lines) = match &room.stamp { + _ if overview => (doc_from_text(room.stamp.as_ref().map_or(&room.name, |s| &s.name)), vec![]), + // [140] ab 1:200 auch eigene Stempel ohne Nutzungs-/Personenzeile. + Some(s) if small => (room_stamp_to_doc(s), room_stamp_extra_lines(&RoomStamp { show_usage: false, occupancy: None, ..s.clone() }, res.net, room.sia_category)), Some(s) => (room_stamp_to_doc(s), room_stamp_extra_lines(s, res.net, room.sia_category)), None => { let mut lines = vec![StampLine { text: format!("{} m²", to_fixed(res.net, 2)), align: Align::Center }]; @@ -619,7 +648,7 @@ fn rooms(c: &Ctx, out: &mut Vec, bounds: &mut Bounds) { (room.stamp_doc.clone().unwrap_or_else(|| doc_from_text(&room.name)), lines) } }; - out.push(Primitive::Text { at, doc, extra_lines, base_pt: if small { ROOM_STAMP_SMALL_PT } else { ROOM_STAMP_PT }, color: color.into(), room_id: Some(room.id.clone()), greyed, opacity: None }); + out.push(Primitive::Text { at, doc, extra_lines, base_pt: if small { ROOM_STAMP_SMALL_PT } else { ROOM_STAMP_PT }, color: text_color.into(), room_id: Some(room.id.clone()), greyed, opacity: None }); } } @@ -954,7 +983,15 @@ fn assemble_cached(c: &Ctx, revs: &crate::document::Revs, cc: &mut super::cache: } h ^ cc.drawings.sig.wrapping_mul(0xff51_afd7_ed55_8ccd) }; - let chunks = super::drawings::plan_drawings_chunked(c, revs.item_stamps("drawings2d").unwrap_or(&[]), &mut cc.drawings, salt, have, &mut bounds)?; + // [140] Achsraster enden an der Gebäudegrundfläche: ihr Stand folgt auch Wänden, Körpern und Dächern. + let stamps = revs.item_stamps("drawings2d").unwrap_or(&[]); + let house_rev = ["walls", "extrudedSolids", "roofs"].iter().fold(0u64, |h, k| (h ^ revs.field(k)).wrapping_mul(0x0000_0100_0000_01b3)); + let stamps: std::borrow::Cow<[u64]> = if house_rev != 0 && c.p.drawings2d.iter().any(|d| matches!(d.geom, crate::model::Drawing2DGeom::Grid { .. })) { + c.p.drawings2d.iter().zip(stamps).map(|(d, &st)| if matches!(d.geom, crate::model::Drawing2DGeom::Grid { .. }) { st ^ house_rev.rotate_left(17) } else { st }).collect::>().into() + } else { + stamps.into() + }; + let chunks = super::drawings::plan_drawings_chunked(c, &stamps, &mut cc.drawings, salt, have, &mut bounds)?; for k in 7..11 { put(w, k, &mut segs); } @@ -1000,6 +1037,36 @@ mod tests { }; assert_eq!(stamp(100.0), (ROOM_STAMP_PT, 2)); assert_eq!(stamp(200.0), (ROOM_STAMP_SMALL_PT, 1)); + // [140] 1:500 (mittel → automatisch grob): nur der Name; Stempel in Tinte. + assert_eq!(stamp(500.0), (ROOM_STAMP_SMALL_PT, 0)); + let t = serde_json::json!({ "floor": "eg", "show": ["20", "60"], "grey": [], "scale": 100 }).to_string(); + let r = plan_domains(&p, &PlanArgs::parse(1.0, &t).unwrap()).unwrap(); + assert!(r.rooms.iter().all(|q| !matches!(q, Primitive::Text { color, .. } if color != MONO_INK)), "Stempel in Tinte"); + // Eigener Stempel ab 1:200 ohne Nutzungszeile. + let mut q = p.clone(); + for r in q.rooms.as_mut().unwrap() { + r.stamp = Some(RoomStamp { name: r.name.clone(), show_floor_area: true, show_usage: true, occupancy: Some(3.0), ..Default::default() }); + } + let lines = |scale: f64| { + let t = serde_json::json!({ "floor": "eg", "show": ["20", "60"], "grey": [], "scale": scale }).to_string(); + plan_domains(&q, &PlanArgs::parse(1.0, &t).unwrap()).unwrap().rooms.iter().find_map(|q| match q { Primitive::Text { extra_lines, .. } => Some(extra_lines.len()), _ => None }).unwrap() + }; + assert_eq!((lines(100.0), lines(200.0), lines(500.0)), (3, 1, 0)); + } + + /// [140] „mittel" ab 1:200 wie „grob" (Wände als Sammelfläche), „fein" bleibt; explizit „grob" ohne Stempel. + #[test] + fn mittel_ab_1_200_automatisch_grob() { + assert_eq!(effective_detail(Detail::Mittel, 100.0), (Detail::Mittel, false)); + assert_eq!(effective_detail(Detail::Mittel, 200.0), (Detail::Grob, true)); + assert_eq!(effective_detail(Detail::Fein, 500.0), (Detail::Fein, false)); + assert_eq!(effective_detail(Detail::Grob, 500.0), (Detail::Grob, false)); + let p = sample(); + let rooms = |detail: f64| { + let t = serde_json::json!({ "floor": "eg", "show": ["20", "60"], "grey": [], "scale": 200 }).to_string(); + plan_domains(&p, &PlanArgs::parse(detail, &t).unwrap()).unwrap().rooms.iter().filter(|q| matches!(q, Primitive::Text { .. })).count() + }; + assert!(rooms(1.0) > 0 && rooms(0.0) == 0); } #[test] diff --git a/src-tauri/core/src/plan/drawings.rs b/src-tauri/core/src/plan/drawings.rs index b092588e..94d30fb2 100644 --- a/src-tauri/core/src/plan/drawings.rs +++ b/src-tauri/core/src/plan/drawings.rs @@ -776,6 +776,8 @@ fn emit_inner(c: &Ctx, d: &Drawing2D, attrs: Attrs, geom: &Drawing2DGeom, greyed em.seg(q[q.len() - 1], q[0]); } } + // [140] Übersichtsplan (ab 1:500, Detail „mittel" automatisch grob): keine Masslinien. + Drawing2DGeom::Dimension { .. } if c.a.auto_coarse && c.a.scale >= super::domains::OVERVIEW_FROM => {} Drawing2DGeom::Dimension { pts, offset, gap_mm, overshoot_mm, tick_len_mm, text_height_mm, line_weight_mm, ext_weight_mm, tick_weight_mm, text_offsets_mm, refs, kind, arc_center } => { let mm = |x: f64| mm_to_model(x, scale); if let Some(k) = kind { @@ -873,7 +875,9 @@ fn emit_inner(c: &Ctx, d: &Drawing2D, attrs: Attrs, geom: &Drawing2DGeom, greyed } Drawing2DGeom::Grid { bubble_mm, .. } => { if let Some(spec) = crate::grid::Spec::of(geom) { - emit_grid(&mut em, &spec, crate::grid::bubble_diameter(*bubble_mm, scale), scale); + // [140] Achsen enden an der Gebäudegrundfläche (alle Geschosse vereinigt). + let house = super::context::building_rings(p); + emit_grid(&mut em, &spec, crate::grid::bubble_diameter(*bubble_mm, scale), scale, &house); } } Drawing2DGeom::Text { at, text: s, height, angle, width, marks, doc, leader_target, leader_bend_points, path_pts, paper_height } => { @@ -1003,7 +1007,7 @@ fn dimension_segment(em: &mut Em, a: Vec2, b: Vec2, offset: f64, st: &DimStyle) } /// Achsraster ([112]): Achsen strichpunktiert, an den Enden Blasen mit der Beschriftung. -fn emit_grid(em: &mut Em, spec: &crate::grid::Spec, diameter: f64, scale: f64) { +fn emit_grid(em: &mut Em, spec: &crate::grid::Spec, diameter: f64, scale: f64, house: &[Vec]) { use crate::grid::Shape; let mm = |x: f64| mm_to_model(x, scale); let dash = [mm(12.0), mm(2.5), mm(1.5), mm(2.5)]; @@ -1013,7 +1017,11 @@ fn emit_grid(em: &mut Em, spec: &crate::grid::Spec, diameter: f64, scale: f64) { let text_h = diameter * 0.5; for ax in spec.axes() { match ax.shape { - Shape::Line { a, b } => em.line(v(a.0, a.1), v(b.0, b.1), w, Some(&dash), dash_ref), + Shape::Line { a, b } => { + for (p0, p1) in super::context::outside(v(a.0, a.1), v(b.0, b.1), house) { + em.line(p0, p1, w, Some(&dash), dash_ref); + } + } Shape::Arc { c, r: rad, a0, a1 } => { let dash_v = Some(dash.to_vec()); if a1 - a0 >= std::f64::consts::TAU - 1e-9 { @@ -1782,6 +1790,25 @@ mod tests { assert!(prims.iter().any(|q| matches!(q, Primitive::DrawingArc { r, .. } if (*r - 4.0).abs() < 1e-9))); } + /// [140] Achsen im Grundriss enden am Gebäude: innerhalb der Gebäudegrundfläche keine Achslinie, + /// ausserhalb (bis zu den Blasen) strichpunktiert. + #[test] + fn achsraster_unterbrochen_im_gebaeude() { + let p = project(serde_json::json!({"extrudedSolids": [{"id": "s", "type": "extrudedSolid", "levelId": "eg", "height": 3, + "points": [{"x": -1, "y": 1}, {"x": 6, "y": 1}, {"x": 6, "y": 3}, {"x": -1, "y": 3}]}]})); + let grid = drawing(serde_json::json!({"shape": "grid", "origin": {"x": 0, "y": 0}, "angle": 0, + "a": [{"label": "1", "pos": 0}, {"label": "2", "pos": 5}], "b": [{"label": "A", "pos": 0}, {"label": "B", "pos": 4}], "extend": 1})); + let prims = render(&p, grid, 100.0); + let segs: Vec<(Vec2, Vec2)> = prims.iter().filter_map(|q| match q { Primitive::Line { a, b, dash: Some(Some(_)), .. } => Some((*a, *b)), _ => None }).collect(); + // Achsen 1, 2 (senkrecht) je zwei Stücke, A, B (waagrecht, ausserhalb) je eins. + assert_eq!(segs.len(), 6, "{segs:?}"); + for (a, b) in &segs { + let m = v((a.x + b.x) / 2.0, (a.y + b.y) / 2.0); + assert!(!(m.x > -1.0 && m.x < 6.0 && m.y > 1.0 && m.y < 3.0), "Achse im Gebäude: {a:?} {b:?}"); + } + assert_eq!(prims.iter().filter(|q| matches!(q, Primitive::DrawingCircle { .. })).count(), 8, "Blasen bleiben"); + } + /// [112] Raster erscheint in jedem Geschoss, bei `levels` nur in den genannten. #[test] fn achsraster_je_geschoss() { diff --git a/src-tauri/core/src/plan/dxf.rs b/src-tauri/core/src/plan/dxf.rs index 4216fd92..9af80e89 100644 --- a/src-tauri/core/src/plan/dxf.rs +++ b/src-tauri/core/src/plan/dxf.rs @@ -1372,6 +1372,7 @@ fn sheets(cx: &mut Ctx, main: &mut Buf, layer_by_code: &HashMap<&str, String>) { compact: false, mono: false, sun_when: None, + auto_coarse: false, }; if let Some(entries) = plan_domains_buf(p, &args).ok().and_then(|buf| { let view = View::parse(&buf)?; diff --git a/src-tauri/core/src/plan/extras.rs b/src-tauri/core/src/plan/extras.rs index 558d4fb3..ed6b3722 100644 --- a/src-tauri/core/src/plan/extras.rs +++ b/src-tauri/core/src/plan/extras.rs @@ -20,7 +20,8 @@ pub const SITE_PICK_VIEW_SHADOWS: &str = "@viewShadows"; /// Füllfarbe der Schattenflächen. pub const SUN_SHADOW_FILL: &str = "#3a4a66"; -const SUN_SHADOW_OPACITY: f64 = 0.28; +/// [140] Schatten heller (0.28 → 0.16): Bemassung und Stempel darüber bleiben lesbar. +const SUN_SHADOW_OPACITY: f64 = 0.16; /// Linien-Klassen und Füllfarbe des Baurechts. pub const SITE_PARCEL_CLS: &str = "site-parcel"; pub const SITE_ALLOWED_CLS: &str = "site-allowed"; diff --git a/src-tauri/core/src/plan/grid_view.rs b/src-tauri/core/src/plan/grid_view.rs index c50aa751..1c11ffa4 100644 --- a/src-tauri/core/src/plan/grid_view.rs +++ b/src-tauri/core/src/plan/grid_view.rs @@ -90,21 +90,25 @@ fn one(spec: &Spec, plane: &Plane, level: &LevelSpec, bounds: [f64; 4], scale: f if x < lo - 1e-9 || x > hi + 1e-9 { continue; } - out.push(Primitive::Line { - a: v2(x, y0), - b: v2(x, y1), - cls: "draw2d".into(), - weight_mm: AXIS_MM, - dash: Some(Some(dash.clone())), - zigzag: None, - motif: None, - color: Some(INK.into()), - drawing_id: None, - opening_id: None, - stair_id: None, - greyed: None, - opacity: None, - }); + // [140] Ansicht: die Achse läuft nicht über die Fassade, nur Stummel unter und über dem Bild. + let spans: &[(f64, f64)] = if level.kind == "elevation" { &[(y0, bounds[1]), (bounds[3], y1)] } else { &[(y0, y1)] }; + for &(ya, yb) in spans { + out.push(Primitive::Line { + a: v2(x, ya), + b: v2(x, yb), + cls: "draw2d".into(), + weight_mm: AXIS_MM, + dash: Some(Some(dash.clone())), + zigzag: None, + motif: None, + color: Some(INK.into()), + drawing_id: None, + opening_id: None, + stair_id: None, + greyed: None, + opacity: None, + }); + } let (y, dir) = if bubbles == GridBubbles::Start { (y0, -1.0) } else { (y1, 1.0) }; let c = v2(x, y + dir * r); out.push(Primitive::DrawingCircle { center: c, r, fill: "none".into(), stroke: INK.into(), weight_mm: 0.25, dash: None, drawing_id: None, greyed: None, opacity: None }); @@ -164,6 +168,11 @@ mod tests { assert!(union_bounds([0.0, 0.0, 9.0, 6.0], &prims)[3] > 6.0); // Ansicht von Süden (y = -3): Achsen 1, 2 stehen senkrecht zur Ebene und erscheinen an ihrer Lage. let level = LevelSpec { kind: "elevation".into(), line: Some([v2(-1.0, -3.0), v2(8.0, -3.0)]), ..Default::default() }; - assert_eq!(texts(&grid_prims(&p, &level, [0.0, 0.0, 9.0, 6.0], 100.0)), ["1", "2"]); + let prims = grid_prims(&p, &level, [0.0, 0.0, 9.0, 6.0], 100.0); + assert_eq!(texts(&prims), ["1", "2"]); + // [140] In der Ansicht laufen die Achsen nicht über die Fassade: nur Stummel unter und über dem Bild. + let lines: Vec<(f64, f64)> = prims.iter().filter_map(|q| if let Primitive::Line { a, b, .. } = q { Some((a.y.min(b.y), a.y.max(b.y))) } else { None }).collect(); + assert_eq!(lines.len(), 4, "{lines:?}"); + assert!(lines.iter().all(|(lo, hi)| *hi <= 0.0 + 1e-9 || *lo >= 6.0 - 1e-9), "{lines:?}"); } } diff --git a/src-tauri/core/src/sheet_viewports.rs b/src-tauri/core/src/sheet_viewports.rs index e6438e84..494fcd26 100644 --- a/src-tauri/core/src/sheet_viewports.rs +++ b/src-tauri/core/src/sheet_viewports.rs @@ -64,9 +64,10 @@ fn detail_of(d: DetailLevel) -> Detail { /// Plan-Argumente eines Viewports (wie `ViewportPlanSvg`: projektglobal, nicht für den Druck). pub fn viewport_args(snap: &ViewSnapshot, scale: f64) -> PlanArgs { + let (detail, auto_coarse) = crate::plan::domains::effective_detail(detail_of(snap.detail), scale); PlanArgs { floor: snap.active_level_id.clone(), - detail: detail_of(snap.detail), + detail, show: snap.layer_visibility.iter().filter(|(_, v)| **v).map(|(k, _)| k.clone()).collect::>(), grey: HashSet::new(), reference_lines: false, @@ -76,6 +77,7 @@ pub fn viewport_args(snap: &ViewSnapshot, scale: f64) -> PlanArgs { compact: false, mono: false, sun_when: None, + auto_coarse, } } From 2738566a2513c452c402c1819569a8c6c4fa8025 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 5 Nov 2026 18:23:04 +0000 Subject: [PATCH 3/5] =?UTF-8?q?[140]=20Strichst=C3=A4rken:=20gr=C3=B6sste?= =?UTF-8?q?=20Standard-St=C3=A4rke=200.25=20bei=201:100=20(W=C3=A4nde/St?= =?UTF-8?q?=C3=BCtzen/Tr=C3=A4ger,=20Schnitt-Umriss,=20Terrain,=20Schnittl?= =?UTF-8?q?inie),=20Decken/D=C3=A4cher/Silhouette=200.18,=20Details=200.13?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src-tauri/core/src/import_context.rs | 2 +- src-tauri/core/src/plan/context.rs | 2 +- src-tauri/core/src/plan/elevation.rs | 9 +++++---- src-tauri/core/src/plan/extras.rs | 3 +++ src-tauri/core/src/plan/section.rs | 7 ++++--- src-tauri/core/src/plan/sketch.rs | 5 +++-- src/model/contextCategories.ts | 2 +- src/model/sampleProject.ts | 19 ++++++++++--------- 8 files changed, 28 insertions(+), 21 deletions(-) diff --git a/src-tauri/core/src/import_context.rs b/src-tauri/core/src/import_context.rs index 7f96e9b3..33ad5c87 100644 --- a/src-tauri/core/src/import_context.rs +++ b/src-tauri/core/src/import_context.rs @@ -27,7 +27,7 @@ struct Def { /// „05 Kontext" — Elternkategorie der Kontext-Kategorien. const CONTEXT_PARENT: Def = Def { code: "05", name: "Kontext", color: "#707078", lw: 0.13 }; /// „31 Dächer" bleibt oberste Ebene. -const IMPORTED_ROOF: Def = Def { code: "31", name: "Dächer", color: "#7a4a3a", lw: 0.35 }; +const IMPORTED_ROOF: Def = Def { code: "31", name: "Dächer", color: "#7a4a3a", lw: 0.18 }; /// Kinder von „05 Kontext", in dieser Reihenfolge (`NESTED_CONTEXT_CATEGORIES`). const NESTED: [Def; 10] = [ Def { code: "02", name: "Gelände", color: "#8a9478", lw: 0.13 }, diff --git a/src-tauri/core/src/plan/context.rs b/src-tauri/core/src/plan/context.rs index a713c173..9b96c49f 100644 --- a/src-tauri/core/src/plan/context.rs +++ b/src-tauri/core/src/plan/context.rs @@ -15,7 +15,7 @@ const CONTEXT_LINE_MM: f64 = 0.1; const SECTION_LINE_CATEGORY: &str = "90"; const SECTION_LINE_INK: &str = "#1f242c"; const SECTION_LINE_MM: f64 = 0.18; -const SECTION_LINE_MARK_MM: f64 = 0.5; +const SECTION_LINE_MARK_MM: f64 = 0.25; const SECTION_LINE_DASH: [f64; 4] = [6.0, 1.5, 0.4, 1.5]; const SECTION_LABEL_H: f64 = 0.5; diff --git a/src-tauri/core/src/plan/elevation.rs b/src-tauri/core/src/plan/elevation.rs index a39e597b..b25efe27 100644 --- a/src-tauri/core/src/plan/elevation.rs +++ b/src-tauri/core/src/plan/elevation.rs @@ -15,17 +15,18 @@ use std::collections::HashMap; const EDGE_INK: &str = "#2b3039"; const EDGE_MM: f64 = 0.13; -/// [140] Silhouette (Umriss aller Bauteile zusammen) mittelstark: hebt den Baukörper von Details ab. -const SILHOUETTE_MM: f64 = 0.35; +/// [140] Silhouette (Umriss aller Bauteile zusammen) mittelstark: hebt den Baukörper von Details (0.13) ab; +/// Terrainlinie 0.25 (grösste Standard-Stärke bei 1:100). +const SILHOUETTE_MM: f64 = 0.18; /// [140] Abstand (m), bis zu dem eine Kante als Teil der Silhouette gilt. const SILHOUETTE_TOL: f64 = 2e-3; -const FRAME_MM: f64 = 0.18; +const FRAME_MM: f64 = 0.13; const GLASS_FILL_MONO: &str = "#c4c8cd"; const GLASS_FILL_COLOR: &str = "#9fc2d9"; const SHADOW_FILL: &str = "#8f959e"; const OPENING_SHADOW_FILL: &str = "#a7adb5"; const GROUND_INK: &str = "#1f242c"; -const GROUND_MM: f64 = 0.5; +const GROUND_MM: f64 = 0.25; const FRAME_FILL_COLOR: &str = "#d9d9d4"; const SILL_FILL_COLOR: &str = "#cccccb"; const DOOR_LEAF_FILL_COLOR: &str = "#ede6d9"; diff --git a/src-tauri/core/src/plan/extras.rs b/src-tauri/core/src/plan/extras.rs index ed6b3722..7d170861 100644 --- a/src-tauri/core/src/plan/extras.rs +++ b/src-tauri/core/src/plan/extras.rs @@ -711,6 +711,9 @@ mod tests { assert!((at(0.5, 50.0) - 0.67).abs() < 0.01); assert!((at(0.5, 200.0) - 0.38).abs() < 0.01); assert_eq!(at(0.5, 100.0), 0.5); + // [140] Grösste Standard-Stärke 0.25 bei 1:100 (Wand-Schnittkante): 1:50 kräftiger, 1:200 feiner. + assert_eq!(at(0.25, 100.0), 0.25); + assert!(at(0.25, 50.0) > 0.3 && at(0.25, 200.0) < 0.21 && at(0.25, 200.0) > at(0.13, 200.0)); assert!((at(0.13, 50.0) - 0.13).abs() < 0.02 && (at(0.13, 200.0) - 0.13).abs() < 0.02); for s in [20.0, 50.0, 100.0, 200.0, 500.0, 1000.0] { let class = [0.7, 0.5, 0.35, 0.25, 0.18, 0.13, 0.1].map(|w| at(w, s)); diff --git a/src-tauri/core/src/plan/section.rs b/src-tauri/core/src/plan/section.rs index f060bb1b..f7f75129 100644 --- a/src-tauri/core/src/plan/section.rs +++ b/src-tauri/core/src/plan/section.rs @@ -20,12 +20,13 @@ use std::collections::{HashMap, HashSet}; const SECTION_INK: &str = "#1f242c"; const SECTION_VISIBLE_INK: &str = "#2b3039"; const SECTION_HIDDEN_INK: &str = "#8a929c"; -/// [140] Umriss der geschnittenen Masse (Vereinigung aller Schnittflächen): schwer wie die Wand im Grundriss. -const SECTION_CUT_OUTLINE_MM: f64 = 0.5; +/// [140] Umriss der geschnittenen Masse (Vereinigung aller Schnittflächen): schwer wie die Wand im Grundriss +/// (grösste Standard-Stärke 0.25 bei 1:100, Entscheid Maintainer). +const SECTION_CUT_OUTLINE_MM: f64 = 0.25; /// [140] Fugen zwischen Schichten/Bauteilen innerhalb der geschnittenen Masse: fein. const SECTION_JOINT_MM: f64 = 0.13; const SECTION_VISIBLE_MM: f64 = 0.18; -const SECTION_GROUND_MM: f64 = 0.5; +const SECTION_GROUND_MM: f64 = 0.25; const SECTION_HIDDEN_MM: f64 = 0.13; const SECTION_HIDDEN_DASH: [f64; 2] = [0.12, 0.08]; /// [T6] gewachsenes Terrain im Schnitt: gestrichelt, dünner als das gestaltete. diff --git a/src-tauri/core/src/plan/sketch.rs b/src-tauri/core/src/plan/sketch.rs index 4e714e43..e9c221c3 100644 --- a/src-tauri/core/src/plan/sketch.rs +++ b/src-tauri/core/src/plan/sketch.rs @@ -32,7 +32,7 @@ const END_MM: f64 = 0.08; /// Ab diesem Knick (Grad) beginnt am Umriss ein neuer Strich (mit Überzug an der Ecke). const CORNER_DEG: f64 = 28.0; /// Zweiter Zug: ab dieser Strichstärke (Papier-mm) und Länge, mit diesem Stärke-Anteil. -pub const DOUBLE_MIN_WEIGHT_MM: f64 = 0.35; +pub const DOUBLE_MIN_WEIGHT_MM: f64 = 0.25; const DOUBLE_MIN_MM: f64 = 5.0; pub const DOUBLE_WEIGHT: f64 = 0.55; @@ -385,7 +385,8 @@ mod tests { #[test] fn writer_linie_verkettet_mit_ueberzug() { use crate::plan::buf::{LineRef, Writer}; - let l = LineRef { a: v(0.0, 0.0), b: v(4.0, 0.0), cls: "x", weight_mm: 0.25, dash: None, zigzag: None, motif: None, color: None, drawing_id: None, opening_id: None, stair_id: None, greyed: None, opacity: None }; + // Unter `DOUBLE_MIN_WEIGHT_MM` (ein Zug). + let l = LineRef { a: v(0.0, 0.0), b: v(4.0, 0.0), cls: "x", weight_mm: 0.18, dash: None, zigzag: None, motif: None, color: None, drawing_id: None, opening_id: None, stair_id: None, greyed: None, opacity: None }; let mut plain = Writer::new(false); plain.line_ref(&l, 0); let mut w = Writer::new(false); diff --git a/src/model/contextCategories.ts b/src/model/contextCategories.ts index 4f749c2d..d0b536a6 100644 --- a/src/model/contextCategories.ts +++ b/src/model/contextCategories.ts @@ -85,7 +85,7 @@ export const IMPORTED_ROOF_CATEGORY: ContextCategoryDef = { code: "31", name: "Dächer", color: "#7a4a3a", - lw: 0.35, + lw: 0.18, }; /** diff --git a/src/model/sampleProject.ts b/src/model/sampleProject.ts index 0ad06739..f8ab875a 100644 --- a/src/model/sampleProject.ts +++ b/src/model/sampleProject.ts @@ -380,7 +380,7 @@ export const sampleProject: Project = { children: [ { code: "10", name: "Situation", color: "#909090", lw: 0.18, visible: true, locked: false }, { code: "11", name: "Strasse", color: "#a89070", lw: 0.18, visible: true, locked: false }, - { code: "12", name: "Gebäude", color: "#888888", lw: 0.25, visible: true, locked: false }, + { code: "12", name: "Gebäude", color: "#888888", lw: 0.18, visible: true, locked: false }, { code: "13", name: "Bäume", color: "#50a050", lw: 0.13, visible: true, locked: false }, { code: "14", name: "Höhenlinien", color: "#909050", lw: 0.18, visible: true, locked: false }, ], @@ -389,20 +389,21 @@ export const sampleProject: Project = { code: "20", name: "Wände", color: "#0a0a0a", - // [140] Schnittkante 0.5 bei 1:100 (mit `scaleLineWeights` ≈ 0.7 bei 1:50, ≈ 0.35 bei 1:200). - lw: 0.5, + // [140] Schnittkante 0.25 bei 1:100 = grösste Standard-Stärke (Entscheid Maintainer; mit + // `scaleLineWeights` ≈ 0.32 bei 1:50, ≈ 0.2 bei 1:200). + lw: 0.25, visible: true, locked: false, children: [ - { code: "21", name: "Türen/Fenster", color: "#5080c8", lw: 0.25, visible: true, locked: false }, + { code: "21", name: "Türen/Fenster", color: "#5080c8", lw: 0.18, visible: true, locked: false }, { code: "22", name: "Möbel", color: "#909090", lw: 0.13, visible: true, locked: false }, - { code: "25", name: "Stützen", color: "#c87050", lw: 0.5, visible: true, locked: false }, + { code: "25", name: "Stützen", color: "#c87050", lw: 0.25, visible: true, locked: false }, ], }, - { code: "30", name: "Decken", color: "#605850", lw: 0.35, visible: true, locked: false }, - { code: "31", name: "Dächer", color: "#7a4a3a", lw: 0.35, visible: true, locked: false }, - { code: "40", name: "Treppen", color: "#4a6a58", lw: 0.25, visible: true, locked: false }, - { code: "35", name: "Träger", color: "#a87858", lw: 0.5, visible: true, locked: false }, + { code: "30", name: "Decken", color: "#605850", lw: 0.18, visible: true, locked: false }, + { code: "31", name: "Dächer", color: "#7a4a3a", lw: 0.18, visible: true, locked: false }, + { code: "40", name: "Treppen", color: "#4a6a58", lw: 0.18, visible: true, locked: false }, + { code: "35", name: "Träger", color: "#a87858", lw: 0.25, visible: true, locked: false }, { code: "50", name: "Text", color: "#d0d0d0", lw: 0.13, visible: true, locked: false }, { code: "60", name: "Räume", color: "#5a7a9a", lw: 0.13, visible: true, locked: false }, { code: "90", name: "Referenzen", color: "#585860", lw: 0.13, visible: true, locked: false }, From 9c79870d813363fd7c8d52afaee86f217a3da241 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 5 Nov 2026 18:27:44 +0000 Subject: [PATCH 4/5] [140] Tusche-Standard: Kategorien, Kontext, Baurecht, Schatten, Achsen, Glas grau/schwarz; Bildschirm: Strichbreite unter 1 px als Deckung (Rangfolge bleibt sichtbar) --- src-tauri/core/src/cmd_create.rs | 2 +- src-tauri/core/src/plan/context.rs | 3 ++- src-tauri/core/src/plan/domains.rs | 3 ++- src-tauri/core/src/plan/elevation.rs | 7 ++--- src-tauri/core/src/plan/extras.rs | 8 +++--- src-tauri/core/src/plan/grid_view.rs | 3 ++- src-tauri/core/src/standards.rs | 2 +- src-tauri/render2d/src/shaders.rs | 11 +++++--- src/model/contextCategories.ts | 12 ++++----- src/model/sampleProject.ts | 35 +++++++++++++------------ src/model/sampleProjectComplex.ts | 4 +-- src/plan/generatePlan.sunShadow.test.ts | 2 +- src/plan/toElevation.test.ts | 6 ++--- 13 files changed, 55 insertions(+), 43 deletions(-) diff --git a/src-tauri/core/src/cmd_create.rs b/src-tauri/core/src/cmd_create.rs index 8fb50015..0ea98048 100644 --- a/src-tauri/core/src/cmd_create.rs +++ b/src-tauri/core/src/cmd_create.rs @@ -532,7 +532,7 @@ fn room_ops(p: &Project, v: &Value, ctx: &Ctx, ids: &mut IdGen) -> Vec { ("siaCategory", s("HNF")), ("name", s(&name)), ("boundary", pvs(&boundary)), - ("color", category_color(p, code, "#5a7a9a")), + ("color", category_color(p, code, "#4a4a4a")), ("stampAnchor", pt(e.centroid[0], e.centroid[1])), ("stampDoc", doc), ])], diff --git a/src-tauri/core/src/plan/context.rs b/src-tauri/core/src/plan/context.rs index 9b96c49f..af783a43 100644 --- a/src-tauri/core/src/plan/context.rs +++ b/src-tauri/core/src/plan/context.rs @@ -127,7 +127,8 @@ pub fn plan_context(c: &Ctx, out: &mut Vec) { out.append(&mut late); } -const TERRAIN_INK: &str = "#7a5b3a"; +/// [140] Gelände/Höhenlinien grau statt braun. +const TERRAIN_INK: &str = "#6e6e6e"; /// [140] Kleinster Papierabstand (mm) zwischen Höhenlinien; enger werden Zwischenlinien ausgelassen. const CONTOUR_MIN_GAP_MM: f64 = 0.6; diff --git a/src-tauri/core/src/plan/domains.rs b/src-tauri/core/src/plan/domains.rs index fb8020b9..9b84e9d5 100644 --- a/src-tauri/core/src/plan/domains.rs +++ b/src-tauri/core/src/plan/domains.rs @@ -16,7 +16,8 @@ use crate::plan::wall_poche::{ceiling_outline_lines, wall_footprint, WallFootpri use std::collections::{HashMap, HashSet}; /// Footprint-Farbe der Extrusionen (wie das 3D-Orange). -const EXTRUSION_STROKE: &str = "#d98c40"; +/// [140] Tusche statt Orange. +const EXTRUSION_STROKE: &str = "#3a3f47"; /// Rückfall-Füllung einer Stütze ohne auflösbares Bauteil. const COLUMN_FALLBACK_FILL: &str = "#3a3f47"; /// Alpha-Suffix der (unsichtbaren) Raumfüllung. diff --git a/src-tauri/core/src/plan/elevation.rs b/src-tauri/core/src/plan/elevation.rs index b25efe27..ff2137be 100644 --- a/src-tauri/core/src/plan/elevation.rs +++ b/src-tauri/core/src/plan/elevation.rs @@ -22,14 +22,15 @@ const SILHOUETTE_MM: f64 = 0.18; const SILHOUETTE_TOL: f64 = 2e-3; const FRAME_MM: f64 = 0.13; const GLASS_FILL_MONO: &str = "#c4c8cd"; -const GLASS_FILL_COLOR: &str = "#9fc2d9"; +/// [140] Glas hellgrau statt blau (Farbe nur, wo der Nutzer sie setzt). +const GLASS_FILL_COLOR: &str = "#d3d8dd"; const SHADOW_FILL: &str = "#8f959e"; const OPENING_SHADOW_FILL: &str = "#a7adb5"; const GROUND_INK: &str = "#1f242c"; const GROUND_MM: f64 = 0.25; -const FRAME_FILL_COLOR: &str = "#d9d9d4"; +const FRAME_FILL_COLOR: &str = "#dcdcdc"; const SILL_FILL_COLOR: &str = "#cccccb"; -const DOOR_LEAF_FILL_COLOR: &str = "#ede6d9"; +const DOOR_LEAF_FILL_COLOR: &str = "#ececec"; const SYMBOL_INK: &str = "#7d858f"; const ROOF_RGB_FALLBACK: [f64; 3] = [0.72, 0.45, 0.36]; const EPS: f64 = 1e-6; diff --git a/src-tauri/core/src/plan/extras.rs b/src-tauri/core/src/plan/extras.rs index 7d170861..4f7a8eaf 100644 --- a/src-tauri/core/src/plan/extras.rs +++ b/src-tauri/core/src/plan/extras.rs @@ -19,7 +19,8 @@ pub const SITE_PICK_RULES: &str = "@siteRules"; pub const SITE_PICK_VIEW_SHADOWS: &str = "@viewShadows"; /// Füllfarbe der Schattenflächen. -pub const SUN_SHADOW_FILL: &str = "#3a4a66"; +/// [140] Schatten grau (Tusche-Darstellung), nicht blau. +pub const SUN_SHADOW_FILL: &str = "#3c3c3c"; /// [140] Schatten heller (0.28 → 0.16): Bemassung und Stempel darüber bleiben lesbar. const SUN_SHADOW_OPACITY: f64 = 0.16; /// Linien-Klassen und Füllfarbe des Baurechts. @@ -29,8 +30,9 @@ pub const SITE_VIOLATION_FILL: &str = "#d0342c"; const SITE_VIOLATION_OPACITY: f64 = 0.45; /// Profilverstösse ([63]): gleiches Rot, schwächer gefüllt (Bauteil ragt über das Gebäudeprofil). const SITE_PROFILE_OPACITY: f64 = 0.25; -const PARCEL_COLOR: &str = "#1f6f3f"; -const ALLOWED_COLOR: &str = "#2b5fae"; +/// [140] Baurecht in Grautönen (Parzelle dunkel, zulässiger Baukörper mittel); Verstösse bleiben rot. +const PARCEL_COLOR: &str = "#3a3a3a"; +const ALLOWED_COLOR: &str = "#6e6e6e"; const PARCEL_DASH: [f64; 4] = [6.0, 1.5, 0.5, 1.5]; const ALLOWED_DASH: [f64; 2] = [2.0, 1.0]; diff --git a/src-tauri/core/src/plan/grid_view.rs b/src-tauri/core/src/plan/grid_view.rs index 1c11ffa4..344b60bc 100644 --- a/src-tauri/core/src/plan/grid_view.rs +++ b/src-tauri/core/src/plan/grid_view.rs @@ -7,7 +7,8 @@ use super::section::{LevelSpec, Plane}; use crate::grid::{bubble_diameter, section_axes, Spec}; use crate::model::{Drawing2DGeom, GridBubbles, Project, Vec2}; -const INK: &str = "#5a5f66"; +/// [140] Achsen in Tusche (schwarz), nicht grau. +const INK: &str = "#1f242c"; const AXIS_MM: f64 = 0.18; /// Überstand der Achse über die Gebäudehöhe und unter die Bodenlinie (Meter). const OVER_TOP: f64 = 0.8; diff --git a/src-tauri/core/src/standards.rs b/src-tauri/core/src/standards.rs index a4ca5e5c..574e6292 100644 --- a/src-tauri/core/src/standards.rs +++ b/src-tauri/core/src/standards.rs @@ -297,7 +297,7 @@ pub fn block_defs() -> Vec { pub const LIGHT_CATEGORY_CODE: &str = "65"; pub fn light_category() -> Value { - json!({"code": LIGHT_CATEGORY_CODE, "name": "Leuchten", "color": "#b08020", "lw": 0.18, "visible": true, "locked": false}) + json!({"code": LIGHT_CATEGORY_CODE, "name": "Leuchten", "color": "#1a1a1a", "lw": 0.18, "visible": true, "locked": false}) } /// Gibt es im Kategorie-Baum schon den Code oder den Namen der Leuchten-Kategorie? diff --git a/src-tauri/render2d/src/shaders.rs b/src-tauri/render2d/src/shaders.rs index cc6b67dd..ffa323c6 100644 --- a/src-tauri/render2d/src/shaders.rs +++ b/src-tauri/render2d/src/shaders.rs @@ -98,7 +98,10 @@ fn vs_main(in : VsIn) -> @builtin(position) vec4 { @fragment fn fs_main() -> @location(0) vec4 { - return globals.color; + // [140] Unter 1 Geraete-px gilt die Breite als Deckung: feine Linien werden heller statt alle + // gleich 1 px — die Rangfolge der Strichstaerken bleibt auch weit herausgezoomt sichtbar. + let cov = clamp(globals.stroke_px * globals.stroke_scale, 0.35, 1.0); + return vec4(globals.color.rgb, globals.color.a * cov); } "#; @@ -258,7 +261,8 @@ fn fs_main(in : VsOut) -> @location(0) vec4 { cov_dash = smoothstep(-0.5, 0.5, sdist); } - let a = in.color.a * cov_radial * cov_cap * cov_dash; + // [140] Deckung unter 1 Geraete-px wie `LINE_WGSL`. + let a = in.color.a * cov_radial * cov_cap * cov_dash * clamp(width_mm * g.stroke_scale, 0.35, 1.0); if (a <= 0.002) { discard; } @@ -384,7 +388,8 @@ fn fs_main(in : VsOut) -> @location(0) vec4 { } } let e = e_in + e_out; - var a = globals.color.a; + // [140] Deckung unter 1 Geraete-px wie `LINE_WGSL`. + var a = globals.color.a * clamp(globals.stroke_px * globals.stroke_scale, 0.35, 1.0); if (e > 0.0) { // Rundes Strich-Ende (Abstand zum Strich), Kante ~1 px weich wie die Boegen. let d = sqrt(e * e + y * y); diff --git a/src/model/contextCategories.ts b/src/model/contextCategories.ts index d0b536a6..b430686b 100644 --- a/src/model/contextCategories.ts +++ b/src/model/contextCategories.ts @@ -53,7 +53,7 @@ export const CONTEXT_PARENT_CATEGORY: ContextCategoryDef = { export const TERRAIN_CATEGORY: ContextCategoryDef = { code: "02", name: "Gelände", - color: "#8a9478", + color: "#808080", lw: 0.13, }; @@ -84,7 +84,7 @@ export const GENERIC_IMPORT_CATEGORY: ContextCategoryDef = { export const IMPORTED_ROOF_CATEGORY: ContextCategoryDef = { code: "31", name: "Dächer", - color: "#7a4a3a", + color: "#4a4a4a", lw: 0.18, }; @@ -95,12 +95,12 @@ export const IMPORTED_ROOF_CATEGORY: ContextCategoryDef = { */ export const GEO_CATEGORY_DEFS: Record = { building: { code: "12", name: "Gebäude", color: "#888888", lw: 0.25 }, - road: { code: "11", name: "Strasse", color: "#a89070", lw: 0.18 }, - forest: { code: "04", name: "Wald", color: "#3a7a3a", lw: 0.13 }, + road: { code: "11", name: "Strasse", color: "#808080", lw: 0.18 }, + forest: { code: "04", name: "Wald", color: "#909090", lw: 0.13 }, parking: { code: "15", name: "Parkplätze", color: "#a0a0a0", lw: 0.13 }, railway: { code: "16", name: "Bahn", color: "#606060", lw: 0.18 }, - water: { code: "17", name: "Gewässer", color: "#5a90b0", lw: 0.13 }, - green: { code: "18", name: "Grünflächen", color: "#70b070", lw: 0.13 }, + water: { code: "17", name: "Gewässer", color: "#909090", lw: 0.13 }, + green: { code: "18", name: "Grünflächen", color: "#a0a0a0", lw: 0.13 }, }; /** diff --git a/src/model/sampleProject.ts b/src/model/sampleProject.ts index f8ab875a..4de755b1 100644 --- a/src/model/sampleProject.ts +++ b/src/model/sampleProject.ts @@ -363,10 +363,11 @@ export const sampleProject: Project = { }, { id: "detail-1", name: "Detail 1", kind: "drawing", visible: true, locked: false }, ], - // Grafik-Kategorie-Baum (DOSSIER-Codes 1:1). + // Grafik-Kategorie-Baum (DOSSIER-Codes 1:1). [140] Standard = Tusche: Bauteile schwarz, Kontext grau; + // Farbe nur, wo der Nutzer sie setzt. layers: [ - { code: "00", name: "Raster", color: "#484850", lw: 0.13, visible: true, locked: false }, - { code: "01", name: "Vermessung", color: "#707078", lw: 0.18, visible: true, locked: false }, + { code: "00", name: "Raster", color: "#1a1a1a", lw: 0.13, visible: true, locked: false }, + { code: "01", name: "Vermessung", color: "#4a4a4a", lw: 0.18, visible: true, locked: false }, // "05 Kontext" bündelt Bestand/Umgebung (manuell gezeichnet ODER importiert, // s. `contextCategories.ts::CONTEXT_PARENT_CATEGORY`) als Kinder statt als // gleichrangige Top-Level-Einträge (Nutzer-Wunsch 2026-08-31). @@ -379,10 +380,10 @@ export const sampleProject: Project = { locked: false, children: [ { code: "10", name: "Situation", color: "#909090", lw: 0.18, visible: true, locked: false }, - { code: "11", name: "Strasse", color: "#a89070", lw: 0.18, visible: true, locked: false }, + { code: "11", name: "Strasse", color: "#808080", lw: 0.18, visible: true, locked: false }, { code: "12", name: "Gebäude", color: "#888888", lw: 0.18, visible: true, locked: false }, - { code: "13", name: "Bäume", color: "#50a050", lw: 0.13, visible: true, locked: false }, - { code: "14", name: "Höhenlinien", color: "#909050", lw: 0.18, visible: true, locked: false }, + { code: "13", name: "Bäume", color: "#808080", lw: 0.13, visible: true, locked: false }, + { code: "14", name: "Höhenlinien", color: "#808080", lw: 0.18, visible: true, locked: false }, ], }, { @@ -395,19 +396,19 @@ export const sampleProject: Project = { visible: true, locked: false, children: [ - { code: "21", name: "Türen/Fenster", color: "#5080c8", lw: 0.18, visible: true, locked: false }, - { code: "22", name: "Möbel", color: "#909090", lw: 0.13, visible: true, locked: false }, - { code: "25", name: "Stützen", color: "#c87050", lw: 0.25, visible: true, locked: false }, + { code: "21", name: "Türen/Fenster", color: "#1a1a1a", lw: 0.18, visible: true, locked: false }, + { code: "22", name: "Möbel", color: "#4a4a4a", lw: 0.13, visible: true, locked: false }, + { code: "25", name: "Stützen", color: "#0a0a0a", lw: 0.25, visible: true, locked: false }, ], }, - { code: "30", name: "Decken", color: "#605850", lw: 0.18, visible: true, locked: false }, - { code: "31", name: "Dächer", color: "#7a4a3a", lw: 0.18, visible: true, locked: false }, - { code: "40", name: "Treppen", color: "#4a6a58", lw: 0.18, visible: true, locked: false }, - { code: "35", name: "Träger", color: "#a87858", lw: 0.25, visible: true, locked: false }, - { code: "50", name: "Text", color: "#d0d0d0", lw: 0.13, visible: true, locked: false }, - { code: "60", name: "Räume", color: "#5a7a9a", lw: 0.13, visible: true, locked: false }, - { code: "90", name: "Referenzen", color: "#585860", lw: 0.13, visible: true, locked: false }, - { code: "99", name: "Konstruktion", color: "#404048", lw: 0.13, visible: true, locked: false }, + { code: "30", name: "Decken", color: "#1a1a1a", lw: 0.18, visible: true, locked: false }, + { code: "31", name: "Dächer", color: "#1a1a1a", lw: 0.18, visible: true, locked: false }, + { code: "40", name: "Treppen", color: "#1a1a1a", lw: 0.18, visible: true, locked: false }, + { code: "35", name: "Träger", color: "#0a0a0a", lw: 0.25, visible: true, locked: false }, + { code: "50", name: "Text", color: "#1a1a1a", lw: 0.13, visible: true, locked: false }, + { code: "60", name: "Räume", color: "#4a4a4a", lw: 0.13, visible: true, locked: false }, + { code: "90", name: "Referenzen", color: "#1a1a1a", lw: 0.13, visible: true, locked: false }, + { code: "99", name: "Konstruktion", color: "#404040", lw: 0.13, visible: true, locked: false }, ], // [140] Strichstärken folgen dem Massstab (neue Projekte; bestehende behalten ihre Einstellung). scaleLineWeights: true, diff --git a/src/model/sampleProjectComplex.ts b/src/model/sampleProjectComplex.ts index 4b4a468c..e7894d26 100644 --- a/src/model/sampleProjectComplex.ts +++ b/src/model/sampleProjectComplex.ts @@ -119,8 +119,8 @@ const LAYERS: LayerCategory[] = [ ? { ...l, children: [ - { code: "02", name: "Gelände", color: "#8a9478", lw: 0.13, visible: true, locked: false }, - { code: "07", name: "Baugrube", color: "#a07850", lw: 0.18, visible: true, locked: false }, + { code: "02", name: "Gelände", color: "#808080", lw: 0.13, visible: true, locked: false }, + { code: "07", name: "Baugrube", color: "#4a4a4a", lw: 0.18, visible: true, locked: false }, ...(l.children ?? []), ], } diff --git a/src/plan/generatePlan.sunShadow.test.ts b/src/plan/generatePlan.sunShadow.test.ts index b9bf0a62..a024e149 100644 --- a/src/plan/generatePlan.sunShadow.test.ts +++ b/src/plan/generatePlan.sunShadow.test.ts @@ -11,7 +11,7 @@ import type { Project } from "../model/types"; const ALL = new Set(flattenCategories(sampleProject.layers).map((c) => c.code)); /** Füllfarbe der Schattenflächen (`core/src/plan/extras.rs::SUN_SHADOW_FILL`). */ -const SUN_SHADOW_FILL = "#3a4a66"; +const SUN_SHADOW_FILL = "#3c3c3c"; const withStudy = (when: string, show = true): Project => ({ ...sampleProject, sunStudy: { when, show } }); const shadows = (p: Project, floorId: string) => diff --git a/src/plan/toElevation.test.ts b/src/plan/toElevation.test.ts index d7cb42cd..063157db 100644 --- a/src/plan/toElevation.test.ts +++ b/src/plan/toElevation.test.ts @@ -359,7 +359,7 @@ describe("toElevation — Öffnungen: Verdeckung + Reveal-Schatten", () => { const plan = generateElevationPlan(p, p.drawingLevels[1])!; // Glasflächen = weiss/blau gefüllte Polygone mit Kontur, keine Öffnung/Rahmen. return plan.primitives.filter( - (pr) => pr.kind === "polygon" && pr.fill === "#9fc2d9", + (pr) => pr.kind === "polygon" && pr.fill === "#d3d8dd", ).length; }; expect(glassCount(1)).toBe(1); // fest, 1 Feld @@ -405,7 +405,7 @@ describe("toElevation — Öffnungen: Verdeckung + Reveal-Schatten", () => { const plan = generateElevationPlan(p, p.drawingLevels[1])!; // Glasflächen = weiss/blau gefüllte Polygone mit Kontur, keine Öffnung/Rahmen. return plan.primitives.filter( - (pr) => pr.kind === "polygon" && pr.fill === "#9fc2d9", + (pr) => pr.kind === "polygon" && pr.fill === "#d3d8dd", ).length; }; expect(glassCount(1)).toBe(1); // fest, 1 Feld @@ -504,7 +504,7 @@ describe("Dächer auf L-Grundriss in der Ansicht", () => { }); describe("toElevation — Tür-Teilverglasung (glazingRatio)", () => { - const GLASS_FILL_COLOR = "#9fc2d9"; + const GLASS_FILL_COLOR = "#d3d8dd"; const DOOR_LEAF_FILL_COLOR = "#ede6d9"; function doorProject(dt: { From d3f2b9f77766d5a3ef6f8f4497681dc1ea6e9bb0 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 5 Nov 2026 18:50:37 +0000 Subject: [PATCH 5/5] =?UTF-8?q?[140]=20Goldens=20neu,=20Kontext-Kategorien?= =?UTF-8?q?=20im=20Kern=20grau,=20Tests=20nachgef=C3=BChrt,=20TODO?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TODO.md | 32 +++- src-tauri/core/src/import_context.rs | 13 +- src/cli/__golden__/ansicht.svg | 36 ++--- src/cli/__golden__/grundriss-eg.svg | 152 ++++++++---------- src/cli/__golden__/schnitt.svg | 50 +++--- .../komplex-ansicht-ansicht-sued.txt | 6 +- .../__golden__/komplex-grundriss-dg-100.txt | 6 +- .../__golden__/komplex-grundriss-dg-50.txt | 6 +- .../__golden__/komplex-grundriss-eg-100.txt | 8 +- .../__golden__/komplex-grundriss-eg-50.txt | 6 +- .../__golden__/komplex-grundriss-og-100.txt | 8 +- .../__golden__/komplex-grundriss-og-50.txt | 6 +- .../__golden__/komplex-grundriss-ug-100.txt | 8 +- .../__golden__/komplex-grundriss-ug-50.txt | 6 +- .../__golden__/komplex-schnitt-schnitt-a.txt | 4 +- .../muster-ansicht-ansicht-sued.txt | 4 +- .../__golden__/muster-grundriss-eg-100.txt | 6 +- .../__golden__/muster-grundriss-eg-50.txt | 2 +- .../__golden__/muster-grundriss-og-100.txt | 6 +- .../__golden__/muster-grundriss-og-50.txt | 2 +- .../__golden__/muster-schnitt-schnitt-a.txt | 4 +- src/plan/generatePlan.tjunction.test.ts | 3 +- src/plan/toElevation.test.ts | 2 +- 23 files changed, 190 insertions(+), 186 deletions(-) diff --git a/TODO.md b/TODO.md index 9abbe647..29c40a64 100644 --- a/TODO.md +++ b/TODO.md @@ -2713,12 +2713,32 @@ Format · [90] Versionsvergleich · [91] Assistent · [92] Speckle. `scaleLineWeights` an. Bestehende Projekte behalten ihre Ebenen-/Element-Stärken; neu wirken nur Ableitung, Faktor und Fallbacks (ohne eigene Werte). Tests: `strichstaerken_rangfolge_je_massstab`, `schnittkante_schwer_fugen_fein`, `silhouette_mittel_details_fein`, `hoehenlinien_enden_am_gebaeude`, `raumstempel_je_massstab`. Goldens neu (Strichstärken, Masszahlgrösse, - Höhenlinien). Offen: dünne Schichten (Putz, Parkett) laufen in 1:100 zu einem Balken zusammen (Detailgrad sollte - sie zusammenfassen); Achsen laufen in Ansicht/Grundriss durch das Gebäude; Raumstempel farbig statt schwarz im - Druck ohne Schwarz-Weiss; Schatten im EG-Grundriss überdeckt Bemassung; eigene Stempel (`Room.stamp`) behalten in - 1:200 alle Zeilen; ein Geschoss in 1:500 braucht Detail „grob" (sonst Stempel/Masse übereinander — die CLI rechnet - immer „mittel"); gestapelte Höhenlinien an Stützmauer/Baugrube wirken als brauner Balken. Nur Linux/CLI-SVG + Chromium geprüft, - nicht in der Tauri-App (Bildschirm-Modus nicht angesehen). · M + Höhenlinien). + (5.11., Teil 2) **Strichstärken** nach Entscheid Maintainer: grösste Standard-Stärke 0.25 bei 1:100 — Kategorien + Wände/Stützen/Träger 0.25, Decken/Dächer/Türen-Fenster/Treppen/Gebäude 0.18 (`sampleProject.ts`, neue Projekte); + Schnitt-Umriss und Terrain 0.25, Ansicht Terrain 0.25 / Silhouette 0.18 / Rahmen 0.13, Schnittlinie im Grundriss 0.25, + Skizzen-Doppelzug ab 0.25, importierte Dächer 0.18; Massstabsfaktor bleibt. **Tusche-Standard:** Kategorien, + Kontext/Gelände/Höhenlinien, Baurecht (Parzelle/zulässig; Verstösse bleiben rot), Schatten, Achsen, Extrusionen, + Glas/Türblatt der Ansicht in Schwarz/Grau statt farbig; Raumstempel in Tinte (Farbe nur aus Darstellungsregel oder + Text-Auszeichnung). Der vorhandene Modus „Schwarz-Weiss" ist KEIN brauchbarer Standard (ohne Wandschraffur, ohne + Schatten/Luftbilder, Gelände schwarz) — Standard bleibt „Farbig", jetzt mit schwarzen Standardfarben. **Dünne + Schichten:** im Detail „mittel" ab 1:100 gehen Schichten < 0.25 mm Papierdicke in der Nachbarschicht auf (Stil der + Nachbarschicht, keine Fuge dazwischen; `walls::thin_layer_targets`); 1:50 und „fein" zeigen alle Schichten. + **Achsen:** im Grundriss an der Gebäudegrundfläche unterbrochen (Stand der Raster-Stücke folgt Wänden/Körpern/Dächern), + in der Ansicht nur Stummel unter/über dem Bild mit Blase. **Massstab:** „mittel" zeichnet ab 1:200 automatisch wie + „grob" (`domains::effective_detail`, auch Layout-Viewports), Raumstempel bleiben (explizit „grob": ohne Stempel wie + bisher); eigene Stempel ab 1:200 ohne Nutzungs-/Personenzeile; ab 1:500 nur der Name und keine Masslinien. + **Schatten** heller (Deckung 0.16, grau). **Höhenlinien** enger als 0.6 mm auf dem Papier: nur jede zweite, unter + 0.3 mm nur Zähllinien (je Dreieck nach Gefälle). **Bildschirm** (render2d): Linien unter 1 Geräte-px zeichnen ihre + Breite als Deckung (min. 0.35) statt alle 1 px — die Rangfolge bleibt auch herausgezoomt sichtbar. Tests: + `duenne_schichten_je_massstab_zusammengefasst`, `achsraster_unterbrochen_im_gebaeude`, `senkrechte_achsen_mit_blase` + (Stummel), `raumstempel_je_massstab` (1:500, Tinte, eigene Stempel), `mittel_ab_1_200_automatisch_grob`, + `hoehenlinien_ausgeduennt_wo_zu_eng`, WGSL-Validierung. Goldens neu (Strichstärken, Farben, Schichten, Achsen). + Offen: Schnitt fasst dünne Decken-/Dachschichten (Parkett, Putz) noch nicht zusammen; Ansicht zeigt im Modus + „Farbig" weiter Materialfarben (Ziegelrot, Fassade) — für Tusche-Ansicht braucht es einen eigenen Modus oder einen + brauchbaren „Schwarz-Weiss"-Modus; Achsblasen in 1:500 gross (Papiermass fest); in 1:200 („grob") keine + Türaufschläge; enge Räume (Bad/Réduit) Stempel überlappen; Stifte (`penSets`) nicht angepasst. Nur Linux/CLI-SVG + + Chromium geprüft, nicht in der Tauri-App (Bildschirm-Deckung nur per WGSL-Validierung geprüft, nicht angesehen). · M - ◐ **[68] Baugrube / Geländebearbeitung.** (30.10.) Kontext-Objekt `excavation` (Rust-Modell, `ContextObject`): Sohle (`outline`, `bottom` m ±0.00), Böschung `slope` (Standard 45°, je Kante `edgeSlopes`), Schüttung `fillSlope` (33.7°), Bermen `bermWidth`/`bermHeight`. Neues Gelände = clamp(t, b − d·tan β, b + H(d)) mit d = Abstand zum diff --git a/src-tauri/core/src/import_context.rs b/src-tauri/core/src/import_context.rs index 33ad5c87..454c85bf 100644 --- a/src-tauri/core/src/import_context.rs +++ b/src-tauri/core/src/import_context.rs @@ -24,22 +24,23 @@ struct Def { lw: f64, } +/// [140] Kontext in Grautönen (Tusche-Standard), Farbe nur, wo der Nutzer sie setzt. /// „05 Kontext" — Elternkategorie der Kontext-Kategorien. const CONTEXT_PARENT: Def = Def { code: "05", name: "Kontext", color: "#707078", lw: 0.13 }; /// „31 Dächer" bleibt oberste Ebene. -const IMPORTED_ROOF: Def = Def { code: "31", name: "Dächer", color: "#7a4a3a", lw: 0.18 }; +const IMPORTED_ROOF: Def = Def { code: "31", name: "Dächer", color: "#4a4a4a", lw: 0.18 }; /// Kinder von „05 Kontext", in dieser Reihenfolge (`NESTED_CONTEXT_CATEGORIES`). const NESTED: [Def; 10] = [ - Def { code: "02", name: "Gelände", color: "#8a9478", lw: 0.13 }, + Def { code: "02", name: "Gelände", color: "#808080", lw: 0.13 }, Def { code: "03", name: "Luftbild", color: "#707078", lw: 0.13 }, Def { code: "10", name: "Situation", color: "#909090", lw: 0.18 }, Def { code: "12", name: "Gebäude", color: "#888888", lw: 0.25 }, - Def { code: "11", name: "Strasse", color: "#a89070", lw: 0.18 }, - Def { code: "04", name: "Wald", color: "#3a7a3a", lw: 0.13 }, + Def { code: "11", name: "Strasse", color: "#808080", lw: 0.18 }, + Def { code: "04", name: "Wald", color: "#909090", lw: 0.13 }, Def { code: "15", name: "Parkplätze", color: "#a0a0a0", lw: 0.13 }, Def { code: "16", name: "Bahn", color: "#606060", lw: 0.18 }, - Def { code: "17", name: "Gewässer", color: "#5a90b0", lw: 0.13 }, - Def { code: "18", name: "Grünflächen", color: "#70b070", lw: 0.13 }, + Def { code: "17", name: "Gewässer", color: "#909090", lw: 0.13 }, + Def { code: "18", name: "Grünflächen", color: "#a0a0a0", lw: 0.13 }, ]; fn category(d: &Def) -> Value { diff --git a/src/cli/__golden__/ansicht.svg b/src/cli/__golden__/ansicht.svg index 771238ba..91a46fd2 100644 --- a/src/cli/__golden__/ansicht.svg +++ b/src/cli/__golden__/ansicht.svg @@ -31,15 +31,15 @@ - - + + - + - + @@ -47,31 +47,31 @@ - + - + - + - + - - + + - - + + - - - - + + + + - - + + diff --git a/src/cli/__golden__/grundriss-eg.svg b/src/cli/__golden__/grundriss-eg.svg index b5048233..33db1bfc 100644 --- a/src/cli/__golden__/grundriss-eg.svg +++ b/src/cli/__golden__/grundriss-eg.svg @@ -3,145 +3,127 @@ -Wohnen -17.01 m² -HNF · Hauptnutzfläche +Wohnen +17.01 m² +HNF · Hauptnutzfläche - - - + - - - - - - + + + - - - + - - - + - - - + - - - - - - + + + - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + A - - - - + + + + A - - - - + + + + Süd - - - - + + + + Süd diff --git a/src/cli/__golden__/schnitt.svg b/src/cli/__golden__/schnitt.svg index ab89457b..ecc03fb8 100644 --- a/src/cli/__golden__/schnitt.svg +++ b/src/cli/__golden__/schnitt.svg @@ -32,30 +32,30 @@ - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -90,5 +90,5 @@ - + diff --git a/src/plan/__golden__/komplex-ansicht-ansicht-sued.txt b/src/plan/__golden__/komplex-ansicht-ansicht-sued.txt index ffe3301c..3220247e 100644 --- a/src/plan/__golden__/komplex-ansicht-ansicht-sued.txt +++ b/src/plan/__golden__/komplex-ansicht-ansicht-sued.txt @@ -1,9 +1,9 @@ viewBox -4.2 0 37.045 17.778 -bytes 346737 +bytes 347561 circle 4 -line 1268 +line 1272 polygon 1541 rect 1 svg 1 text 4 -hash 13c462eddf903040 +hash 7d9bfe8d6f13e06b diff --git a/src/plan/__golden__/komplex-grundriss-dg-100.txt b/src/plan/__golden__/komplex-grundriss-dg-100.txt index f5e06c55..01e08745 100644 --- a/src/plan/__golden__/komplex-grundriss-dg-100.txt +++ b/src/plan/__golden__/komplex-grundriss-dg-100.txt @@ -1,10 +1,10 @@ viewBox -4 0 23 18 -bytes 335698 +bytes 332518 circle 14 -line 3490 +line 3452 path 7 polygon 84 rect 1 svg 1 text 36 -hash b88ec245a30ce2f3 +hash fdfe3a2dadd080ba diff --git a/src/plan/__golden__/komplex-grundriss-dg-50.txt b/src/plan/__golden__/komplex-grundriss-dg-50.txt index 0cf96f05..2c9d0f58 100644 --- a/src/plan/__golden__/komplex-grundriss-dg-50.txt +++ b/src/plan/__golden__/komplex-grundriss-dg-50.txt @@ -1,10 +1,10 @@ viewBox -4 0 23 18 -bytes 339174 +bytes 339795 circle 14 -line 3490 +line 3495 path 7 polygon 84 rect 1 svg 1 text 36 -hash 24505c31de657c2a +hash d4bd538bff4bc2d6 diff --git a/src/plan/__golden__/komplex-grundriss-eg-100.txt b/src/plan/__golden__/komplex-grundriss-eg-100.txt index 2cbc5bea..c493039a 100644 --- a/src/plan/__golden__/komplex-grundriss-eg-100.txt +++ b/src/plan/__golden__/komplex-grundriss-eg-100.txt @@ -1,10 +1,10 @@ viewBox -41.5 0 95 63.6 -bytes 147365 +bytes 139395 circle 16 -line 832 -path 68 +line 746 +path 62 polygon 257 rect 1 svg 1 text 121 -hash 6adf8da2a695b17a +hash b112d6318c64a2d6 diff --git a/src/plan/__golden__/komplex-grundriss-eg-50.txt b/src/plan/__golden__/komplex-grundriss-eg-50.txt index 8bf4f61f..92f72a03 100644 --- a/src/plan/__golden__/komplex-grundriss-eg-50.txt +++ b/src/plan/__golden__/komplex-grundriss-eg-50.txt @@ -1,10 +1,10 @@ viewBox -41.5 0 95 63.6 -bytes 147696 +bytes 148337 circle 16 -line 832 +line 837 path 68 polygon 257 rect 1 svg 1 text 121 -hash c61e13454d30ac4f +hash a8ad9b27b549839b diff --git a/src/plan/__golden__/komplex-grundriss-og-100.txt b/src/plan/__golden__/komplex-grundriss-og-100.txt index 96cefbe9..efc4f75d 100644 --- a/src/plan/__golden__/komplex-grundriss-og-100.txt +++ b/src/plan/__golden__/komplex-grundriss-og-100.txt @@ -1,10 +1,10 @@ viewBox -4.055 0 25.109 23.11 -bytes 412951 +bytes 405414 circle 14 -line 4009 -path 40 +line 3927 +path 34 polygon 226 rect 1 svg 1 text 91 -hash 95b660dfdb89c295 +hash c62cf9adddb03311 diff --git a/src/plan/__golden__/komplex-grundriss-og-50.txt b/src/plan/__golden__/komplex-grundriss-og-50.txt index 21d709bf..fdc5c0e1 100644 --- a/src/plan/__golden__/komplex-grundriss-og-50.txt +++ b/src/plan/__golden__/komplex-grundriss-og-50.txt @@ -1,10 +1,10 @@ viewBox -4.055 0 25.109 23.11 -bytes 416599 +bytes 417246 circle 14 -line 4009 +line 4014 path 40 polygon 226 rect 1 svg 1 text 91 -hash 5a80b44538371ebc +hash 0df0407219a90af1 diff --git a/src/plan/__golden__/komplex-grundriss-ug-100.txt b/src/plan/__golden__/komplex-grundriss-ug-100.txt index 575e1865..f45a9732 100644 --- a/src/plan/__golden__/komplex-grundriss-ug-100.txt +++ b/src/plan/__golden__/komplex-grundriss-ug-100.txt @@ -1,10 +1,10 @@ viewBox -10.004 0 31.058 26.958 -bytes 83175 +bytes 82741 circle 14 -line 481 -path 30 +line 475 +path 28 polygon 107 rect 1 svg 1 text 75 -hash 04995fa4a25c1dce +hash fc38ce615762aadc diff --git a/src/plan/__golden__/komplex-grundriss-ug-50.txt b/src/plan/__golden__/komplex-grundriss-ug-50.txt index e39d8041..41c3f8f0 100644 --- a/src/plan/__golden__/komplex-grundriss-ug-50.txt +++ b/src/plan/__golden__/komplex-grundriss-ug-50.txt @@ -1,10 +1,10 @@ viewBox -10.004 0 31.058 26.958 -bytes 83420 +bytes 84067 circle 14 -line 481 +line 486 path 30 polygon 107 rect 1 svg 1 text 75 -hash 8debbdbb59223894 +hash a3ec09ceaef6f21a diff --git a/src/plan/__golden__/komplex-schnitt-schnitt-a.txt b/src/plan/__golden__/komplex-schnitt-schnitt-a.txt index cfeb7577..3791334c 100644 --- a/src/plan/__golden__/komplex-schnitt-schnitt-a.txt +++ b/src/plan/__golden__/komplex-schnitt-schnitt-a.txt @@ -1,9 +1,9 @@ viewBox 4.457 0 21.343 17.778 -bytes 65056 +bytes 65272 circle 3 line 376 polygon 168 rect 1 svg 1 text 3 -hash 85215eea3c7d1169 +hash 627f98c1ca812309 diff --git a/src/plan/__golden__/muster-ansicht-ansicht-sued.txt b/src/plan/__golden__/muster-ansicht-ansicht-sued.txt index f6f4cf9b..58399495 100644 --- a/src/plan/__golden__/muster-ansicht-ansicht-sued.txt +++ b/src/plan/__golden__/muster-ansicht-ansicht-sued.txt @@ -1,7 +1,7 @@ viewBox 0.1 0 6.8 7.586 -bytes 8483 +bytes 8484 line 31 polygon 42 rect 1 svg 1 -hash 4b1f6e5269c6c321 +hash a1b63d6d537a00f4 diff --git a/src/plan/__golden__/muster-grundriss-eg-100.txt b/src/plan/__golden__/muster-grundriss-eg-100.txt index 0464f085..9ef5fa46 100644 --- a/src/plan/__golden__/muster-grundriss-eg-100.txt +++ b/src/plan/__golden__/muster-grundriss-eg-100.txt @@ -1,9 +1,9 @@ viewBox -0.672 0 6.345 5.345 -bytes 15907 -line 67 +bytes 14371 +line 49 path 8 polygon 61 rect 1 svg 1 text 7 -hash ad8766ed45e2dec9 +hash d5b42abbc948799a diff --git a/src/plan/__golden__/muster-grundriss-eg-50.txt b/src/plan/__golden__/muster-grundriss-eg-50.txt index 15097414..07696ccc 100644 --- a/src/plan/__golden__/muster-grundriss-eg-50.txt +++ b/src/plan/__golden__/muster-grundriss-eg-50.txt @@ -6,4 +6,4 @@ polygon 61 rect 1 svg 1 text 7 -hash 10fc1ef5859d46d9 +hash f679a3f74df4cb03 diff --git a/src/plan/__golden__/muster-grundriss-og-100.txt b/src/plan/__golden__/muster-grundriss-og-100.txt index ae980bed..eb6d79ce 100644 --- a/src/plan/__golden__/muster-grundriss-og-100.txt +++ b/src/plan/__golden__/muster-grundriss-og-100.txt @@ -1,9 +1,9 @@ viewBox -0.9 0 6.8 5.8 -bytes 7481 -line 35 +bytes 6777 +line 27 path 4 polygon 23 rect 1 svg 1 text 4 -hash 0b855c965139033b +hash 3d69b9b36146a697 diff --git a/src/plan/__golden__/muster-grundriss-og-50.txt b/src/plan/__golden__/muster-grundriss-og-50.txt index dc305f31..f491ce60 100644 --- a/src/plan/__golden__/muster-grundriss-og-50.txt +++ b/src/plan/__golden__/muster-grundriss-og-50.txt @@ -6,4 +6,4 @@ polygon 23 rect 1 svg 1 text 4 -hash 631f36b943fff8e6 +hash 45bfc14809fb812c diff --git a/src/plan/__golden__/muster-schnitt-schnitt-a.txt b/src/plan/__golden__/muster-schnitt-schnitt-a.txt index 68f34a09..f6d6e7a0 100644 --- a/src/plan/__golden__/muster-schnitt-schnitt-a.txt +++ b/src/plan/__golden__/muster-schnitt-schnitt-a.txt @@ -1,7 +1,7 @@ viewBox 0.1 0 6.8 7.586 -bytes 9686 +bytes 9711 line 59 polygon 31 rect 1 svg 1 -hash 1626fed816bbf55f +hash c6a5e7d3016d17ec diff --git a/src/plan/generatePlan.tjunction.test.ts b/src/plan/generatePlan.tjunction.test.ts index 7bb06130..3d7a5383 100644 --- a/src/plan/generatePlan.tjunction.test.ts +++ b/src/plan/generatePlan.tjunction.test.ts @@ -195,7 +195,8 @@ describe("generatePlan — Durchgangswand-Aussparung am Mittelspann-Stoss (Phase }); it("unterbricht die Schichtfuge im Merge-Bereich (keine Trennlinie an der Verschmelzungsfläche)", () => { - const plan = generatePlan(midSpanProject(), "eg", visible, undefined, "mittel"); + // „fein": alle Schichten mit Fugen ([140] fasst in „mittel" 1:100 den 15-mm-Putz zusammen). + const plan = generatePlan(midSpanProject(), "eg", visible, undefined, "fein"); // Fugen der Durchgangswand W: layer-joint-Linien parallel zur x-Achse. const joints = plan.primitives.filter( (p): p is Extract => diff --git a/src/plan/toElevation.test.ts b/src/plan/toElevation.test.ts index 063157db..83076017 100644 --- a/src/plan/toElevation.test.ts +++ b/src/plan/toElevation.test.ts @@ -505,7 +505,7 @@ describe("Dächer auf L-Grundriss in der Ansicht", () => { describe("toElevation — Tür-Teilverglasung (glazingRatio)", () => { const GLASS_FILL_COLOR = "#d3d8dd"; - const DOOR_LEAF_FILL_COLOR = "#ede6d9"; + const DOOR_LEAF_FILL_COLOR = "#ececec"; function doorProject(dt: { leafStyle: "glatt" | "kassette" | "glas";