Merge branch 'worktree-agent-a21866b6be5474deb' into claude/practical-noether-1hb2s1
# Conflicts: # TODO.md # src/plan/__golden__/komplex-grundriss-dg-100.txt # src/plan/__golden__/komplex-grundriss-dg-50.txt # src/plan/__golden__/komplex-grundriss-eg-100.txt # src/plan/__golden__/komplex-grundriss-eg-50.txt # src/plan/__golden__/komplex-grundriss-og-100.txt # src/plan/__golden__/komplex-grundriss-og-50.txt # src/plan/__golden__/komplex-grundriss-ug-100.txt # src/plan/__golden__/komplex-grundriss-ug-50.txt # src/plan/__golden__/muster-grundriss-eg-100.txt # src/plan/__golden__/muster-grundriss-eg-50.txt
This commit is contained in:
24 files changed
+341
-158
No files matched your search
@@ -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
|
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,
|
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.
|
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
|
Rest (10.11.): Ansichtsmarker als eigenes Symbol (nur flaches gefülltes Dreieck, Basis 6 mm, Höhe 3 mm in Blickrichtung, Bezeichnung
|
||||||
im Kreis, `misc.rs` `view_marker_sized`, keine Linie mehr); Modell `DrawingLevel.bendPoints` (optional, Knickpunkte zwischen
|
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
|
`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
|
(`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
|
(`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
|
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
|
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
|
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,
|
- ◐ **[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,
|
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
|
`sun::shadow_polygons_plan_in`); Flächenzeile nach Rundungsschritt („16.0 m²“ statt „16 m²“); Schnitt genau am Rand
|
||||||
|
|||||||
@@ -1847,6 +1847,11 @@ pub struct DrawingLevel {
|
|||||||
#[serde(rename = "bendPoints", default, skip_serializing_if = "Option::is_none")]
|
#[serde(rename = "bendPoints", default, skip_serializing_if = "Option::is_none")]
|
||||||
#[ts(optional)]
|
#[ts(optional)]
|
||||||
pub bend_points: Option<Vec<Vec2>>,
|
pub bend_points: Option<Vec<Vec2>>,
|
||||||
|
/// [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<SectionMarkerStyle>,
|
||||||
/// Blickrichtung relativ zur Schnittlinie (nur Schnitt/Ansicht).
|
/// Blickrichtung relativ zur Schnittlinie (nur Schnitt/Ansicht).
|
||||||
#[serde(rename = "directionSign", default, skip_serializing_if = "Option::is_none")]
|
#[serde(rename = "directionSign", default, skip_serializing_if = "Option::is_none")]
|
||||||
#[ts(optional, type = "1 | -1")]
|
#[ts(optional, type = "1 | -1")]
|
||||||
@@ -2076,11 +2081,42 @@ pub struct ModelViewOption {
|
|||||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||||
#[ts(optional)]
|
#[ts(optional)]
|
||||||
pub elevation: Option<ModelViewElevation>,
|
pub elevation: Option<ModelViewElevation>,
|
||||||
|
/// [176] Schnittmarken im Grundriss.
|
||||||
|
#[serde(rename = "sectionMarks", default, skip_serializing_if = "Option::is_none")]
|
||||||
|
#[ts(optional)]
|
||||||
|
pub section_marks: Option<ModelViewSectionMarks>,
|
||||||
#[serde(flatten)]
|
#[serde(flatten)]
|
||||||
#[ts(skip)]
|
#[ts(skip)]
|
||||||
pub extra: Extra,
|
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<SectionMarkerStyle>,
|
||||||
|
#[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).
|
/// [173] Türen in der Modelldarstellung (fehlt ⇒ wie Basis).
|
||||||
#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize, TS)]
|
#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize, TS)]
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
|
|||||||
@@ -20,8 +20,6 @@ const SECTION_LINE_MARK_MM: f64 = 0.5;
|
|||||||
const SECTION_LINE_DASH: [f64; 4] = super::line_pattern::SECTION_LINE;
|
const SECTION_LINE_DASH: [f64; 4] = super::line_pattern::SECTION_LINE;
|
||||||
/// [176] Beschriftungshöhe in Papier-mm (Modell-Meter = mm · Massstab/1000).
|
/// [176] Beschriftungshöhe in Papier-mm (Modell-Meter = mm · Massstab/1000).
|
||||||
const SECTION_LABEL_MM: f64 = 3.5;
|
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 {
|
fn v2(x: f64, y: f64) -> Vec2 {
|
||||||
Vec2 { x, y }
|
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
|
/// [176] Ansichtsmarker als eigenes Symbol: nur ein flaches gefülltes Dreieck in Blickrichtung (kein Kreis, keine Linie),
|
||||||
/// Dreieck in Blickrichtung, Bezeichnung waagrecht im Kreis (verkleinert, wenn nötig) bzw. rechts daneben; Pick-Band
|
/// die Bezeichnung waagrecht dahinter (auf der dem Blick abgewandten Seite); Pick-Band über Dreieck und Text.
|
||||||
/// über dem ganzen Symbol. Keine durchgehende Linie.
|
|
||||||
#[allow(clippy::too_many_arguments)]
|
#[allow(clippy::too_many_arguments)]
|
||||||
fn view_marker(c: &Ctx, level: &DrawingLevel, p0: Vec2, p1: Vec2, sign: f64, k: f64, tag: &str, greyed: Option<bool>, obst: &mut super::stamp_place::Obstacles, out: &mut Vec<Primitive>) {
|
fn view_marker(c: &Ctx, level: &DrawingLevel, p0: Vec2, p1: Vec2, sign: f64, k: f64, tag: &str, greyed: Option<bool>, obst: &mut super::stamp_place::Obstacles, out: &mut Vec<Primitive>) {
|
||||||
let _ = c;
|
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() {
|
if f.is_empty() {
|
||||||
return;
|
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 {
|
for _ in 0..f[0] as usize {
|
||||||
if f[i] == 4.0 {
|
if f[i] == 3.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 {
|
|
||||||
let pts: Vec<Vec2> = (0..3).map(|j| v2(f[i + 1 + 2 * j], f[i + 2 + 2 * j])).collect();
|
let pts: Vec<Vec2> = (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();
|
let ring: Vec<[f64; 2]> = pts.iter().map(|q| [q.x, q.y]).collect();
|
||||||
obst.area(ring);
|
obst.area(ring);
|
||||||
@@ -877,41 +854,33 @@ fn view_marker(c: &Ctx, level: &DrawingLevel, p0: Vec2, p1: Vec2, sign: f64, k:
|
|||||||
}
|
}
|
||||||
out.push(tri);
|
out.push(tri);
|
||||||
i += 7;
|
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 {
|
} else {
|
||||||
let pts = (0..4).map(|j| v2(f[i + 1 + 2 * j], f[i + 2 + 2 * j])).collect();
|
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)));
|
out.push(pick_band(pts, None, Some(&level.id)));
|
||||||
i += 9;
|
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`).
|
/// Schnittführungs-Symbole aller Schnitt-/Ansichtsebenen mit Linie (`addSectionLines`).
|
||||||
@@ -948,7 +917,7 @@ pub fn plan_section_lines(c: &Ctx, out: &mut Vec<Primitive>) {
|
|||||||
let mut path: Vec<(f64, f64)> = vec![(p0.x, p0.y)];
|
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.extend(level.bend_points.iter().flatten().map(|q| (q.x, q.y)));
|
||||||
path.push((p1.x, p1.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() {
|
if f.is_empty() {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -1169,10 +1138,10 @@ mod tests {
|
|||||||
assert!(d.bounds.is_some_and(|b| b[3] >= top - 1e-9), "{:?} < {top}", d.bounds);
|
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,
|
/// [176] Ansichtsmarker: nur flaches gefülltes Dreieck (Basis 6 mm, Höhe 3 mm) in Blickrichtung, Bezeichnung waagrecht
|
||||||
/// keine durchgehende Linie; Pick-Band trägt die Ebenen-ID.
|
/// dahinter (gegen den Blick), kein Kreis, keine Linie; Pick-Band trägt die Ebenen-ID.
|
||||||
#[test]
|
#[test]
|
||||||
fn ansichtsmarker_ist_kreis_mit_pfeil_und_bezeichnung() {
|
fn ansichtsmarker_ist_dreieck_mit_bezeichnung() {
|
||||||
let p = Project {
|
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,
|
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()],
|
"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 a = super::super::domains::PlanArgs::parse(1.0, r#"{"show": ["90"], "scale": 100, "global": true}"#).unwrap();
|
||||||
let mut out = Vec::new();
|
let mut out = Vec::new();
|
||||||
plan_section_lines(&Ctx::new(&p, &a), &mut out);
|
plan_section_lines(&Ctx::new(&p, &a), &mut out);
|
||||||
assert!(!out.iter().any(|q| matches!(q, Primitive::Line { .. })), "keine Linie");
|
assert!(!out.iter().any(|q| matches!(q, Primitive::Line { .. } | Primitive::Arc { .. })), "keine Linie, kein Kreis");
|
||||||
let arcs: Vec<f64> = 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]);
|
|
||||||
let tri = out.iter().find_map(|q| match q { Primitive::Polygon { pts, fill, .. } if fill != "none" => Some(pts.clone()), _ => None }).unwrap();
|
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.
|
// 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.4, "{tri:?}");
|
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")));
|
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();
|
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");
|
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;
|
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
|
/// [176] Geknickter Schnitt: Knickpunkte aus `bendPoints` erscheinen als kräftige Stücke im Grundriss; ohne
|
||||||
|
|||||||
+120
-28
@@ -15,7 +15,10 @@
|
|||||||
//! 5 label [5, x, y] (unten links; Kurz-Tag setzt der Aufrufer)
|
//! 5 label [5, x, y] (unten links; Kurz-Tag setzt der Aufrufer)
|
||||||
//! 1 polygon [1, x0, y0 … x3, y3] (unsichtbares Pick-Band)
|
//! 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
|
//! ## Linienende
|
||||||
//! `end_mark(x, y, dx, dy, art, mm, massstab)` → `[verkuerzung, n, Eintrag × n]` (leer = nichts):
|
//! `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::jsmath::hypot2;
|
||||||
use crate::jsnum::round;
|
use crate::jsnum::round;
|
||||||
|
use crate::model::SectionMarkerStyle;
|
||||||
use std::collections::HashSet;
|
use std::collections::HashSet;
|
||||||
|
|
||||||
const FOOTPRINT_Z_TOL: f64 = 0.6;
|
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_HEAD_HALF_MM: f64 = 1.3;
|
||||||
const SECTION_LABEL_MM: f64 = 3.5;
|
const SECTION_LABEL_MM: f64 = 3.5;
|
||||||
const SECTION_PICK_HALF: f64 = 0.3;
|
const SECTION_PICK_HALF: f64 = 0.3;
|
||||||
/// [176] Ansichtsmarker: Kreis Ø 8 mm, Pfeilspitze 3.5 mm lang und 3.2 mm breit.
|
/// [176] L-Marke: langer Schenkel längs der Linie, kurzer in Blickrichtung.
|
||||||
pub const VIEW_MARKER_R_MM: f64 = 4.0;
|
const L_LONG_MM: f64 = 12.0;
|
||||||
const VIEW_MARKER_TIP_MM: f64 = 3.5;
|
const L_SHORT_MM: f64 = 6.0;
|
||||||
const VIEW_MARKER_HALF_MM: f64 = 1.6;
|
/// [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;
|
const ARROW_ASPECT: f64 = 0.32;
|
||||||
|
|
||||||
/// Ganzzahl-Schlüssel für die Quantisierung; NaN/∞ bekommen feste Platzhalter (wie ihre Textform in JS).
|
/// 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
|
/// 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.
|
/// 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<f64> {
|
pub fn section_polyline_sized(pts: &[(f64, f64)], sign: f64, mm: f64, label_w: f64) -> Vec<f64> {
|
||||||
|
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<f64> {
|
||||||
|
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) {
|
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();
|
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 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 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);
|
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, 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, 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);
|
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);
|
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 (bnx, bny) = (-uy * sign, ux * sign);
|
||||||
let tip = (end.0 + bnx * leg, end.1 + bny * leg);
|
let tip = (end.0 + bnx * leg, end.1 + bny * leg);
|
||||||
line(&mut o, &mut n, 1.0, end, tip);
|
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
|
out
|
||||||
}
|
}
|
||||||
|
|
||||||
/// [176] Ansichtsmarker (eigenes Symbol statt Schnittlinie): Kreis (Ø 8 mm Papier) in der Mitte der Ansichtslinie
|
/// [176] Ansichtsmarker (eigenes Symbol statt Schnittlinie): nur ein flaches gefülltes Dreieck (Basis 6 mm, Höhe 3 mm
|
||||||
/// `p0`–`p1`, daran ein gefülltes Dreieck in Blickrichtung (`sign` wie bei der Schnittlinie). `mm` = Modell-Meter je
|
/// Papier) in Blickrichtung (`sign` wie bei der Schnittlinie) mit der Basis in der Mitte der Ansichtslinie `p0`–`p1`,
|
||||||
/// Papier-mm. Ergebnis `[n, Eintrag × n]` mit `4 circle [4, cx, cy, r]`, `3 triangle` und `1 polygon` (Pick-Band);
|
/// dahinter (auf der dem Blick abgewandten Seite) waagrecht die Bezeichnung (Breite `label_w`, Schrift
|
||||||
/// die Bezeichnung setzt der Aufrufer. Leer bei zu kurzer Linie oder Unsinn.
|
/// `SECTION_LABEL_MM · mm`). `mm` = Modell-Meter je Papier-mm. Ergebnis `[n, Eintrag × n]` mit `3 triangle`,
|
||||||
pub fn view_marker_sized(p0x: f64, p0y: f64, p1x: f64, p1y: f64, sign: f64, mm: f64) -> Vec<f64> {
|
/// `5 label [5, x, y]` (unten links) und `1 polygon` (Pick-Band über Dreieck und Text). Kein Kreis, keine Linie.
|
||||||
if ![p0x, p0y, p1x, p1y, sign, mm].iter().all(|x| x.is_finite()) || !(mm > 0.0) {
|
/// 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<f64> {
|
||||||
|
if ![p0x, p0y, p1x, p1y, sign, mm, label_w].iter().all(|x| x.is_finite()) || !(mm > 0.0) {
|
||||||
return Vec::new();
|
return Vec::new();
|
||||||
}
|
}
|
||||||
let (ax, ay) = (p1x - p0x, p1y - p0y);
|
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 (ux, uy) = (ax / len, ay / len);
|
||||||
let (bnx, bny) = (-uy * sign, ux * sign);
|
let (bnx, bny) = (-uy * sign, ux * sign);
|
||||||
let (cx, cy) = ((p0x + p1x) / 2.0, (p0y + p1y) / 2.0);
|
let (cx, cy) = ((p0x + p1x) / 2.0, (p0y + p1y) / 2.0);
|
||||||
let r = VIEW_MARKER_R_MM * mm;
|
let (tip_l, hw) = (VIEW_MARKER_HEIGHT_MM * mm, VIEW_MARKER_HALF_MM * mm);
|
||||||
let (tip_l, hw) = (VIEW_MARKER_TIP_MM * mm, VIEW_MARKER_HALF_MM * mm);
|
let tip = (cx + bnx * tip_l, cy + bny * tip_l);
|
||||||
let base = (cx + bnx * r, cy + bny * r);
|
let mut o = vec![3.0, tip.0, tip.1, cx + ux * hw, cy + uy * hw, cx - ux * hw, cy - uy * hw];
|
||||||
let tip = (base.0 + bnx * tip_l, base.1 + bny * tip_l);
|
// Bezeichnung hinter der Basis (gegen die Blickrichtung): Mitte im Abstand 1 mm + halbe Kastenausdehnung.
|
||||||
let mut o = vec![4.0, cx, cy, r];
|
let label_h = SECTION_LABEL_MM * mm * 0.75;
|
||||||
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 ext = bnx.abs() * label_w / 2.0 + bny.abs() * label_h / 2.0;
|
||||||
let back = (cx - bnx * r, cy - bny * r);
|
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.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];
|
let mut out = vec![3.0];
|
||||||
out.extend(o);
|
out.extend(o);
|
||||||
out
|
out
|
||||||
@@ -347,16 +391,64 @@ mod tests {
|
|||||||
assert_eq!(f[0], 10.0);
|
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]
|
#[test]
|
||||||
fn ansichtsmarker_kreis_dreieck_pick() {
|
fn ansichtsmarker_dreieck_label_pick() {
|
||||||
let f = view_marker_sized(0.0, 0.0, 10.0, 0.0, 1.0, 0.2);
|
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[0], 3.0);
|
||||||
assert_eq!(f[1..5], [4.0, 5.0, 0.0, 0.8]);
|
assert_eq!(f[1], 3.0);
|
||||||
// Dreieck: Spitze 0.8 + 0.7 m in +y (Blickrichtung bei sign 1).
|
// Spitze: Mitte (5, 0) + 3 mm · 0.2 in +y; Basis ± 3 mm · 0.2 längs der Linie.
|
||||||
assert!((f[6] - 5.0).abs() < 1e-12 && (f[7] - 1.5).abs() < 1e-12);
|
let near = |x: &[f64], y: &[f64]| x.iter().zip(y).all(|(a, b)| (a - b).abs() < 1e-9);
|
||||||
assert!(view_marker_sized(0.0, 0.0, 0.0, 0.0, 1.0, 0.2).is_empty());
|
assert!(near(&f[2..8], &[5.0, 0.6, 5.6, 0.0, 4.4, 0.0]), "{:?}", &f[2..8]);
|
||||||
assert!(view_marker_sized(f64::NAN, 0.0, 1.0, 0.0, 1.0, 0.2).is_empty());
|
// 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.
|
/// [176] Fixe Papiergrösse: Schenkel 8 mm, Endstück 12 mm; Ansicht ohne kräftige Endstücke.
|
||||||
|
|||||||
@@ -240,6 +240,8 @@ pub struct Options {
|
|||||||
pub elevation: ElevOpts,
|
pub elevation: ElevOpts,
|
||||||
pub floor_finish_mv: Option<FloorFinishDisplay>,
|
pub floor_finish_mv: Option<FloorFinishDisplay>,
|
||||||
pub terrain_mv: Option<bool>,
|
pub terrain_mv: Option<bool>,
|
||||||
|
/// [176] Markentyp der Schnitte laut Modelldarstellung (die Ebene geht vor, s. [`Options::section_marker`]).
|
||||||
|
pub section_marker_mv: Option<SectionMarkerStyle>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Options {
|
impl Options {
|
||||||
@@ -255,6 +257,10 @@ impl Options {
|
|||||||
pub fn terrain(&self, level: Option<bool>) -> Option<bool> {
|
pub fn terrain(&self, level: Option<bool>) -> Option<bool> {
|
||||||
level.or(self.terrain_mv)
|
level.or(self.terrain_mv)
|
||||||
}
|
}
|
||||||
|
/// [176] Schnittmarke: Ebene > Modelldarstellung > Pfeil.
|
||||||
|
pub fn section_marker(&self, level: Option<SectionMarkerStyle>) -> SectionMarkerStyle {
|
||||||
|
level.filter(|s| *s != SectionMarkerStyle::Unknown).or(self.section_marker_mv).unwrap_or(SectionMarkerStyle::Arrow)
|
||||||
|
}
|
||||||
/// Schlagschatten der Ansicht: Ebene > Modelldarstellung > aus.
|
/// Schlagschatten der Ansicht: Ebene > Modelldarstellung > aus.
|
||||||
pub fn shadows(&self, level: Option<bool>) -> bool {
|
pub fn shadows(&self, level: Option<bool>) -> bool {
|
||||||
level.or(self.elevation.shadows_mv).unwrap_or(false)
|
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) },
|
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),
|
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),
|
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),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="-1.62075 0 8.2415 7.30258" width="82.415mm" height="73.02581mm">
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="-1.62075 0 8.2415 7.535" width="82.415mm" height="75.35mm">
|
||||||
<rect x="-1.62075" y="0" width="8.2415" height="7.30258" fill="#ffffff"/>
|
<rect x="-1.62075" y="0" width="8.2415" height="7.535" fill="#ffffff"/>
|
||||||
<g stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="4">
|
<g stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="4">
|
||||||
<polygon points="0,4.6725 5,4.6725 5,0.6725 0,0.6725" fill="none" stroke="none" stroke-width="0"/>
|
<polygon points="0,4.6725 5,4.6725 5,0.6725 0,0.6725" fill="none" stroke="none" stroke-width="0"/>
|
||||||
<polygon points="0.1725,4.5 4.8275,4.5 4.8275,0.845 0.1725,0.845" fill="#6b728000" stroke="#6b7280" stroke-width="0.002"/>
|
<polygon points="0.1725,4.5 4.8275,4.5 4.8275,0.845 0.1725,0.845" fill="#6b728000" stroke="#6b7280" stroke-width="0.002"/>
|
||||||
@@ -44,11 +44,9 @@
|
|||||||
<polyline points="4.8,2.6725 6,2.6725 6,1.8725" fill="none" stroke="#1f242c" stroke-width="0.05"/>
|
<polyline points="4.8,2.6725 6,2.6725 6,1.8725" fill="none" stroke="#1f242c" stroke-width="0.05"/>
|
||||||
<polygon points="6,1.8725 6.13,2.2225 5.87,2.2225" fill="#1f242c" stroke="#1f242c" stroke-width="0.012"/>
|
<polygon points="6,1.8725 6.13,2.2225 5.87,2.2225" fill="#1f242c" stroke="#1f242c" stroke-width="0.012"/>
|
||||||
<polygon points="-1,2.3725 6,2.3725 6,2.9725 -1,2.9725" fill="none" stroke="none" stroke-width="0"/>
|
<polygon points="-1,2.3725 6,2.3725 6,2.9725 -1,2.9725" fill="none" stroke="none" stroke-width="0"/>
|
||||||
<path d="M 2.9 6.6725 A 0.4 0.4 0 0 0 2.1 6.6725" fill="none" stroke="#000" stroke-width="0.025"/>
|
<polygon points="2.5,6.3725 2.8,6.6725 2.2,6.6725" fill="#1f242c" stroke="#1f242c" stroke-width="0.012"/>
|
||||||
<path d="M 2.1 6.6725 A 0.4 0.4 0 0 0 2.9 6.6725" fill="none" stroke="#000" stroke-width="0.025"/>
|
<text x="2.17713" y="7.035" font-size="0.35" fill="#1f242c" font-family="sans-serif" transform="rotate(0 2.17713 7.035)">Süd</text>
|
||||||
<polygon points="2.5,5.9225 2.66,6.2725 2.34,6.2725" fill="#1f242c" stroke="#1f242c" stroke-width="0.012"/>
|
<polygon points="2.82288,7.035 2.82288,6.3725 2.17713,6.3725 2.17713,7.035" fill="none" stroke="none" stroke-width="0"/>
|
||||||
<polygon points="2.9,7.0725 2.9,5.9225 2.1,5.9225 2.1,7.0725" fill="none" stroke="none" stroke-width="0"/>
|
|
||||||
<text x="2.18" y="6.80258" font-size="0.34688" fill="#1f242c" font-family="sans-serif" transform="rotate(0 2.18 6.80258)">Süd</text>
|
|
||||||
<text x="-1.12075" y="1.7725" font-size="0.35" fill="#1f242c" font-family="sans-serif" transform="rotate(0 -1.12075 1.7725)">A</text>
|
<text x="-1.12075" y="1.7725" font-size="0.35" fill="#1f242c" font-family="sans-serif" transform="rotate(0 -1.12075 1.7725)">A</text>
|
||||||
<text x="5.87925" y="1.7725" font-size="0.35" fill="#1f242c" font-family="sans-serif" transform="rotate(0 5.87925 1.7725)">A</text>
|
<text x="5.87925" y="1.7725" font-size="0.35" fill="#1f242c" font-family="sans-serif" transform="rotate(0 5.87925 1.7725)">A</text>
|
||||||
</g>
|
</g>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 5.9 KiB |
@@ -1189,6 +1189,7 @@ export const de = {
|
|||||||
"resources.modelViews.section.site": "Gelände",
|
"resources.modelViews.section.site": "Gelände",
|
||||||
"resources.modelViews.section.roofs": "Dächer",
|
"resources.modelViews.section.roofs": "Dächer",
|
||||||
"resources.modelViews.section.columns": "Stützen",
|
"resources.modelViews.section.columns": "Stützen",
|
||||||
|
"resources.modelViews.section.sectionMarks": "Schnittmarken",
|
||||||
"resources.modelViews.section.elevation": "Ansicht",
|
"resources.modelViews.section.elevation": "Ansicht",
|
||||||
"resources.modelViews.opt.doors.threshold": "Schwelle (Grundriss)",
|
"resources.modelViews.opt.doors.threshold": "Schwelle (Grundriss)",
|
||||||
"resources.modelViews.opt.doors.sectionDetail": "Zarge und Sturz im Schnitt",
|
"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.reveals": "Schichteinzug",
|
||||||
"resources.modelViews.opt.walls.cutHatch": "Schnittflächen ab 1:100 schraffiert",
|
"resources.modelViews.opt.walls.cutHatch": "Schnittflächen ab 1:100 schraffiert",
|
||||||
"resources.modelViews.opt.slabs.floorFinish": "Bodenbelag",
|
"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.opt.site.terrain": "Gelände im Grundriss",
|
||||||
"resources.modelViews.val.gestrichelt": "gestrichelt",
|
"resources.modelViews.val.gestrichelt": "gestrichelt",
|
||||||
"resources.modelViews.val.punktiert": "punktiert",
|
"resources.modelViews.val.punktiert": "punktiert",
|
||||||
|
|||||||
@@ -1183,6 +1183,7 @@ export const en: Record<TranslationKey, string> = {
|
|||||||
"resources.modelViews.section.site": "Site",
|
"resources.modelViews.section.site": "Site",
|
||||||
"resources.modelViews.section.roofs": "Roofs",
|
"resources.modelViews.section.roofs": "Roofs",
|
||||||
"resources.modelViews.section.columns": "Columns",
|
"resources.modelViews.section.columns": "Columns",
|
||||||
|
"resources.modelViews.section.sectionMarks": "Section marks",
|
||||||
"resources.modelViews.section.elevation": "Elevation",
|
"resources.modelViews.section.elevation": "Elevation",
|
||||||
"resources.modelViews.opt.doors.threshold": "Threshold (plan)",
|
"resources.modelViews.opt.doors.threshold": "Threshold (plan)",
|
||||||
"resources.modelViews.opt.doors.sectionDetail": "Frame and lintel in section",
|
"resources.modelViews.opt.doors.sectionDetail": "Frame and lintel in section",
|
||||||
@@ -1228,6 +1229,11 @@ export const en: Record<TranslationKey, string> = {
|
|||||||
"resources.modelViews.opt.walls.reveals": "Layer reveal",
|
"resources.modelViews.opt.walls.reveals": "Layer reveal",
|
||||||
"resources.modelViews.opt.walls.cutHatch": "Hatch cut faces from 1:100",
|
"resources.modelViews.opt.walls.cutHatch": "Hatch cut faces from 1:100",
|
||||||
"resources.modelViews.opt.slabs.floorFinish": "Floor finish",
|
"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.opt.site.terrain": "Terrain in plan",
|
||||||
"resources.modelViews.val.gestrichelt": "dashed",
|
"resources.modelViews.val.gestrichelt": "dashed",
|
||||||
"resources.modelViews.val.punktiert": "dotted",
|
"resources.modelViews.val.punktiert": "dotted",
|
||||||
|
|||||||
@@ -1100,6 +1100,11 @@ export type DrawingLevel = {
|
|||||||
* folgt weiter der Verbindung der Endpunkte.
|
* folgt weiter der Verbindung der Endpunkte.
|
||||||
*/
|
*/
|
||||||
bendPoints?: Array<Vec2>;
|
bendPoints?: Array<Vec2>;
|
||||||
|
/**
|
||||||
|
* [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). */
|
/** Blickrichtung relativ zur Schnittlinie (nur Schnitt/Ansicht). */
|
||||||
directionSign?: 1 | -1;
|
directionSign?: 1 | -1;
|
||||||
/**
|
/**
|
||||||
@@ -2051,6 +2056,8 @@ export type ModelViewOption = {
|
|||||||
columns?: ModelViewColumns;
|
columns?: ModelViewColumns;
|
||||||
/** [173] Ansicht (Fassade). */
|
/** [173] Ansicht (Fassade). */
|
||||||
elevation?: ModelViewElevation;
|
elevation?: ModelViewElevation;
|
||||||
|
/** [176] Schnittmarken im Grundriss. */
|
||||||
|
sectionMarks?: ModelViewSectionMarks;
|
||||||
};
|
};
|
||||||
|
|
||||||
/** [173] Dächer in der Modelldarstellung (fehlt ⇒ wie Basis). */
|
/** [173] Dächer in der Modelldarstellung (fehlt ⇒ wie Basis). */
|
||||||
@@ -2063,6 +2070,12 @@ export type ModelViewRoofs = {
|
|||||||
viewHatch?: boolean;
|
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. */
|
/** [173] Gelände in der Modelldarstellung. */
|
||||||
export type ModelViewSite = {
|
export type ModelViewSite = {
|
||||||
/** Gelände, Höhenlinien und Baugruben im Grundriss (die Ebene geht vor; Basis: automatisch). */
|
/** Gelände, Höhenlinien und Baugruben im Grundriss (die Ebene geht vor; Basis: automatisch). */
|
||||||
@@ -3193,6 +3206,12 @@ export type SashDef = {
|
|||||||
hingeSide?: "left" | "right";
|
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.
|
* Sequenz-Regel: fasst mehrere Unterregeln zusammen und wendet sie geordnet an.
|
||||||
* Jede Unterregel kann die Ausgabe der vorherigen verfeinern.
|
* Jede Unterregel kann die Ausgabe der vorherigen verfeinern.
|
||||||
|
|||||||
@@ -127,6 +127,24 @@ export function SectionLineSection({
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{/* [176] Schnittmarke im Grundriss: leer = Vorgabe der Modelldarstellung (sonst Pfeil). */}
|
||||||
|
{level.kind === "section" && (
|
||||||
|
<div className="objinfo-field">
|
||||||
|
<span className="objinfo-flabel">{t("objinfo.sectionLine.marker")}</span>
|
||||||
|
<Dropdown
|
||||||
|
value={level.markerStyle ?? ""}
|
||||||
|
onChange={(v) => 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}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
{/* Verdeckte Kanten (gestrichelt) — Default aus (blasses Liniengewirr). */}
|
{/* Verdeckte Kanten (gestrichelt) — Default aus (blasses Liniengewirr). */}
|
||||||
<div className="objinfo-field">
|
<div className="objinfo-field">
|
||||||
<span className="objinfo-flabel">{t("objinfo.sectionLine.hiddenLines")}</span>
|
<span className="objinfo-flabel">{t("objinfo.sectionLine.hiddenLines")}</span>
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
viewBox -12.82 0 37.603 33.301
|
viewBox -13.448 0 38.615 33.813
|
||||||
bytes 21028
|
bytes 19897
|
||||||
circle 14
|
circle 14
|
||||||
g 1
|
g 1
|
||||||
line 63
|
line 63
|
||||||
path 8
|
|
||||||
polygon 29
|
polygon 29
|
||||||
polyline 14
|
polyline 14
|
||||||
rect 1
|
rect 1
|
||||||
svg 1
|
svg 1
|
||||||
text 32
|
text 31
|
||||||
tspan 9
|
tspan 8
|
||||||
hash bcc413923d65ce13
|
hash 9d4b051d4643a275
|
||||||
@@ -1,13 +1,12 @@
|
|||||||
viewBox -12.66 0 37.302 33.15
|
viewBox -12.974 0 37.808 33.406
|
||||||
bytes 318905
|
bytes 318165
|
||||||
circle 14
|
circle 14
|
||||||
g 1
|
g 1
|
||||||
line 3212
|
line 3212
|
||||||
path 8
|
|
||||||
polygon 75
|
polygon 75
|
||||||
polyline 72
|
polyline 72
|
||||||
rect 1
|
rect 1
|
||||||
svg 1
|
svg 1
|
||||||
text 32
|
text 32
|
||||||
tspan 9
|
tspan 9
|
||||||
hash 962593263cd8229b
|
hash f65e632e02bea427
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
viewBox -41.5 0 95 63.6
|
viewBox -41.5 0 95 63.6
|
||||||
bytes 66253
|
bytes 65478
|
||||||
circle 16
|
circle 16
|
||||||
g 1
|
g 1
|
||||||
line 143
|
line 143
|
||||||
path 43
|
path 35
|
||||||
polygon 87
|
polygon 87
|
||||||
polyline 107
|
polyline 107
|
||||||
rect 1
|
rect 1
|
||||||
svg 1
|
svg 1
|
||||||
text 115
|
text 115
|
||||||
tspan 24
|
tspan 24
|
||||||
hash 961b2149a53df82f
|
hash 15578d089b60bf60
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
viewBox -41.5 0 95 63.6
|
viewBox -41.5 0 95 63.6
|
||||||
bytes 107944
|
bytes 107202
|
||||||
circle 16
|
circle 16
|
||||||
g 1
|
g 1
|
||||||
line 371
|
line 371
|
||||||
path 74
|
path 66
|
||||||
polygon 208
|
polygon 208
|
||||||
polyline 125
|
polyline 125
|
||||||
rect 1
|
rect 1
|
||||||
svg 1
|
svg 1
|
||||||
text 115
|
text 115
|
||||||
tspan 24
|
tspan 24
|
||||||
hash f09efcc05ba05e8f
|
hash 79e3b4ca1a64e95a
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
viewBox -12.82 0 37.603 33.301
|
viewBox -13.448 0 38.615 33.813
|
||||||
bytes 45958
|
bytes 44888
|
||||||
circle 14
|
circle 14
|
||||||
g 1
|
g 1
|
||||||
line 113
|
line 113
|
||||||
path 17
|
path 9
|
||||||
polygon 52
|
polygon 52
|
||||||
polyline 98
|
polyline 98
|
||||||
rect 1
|
rect 1
|
||||||
svg 1
|
svg 1
|
||||||
text 86
|
text 86
|
||||||
tspan 19
|
tspan 19
|
||||||
hash 49796bdd700d403b
|
hash 63a214a67a23917f
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
viewBox -12.66 0 37.302 33.15
|
viewBox -12.974 0 37.808 33.406
|
||||||
bytes 354423
|
bytes 353699
|
||||||
circle 14
|
circle 14
|
||||||
g 1
|
g 1
|
||||||
line 3256
|
line 3256
|
||||||
path 45
|
path 37
|
||||||
polygon 152
|
polygon 152
|
||||||
polyline 167
|
polyline 167
|
||||||
rect 1
|
rect 1
|
||||||
svg 1
|
svg 1
|
||||||
text 85
|
text 85
|
||||||
tspan 18
|
tspan 18
|
||||||
hash fb10aaccb7719cff
|
hash 02d3fdb73b319310
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
viewBox -12.82 0 37.603 33.301
|
viewBox -13.448 0 38.615 33.813
|
||||||
bytes 39254
|
bytes 38285
|
||||||
circle 15
|
circle 15
|
||||||
g 1
|
g 1
|
||||||
line 91
|
line 91
|
||||||
path 31
|
path 23
|
||||||
polygon 43
|
polygon 43
|
||||||
polyline 64
|
polyline 64
|
||||||
rect 1
|
rect 1
|
||||||
svg 1
|
svg 1
|
||||||
text 70
|
text 70
|
||||||
tspan 15
|
tspan 15
|
||||||
hash e6296781b3b2420d
|
hash 04304c2c1d1feb26
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
viewBox -12.66 0 37.302 33.15
|
viewBox -12.974 0 37.808 33.406
|
||||||
bytes 45035
|
bytes 44206
|
||||||
circle 15
|
circle 15
|
||||||
g 1
|
g 1
|
||||||
line 87
|
line 87
|
||||||
path 46
|
path 38
|
||||||
polygon 78
|
polygon 78
|
||||||
polyline 71
|
polyline 71
|
||||||
rect 1
|
rect 1
|
||||||
svg 1
|
svg 1
|
||||||
text 70
|
text 70
|
||||||
tspan 15
|
tspan 15
|
||||||
hash 5f24df35a8494c7f
|
hash 9cc8b4d9e5563c5a
|
||||||
@@ -1,12 +1,11 @@
|
|||||||
viewBox -1.621 0 8.242 7.303
|
viewBox -1.621 0 8.242 7.535
|
||||||
bytes 6007
|
bytes 5819
|
||||||
g 1
|
g 1
|
||||||
line 19
|
line 19
|
||||||
path 2
|
|
||||||
polygon 19
|
polygon 19
|
||||||
polyline 4
|
polyline 4
|
||||||
rect 1
|
rect 1
|
||||||
svg 1
|
svg 1
|
||||||
text 5
|
text 5
|
||||||
tspan 2
|
tspan 2
|
||||||
hash 8d6d9e4463465000
|
hash 02c76630347cfb6b
|
||||||
@@ -1,12 +1,11 @@
|
|||||||
viewBox -1.56 0 8.121 7.238
|
viewBox -1.56 0 8.121 7.354
|
||||||
bytes 9425
|
bytes 9241
|
||||||
g 1
|
g 1
|
||||||
line 20
|
line 20
|
||||||
path 2
|
|
||||||
polygon 46
|
polygon 46
|
||||||
polyline 8
|
polyline 8
|
||||||
rect 1
|
rect 1
|
||||||
svg 1
|
svg 1
|
||||||
text 5
|
text 5
|
||||||
tspan 2
|
tspan 2
|
||||||
hash 465465525671b296
|
hash bf901e6810ddf2e2
|
||||||
@@ -1,11 +1,10 @@
|
|||||||
viewBox -1.621 0 8.242 7.53
|
viewBox -1.621 0 8.242 7.763
|
||||||
bytes 2843
|
bytes 2669
|
||||||
g 1
|
g 1
|
||||||
line 2
|
line 2
|
||||||
path 2
|
|
||||||
polygon 12
|
polygon 12
|
||||||
polyline 3
|
polyline 3
|
||||||
rect 1
|
rect 1
|
||||||
svg 1
|
svg 1
|
||||||
text 3
|
text 3
|
||||||
hash f243af6d8f088bb7
|
hash d0fc9efc7b012bf2
|
||||||
@@ -1,11 +1,10 @@
|
|||||||
viewBox -1.56 0 8.121 7.465
|
viewBox -1.56 0 8.121 7.581
|
||||||
bytes 4727
|
bytes 4552
|
||||||
g 1
|
g 1
|
||||||
line 2
|
line 2
|
||||||
path 2
|
|
||||||
polygon 29
|
polygon 29
|
||||||
polyline 3
|
polyline 3
|
||||||
rect 1
|
rect 1
|
||||||
svg 1
|
svg 1
|
||||||
text 3
|
text 3
|
||||||
hash bee2ad69ea28de30
|
hash db41c17fef99a859
|
||||||
@@ -21,7 +21,7 @@ export function isBuiltinModelView(id: string | undefined | null): id is DetailL
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Abschnitte je Bauteilart. */
|
/** 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. */
|
/** Ein Eintrag der Auswahl (Werkzeugleiste, Vorlage): eingebaute Stufen zuerst, dann die eigenen. */
|
||||||
export interface ModelViewChoice {
|
export interface ModelViewChoice {
|
||||||
@@ -180,6 +180,7 @@ export const MODEL_VIEW_FIELDS: readonly ModelViewField[] = [
|
|||||||
{ section: "elevation", key: "shadows", values: "bool" },
|
{ section: "elevation", key: "shadows", values: "bool" },
|
||||||
{ section: "elevation", key: "materialHatch", values: "bool" },
|
{ section: "elevation", key: "materialHatch", values: "bool" },
|
||||||
{ section: "site", key: "terrain", 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}. */
|
/** Auswahlwert eines Feldes als Text (`""` = wie Basis); Gegenstück: {@link parseFieldValue}. */
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ export interface ModelViewHandlers {
|
|||||||
onSetModelViewOption?: (id: string, section: ModelViewSection, key: string, value: string | number | boolean | null) => void;
|
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). */
|
/** Anzeige eines Auswahlwerts (Zahlen mit Einheit, Rest übersetzt). */
|
||||||
function valueLabel(f: ModelViewField, v: string | number): string {
|
function valueLabel(f: ModelViewField, v: string | number): string {
|
||||||
|
|||||||
Reference in new issue
Block a user