diff --git a/TODO.md b/TODO.md index 0227fda0..aecc7d7a 100644 --- a/TODO.md +++ b/TODO.md @@ -133,8 +133,8 @@ Wer zu einer ID mehr wissen will (Entscheide, Tests, Bilder), sucht dort nach `* Strich-Punkt-Linie dazwischen, an jedem Ende Schenkel (8 mm) in Blickrichtung mit gefülltem Dreieck, Beschriftung 3.5 mm waagrecht vor der Spitze; alles fest in Papier-mm (vorher Massstab-abhängig, √-Faktor ab 1:200); Ansicht: ganze Linie dünn, nur Schenkel + Dreieck kräftig. Kern `plan/misc.rs` (`section_line_sized`) + `plan/context.rs`, gleicher Pfad für Bildschirm/Druck/CLI. - Rest (10.11.): Ansichtsmarker als eigenes Symbol (Kreis Ø 8 mm, 0.25 mm, gefülltes Dreieck in Blickrichtung, Bezeichnung - im Kreis, `misc.rs` `view_marker_sized`, keine Linie mehr); Modell `DrawingLevel.bendPoints` (optional, Knickpunkte zwischen + Rest (10.11.): Ansichtsmarker als eigenes Symbol (nur flaches gefülltes Dreieck, Basis 6 mm, Höhe 3 mm in Blickrichtung, Bezeichnung + waagrecht dahinter, kein Kreis, keine Linie, `misc.rs` `view_marker_sized`, Pick-Band über Dreieck+Text); Modell `DrawingLevel.bendPoints` (optional, Knickpunkte zwischen `linePoints[0]`/`[1]`, altes 2-Punkt-Format liest weiter, verschiebt mit Georeferenz) und Darstellung im Grundriss (`section_polyline_sized`: kräftige 6-mm-Stücke an jedem Knick). Geknickter Schnitt fertig (10.11.): Abwicklung im Kern (`plan/section/unfold.rs`): je Segment eigene Ebene, Schnittflächen auf den u-Bereich, Projektion an den Winkelhalbierenden @@ -142,7 +142,13 @@ Wer zu einer ID mehr wissen will (Entscheide, Tests, Bilder), sucht dort nach `* Achsen je Segment geschnitten, Bäume nach Mitte zugeordnet. Werkzeug: Schnitt nimmt weitere Klicks als Knicke, Enter/Doppelklick beendet (Ansicht weiter zwei Klicks); Griffe an Anfang, Knicken, Ende (`grips.rs` `sectionLineGrip`). Offen: Grundriss-Unterlage im Schnitt (`underlay.rs`) und 3D-Live-Schnitt folgen der Endpunkt-Verbindung; Knick einfügen/löschen am bestehenden Schnitt - (nur Ziehen); optionale dünne Ansichtsebene; Mac-/Tauri-Ansicht nicht geprüft. · M + (nur Ziehen); optionale dünne Ansichtsebene; Mac-/Tauri-Ansicht nicht geprüft. + L-Marke (10.11., Wunsch Maintainer): Markentyp + `DrawingLevel.markerStyle` ("arrow" Basis | "lAngle") mit Vorgabe `ModelViewOption.sectionMarks.style` (Ebene > Modelldarstellung > + Pfeil; `Options::section_marker`); L = je Ende kräftiger langer Schenkel (12 mm) längs der Linie nach innen + kurzer (6 mm) in + Blickrichtung, keine Linie dazwischen, kein Dreieck, Bezeichnung waagrecht aussen neben dem kurzen Schenkel, Knickstücke bleiben + (`misc.rs` `section_polyline_styled`, `context.rs` `plan_section_lines`); Auswahl in Objekt-Info (Schnitt) und Ressourcen-Tab + Modelldarstellung („Schnittmarken"). Goldens: nur die Ansichtsmarker ändern sich. · M - ◐ **[171]** Plan-Review Runde 2 (10.11., beide Musterhäuser, CLI-SVG `--hatch` in Chromium, nur Linux). Behoben (Kern, Test je Fix): Sonnenschatten auf Flächen unter dem Ansichtsbereich (grauer Fleck über dem Carport im OG/DG, `sun::shadow_polygons_plan_in`); Flächenzeile nach Rundungsschritt („16.0 m²“ statt „16 m²“); Schnitt genau am Rand diff --git a/src-tauri/core/src/model/generated.rs b/src-tauri/core/src/model/generated.rs index bbbeed6d..d3052352 100644 --- a/src-tauri/core/src/model/generated.rs +++ b/src-tauri/core/src/model/generated.rs @@ -1847,6 +1847,11 @@ pub struct DrawingLevel { #[serde(rename = "bendPoints", default, skip_serializing_if = "Option::is_none")] #[ts(optional)] pub bend_points: Option>, + /// [176] Schnittmarke im Grundriss: "arrow" (Pfeil mit Dreieck, Basis) oder "lAngle" (nur ein L je Ende). Fehlt ⇒ die + /// Vorgabe der Modelldarstellung (`sectionMarks.style`), sonst Pfeil. Nur Schnitt. + #[serde(rename = "markerStyle", default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub marker_style: Option, /// Blickrichtung relativ zur Schnittlinie (nur Schnitt/Ansicht). #[serde(rename = "directionSign", default, skip_serializing_if = "Option::is_none")] #[ts(optional, type = "1 | -1")] @@ -2076,11 +2081,42 @@ pub struct ModelViewOption { #[serde(default, skip_serializing_if = "Option::is_none")] #[ts(optional)] pub elevation: Option, + /// [176] Schnittmarken im Grundriss. + #[serde(rename = "sectionMarks", default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub section_marks: Option, #[serde(flatten)] #[ts(skip)] pub extra: Extra, } +/// [176] Schnittmarken in der Modelldarstellung (fehlt ⇒ Pfeil). +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize, TS)] +#[serde(default)] +pub struct ModelViewSectionMarks { + /// Markentyp der Schnitte (die Ebene geht vor; Basis: Pfeil). + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub style: Option, + #[serde(flatten)] + #[ts(skip)] + pub extra: Extra, +} + +/// [176] Markentyp einer Schnittlinie im Grundriss: Pfeil (kräftige Endstücke, dünne Linie, Schenkel mit Dreieck) +/// oder nur ein L an jedem Ende (langer Schenkel längs der Linie, kurzer in Blickrichtung, keine Linie dazwischen). +#[derive(Debug, Clone, Copy, PartialEq, Eq, Default, Serialize, Deserialize, TS)] +pub enum SectionMarkerStyle { + #[default] + #[serde(rename = "arrow")] + Arrow, + #[serde(rename = "lAngle")] + LAngle, + #[serde(other)] + #[ts(skip)] + Unknown, +} + /// [173] Türen in der Modelldarstellung (fehlt ⇒ wie Basis). #[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize, TS)] #[serde(default)] diff --git a/src-tauri/core/src/plan/context.rs b/src-tauri/core/src/plan/context.rs index befe6baa..c31ab816 100644 --- a/src-tauri/core/src/plan/context.rs +++ b/src-tauri/core/src/plan/context.rs @@ -20,8 +20,6 @@ const SECTION_LINE_MARK_MM: f64 = 0.5; const SECTION_LINE_DASH: [f64; 4] = super::line_pattern::SECTION_LINE; /// [176] Beschriftungshöhe in Papier-mm (Modell-Meter = mm · Massstab/1000). const SECTION_LABEL_MM: f64 = 3.5; -const VIEW_MARKER_RING_MM: f64 = 0.25; -const VIEW_MARKER_MIN_FONT_MM: f64 = 2.4; fn v2(x: f64, y: f64) -> Vec2 { Vec2 { x, y } @@ -833,41 +831,20 @@ pub fn section_label_tag(name: &str) -> String { } } -/// [176] Ansichtsmarker als eigenes Symbol: Kreis (Ø 8 mm Papier, 0.25 mm) in der Mitte der Ansichtslinie, gefülltes -/// Dreieck in Blickrichtung, Bezeichnung waagrecht im Kreis (verkleinert, wenn nötig) bzw. rechts daneben; Pick-Band -/// über dem ganzen Symbol. Keine durchgehende Linie. +/// [176] Ansichtsmarker als eigenes Symbol: nur ein flaches gefülltes Dreieck in Blickrichtung (kein Kreis, keine Linie), +/// die Bezeichnung waagrecht dahinter (auf der dem Blick abgewandten Seite); Pick-Band über Dreieck und Text. #[allow(clippy::too_many_arguments)] fn view_marker(c: &Ctx, level: &DrawingLevel, p0: Vec2, p1: Vec2, sign: f64, k: f64, tag: &str, greyed: Option, obst: &mut super::stamp_place::Obstacles, out: &mut Vec) { let _ = c; - let f = crate::plan::misc::view_marker_sized(p0.x, p0.y, p1.x, p1.y, sign, k); + let h = SECTION_LABEL_MM * k; + let w = crate::text_layout::text_width_em(tag, false) * h; + let f = crate::plan::misc::view_marker_sized(p0.x, p0.y, p1.x, p1.y, sign, k, w); if f.is_empty() { return; } - let (mut i, mut center, mut r) = (1, v2(0.0, 0.0), 0.0); + let mut i = 1; for _ in 0..f[0] as usize { - if f[i] == 4.0 { - center = v2(f[i + 1], f[i + 2]); - r = f[i + 3]; - for (from, to) in [(v2(center.x + r, center.y), v2(center.x - r, center.y)), (v2(center.x - r, center.y), v2(center.x + r, center.y))] { - let arc = Primitive::Arc { - center, - from, - to, - r, - cls: "section-line".into(), - weight_mm: VIEW_MARKER_RING_MM, - dash: None, - color: Some(SECTION_LINE_INK.into()), - opening_id: None, - stair_id: None, - greyed, - opacity: None, - }; - obst.add_prim(&arc); - out.push(arc); - } - i += 4; - } else if f[i] == 3.0 { + if f[i] == 3.0 { let pts: Vec = (0..3).map(|j| v2(f[i + 1 + 2 * j], f[i + 2 + 2 * j])).collect(); let ring: Vec<[f64; 2]> = pts.iter().map(|q| [q.x, q.y]).collect(); obst.area(ring); @@ -877,41 +854,33 @@ fn view_marker(c: &Ctx, level: &DrawingLevel, p0: Vec2, p1: Vec2, sign: f64, k: } out.push(tri); i += 7; + } else if f[i] == 5.0 { + let at = v2(f[i + 1], f[i + 2]); + i += 3; + if !(w > 0.0) { + continue; + } + let pad = 0.1 * h; + obst.area(vec![[at.x - pad, at.y - pad], [at.x + w + pad, at.y - pad], [at.x + w + pad, at.y + 0.75 * h + pad], [at.x - pad, at.y + 0.75 * h + pad]]); + out.push(Primitive::DrawingText { + at, + text: tag.to_string(), + height_m: h, + angle: 0.0, + color: SECTION_LINE_INK.into(), + marks: None, + wrap_width: None, + doc: None, + drawing_id: None, + greyed, + opacity: None, + }); } else { let pts = (0..4).map(|j| v2(f[i + 1 + 2 * j], f[i + 2 + 2 * j])).collect(); out.push(pick_band(pts, None, Some(&level.id))); i += 9; } } - // Bezeichnung: im Kreis, solange sie mit mindestens 2.4 mm Schrift in 1.6 · r passt, sonst rechts neben dem Kreis. - let w_em = crate::text_layout::text_width_em(tag, false); - if !(w_em > 0.0) { - return; - } - let inner_mm = 1.6 * r / k; - let font_mm = SECTION_LABEL_MM.min(inner_mm / w_em); - let (h, at) = if font_mm >= VIEW_MARKER_MIN_FONT_MM { - let h = font_mm * k; - (h, v2(center.x - w_em * h / 2.0, center.y - 0.375 * h)) - } else { - let h = SECTION_LABEL_MM * k; - (h, v2(center.x + r + k, center.y - 0.375 * h)) - }; - let (w, pad) = (w_em * h, 0.1 * h); - obst.area(vec![[at.x - pad, at.y - pad], [at.x + w + pad, at.y - pad], [at.x + w + pad, at.y + 0.75 * h + pad], [at.x - pad, at.y + 0.75 * h + pad]]); - out.push(Primitive::DrawingText { - at, - text: tag.to_string(), - height_m: h, - angle: 0.0, - color: SECTION_LINE_INK.into(), - marks: None, - wrap_width: None, - doc: None, - drawing_id: None, - greyed, - opacity: None, - }); } /// Schnittführungs-Symbole aller Schnitt-/Ansichtsebenen mit Linie (`addSectionLines`). @@ -948,7 +917,7 @@ pub fn plan_section_lines(c: &Ctx, out: &mut Vec) { let mut path: Vec<(f64, f64)> = vec![(p0.x, p0.y)]; path.extend(level.bend_points.iter().flatten().map(|q| (q.x, q.y))); path.push((p1.x, p1.y)); - let f = crate::plan::misc::section_polyline_sized(&path, sign, k, label_w); + let f = crate::plan::misc::section_polyline_styled(&path, sign, k, label_w, c.mv().section_marker(level.marker_style)); if f.is_empty() { continue; } @@ -1169,10 +1138,10 @@ mod tests { assert!(d.bounds.is_some_and(|b| b[3] >= top - 1e-9), "{:?} < {top}", d.bounds); } - /// [176] Ansichtsmarker: Kreis (Ø 8 mm Papier) mit gefülltem Dreieck in Blickrichtung und Bezeichnung im Kreis, - /// keine durchgehende Linie; Pick-Band trägt die Ebenen-ID. + /// [176] Ansichtsmarker: nur flaches gefülltes Dreieck (Basis 6 mm, Höhe 3 mm) in Blickrichtung, Bezeichnung waagrecht + /// dahinter (gegen den Blick), kein Kreis, keine Linie; Pick-Band trägt die Ebenen-ID. #[test] - fn ansichtsmarker_ist_kreis_mit_pfeil_und_bezeichnung() { + fn ansichtsmarker_ist_dreieck_mit_bezeichnung() { let p = Project { drawing_levels: vec![serde_json::from_value(serde_json::json!({ "id": "n", "name": "Ansicht Süd", "kind": "elevation", "visible": true, "locked": false, "linePoints": [{ "x": 0.0, "y": -2.0 }, { "x": 10.0, "y": -2.0 }] })).unwrap()], @@ -1181,18 +1150,49 @@ mod tests { let a = super::super::domains::PlanArgs::parse(1.0, r#"{"show": ["90"], "scale": 100, "global": true}"#).unwrap(); let mut out = Vec::new(); plan_section_lines(&Ctx::new(&p, &a), &mut out); - assert!(!out.iter().any(|q| matches!(q, Primitive::Line { .. })), "keine Linie"); - let arcs: Vec = out.iter().filter_map(|q| match q { Primitive::Arc { r, center, .. } => { assert!((center.x - 5.0).abs() < 1e-9 && (center.y + 2.0).abs() < 1e-9); Some(*r) } _ => None }).collect(); - assert_eq!(arcs.len(), 2); - assert!((arcs[0] - 0.4).abs() < 1e-9, "Ø 8 mm bei 1:100 = r 0.4 m, ist {}", arcs[0]); + assert!(!out.iter().any(|q| matches!(q, Primitive::Line { .. } | Primitive::Arc { .. })), "keine Linie, kein Kreis"); let tri = out.iter().find_map(|q| match q { Primitive::Polygon { pts, fill, .. } if fill != "none" => Some(pts.clone()), _ => None }).unwrap(); - // Blickrichtung +y (Linie von links nach rechts, Vorzeichen 1): Spitze oberhalb des Kreises. - assert!(tri[0].y > -2.0 + 0.4, "{tri:?}"); + // Blickrichtung +y (Linie von links nach rechts, Vorzeichen 1): Spitze 3 mm · 100 = 0.3 m über der Linie, Basis 0.6 m breit. + assert!((tri[0].y - (-2.0 + 0.3)).abs() < 1e-9 && (tri[0].x - 5.0).abs() < 1e-9, "{tri:?}"); + assert!(((tri[1].x - tri[2].x).abs() - 0.6).abs() < 1e-9, "{tri:?}"); assert!(out.iter().any(|q| matches!(q, Primitive::Polygon { section_line_id: Some(id), .. } if id == "n"))); let t = out.iter().find_map(|q| match q { Primitive::DrawingText { at, text, height_m, .. } => Some((*at, text.clone(), *height_m)), _ => None }).unwrap(); assert_eq!(t.1, "Süd"); + // Text hinter der Basis (unterhalb der Linie), waagrecht um die Mitte, ohne das Dreieck zu überlappen. let w = crate::text_layout::text_width_em("Süd", false) * t.2; - assert!(t.0.x > 5.0 - 0.4 && t.0.x + w < 5.0 + 0.4, "Text im Kreis: {t:?}"); + assert!(t.0.y + 0.75 * t.2 < -2.0 && ((t.0.x + w / 2.0) - 5.0).abs() < 1e-9, "{t:?}"); + } + + /// [176] Schnittmarke als L: Ebenenfeld `markerStyle` bzw. Vorgabe der Modelldarstellung (`sectionMarks.style`); + /// Ebene > Modelldarstellung > Pfeil. L: keine dünne Linie, kein Dreieck. + #[test] + fn schnittmarke_als_l_nach_ebene_und_modelldarstellung() { + let mk = |style: Option<&str>| -> Project { + let mut lv = serde_json::json!({ "id": "s", "name": "Schnitt A-A", "kind": "section", "visible": true, "locked": false, + "linePoints": [{ "x": 0.0, "y": 0.0 }, { "x": 10.0, "y": 0.0 }] }); + if let Some(st) = style { + lv["markerStyle"] = st.into(); + } + let mut p = Project { drawing_levels: vec![serde_json::from_value(lv).unwrap()], ..Default::default() }; + p.model_view_options = Some(vec![serde_json::from_value(serde_json::json!({ "id": "m", "name": "M", "sectionMarks": { "style": "lAngle" } })).unwrap()]); + p + }; + let run = |p: &Project, mv: bool| { + let a = super::super::domains::PlanArgs::parse(1.0, &format!(r#"{{"show": ["90"], "scale": 100, "global": true{}}}"#, if mv { r#", "modelView": "m""# } else { "" })).unwrap(); + let mut out = Vec::new(); + plan_section_lines(&Ctx::new(p, &a), &mut out); + out + }; + let is_l = |out: &[Primitive]| !out.iter().any(|q| matches!(q, Primitive::Line { dash: Some(_), .. })) && !out.iter().any(|q| matches!(q, Primitive::Polygon { fill, .. } if fill != "none")); + let heavy = |out: &[Primitive]| out.iter().filter(|q| matches!(q, Primitive::Line { weight_mm, .. } if *weight_mm > 0.4)).count(); + assert!(!is_l(&run(&mk(None), false)), "Basis = Pfeil"); + assert!(!is_l(&run(&mk(None), false))); + let l = run(&mk(Some("lAngle")), false); + assert!(is_l(&l)); + assert_eq!(heavy(&l), 4, "je Ende zwei Schenkel"); + assert_eq!(l.iter().filter(|q| matches!(q, Primitive::DrawingText { .. })).count(), 2); + assert!(is_l(&run(&mk(None), true)), "Vorgabe der Modelldarstellung"); + assert!(!is_l(&run(&mk(Some("arrow")), true)), "Ebene geht vor"); } /// [176] Geknickter Schnitt: Knickpunkte aus `bendPoints` erscheinen als kräftige Stücke im Grundriss; ohne diff --git a/src-tauri/core/src/plan/misc.rs b/src-tauri/core/src/plan/misc.rs index 6c2dfc20..f71b1575 100644 --- a/src-tauri/core/src/plan/misc.rs +++ b/src-tauri/core/src/plan/misc.rs @@ -15,7 +15,10 @@ //! 5 label [5, x, y] (unten links; Kurz-Tag setzt der Aufrufer) //! 1 polygon [1, x0, y0 … x3, y3] (unsichtbares Pick-Band) //! ``` -//! Ansicht ([176]): `view_marker_sized` → `[3, 4 circle [4, cx, cy, r], 3 triangle, 1 polygon]`. +//! L-Marke ([176], `SectionMarkerStyle::LAngle`): `section_polyline_styled(.., LAngle)` → je Ende zwei kräftige Linien +//! (langer Schenkel längs der Linie nach innen, kurzer in Blickrichtung), Label, an Knicken Knickstücke; keine Linie dazwischen, +//! kein Dreieck, Pick-Band je Segment. +//! Ansicht ([176]): `view_marker_sized` → `[n, 3 triangle (flach), 5 label, 1 polygon]`, kein Kreis. //! //! ## Linienende //! `end_mark(x, y, dx, dy, art, mm, massstab)` → `[verkuerzung, n, Eintrag × n]` (leer = nichts): @@ -28,6 +31,7 @@ use crate::jsmath::hypot2; use crate::jsnum::round; +use crate::model::SectionMarkerStyle; use std::collections::HashSet; const FOOTPRINT_Z_TOL: f64 = 0.6; @@ -39,10 +43,12 @@ const SECTION_HEAD_LEN_MM: f64 = 3.5; const SECTION_HEAD_HALF_MM: f64 = 1.3; const SECTION_LABEL_MM: f64 = 3.5; const SECTION_PICK_HALF: f64 = 0.3; -/// [176] Ansichtsmarker: Kreis Ø 8 mm, Pfeilspitze 3.5 mm lang und 3.2 mm breit. -pub const VIEW_MARKER_R_MM: f64 = 4.0; -const VIEW_MARKER_TIP_MM: f64 = 3.5; -const VIEW_MARKER_HALF_MM: f64 = 1.6; +/// [176] L-Marke: langer Schenkel längs der Linie, kurzer in Blickrichtung. +const L_LONG_MM: f64 = 12.0; +const L_SHORT_MM: f64 = 6.0; +/// [176] Ansichtsmarker: flaches gefülltes Dreieck, Basis 6 mm, Höhe 3 mm in Blickrichtung. +const VIEW_MARKER_HEIGHT_MM: f64 = 3.0; +const VIEW_MARKER_HALF_MM: f64 = 3.0; const ARROW_ASPECT: f64 = 0.32; /// Ganzzahl-Schlüssel für die Quantisierung; NaN/∞ bekommen feste Platzhalter (wie ihre Textform in JS). @@ -162,6 +168,15 @@ pub fn section_line_sized(p0x: f64, p0y: f64, p1x: f64, p1y: f64, sign: f64, mm: /// Stücke (6 mm) auf beiden Seiten; Schenkel/Dreieck/Beschriftung an den Enden gehören zum ersten bzw. letzten /// Segment; je Segment ein Pick-Band. Mit zwei Punkten identisch zur geraden Linie. Segmente unter 1 µm entfallen. pub fn section_polyline_sized(pts: &[(f64, f64)], sign: f64, mm: f64, label_w: f64) -> Vec { + section_polyline_styled(pts, sign, mm, label_w, SectionMarkerStyle::Arrow) +} + +/// [176] Wie [`section_polyline_sized`] mit Markentyp: `Arrow` = bisher; `LAngle` = an jedem Ende ein L (langer Schenkel +/// 12 mm längs der Linie nach innen, kurzer 6 mm in Blickrichtung, beide kräftig), keine Linie dazwischen und kein Dreieck; +/// die Beschriftung steht waagrecht neben dem Ende des kurzen Schenkels, ausserhalb der Linie. An Knicken die +/// Knickstücke wie beim Pfeil. +pub fn section_polyline_styled(pts: &[(f64, f64)], sign: f64, mm: f64, label_w: f64, style: SectionMarkerStyle) -> Vec { + let l_angle = style == SectionMarkerStyle::LAngle; if pts.len() < 2 || !pts.iter().all(|p| p.0.is_finite() && p.1.is_finite()) || ![sign, mm, label_w].iter().all(|x| x.is_finite()) || !(mm > 0.0) { return Vec::new(); } @@ -194,12 +209,33 @@ pub fn section_polyline_sized(pts: &[(f64, f64)], sign: f64, mm: f64, label_w: f let len = hypot2(b.0 - a.0, b.1 - a.1); let ps = (if i == 0 { SECTION_END_PIECE_MM } else { SECTION_BEND_PIECE_MM } * mm).min(len / 3.0); let pe = (if i == segs - 1 { SECTION_END_PIECE_MM } else { SECTION_BEND_PIECE_MM } * mm).min(len / 3.0); + if l_angle { + // Langer Schenkel am Ende (12 mm), Knickstücke (6 mm) an den Knicken; dazwischen nichts. + let (ps, pe) = ((if i == 0 { L_LONG_MM } else { SECTION_BEND_PIECE_MM } * mm).min(len / 3.0), (if i == segs - 1 { L_LONG_MM } else { SECTION_BEND_PIECE_MM } * mm).min(len / 3.0)); + line(&mut o, &mut n, 1.0, a, (a.0 + ux * ps, a.1 + uy * ps)); + line(&mut o, &mut n, 1.0, (b.0 - ux * pe, b.1 - uy * pe), b); + continue; + } line(&mut o, &mut n, 1.0, a, (a.0 + ux * ps, a.1 + uy * ps)); line(&mut o, &mut n, 0.0, (a.0 + ux * ps, a.1 + uy * ps), (b.0 - ux * pe, b.1 - uy * pe)); line(&mut o, &mut n, 1.0, (b.0 - ux * pe, b.1 - uy * pe), b); } + if l_angle { + let short = L_SHORT_MM * mm; + for (end, (ux, uy), outward) in [(pts[0], dirs[0], -1.0), (pts[segs], dirs[segs - 1], 1.0)] { + let (bnx, bny) = (-uy * sign, ux * sign); + let tip = (end.0 + bnx * short, end.1 + bny * short); + line(&mut o, &mut n, 1.0, end, tip); + // Beschriftung neben dem Ende des kurzen Schenkels, nach aussen (längs der Linie, vom Ende weg). + let (ox, oy) = (ux * outward, uy * outward); + let reach = mm * 1.0 + ox.abs() * label_w / 2.0 + oy.abs() * label_h / 2.0; + let (cx, cy) = (tip.0 + ox * reach, tip.1 + oy * reach); + o.extend([5.0, cx - label_w / 2.0, cy - label_h / 2.0]); + n += 1; + } + } let (head_l, head_hw) = (SECTION_HEAD_LEN_MM * mm, SECTION_HEAD_HALF_MM * mm); - for (end, (ux, uy)) in [(pts[0], dirs[0]), (pts[segs], dirs[segs - 1])] { + for (end, (ux, uy)) in if l_angle { vec![] } else { vec![(pts[0], dirs[0]), (pts[segs], dirs[segs - 1])] } { let (bnx, bny) = (-uy * sign, ux * sign); let tip = (end.0 + bnx * leg, end.1 + bny * leg); line(&mut o, &mut n, 1.0, end, tip); @@ -225,12 +261,14 @@ pub fn section_polyline_sized(pts: &[(f64, f64)], sign: f64, mm: f64, label_w: f out } -/// [176] Ansichtsmarker (eigenes Symbol statt Schnittlinie): Kreis (Ø 8 mm Papier) in der Mitte der Ansichtslinie -/// `p0`–`p1`, daran ein gefülltes Dreieck in Blickrichtung (`sign` wie bei der Schnittlinie). `mm` = Modell-Meter je -/// Papier-mm. Ergebnis `[n, Eintrag × n]` mit `4 circle [4, cx, cy, r]`, `3 triangle` und `1 polygon` (Pick-Band); -/// die Bezeichnung setzt der Aufrufer. Leer bei zu kurzer Linie oder Unsinn. -pub fn view_marker_sized(p0x: f64, p0y: f64, p1x: f64, p1y: f64, sign: f64, mm: f64) -> Vec { - if ![p0x, p0y, p1x, p1y, sign, mm].iter().all(|x| x.is_finite()) || !(mm > 0.0) { +/// [176] Ansichtsmarker (eigenes Symbol statt Schnittlinie): nur ein flaches gefülltes Dreieck (Basis 6 mm, Höhe 3 mm +/// Papier) in Blickrichtung (`sign` wie bei der Schnittlinie) mit der Basis in der Mitte der Ansichtslinie `p0`–`p1`, +/// dahinter (auf der dem Blick abgewandten Seite) waagrecht die Bezeichnung (Breite `label_w`, Schrift +/// `SECTION_LABEL_MM · mm`). `mm` = Modell-Meter je Papier-mm. Ergebnis `[n, Eintrag × n]` mit `3 triangle`, +/// `5 label [5, x, y]` (unten links) und `1 polygon` (Pick-Band über Dreieck und Text). Kein Kreis, keine Linie. +/// Leer bei zu kurzer Linie oder Unsinn. +pub fn view_marker_sized(p0x: f64, p0y: f64, p1x: f64, p1y: f64, sign: f64, mm: f64, label_w: f64) -> Vec { + if ![p0x, p0y, p1x, p1y, sign, mm, label_w].iter().all(|x| x.is_finite()) || !(mm > 0.0) { return Vec::new(); } let (ax, ay) = (p1x - p0x, p1y - p0y); @@ -241,15 +279,21 @@ pub fn view_marker_sized(p0x: f64, p0y: f64, p1x: f64, p1y: f64, sign: f64, mm: let (ux, uy) = (ax / len, ay / len); let (bnx, bny) = (-uy * sign, ux * sign); let (cx, cy) = ((p0x + p1x) / 2.0, (p0y + p1y) / 2.0); - let r = VIEW_MARKER_R_MM * mm; - let (tip_l, hw) = (VIEW_MARKER_TIP_MM * mm, VIEW_MARKER_HALF_MM * mm); - let base = (cx + bnx * r, cy + bny * r); - let tip = (base.0 + bnx * tip_l, base.1 + bny * tip_l); - let mut o = vec![4.0, cx, cy, r]; - o.extend([3.0, tip.0, tip.1, base.0 + ux * hw, base.1 + uy * hw, base.0 - ux * hw, base.1 - uy * hw]); - let back = (cx - bnx * r, cy - bny * r); + let (tip_l, hw) = (VIEW_MARKER_HEIGHT_MM * mm, VIEW_MARKER_HALF_MM * mm); + let tip = (cx + bnx * tip_l, cy + bny * tip_l); + let mut o = vec![3.0, tip.0, tip.1, cx + ux * hw, cy + uy * hw, cx - ux * hw, cy - uy * hw]; + // Bezeichnung hinter der Basis (gegen die Blickrichtung): Mitte im Abstand 1 mm + halbe Kastenausdehnung. + let label_h = SECTION_LABEL_MM * mm * 0.75; + let ext = bnx.abs() * label_w / 2.0 + bny.abs() * label_h / 2.0; + let reach = mm * 1.0 + ext; + let (lx, ly) = (cx - bnx * reach, cy - bny * reach); + o.extend([5.0, lx - label_w / 2.0, ly - label_h / 2.0]); + // Pick-Band: orientiertes Rechteck von der Rückseite des Textes bis zur Spitze, breit genug für Dreieck und Text. + let back_d = reach + ext; + let half_u = hw.max(ux.abs() * label_w / 2.0 + uy.abs() * label_h / 2.0); + let back = (cx - bnx * back_d, cy - bny * back_d); o.push(1.0); - o.extend([back.0 + ux * r, back.1 + uy * r, tip.0 + ux * r, tip.1 + uy * r, tip.0 - ux * r, tip.1 - uy * r, back.0 - ux * r, back.1 - uy * r]); + o.extend([back.0 + ux * half_u, back.1 + uy * half_u, tip.0 + ux * half_u, tip.1 + uy * half_u, tip.0 - ux * half_u, tip.1 - uy * half_u, back.0 - ux * half_u, back.1 - uy * half_u]); let mut out = vec![3.0]; out.extend(o); out @@ -347,16 +391,64 @@ mod tests { assert_eq!(f[0], 10.0); } - /// [176] Ansichtsmarker: Kreis Ø 8 mm in der Linienmitte, Dreieck in Blickrichtung, kein Linienstück. + /// [176] Ansichtsmarker: nur flaches Dreieck (Basis 6 mm, Höhe 3 mm) in Blickrichtung, Bezeichnung dahinter, Pick-Band. #[test] - fn ansichtsmarker_kreis_dreieck_pick() { - let f = view_marker_sized(0.0, 0.0, 10.0, 0.0, 1.0, 0.2); + fn ansichtsmarker_dreieck_label_pick() { + let f = view_marker_sized(0.0, 0.0, 10.0, 0.0, 1.0, 0.2, 1.0); + // Dreieck, Label, Pick (kein Kreis). assert_eq!(f[0], 3.0); - assert_eq!(f[1..5], [4.0, 5.0, 0.0, 0.8]); - // Dreieck: Spitze 0.8 + 0.7 m in +y (Blickrichtung bei sign 1). - assert!((f[6] - 5.0).abs() < 1e-12 && (f[7] - 1.5).abs() < 1e-12); - assert!(view_marker_sized(0.0, 0.0, 0.0, 0.0, 1.0, 0.2).is_empty()); - assert!(view_marker_sized(f64::NAN, 0.0, 1.0, 0.0, 1.0, 0.2).is_empty()); + assert_eq!(f[1], 3.0); + // Spitze: Mitte (5, 0) + 3 mm · 0.2 in +y; Basis ± 3 mm · 0.2 längs der Linie. + let near = |x: &[f64], y: &[f64]| x.iter().zip(y).all(|(a, b)| (a - b).abs() < 1e-9); + assert!(near(&f[2..8], &[5.0, 0.6, 5.6, 0.0, 4.4, 0.0]), "{:?}", &f[2..8]); + // Label hinter der Basis (y < 0), waagrecht um x = 5 zentriert, ohne das Dreieck zu berühren. + assert_eq!(f[8], 5.0); + let label_h = 3.5 * 0.2 * 0.75; + assert!((f[9] - 4.5).abs() < 1e-9 && f[10] + 0.0 < 0.0 && f[10] + label_h <= -0.2 + 1e-9, "{:?}", &f[8..11]); + assert_eq!(f[11], 1.0); + assert!(view_marker_sized(0.0, 0.0, 0.0, 0.0, 1.0, 0.2, 1.0).is_empty()); + assert!(view_marker_sized(f64::NAN, 0.0, 1.0, 0.0, 1.0, 0.2, 1.0).is_empty()); + } + + /// [176] L-Marke: je Ende zwei kräftige Linien (12 mm längs der Linie nach innen, 6 mm in Blickrichtung), keine + /// dünne Linie, kein Dreieck; Label ausserhalb neben dem kurzen Schenkel; Pick-Band je Segment. + #[test] + fn l_marke_zwei_schenkel_je_ende_ohne_linie() { + let f = section_polyline_styled(&[(0.0, 0.0), (10.0, 0.0)], 1.0, 0.2, 1.0, SectionMarkerStyle::LAngle); + // 2 × (langer + kurzer Schenkel + Label) + 1 Pick = 7 + assert_eq!(f[0], 7.0); + let near = |x: &[f64], y: &[f64]| x.iter().zip(y).all(|(a, b)| (a - b).abs() < 1e-9); + assert!(near(&f[1..7], &[2.0, 1.0, 0.0, 0.0, 2.4, 0.0]), "lang links"); + assert!(near(&f[7..13], &[2.0, 1.0, 7.6, 0.0, 10.0, 0.0]), "lang rechts"); + assert!(near(&f[13..19], &[2.0, 1.0, 0.0, 0.0, 0.0, 1.2]), "kurz links"); + // Label links: ausserhalb (x < 0) auf Höhe des kurzen Schenkels (y ≈ 1.2). + assert_eq!(f[19], 5.0); + assert!(f[20] + 1.0 < 0.0 && (f[21] + 3.5 * 0.2 * 0.75 / 2.0 - 1.2).abs() < 1e-9, "{:?}", &f[19..22]); + // Weder dünne Linie (art 0) noch Dreieck (3). + let mut i = 1; + for _ in 0..7 { + match f[i] { + 2.0 => { + assert_eq!(f[i + 1], 1.0); + i += 6; + } + 5.0 => i += 3, + 1.0 => i += 9, + t => panic!("unerwarteter Eintrag {t}"), + } + } + // Pfeil unverändert. + assert_eq!(section_polyline_styled(&[(0.0, 0.0), (10.0, 0.0)], 1.0, 0.2, 1.0, SectionMarkerStyle::Arrow), section_line_sized(0.0, 0.0, 10.0, 0.0, 1.0, 0.2, 1.0)); + } + + /// [176] L-Marke mit Knick: Knickstücke (6 mm) bleiben, Schenkel nur an den Enden. + #[test] + fn l_marke_geknickt_behaelt_knickstuecke() { + let f = section_polyline_styled(&[(0.0, 0.0), (10.0, 0.0), (10.0, 8.0)], 1.0, 0.2, 1.0, SectionMarkerStyle::LAngle); + // 4 Endstücke/Knickstücke je Segment 2 = 4, 2 kurze Schenkel, 2 Label, 2 Pick = 10 + assert_eq!(f[0], 10.0); + let near = |x: &[f64], y: &[f64]| x.iter().zip(y).all(|(a, b)| (a - b).abs() < 1e-9); + assert!(near(&f[7..13], &[2.0, 1.0, 8.8, 0.0, 10.0, 0.0])); } /// [176] Fixe Papiergrösse: Schenkel 8 mm, Endstück 12 mm; Ansicht ohne kräftige Endstücke. diff --git a/src-tauri/core/src/plan/model_view.rs b/src-tauri/core/src/plan/model_view.rs index 8c4cdbd8..eb5d3802 100644 --- a/src-tauri/core/src/plan/model_view.rs +++ b/src-tauri/core/src/plan/model_view.rs @@ -240,6 +240,8 @@ pub struct Options { pub elevation: ElevOpts, pub floor_finish_mv: Option, pub terrain_mv: Option, + /// [176] Markentyp der Schnitte laut Modelldarstellung (die Ebene geht vor, s. [`Options::section_marker`]). + pub section_marker_mv: Option, } impl Options { @@ -255,6 +257,10 @@ impl Options { pub fn terrain(&self, level: Option) -> Option { level.or(self.terrain_mv) } + /// [176] Schnittmarke: Ebene > Modelldarstellung > Pfeil. + pub fn section_marker(&self, level: Option) -> SectionMarkerStyle { + level.filter(|s| *s != SectionMarkerStyle::Unknown).or(self.section_marker_mv).unwrap_or(SectionMarkerStyle::Arrow) + } /// Schlagschatten der Ansicht: Ebene > Modelldarstellung > aus. pub fn shadows(&self, level: Option) -> bool { level.or(self.elevation.shadows_mv).unwrap_or(false) @@ -395,6 +401,7 @@ pub fn resolve(mv: Option<&ModelViewOption>, detail: Detail, scale: f64) -> Opti elevation: ElevOpts { shadows_mv: el.and_then(|e| e.shadows), material_hatch: el.and_then(|e| e.material_hatch).unwrap_or(true) }, floor_finish_mv: mv.and_then(|m| m.slabs.as_ref()).and_then(|s| s.floor_finish).filter(|f| *f != FloorFinishDisplay::Unknown), terrain_mv: mv.and_then(|m| m.site.as_ref()).and_then(|s| s.terrain), + section_marker_mv: mv.and_then(|m| m.section_marks.as_ref()).and_then(|s| s.style).filter(|s| *s != SectionMarkerStyle::Unknown), } } diff --git a/src/cli/__golden__/grundriss-eg.svg b/src/cli/__golden__/grundriss-eg.svg index 7614aae9..985f0e95 100644 --- a/src/cli/__golden__/grundriss-eg.svg +++ b/src/cli/__golden__/grundriss-eg.svg @@ -1,6 +1,6 @@ - - + + @@ -44,11 +44,9 @@ - - - - -Süd + +Süd + A A diff --git a/src/i18n/de.ts b/src/i18n/de.ts index ef534858..11653e18 100644 --- a/src/i18n/de.ts +++ b/src/i18n/de.ts @@ -1189,6 +1189,7 @@ export const de = { "resources.modelViews.section.site": "Gelände", "resources.modelViews.section.roofs": "Dächer", "resources.modelViews.section.columns": "Stützen", + "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", @@ -1234,6 +1235,11 @@ export const de = { "resources.modelViews.opt.walls.reveals": "Schichteinzug", "resources.modelViews.opt.walls.cutHatch": "Schnittflächen ab 1:100 schraffiert", "resources.modelViews.opt.slabs.floorFinish": "Bodenbelag", + "resources.modelViews.opt.sectionMarks.style": "Markentyp der Schnitte", + "resources.modelViews.val.arrow": "Pfeil", + "resources.modelViews.val.lAngle": "Nur L", + "objinfo.sectionLine.marker": "Schnittmarke", + "objinfo.sectionLine.marker.model": "wie Modelldarstellung", "resources.modelViews.opt.site.terrain": "Gelände im Grundriss", "resources.modelViews.val.gestrichelt": "gestrichelt", "resources.modelViews.val.punktiert": "punktiert", diff --git a/src/i18n/en.ts b/src/i18n/en.ts index b12b5de6..73326351 100644 --- a/src/i18n/en.ts +++ b/src/i18n/en.ts @@ -1183,6 +1183,7 @@ export const en: Record = { "resources.modelViews.section.site": "Site", "resources.modelViews.section.roofs": "Roofs", "resources.modelViews.section.columns": "Columns", + "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", @@ -1228,6 +1229,11 @@ export const en: Record = { "resources.modelViews.opt.walls.reveals": "Layer reveal", "resources.modelViews.opt.walls.cutHatch": "Hatch cut faces from 1:100", "resources.modelViews.opt.slabs.floorFinish": "Floor finish", + "resources.modelViews.opt.sectionMarks.style": "Section marker type", + "resources.modelViews.val.arrow": "Arrow", + "resources.modelViews.val.lAngle": "L only", + "objinfo.sectionLine.marker": "Section marker", + "objinfo.sectionLine.marker.model": "as model view", "resources.modelViews.opt.site.terrain": "Terrain in plan", "resources.modelViews.val.gestrichelt": "dashed", "resources.modelViews.val.punktiert": "dotted", diff --git a/src/model/types.generated.ts b/src/model/types.generated.ts index b0aa813c..23e1dda3 100644 --- a/src/model/types.generated.ts +++ b/src/model/types.generated.ts @@ -1100,6 +1100,11 @@ export type DrawingLevel = { * folgt weiter der Verbindung der Endpunkte. */ bendPoints?: Array; + /** + * [176] Schnittmarke im Grundriss: "arrow" (Pfeil mit Dreieck, Basis) oder "lAngle" (nur ein L je Ende). Fehlt ⇒ die + * Vorgabe der Modelldarstellung (`sectionMarks.style`), sonst Pfeil. Nur Schnitt. + */ + markerStyle?: SectionMarkerStyle; /** Blickrichtung relativ zur Schnittlinie (nur Schnitt/Ansicht). */ directionSign?: 1 | -1; /** @@ -2051,6 +2056,8 @@ export type ModelViewOption = { columns?: ModelViewColumns; /** [173] Ansicht (Fassade). */ elevation?: ModelViewElevation; + /** [176] Schnittmarken im Grundriss. */ + sectionMarks?: ModelViewSectionMarks; }; /** [173] Dächer in der Modelldarstellung (fehlt ⇒ wie Basis). */ @@ -2063,6 +2070,12 @@ export type ModelViewRoofs = { viewHatch?: boolean; }; +/** [176] Schnittmarken in der Modelldarstellung (fehlt ⇒ Pfeil). */ +export type ModelViewSectionMarks = { + /** Markentyp der Schnitte (die Ebene geht vor; Basis: Pfeil). */ + style?: SectionMarkerStyle; +}; + /** [173] Gelände in der Modelldarstellung. */ export type ModelViewSite = { /** Gelände, Höhenlinien und Baugruben im Grundriss (die Ebene geht vor; Basis: automatisch). */ @@ -3193,6 +3206,12 @@ export type SashDef = { hingeSide?: "left" | "right"; }; +/** + * [176] Markentyp einer Schnittlinie im Grundriss: Pfeil (kräftige Endstücke, dünne Linie, Schenkel mit Dreieck) + * oder nur ein L an jedem Ende (langer Schenkel längs der Linie, kurzer in Blickrichtung, keine Linie dazwischen). + */ +export type SectionMarkerStyle = "arrow" | "lAngle"; + /** * Sequenz-Regel: fasst mehrere Unterregeln zusammen und wendet sie geordnet an. * Jede Unterregel kann die Ausgabe der vorherigen verfeinern. diff --git a/src/panels/objectInfo/SectionLineSection.tsx b/src/panels/objectInfo/SectionLineSection.tsx index aa57a4cc..5f2a4e0d 100644 --- a/src/panels/objectInfo/SectionLineSection.tsx +++ b/src/panels/objectInfo/SectionLineSection.tsx @@ -127,6 +127,24 @@ export function SectionLineSection({ /> + {/* [176] Schnittmarke im Grundriss: leer = Vorgabe der Modelldarstellung (sonst Pfeil). */} + {level.kind === "section" && ( +
+ {t("objinfo.sectionLine.marker")} + host.onSetSectionLinePatch({ markerStyle: v === "arrow" || v === "lAngle" ? v : undefined })} + options={[ + { value: "", label: t("objinfo.sectionLine.marker.model") }, + { value: "arrow", label: t("resources.modelViews.val.arrow") }, + { value: "lAngle", label: t("resources.modelViews.val.lAngle") }, + ]} + title={t("objinfo.sectionLine.marker")} + width={150} + /> +
+ )} + {/* Verdeckte Kanten (gestrichelt) — Default aus (blasses Liniengewirr). */}
{t("objinfo.sectionLine.hiddenLines")} diff --git a/src/plan/__golden__/komplex-grundriss-dg-100.txt b/src/plan/__golden__/komplex-grundriss-dg-100.txt index 7a692e82..64034d3f 100644 --- a/src/plan/__golden__/komplex-grundriss-dg-100.txt +++ b/src/plan/__golden__/komplex-grundriss-dg-100.txt @@ -1,13 +1,12 @@ -viewBox -12.82 0 37.603 33.301 -bytes 21028 +viewBox -13.448 0 38.615 33.813 +bytes 19897 circle 14 g 1 line 63 -path 8 polygon 29 polyline 14 rect 1 svg 1 -text 32 -tspan 9 -hash bcc413923d65ce13 +text 31 +tspan 8 +hash 9d4b051d4643a275 diff --git a/src/plan/__golden__/komplex-grundriss-dg-50.txt b/src/plan/__golden__/komplex-grundriss-dg-50.txt index eb7902db..93a825c4 100644 --- a/src/plan/__golden__/komplex-grundriss-dg-50.txt +++ b/src/plan/__golden__/komplex-grundriss-dg-50.txt @@ -1,13 +1,12 @@ -viewBox -12.66 0 37.302 33.15 -bytes 318905 +viewBox -12.974 0 37.808 33.406 +bytes 318165 circle 14 g 1 line 3212 -path 8 polygon 75 polyline 72 rect 1 svg 1 text 32 tspan 9 -hash 962593263cd8229b +hash f65e632e02bea427 diff --git a/src/plan/__golden__/komplex-grundriss-eg-100.txt b/src/plan/__golden__/komplex-grundriss-eg-100.txt index 6913e2eb..6c078911 100644 --- a/src/plan/__golden__/komplex-grundriss-eg-100.txt +++ b/src/plan/__golden__/komplex-grundriss-eg-100.txt @@ -1,13 +1,13 @@ viewBox -41.5 0 95 63.6 -bytes 66253 +bytes 65478 circle 16 g 1 line 143 -path 43 +path 35 polygon 87 polyline 107 rect 1 svg 1 text 115 tspan 24 -hash 961b2149a53df82f +hash 15578d089b60bf60 diff --git a/src/plan/__golden__/komplex-grundriss-eg-50.txt b/src/plan/__golden__/komplex-grundriss-eg-50.txt index 73762f1f..ec1af8ee 100644 --- a/src/plan/__golden__/komplex-grundriss-eg-50.txt +++ b/src/plan/__golden__/komplex-grundriss-eg-50.txt @@ -1,13 +1,13 @@ viewBox -41.5 0 95 63.6 -bytes 107944 +bytes 107202 circle 16 g 1 line 371 -path 74 +path 66 polygon 208 polyline 125 rect 1 svg 1 text 115 tspan 24 -hash f09efcc05ba05e8f +hash 79e3b4ca1a64e95a diff --git a/src/plan/__golden__/komplex-grundriss-og-100.txt b/src/plan/__golden__/komplex-grundriss-og-100.txt index de69b655..742b9240 100644 --- a/src/plan/__golden__/komplex-grundriss-og-100.txt +++ b/src/plan/__golden__/komplex-grundriss-og-100.txt @@ -1,13 +1,13 @@ -viewBox -12.82 0 37.603 33.301 -bytes 45958 +viewBox -13.448 0 38.615 33.813 +bytes 44888 circle 14 g 1 line 113 -path 17 +path 9 polygon 52 polyline 98 rect 1 svg 1 text 86 tspan 19 -hash 49796bdd700d403b +hash 63a214a67a23917f diff --git a/src/plan/__golden__/komplex-grundriss-og-50.txt b/src/plan/__golden__/komplex-grundriss-og-50.txt index aa0a0842..ba98db10 100644 --- a/src/plan/__golden__/komplex-grundriss-og-50.txt +++ b/src/plan/__golden__/komplex-grundriss-og-50.txt @@ -1,13 +1,13 @@ -viewBox -12.66 0 37.302 33.15 -bytes 354423 +viewBox -12.974 0 37.808 33.406 +bytes 353699 circle 14 g 1 line 3256 -path 45 +path 37 polygon 152 polyline 167 rect 1 svg 1 text 85 tspan 18 -hash fb10aaccb7719cff +hash 02d3fdb73b319310 diff --git a/src/plan/__golden__/komplex-grundriss-ug-100.txt b/src/plan/__golden__/komplex-grundriss-ug-100.txt index b355bb79..61f636bc 100644 --- a/src/plan/__golden__/komplex-grundriss-ug-100.txt +++ b/src/plan/__golden__/komplex-grundriss-ug-100.txt @@ -1,13 +1,13 @@ -viewBox -12.82 0 37.603 33.301 -bytes 39254 +viewBox -13.448 0 38.615 33.813 +bytes 38285 circle 15 g 1 line 91 -path 31 +path 23 polygon 43 polyline 64 rect 1 svg 1 text 70 tspan 15 -hash e6296781b3b2420d +hash 04304c2c1d1feb26 diff --git a/src/plan/__golden__/komplex-grundriss-ug-50.txt b/src/plan/__golden__/komplex-grundriss-ug-50.txt index a02018a5..b9c19e6b 100644 --- a/src/plan/__golden__/komplex-grundriss-ug-50.txt +++ b/src/plan/__golden__/komplex-grundriss-ug-50.txt @@ -1,13 +1,13 @@ -viewBox -12.66 0 37.302 33.15 -bytes 45035 +viewBox -12.974 0 37.808 33.406 +bytes 44206 circle 15 g 1 line 87 -path 46 +path 38 polygon 78 polyline 71 rect 1 svg 1 text 70 tspan 15 -hash 5f24df35a8494c7f +hash 9cc8b4d9e5563c5a diff --git a/src/plan/__golden__/muster-grundriss-eg-100.txt b/src/plan/__golden__/muster-grundriss-eg-100.txt index 8dd7982e..be23414b 100644 --- a/src/plan/__golden__/muster-grundriss-eg-100.txt +++ b/src/plan/__golden__/muster-grundriss-eg-100.txt @@ -1,12 +1,11 @@ -viewBox -1.621 0 8.242 7.303 -bytes 6007 +viewBox -1.621 0 8.242 7.535 +bytes 5819 g 1 line 19 -path 2 polygon 19 polyline 4 rect 1 svg 1 text 5 tspan 2 -hash 8d6d9e4463465000 +hash 02c76630347cfb6b diff --git a/src/plan/__golden__/muster-grundriss-eg-50.txt b/src/plan/__golden__/muster-grundriss-eg-50.txt index bc7782f0..d0b0b79d 100644 --- a/src/plan/__golden__/muster-grundriss-eg-50.txt +++ b/src/plan/__golden__/muster-grundriss-eg-50.txt @@ -1,12 +1,11 @@ -viewBox -1.56 0 8.121 7.238 -bytes 9425 +viewBox -1.56 0 8.121 7.354 +bytes 9241 g 1 line 20 -path 2 polygon 46 polyline 8 rect 1 svg 1 text 5 tspan 2 -hash 465465525671b296 +hash bf901e6810ddf2e2 diff --git a/src/plan/__golden__/muster-grundriss-og-100.txt b/src/plan/__golden__/muster-grundriss-og-100.txt index b0c29ed5..da242a63 100644 --- a/src/plan/__golden__/muster-grundriss-og-100.txt +++ b/src/plan/__golden__/muster-grundriss-og-100.txt @@ -1,11 +1,10 @@ -viewBox -1.621 0 8.242 7.53 -bytes 2843 +viewBox -1.621 0 8.242 7.763 +bytes 2669 g 1 line 2 -path 2 polygon 12 polyline 3 rect 1 svg 1 text 3 -hash f243af6d8f088bb7 +hash d0fc9efc7b012bf2 diff --git a/src/plan/__golden__/muster-grundriss-og-50.txt b/src/plan/__golden__/muster-grundriss-og-50.txt index 9ba24626..47e82c13 100644 --- a/src/plan/__golden__/muster-grundriss-og-50.txt +++ b/src/plan/__golden__/muster-grundriss-og-50.txt @@ -1,11 +1,10 @@ -viewBox -1.56 0 8.121 7.465 -bytes 4727 +viewBox -1.56 0 8.121 7.581 +bytes 4552 g 1 line 2 -path 2 polygon 29 polyline 3 rect 1 svg 1 text 3 -hash bee2ad69ea28de30 +hash db41c17fef99a859 diff --git a/src/state/modelViews.ts b/src/state/modelViews.ts index b30aac65..f7e7f763 100644 --- a/src/state/modelViews.ts +++ b/src/state/modelViews.ts @@ -21,7 +21,7 @@ export function isBuiltinModelView(id: string | undefined | null): id is DetailL } /** Abschnitte je Bauteilart. */ -export type ModelViewSection = "doors" | "windows" | "stairs" | "walls" | "slabs" | "roofs" | "columns" | "elevation" | "site"; +export type ModelViewSection = "doors" | "windows" | "stairs" | "walls" | "slabs" | "roofs" | "columns" | "elevation" | "site" | "sectionMarks"; /** Ein Eintrag der Auswahl (Werkzeugleiste, Vorlage): eingebaute Stufen zuerst, dann die eigenen. */ export interface ModelViewChoice { @@ -180,6 +180,7 @@ export const MODEL_VIEW_FIELDS: readonly ModelViewField[] = [ { section: "elevation", key: "shadows", values: "bool" }, { section: "elevation", key: "materialHatch", values: "bool" }, { section: "site", key: "terrain", values: "bool" }, + { section: "sectionMarks", key: "style", values: ["arrow", "lAngle"] }, ]; /** Auswahlwert eines Feldes als Text (`""` = wie Basis); Gegenstück: {@link parseFieldValue}. */ diff --git a/src/ui/resourceManager/ModelViewsTab.tsx b/src/ui/resourceManager/ModelViewsTab.tsx index d43f6312..4b1a64c2 100644 --- a/src/ui/resourceManager/ModelViewsTab.tsx +++ b/src/ui/resourceManager/ModelViewsTab.tsx @@ -31,7 +31,7 @@ export interface ModelViewHandlers { onSetModelViewOption?: (id: string, section: ModelViewSection, key: string, value: string | number | boolean | null) => void; } -const SECTIONS: ModelViewSection[] = ["doors", "windows", "stairs", "walls", "slabs", "roofs", "columns", "elevation", "site"]; +const SECTIONS: ModelViewSection[] = ["doors", "windows", "stairs", "walls", "slabs", "roofs", "columns", "elevation", "site", "sectionMarks"]; /** Anzeige eines Auswahlwerts (Zahlen mit Einheit, Rest übersetzt). */ function valueLabel(f: ModelViewField, v: string | number): string {