Merge [276] Schnitt- und Ansichtslinien: Linie, Marke, Lage und Beschriftung einstellbar
This commit is contained in:
20 files changed
+1114
-180
No files matched your search
@@ -1878,11 +1878,38 @@ pub struct DrawingLevel {
|
||||
#[serde(rename = "autoLine", default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
pub auto_line: Option<bool>,
|
||||
/// [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")]
|
||||
/// [276] Darstellung der Linie im Grundriss: "full" (Basis: Schnitt = dünne Strichpunktlinie mit kräftigen Endstücken),
|
||||
/// "ends" (nur die Endstücke) oder "none" (keine Linie). Fehlt ⇒ Vorgabe der Modelldarstellung (`sectionMarks` bzw.
|
||||
/// `elevationMarks`), sonst Schnitt "full", Ansicht "none". Nur Schnitt/Ansicht.
|
||||
#[serde(rename = "lineMode", default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
pub marker_style: Option<SectionMarkerStyle>,
|
||||
pub line_mode: Option<SectionLineMode>,
|
||||
/// [276] Länge der Endstücke in Papier-mm (Basis 12; an Knicken die Hälfte).
|
||||
#[serde(rename = "endLengthMm", default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
pub end_length_mm: Option<f64>,
|
||||
/// [276] Linientyp (`LineStyle.id`) der Linie; fehlt ⇒ Basis (Strichpunkt, bei "ends" durchgezogen).
|
||||
#[serde(rename = "lineStyleId", default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
pub line_style_id: Option<String>,
|
||||
/// [276] Stift (`ColorPen.id`) der Linie (Farbe und Strichstärke des aktiven Stiftsatzes); fehlt ⇒ Basis.
|
||||
#[serde(rename = "linePenId", default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
pub line_pen_id: Option<String>,
|
||||
/// [276] Marke an den Enden bzw. (Ansicht) in der Mitte: "arrow" (Schenkel mit Dreieck), "lAngle" (nur Schenkel, ein L
|
||||
/// mit dem Endstück), "triangle" (nur gefülltes Dreieck) oder "none". Fehlt ⇒ Vorgabe der Modelldarstellung, sonst
|
||||
/// Schnitt "arrow", Ansicht "triangle". Ansichten kennen "arrow", "triangle", "none".
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
pub marker: Option<SectionMarker>,
|
||||
/// [276] Wo die Marke steht (nur Schnitt): beide Enden (Basis), nur am Anfang oder nur am Ende.
|
||||
#[serde(rename = "markerAt", default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
pub marker_at: Option<SectionMarkerAt>,
|
||||
/// [276] Beschriftung der Marke (Basis: ja).
|
||||
#[serde(rename = "markerLabel", default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
pub marker_label: Option<bool>,
|
||||
/// Blickrichtung relativ zur Schnittlinie (nur Schnitt/Ansicht).
|
||||
#[serde(rename = "directionSign", default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional, type = "1 | -1")]
|
||||
@@ -2147,6 +2174,10 @@ pub struct ModelViewOption {
|
||||
#[serde(rename = "sectionMarks", default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
pub section_marks: Option<ModelViewSectionMarks>,
|
||||
/// [276] Ansichtslinien und -marken im Grundriss.
|
||||
#[serde(rename = "elevationMarks", default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
pub elevation_marks: Option<ModelViewSectionMarks>,
|
||||
/// [173] Raumstempel: welche Zeilen (die Einstellung am Stempel geht vor).
|
||||
#[serde(rename = "roomStamps", default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
@@ -2271,28 +2302,82 @@ pub enum ModelViewDimChains {
|
||||
Unknown,
|
||||
}
|
||||
|
||||
/// [176] Schnittmarken in der Modelldarstellung (fehlt ⇒ Pfeil).
|
||||
/// [176]/[276] Schnitt- bzw. Ansichtsmarken in der Modelldarstellung (fehlt ⇒ Basis; die Ebene geht vor). Dieselben
|
||||
/// Felder wie an der Ebene (`DrawingLevel.lineMode` …) ohne Linientyp und Stift.
|
||||
#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize, TS)]
|
||||
#[serde(default)]
|
||||
pub struct ModelViewSectionMarks {
|
||||
/// Markentyp der Schnitte (die Ebene geht vor; Basis: Pfeil).
|
||||
/// Linie: durchgehend, nur Endstücke, keine.
|
||||
#[serde(rename = "lineMode", default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
pub line_mode: Option<SectionLineMode>,
|
||||
/// Länge der Endstücke in Papier-mm.
|
||||
#[serde(rename = "endLengthMm", default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
pub end_length_mm: Option<f64>,
|
||||
/// Marke (Pfeil, L, Dreieck, keine).
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
pub style: Option<SectionMarkerStyle>,
|
||||
pub marker: Option<SectionMarker>,
|
||||
/// Wo die Marke steht (nur Schnitt).
|
||||
#[serde(rename = "markerAt", default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
pub marker_at: Option<SectionMarkerAt>,
|
||||
/// Beschriftung der Marke.
|
||||
#[serde(rename = "markerLabel", default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
pub marker_label: Option<bool>,
|
||||
#[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).
|
||||
/// [276] Linie einer Schnitt-/Ansichtslinie im Grundriss.
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default, Serialize, Deserialize, TS)]
|
||||
pub enum SectionMarkerStyle {
|
||||
pub enum SectionLineMode {
|
||||
/// Ganze Linie (dünn, Strichpunkt) mit kräftigen Endstücken.
|
||||
#[default]
|
||||
#[serde(rename = "full")]
|
||||
Full,
|
||||
/// Nur die Endstücke (und Knickstücke).
|
||||
#[serde(rename = "ends")]
|
||||
Ends,
|
||||
/// Keine Linie.
|
||||
#[serde(rename = "none")]
|
||||
None,
|
||||
#[serde(other)]
|
||||
#[ts(skip)]
|
||||
Unknown,
|
||||
}
|
||||
|
||||
/// [276] Marke einer Schnitt-/Ansichtslinie: Pfeil (Schenkel in Blickrichtung mit Dreieck), L (nur Schenkel), gefülltes
|
||||
/// Dreieck, keine.
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default, Serialize, Deserialize, TS)]
|
||||
pub enum SectionMarker {
|
||||
#[default]
|
||||
#[serde(rename = "arrow")]
|
||||
Arrow,
|
||||
#[serde(rename = "lAngle")]
|
||||
LAngle,
|
||||
#[serde(rename = "triangle")]
|
||||
Triangle,
|
||||
#[serde(rename = "none")]
|
||||
None,
|
||||
#[serde(other)]
|
||||
#[ts(skip)]
|
||||
Unknown,
|
||||
}
|
||||
|
||||
/// [276] An welchem Ende einer Schnittlinie die Marke steht.
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default, Serialize, Deserialize, TS)]
|
||||
pub enum SectionMarkerAt {
|
||||
#[default]
|
||||
#[serde(rename = "both")]
|
||||
Both,
|
||||
#[serde(rename = "start")]
|
||||
Start,
|
||||
#[serde(rename = "end")]
|
||||
End,
|
||||
#[serde(other)]
|
||||
#[ts(skip)]
|
||||
Unknown,
|
||||
|
||||
@@ -23,6 +23,65 @@ 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;
|
||||
|
||||
/// [276] Farbe, Strichstärken und Linientyp einer Schnitt-/Ansichtslinie: Stift (aktiver Stiftsatz) > Linientyp > Basis.
|
||||
struct LineInk {
|
||||
color: String,
|
||||
main_w: f64,
|
||||
mark_w: f64,
|
||||
main_dash: Option<Vec<f64>>,
|
||||
piece_dash: Option<Vec<f64>>,
|
||||
zigzag: Option<LineStyleZigzag>,
|
||||
motif: Option<LineStyleMotif>,
|
||||
/// Zickzack/Motiv gelten für die Hauptlinie (`full`) bzw. die Endstücke (`ends`).
|
||||
styled_ends: bool,
|
||||
}
|
||||
|
||||
fn line_ink(p: &Project, level: &DrawingLevel, look: &crate::plan::misc::SectionLook) -> LineInk {
|
||||
let ls = level.line_style_id.as_deref().filter(|s| !s.is_empty()).and_then(|id| p.line_style(id));
|
||||
let pen = level.line_pen_id.as_deref().filter(|s| !s.is_empty()).and_then(|id| {
|
||||
let set = p.pen_sets.as_deref()?.iter().find(|s| Some(&s.id) == p.active_pen_set_id.as_ref())?;
|
||||
Some(set.pens.get(id).map_or((crate::pens::PEN_FALLBACK_COLOR.to_string(), crate::pens::PEN_FALLBACK_WEIGHT), |st| (st.color.clone(), st.weight)))
|
||||
});
|
||||
let ends = look.line == SectionLineMode::Ends;
|
||||
let pen_w = pen.as_ref().map(|x| x.1).filter(|w| w.is_finite() && *w > 0.0);
|
||||
let color = pen.as_ref().map(|x| x.0.clone()).or_else(|| ls.map(|l| l.color.clone()).filter(|c| !c.is_empty())).unwrap_or_else(|| SECTION_LINE_INK.to_string());
|
||||
LineInk {
|
||||
color,
|
||||
main_w: pen_w.unwrap_or(SECTION_LINE_MM),
|
||||
mark_w: if ends || look.line == SectionLineMode::None { pen_w.unwrap_or(SECTION_LINE_MARK_MM) } else { pen_w.map_or(SECTION_LINE_MARK_MM, |w| w.max(SECTION_LINE_MARK_MM)) },
|
||||
main_dash: match ls {
|
||||
Some(l) => l.dash.clone().filter(|d| !d.is_empty()),
|
||||
None => Some(SECTION_LINE_DASH.to_vec()),
|
||||
},
|
||||
piece_dash: if ends { ls.and_then(|l| l.dash.clone()).filter(|d| !d.is_empty()) } else { None },
|
||||
zigzag: ls.filter(|l| l.kind == Some(LineStyleKind::Zigzag)).and_then(|l| l.zigzag.clone()),
|
||||
motif: ls.filter(|l| l.kind == Some(LineStyleKind::Custom)).and_then(|l| l.motif.clone()),
|
||||
styled_ends: ends,
|
||||
}
|
||||
}
|
||||
|
||||
impl LineInk {
|
||||
/// Linie `a`–`b`: `main` = dünne Hauptlinie, sonst kräftiges Stück bzw. Schenkel.
|
||||
fn line(&self, a: Vec2, b: Vec2, main: bool, greyed: Option<bool>) -> Primitive {
|
||||
let styled = main != self.styled_ends;
|
||||
Primitive::Line {
|
||||
a,
|
||||
b,
|
||||
cls: "section-line".into(),
|
||||
weight_mm: if main { self.main_w } else { self.mark_w },
|
||||
dash: if main { Some(self.main_dash.clone()) } else { self.piece_dash.clone().map(Some) },
|
||||
zigzag: if styled { self.zigzag.clone() } else { None },
|
||||
motif: if styled { self.motif.clone() } else { None },
|
||||
color: Some(self.color.clone().into()),
|
||||
drawing_id: None,
|
||||
opening_id: None,
|
||||
stair_id: None,
|
||||
greyed,
|
||||
opacity: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn v2(x: f64, y: f64) -> Vec2 {
|
||||
Vec2 { x, y }
|
||||
}
|
||||
@@ -926,6 +985,24 @@ pub fn section_label_tag(name: &str) -> String {
|
||||
/// 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<bool>, obst: &mut super::stamp_place::Obstacles, out: &mut Vec<Primitive>) {
|
||||
let look = c.mv().mark_look(level);
|
||||
let ink = line_ink(c.p, level, &look);
|
||||
// [276] Die Linie selbst (Basis: keine) liegt exakt auf der Ansichtslinie.
|
||||
{
|
||||
let f = crate::plan::misc::view_line_parts((p0.x, p0.y), (p1.x, p1.y), k, &look);
|
||||
let mut i = 1;
|
||||
for _ in 0..f.first().copied().unwrap_or(0.0) as usize {
|
||||
let (a, b) = (v2(f[i + 2], f[i + 3]), v2(f[i + 4], f[i + 5]));
|
||||
let main = f[i + 1] == 0.0;
|
||||
let pieces = if main { c.cut_at_gaps(a, b) } else { vec![(a, b)] };
|
||||
for (a, b) in pieces {
|
||||
let line = ink.line(a, b, main, greyed);
|
||||
obst.add_prim(&line);
|
||||
out.push(line);
|
||||
}
|
||||
i += 6;
|
||||
}
|
||||
}
|
||||
let h = SECTION_LABEL_MM * k;
|
||||
let w = crate::text_layout::text_width_em(tag, false) * h;
|
||||
// [199] Steht der Marker auf der Bemassung (Massketten rücken bei 1:200 auf 7 mm Abstand hinaus), rückt er
|
||||
@@ -937,7 +1014,7 @@ fn view_marker(c: &Ctx, level: &DrawingLevel, p0: Vec2, p1: Vec2, sign: f64, k:
|
||||
let ul = if len > 1e-9 { v2((p1.x - p0.x) / len, (p1.y - p0.y) / len) } else { v2(0.0, 0.0) };
|
||||
let at = |(s, t): (f64, f64)| {
|
||||
let (dx, dy) = (-bn.x * s + ul.x * t, -bn.y * s + ul.y * t);
|
||||
crate::plan::misc::view_marker_sized(p0.x + dx, p0.y + dy, p1.x + dx, p1.y + dy, sign, k, w)
|
||||
crate::plan::misc::view_symbol(p0.x + dx, p0.y + dy, p1.x + dx, p1.y + dy, sign, k, w, look.marker, look.label)
|
||||
};
|
||||
let band = |f: &[f64]| -> Option<Vec<[f64; 2]>> {
|
||||
let mut i = 1;
|
||||
@@ -945,6 +1022,7 @@ fn view_marker(c: &Ctx, level: &DrawingLevel, p0: Vec2, p1: Vec2, sign: f64, k:
|
||||
match f.get(i).copied()? {
|
||||
3.0 => i += 7,
|
||||
5.0 => i += 3,
|
||||
2.0 => i += 6,
|
||||
_ => return Some((0..4).map(|j| [f[i + 1 + 2 * j], f[i + 2 + 2 * j]]).collect()),
|
||||
}
|
||||
}
|
||||
@@ -965,6 +1043,7 @@ fn view_marker(c: &Ctx, level: &DrawingLevel, p0: Vec2, p1: Vec2, sign: f64, k:
|
||||
out.push(vec![[x - pad, y - pad], [x + w + pad, y - pad], [x + w + pad, y + 0.75 * h + pad], [x - pad, y + 0.75 * h + pad]]);
|
||||
i += 3;
|
||||
}
|
||||
Some(2.0) => i += 6,
|
||||
Some(_) => i += 9,
|
||||
None => break,
|
||||
}
|
||||
@@ -986,13 +1065,18 @@ fn view_marker(c: &Ctx, level: &DrawingLevel, p0: Vec2, p1: Vec2, sign: f64, k:
|
||||
}
|
||||
let mut i = 1;
|
||||
for _ in 0..f[0] as usize {
|
||||
if f[i] == 3.0 {
|
||||
if f[i] == 2.0 {
|
||||
let line = ink.line(v2(f[i + 2], f[i + 3]), v2(f[i + 4], f[i + 5]), false, greyed);
|
||||
obst.add_prim(&line);
|
||||
out.push(line);
|
||||
i += 6;
|
||||
} 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 ring: Vec<[f64; 2]> = pts.iter().map(|q| [q.x, q.y]).collect();
|
||||
obst.area(ring);
|
||||
let mut tri = pick_band(pts, None, None);
|
||||
if let Primitive::Polygon { fill, .. } = &mut tri {
|
||||
*fill = SECTION_LINE_INK.into();
|
||||
*fill = ink.color.clone().into();
|
||||
}
|
||||
out.push(tri);
|
||||
i += 7;
|
||||
@@ -1009,7 +1093,7 @@ fn view_marker(c: &Ctx, level: &DrawingLevel, p0: Vec2, p1: Vec2, sign: f64, k:
|
||||
text: tag.to_string(),
|
||||
height_m: h,
|
||||
angle: 0.0,
|
||||
color: SECTION_LINE_INK.into(),
|
||||
color: ink.color.clone().into(),
|
||||
marks: None,
|
||||
wrap_width: None,
|
||||
doc: None,
|
||||
@@ -1041,7 +1125,7 @@ pub fn plan_section_lines(c: &Ctx, out: &mut Vec<Primitive>) {
|
||||
let k = n / 1000.0;
|
||||
// [157] Beschriftungen zuletzt: sie weichen Masszahlen, Texten, Achsblasen, allen Linien und Marken der
|
||||
// Schnittführungen und den schon gesetzten Beschriftungen aus.
|
||||
let mut labels: Vec<(Vec2, String, Vec2, Vec2)> = Vec::new();
|
||||
let mut labels: Vec<(Vec2, String, Vec2, Vec2, String)> = Vec::new();
|
||||
let mut obst = super::stamp_place::Obstacles::default();
|
||||
// [270] Erst die Schnitte, dann die Ansichtsmarken: diese weichen den Schnittmarken aus (`view_marker`).
|
||||
let sections = c.p.drawing_levels.iter().filter(|l| matches!(l.kind, DrawingLevelKind::Section));
|
||||
@@ -1059,7 +1143,10 @@ pub fn plan_section_lines(c: &Ctx, out: &mut Vec<Primitive>) {
|
||||
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_styled(&path, sign, k, label_w, c.mv().section_marker(level.marker_style));
|
||||
let look = c.mv().mark_look(level);
|
||||
let ink = line_ink(c.p, level, &look);
|
||||
let marked = look.marked_ends();
|
||||
let f = crate::plan::misc::section_polyline_look(&path, sign, k, label_w, &look);
|
||||
if f.is_empty() {
|
||||
continue;
|
||||
}
|
||||
@@ -1083,21 +1170,7 @@ pub fn plan_section_lines(c: &Ctx, out: &mut Vec<Primitive>) {
|
||||
// Musterhaus komplex EG/DG); die kräftigen Endstücke bleiben ganz.
|
||||
let pieces = if main { c.cut_at_gaps(a, b) } else { vec![(a, b)] };
|
||||
for (a, b) in pieces {
|
||||
let line = Primitive::Line {
|
||||
a,
|
||||
b,
|
||||
cls: "section-line".into(),
|
||||
weight_mm: if main { SECTION_LINE_MM } else { SECTION_LINE_MARK_MM },
|
||||
dash: main.then(|| Some(SECTION_LINE_DASH.to_vec())),
|
||||
zigzag: None,
|
||||
motif: None,
|
||||
color: Some(SECTION_LINE_INK.into()),
|
||||
drawing_id: None,
|
||||
opening_id: None,
|
||||
stair_id: None,
|
||||
greyed,
|
||||
opacity: None,
|
||||
};
|
||||
let line = ink.line(a, b, main, greyed);
|
||||
obst.add_prim(&line);
|
||||
out.push(line);
|
||||
}
|
||||
@@ -1108,14 +1181,14 @@ pub fn plan_section_lines(c: &Ctx, out: &mut Vec<Primitive>) {
|
||||
obst.area(pts.iter().map(|q| [q.x, q.y]).collect());
|
||||
let mut tri = pick_band(pts, None, None);
|
||||
if let Primitive::Polygon { fill, .. } = &mut tri {
|
||||
*fill = SECTION_LINE_INK.into();
|
||||
*fill = ink.color.clone().into();
|
||||
}
|
||||
out.push(tri);
|
||||
i += 7;
|
||||
} else if f[i] == 5.0 {
|
||||
let (outward, bn) = ends[end_no.min(1)];
|
||||
let (outward, bn) = ends[marked.get(end_no).copied().unwrap_or(1).min(1)];
|
||||
end_no += 1;
|
||||
labels.push((v2(f[i + 1], f[i + 2]), tag.clone(), bn, outward));
|
||||
labels.push((v2(f[i + 1], f[i + 2]), tag.clone(), bn, outward, ink.color.clone()));
|
||||
i += 3;
|
||||
} else {
|
||||
let pts = (0..4).map(|j| v2(f[i + 1 + 2 * j], f[i + 2 + 2 * j])).collect();
|
||||
@@ -1158,7 +1231,7 @@ pub fn plan_section_lines(c: &Ctx, out: &mut Vec<Primitive>) {
|
||||
let cost = |&(so, sb): &(f64, f64)| so.hypot(sb) + if sb < 0.0 || so < 0.0 { 0.5 } else { 0.0 };
|
||||
steps.sort_by(|a, b| cost(a).total_cmp(&cost(b)).then(a.0.total_cmp(&b.0).reverse()).then(a.1.total_cmp(&b.1).reverse()));
|
||||
let steps = &steps;
|
||||
for (at, tag, bn, outward) in labels {
|
||||
for (at, tag, bn, outward, ink_color) in labels {
|
||||
let w = crate::text_layout::text_width_em(&tag, false) * h;
|
||||
let rect = |a: Vec2| -> Vec<[f64; 2]> {
|
||||
let pad = 0.1 * h;
|
||||
@@ -1179,7 +1252,7 @@ pub fn plan_section_lines(c: &Ctx, out: &mut Vec<Primitive>) {
|
||||
text: tag,
|
||||
height_m: h,
|
||||
angle: 0.0,
|
||||
color: SECTION_LINE_INK.into(),
|
||||
color: ink_color.into(),
|
||||
marks: None,
|
||||
wrap_width: None,
|
||||
doc: None,
|
||||
@@ -1401,36 +1474,108 @@ mod tests {
|
||||
assert!((ost[1][0] - 15.0).abs() < 1e-9 && ((ost[1][1] + ost[2][1]) / 2.0 - 5.0).abs() < 1e-9, "Ost bleibt in der Mitte: {ost:?}");
|
||||
}
|
||||
|
||||
/// [176] Schnittmarke als L: Ebenenfeld `markerStyle` bzw. Vorgabe der Modelldarstellung (`sectionMarks.style`);
|
||||
/// Ebene > Modelldarstellung > Pfeil. L: keine dünne Linie, kein Dreieck.
|
||||
/// Projekt mit einem Schnitt (`kind` "section") oder einer Ansicht; `lv` ergänzt Felder der Ebene, `mv` die Modelldarstellung "m".
|
||||
fn look_project(kind: &str, lv: serde_json::Value, mv: Option<serde_json::Value>) -> Project {
|
||||
let mut lvl = serde_json::json!({ "id": "s", "name": "Schnitt A-A", "kind": kind, "visible": true, "locked": false,
|
||||
"linePoints": [{ "x": 0.0, "y": 0.0 }, { "x": 10.0, "y": 0.0 }] });
|
||||
for (k, v) in lv.as_object().unwrap() {
|
||||
lvl[k] = v.clone();
|
||||
}
|
||||
let mut p = Project { drawing_levels: vec![serde_json::from_value(lvl).unwrap()], ..Default::default() };
|
||||
if let Some(m) = mv {
|
||||
let mut o = serde_json::json!({ "id": "m", "name": "M" });
|
||||
for (k, v) in m.as_object().unwrap() {
|
||||
o[k] = v.clone();
|
||||
}
|
||||
p.model_view_options = Some(vec![serde_json::from_value(o).unwrap()]);
|
||||
}
|
||||
p
|
||||
}
|
||||
|
||||
fn run_lines(p: &Project, mv: bool) -> Vec<Primitive> {
|
||||
let a = super::super::domains::PlanArgs::parse(1.0, &format!(r#"{{"show": ["02", "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
|
||||
}
|
||||
|
||||
/// (dünne Linien, kräftige Linien, Dreiecke, Texte)
|
||||
fn count_parts(out: &[Primitive]) -> (usize, usize, usize, usize) {
|
||||
let thin = out.iter().filter(|q| matches!(q, Primitive::Line { dash: Some(_), .. })).count();
|
||||
let heavy = out.iter().filter(|q| matches!(q, Primitive::Line { dash: None, weight_mm, .. } if *weight_mm > 0.4)).count();
|
||||
let tri = out.iter().filter(|q| matches!(q, Primitive::Polygon { fill, .. } if fill != "none")).count();
|
||||
let txt = out.iter().filter(|q| matches!(q, Primitive::DrawingText { .. })).count();
|
||||
(thin, heavy, tri, txt)
|
||||
}
|
||||
|
||||
/// [176] Schnittmarke als L: Ebenenfeld `marker`/`lineMode` bzw. Vorgabe der Modelldarstellung (`sectionMarks`); die
|
||||
/// Ebene geht vor. L mit "ends": 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": ["02", "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");
|
||||
let mvl = serde_json::json!({ "sectionMarks": { "lineMode": "ends", "marker": "lAngle" } });
|
||||
let base = run_lines(&look_project("section", serde_json::json!({}), Some(mvl.clone())), false);
|
||||
let (thin, heavy, tri, txt) = count_parts(&base);
|
||||
assert!(thin == 1 && tri == 2 && heavy == 4 && txt == 2, "Basis = Pfeil: {:?}", count_parts(&base));
|
||||
let l = run_lines(&look_project("section", serde_json::json!({ "lineMode": "ends", "marker": "lAngle" }), None), false);
|
||||
assert_eq!(count_parts(&l), (0, 4, 0, 2), "je Ende zwei Schenkel");
|
||||
let via_mv = run_lines(&look_project("section", serde_json::json!({}), Some(mvl.clone())), true);
|
||||
assert_eq!(count_parts(&via_mv), (0, 4, 0, 2), "Vorgabe der Modelldarstellung");
|
||||
let ebene = run_lines(&look_project("section", serde_json::json!({ "marker": "arrow", "lineMode": "full" }), Some(mvl)), true);
|
||||
assert_eq!(count_parts(&ebene), (1, 4, 2, 2), "Ebene geht vor");
|
||||
}
|
||||
|
||||
/// [276] Varianten im Grundriss: Linie keine/Enden, Dreieck, nur Anfang, ohne Beschriftung; Pick-Band bleibt immer.
|
||||
#[test]
|
||||
fn schnittlinie_varianten_im_grundriss() {
|
||||
let run = |lv: serde_json::Value| run_lines(&look_project("section", lv, None), false);
|
||||
assert_eq!(count_parts(&run(serde_json::json!({ "lineMode": "none", "marker": "triangle" }))), (0, 0, 2, 2));
|
||||
assert_eq!(count_parts(&run(serde_json::json!({ "lineMode": "none", "marker": "none", "markerLabel": false }))), (0, 0, 0, 0));
|
||||
assert_eq!(count_parts(&run(serde_json::json!({ "markerAt": "start" }))), (1, 3, 1, 1));
|
||||
assert_eq!(count_parts(&run(serde_json::json!({ "markerLabel": false }))), (1, 4, 2, 0));
|
||||
let leer = run(serde_json::json!({ "lineMode": "none", "marker": "none", "markerLabel": false }));
|
||||
assert!(leer.iter().any(|q| matches!(q, Primitive::Polygon { section_line_id: Some(_), .. })), "Pick-Band bleibt");
|
||||
// Nur Anfang: die Beschriftung steht am Anfang (links, x < 0), nicht am Ende.
|
||||
let start = run(serde_json::json!({ "markerAt": "start" }));
|
||||
let x = start.iter().find_map(|q| if let Primitive::DrawingText { at, .. } = q { Some(at.x) } else { None }).unwrap();
|
||||
assert!(x < 3.0, "Anfang: {x}");
|
||||
let end = run(serde_json::json!({ "markerAt": "end" }));
|
||||
let x = end.iter().find_map(|q| if let Primitive::DrawingText { at, .. } = q { Some(at.x) } else { None }).unwrap();
|
||||
assert!(x > 7.0, "Ende: {x}");
|
||||
}
|
||||
|
||||
/// [276] Linientyp und Stift der Linie: Stift (Farbe, Stärke) und Linientyp (Muster) wirken auf die Hauptlinie.
|
||||
#[test]
|
||||
fn schnittlinie_linientyp_und_stift() {
|
||||
let mut p = look_project("section", serde_json::json!({ "lineStyleId": "ls", "linePenId": "pen" }), None);
|
||||
p.line_styles.push(serde_json::from_value(serde_json::json!({ "id": "ls", "name": "Punkt", "color": "#00ff00", "dash": [0.0, 1.0] })).unwrap());
|
||||
p.active_pen_set_id = Some("set".into());
|
||||
p.pen_sets = Some(vec![serde_json::from_value(serde_json::json!({ "id": "set", "name": "S", "pens": { "pen": { "color": "#ff0000", "weight": 0.35 } } })).unwrap()]);
|
||||
let out = run_lines(&p, false);
|
||||
let main = out.iter().find_map(|q| match q {
|
||||
Primitive::Line { dash: Some(d), weight_mm, color, .. } => Some((d.clone(), *weight_mm, color.clone())),
|
||||
_ => None,
|
||||
});
|
||||
let (d, w, col) = main.expect("Hauptlinie");
|
||||
assert_eq!(d, Some(vec![0.0, 1.0]));
|
||||
assert!((w - 0.35).abs() < 1e-12);
|
||||
assert_eq!(col.as_deref(), Some("#ff0000"));
|
||||
// Ohne Stift: Farbe des Linientyps.
|
||||
p.drawing_levels[0].line_pen_id = None;
|
||||
let out = run_lines(&p, false);
|
||||
assert!(out.iter().any(|q| matches!(q, Primitive::Line { color: Some(c), dash: Some(_), .. } if &**c == "#00ff00")));
|
||||
}
|
||||
|
||||
/// [276] Ansicht: Basis wie bisher (nur Dreieck + Bezeichnung, keine Linie); mit Linie, Pfeil oder ohne Zeichen.
|
||||
#[test]
|
||||
fn ansichtslinie_varianten() {
|
||||
let run = |lv: serde_json::Value| run_lines(&look_project("elevation", lv, None), false);
|
||||
assert_eq!(count_parts(&run(serde_json::json!({}))), (0, 0, 1, 1));
|
||||
assert_eq!(count_parts(&run(serde_json::json!({ "lineMode": "full" }))), (1, 2, 1, 1));
|
||||
assert_eq!(count_parts(&run(serde_json::json!({ "lineMode": "ends", "marker": "none" }))), (0, 2, 0, 1));
|
||||
assert_eq!(count_parts(&run(serde_json::json!({ "marker": "arrow" }))), (0, 1, 1, 1));
|
||||
assert_eq!(count_parts(&run(serde_json::json!({ "marker": "none", "markerLabel": false }))), (0, 0, 0, 0));
|
||||
let mv = serde_json::json!({ "elevationMarks": { "lineMode": "full" } });
|
||||
assert_eq!(count_parts(&run_lines(&look_project("elevation", serde_json::json!({}), Some(mv)), true)), (1, 2, 1, 1), "Vorgabe Ansichten");
|
||||
}
|
||||
|
||||
/// [176] Geknickter Schnitt: Knickpunkte aus `bendPoints` erscheinen als kräftige Stücke im Grundriss; ohne
|
||||
|
||||
+227
-70
@@ -15,9 +15,10 @@
|
||||
//! 5 label [5, x, y] (unten links; Kurz-Tag setzt der Aufrufer)
|
||||
//! 1 polygon [1, x0, y0 … x3, y3] (unsichtbares Pick-Band)
|
||||
//! ```
|
||||
//! 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.
|
||||
//! Darstellung ([276], [`SectionLook`]): Linie `full` (dünn + kräftige Endstücke) | `ends` (nur Endstücke) | `none`; Marke je Ende
|
||||
//! (`markerAt`) `arrow` (Schenkel + Dreieck) | `lAngle` (Schenkel, mit dem Endstück ein L) | `triangle` | `none`; Beschriftung an/aus.
|
||||
//! `section_polyline_look`; Ansicht: `view_symbol` (Zeichen in der Mitte), `view_line_parts` (Linie).
|
||||
|
||||
//! Ansicht ([176]): `view_marker_sized` → `[n, 3 triangle (flach), 5 label, 1 polygon]`, kein Kreis.
|
||||
//!
|
||||
//! ## Linienende
|
||||
@@ -31,7 +32,7 @@
|
||||
|
||||
use crate::jsmath::hypot2;
|
||||
use crate::jsnum::round;
|
||||
use crate::model::SectionMarkerStyle;
|
||||
use crate::model::{SectionLineMode, SectionMarker, SectionMarkerAt};
|
||||
use std::collections::HashSet;
|
||||
|
||||
const FOOTPRINT_Z_TOL: f64 = 0.6;
|
||||
@@ -49,6 +50,9 @@ 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;
|
||||
/// [276] Marke „Dreieck" an Schnittenden: Höhe und halbe Basis in Papier-mm.
|
||||
const TRIANGLE_HEIGHT_MM: f64 = 4.5;
|
||||
const TRIANGLE_HALF_MM: f64 = 2.0;
|
||||
const ARROW_ASPECT: f64 = 0.32;
|
||||
|
||||
/// Ganzzahl-Schlüssel für die Quantisierung; NaN/∞ bekommen feste Platzhalter (wie ihre Textform in JS).
|
||||
@@ -168,15 +172,72 @@ 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<f64> {
|
||||
section_polyline_styled(pts, sign, mm, label_w, SectionMarkerStyle::Arrow)
|
||||
section_polyline_look(pts, sign, mm, label_w, &SectionLook::default())
|
||||
}
|
||||
|
||||
/// [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;
|
||||
/// [276] Darstellung einer Schnittlinie: Linie, Endstücke, Marke und Beschriftung.
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
pub struct SectionLook {
|
||||
pub line: SectionLineMode,
|
||||
/// Länge der Endstücke in Papier-mm (an Knicken die Hälfte).
|
||||
pub end_mm: f64,
|
||||
pub marker: SectionMarker,
|
||||
pub at: SectionMarkerAt,
|
||||
pub label: bool,
|
||||
}
|
||||
|
||||
impl Default for SectionLook {
|
||||
/// Heutiges Bild des Schnitts: dünne Linie mit kräftigen Endstücken, Pfeil an beiden Enden, Beschriftung.
|
||||
fn default() -> Self {
|
||||
SectionLook { line: SectionLineMode::Full, end_mm: SECTION_END_PIECE_MM, marker: SectionMarker::Arrow, at: SectionMarkerAt::Both, label: true }
|
||||
}
|
||||
}
|
||||
|
||||
impl SectionLook {
|
||||
/// Welche Enden eine Marke tragen (0 = Anfang, 1 = Ende).
|
||||
pub fn marked_ends(&self) -> Vec<usize> {
|
||||
if self.marker == SectionMarker::None && !self.label {
|
||||
return Vec::new();
|
||||
}
|
||||
match self.at {
|
||||
SectionMarkerAt::Start => vec![0],
|
||||
SectionMarkerAt::End => vec![1],
|
||||
_ => vec![0, 1],
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// [276] Die Linienstücke einer Linie `pts` nach `look.line`: `[2, art, ax, ay, bx, by]` je Stück (Art 0 dünne Hauptlinie,
|
||||
/// Art 1 kräftiges End-/Knickstück), Endstücke höchstens ein Drittel des Segments.
|
||||
fn line_parts(pts: &[(f64, f64)], dirs: &[(f64, f64)], mm: f64, look: &SectionLook, o: &mut Vec<f64>, n: &mut usize) {
|
||||
if look.line == SectionLineMode::None {
|
||||
return;
|
||||
}
|
||||
let segs = pts.len() - 1;
|
||||
let end_mm = if look.end_mm.is_finite() && look.end_mm > 0.0 { look.end_mm } else { SECTION_END_PIECE_MM };
|
||||
let bend_mm = end_mm / 2.0;
|
||||
let mut line = |art: f64, a: (f64, f64), b: (f64, f64)| {
|
||||
o.extend([2.0, art, a.0, a.1, b.0, b.1]);
|
||||
*n += 1;
|
||||
};
|
||||
for i in 0..segs {
|
||||
let (a, b, (ux, uy)) = (pts[i], pts[i + 1], dirs[i]);
|
||||
let len = hypot2(b.0 - a.0, b.1 - a.1);
|
||||
let ps = (if i == 0 { end_mm } else { bend_mm } * mm).min(len / 3.0);
|
||||
let pe = (if i == segs - 1 { end_mm } else { bend_mm } * mm).min(len / 3.0);
|
||||
line(1.0, a, (a.0 + ux * ps, a.1 + uy * ps));
|
||||
if look.line != SectionLineMode::Ends {
|
||||
line(0.0, (a.0 + ux * ps, a.1 + uy * ps), (b.0 - ux * pe, b.1 - uy * pe));
|
||||
}
|
||||
line(1.0, (b.0 - ux * pe, b.1 - uy * pe), b);
|
||||
}
|
||||
}
|
||||
|
||||
/// [176]/[276] Schnittlinie nach `look`: Linie (`line_parts`), je Marke (Ende laut `look.at`): `arrow` = Schenkel (8 mm) in
|
||||
/// Blickrichtung mit gefülltem Dreieck, `lAngle` = Schenkel 6 mm (zusammen mit dem Endstück ein L), `triangle` = nur ein
|
||||
/// gefülltes Dreieck am Ende, `none` = nichts; Beschriftung (wenn `look.label`) vor der Spitze bzw. neben dem Ende;
|
||||
/// je Segment ein Pick-Band. Kurzes Beispiel: `Default` = bisheriger Pfeil.
|
||||
pub fn section_polyline_look(pts: &[(f64, f64)], sign: f64, mm: f64, label_w: f64, look: &SectionLook) -> Vec<f64> {
|
||||
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();
|
||||
}
|
||||
@@ -185,10 +246,8 @@ pub fn section_polyline_styled(pts: &[(f64, f64)], sign: f64, mm: f64, label_w:
|
||||
if pts.len() < 2 {
|
||||
return Vec::new();
|
||||
}
|
||||
let leg = SECTION_LEG_MM * mm;
|
||||
let label_h = SECTION_LABEL_MM * mm * 0.75;
|
||||
let segs = pts.len() - 1;
|
||||
// Einheitsrichtung je Segment.
|
||||
let dirs: Vec<(f64, f64)> = (0..segs)
|
||||
.map(|i| {
|
||||
let (ax, ay) = (pts[i + 1].0 - pts[i].0, pts[i + 1].1 - pts[i].1);
|
||||
@@ -198,56 +257,47 @@ pub fn section_polyline_styled(pts: &[(f64, f64)], sign: f64, mm: f64, label_w:
|
||||
.collect();
|
||||
let mut o: Vec<f64> = Vec::new();
|
||||
let mut n = 0usize;
|
||||
let line = |o: &mut Vec<f64>, n: &mut usize, art: f64, a: (f64, f64), b: (f64, f64)| {
|
||||
o.extend([2.0, art, a.0, a.1, b.0, b.1]);
|
||||
*n += 1;
|
||||
};
|
||||
// Endstück: höchstens ein Drittel des Segments, damit bei kurzen Segmenten noch ein dünnes Stück bleibt;
|
||||
// an den Knicken das kürzere Knickstück.
|
||||
for i in 0..segs {
|
||||
let (a, b, (ux, uy)) = (pts[i], pts[i + 1], dirs[i]);
|
||||
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);
|
||||
line_parts(&pts, &dirs, mm, look, &mut o, &mut n);
|
||||
let (head_l, head_hw) = (SECTION_HEAD_LEN_MM * mm, SECTION_HEAD_HALF_MM * mm);
|
||||
for which in look.marked_ends() {
|
||||
let (end, (ux, uy)) = if which == 0 { (pts[0], dirs[0]) } else { (pts[segs], dirs[segs - 1]) };
|
||||
let (bnx, bny) = (-uy * sign, ux * sign);
|
||||
// Spitze der Marke und Richtung, in der die Beschriftung davor steht.
|
||||
let (tip, label_dir) = match look.marker {
|
||||
SectionMarker::Arrow => {
|
||||
let tip = (end.0 + bnx * SECTION_LEG_MM * mm, end.1 + bny * SECTION_LEG_MM * mm);
|
||||
o.extend([2.0, 1.0, end.0, end.1, tip.0, tip.1]);
|
||||
n += 1;
|
||||
let hb = (tip.0 - bnx * head_l, tip.1 - bny * head_l);
|
||||
o.extend([3.0, tip.0, tip.1, hb.0 + ux * head_hw, hb.1 + uy * head_hw, hb.0 - ux * head_hw, hb.1 - uy * head_hw]);
|
||||
n += 1;
|
||||
(tip, (bnx, bny))
|
||||
}
|
||||
SectionMarker::Triangle => {
|
||||
// Gefülltes Dreieck am Ende, Basis auf der Linie quer zur Blickrichtung (zeigt in Blickrichtung).
|
||||
let tip = (end.0 + bnx * TRIANGLE_HEIGHT_MM * mm, end.1 + bny * TRIANGLE_HEIGHT_MM * mm);
|
||||
let hw = TRIANGLE_HALF_MM * mm;
|
||||
o.extend([3.0, tip.0, tip.1, end.0 + ux * hw, end.1 + uy * hw, end.0 - ux * hw, end.1 - uy * hw]);
|
||||
n += 1;
|
||||
(tip, (bnx, bny))
|
||||
}
|
||||
SectionMarker::LAngle => {
|
||||
let tip = (end.0 + bnx * L_SHORT_MM * mm, end.1 + bny * L_SHORT_MM * mm);
|
||||
o.extend([2.0, 1.0, end.0, end.1, tip.0, tip.1]);
|
||||
n += 1;
|
||||
// Beschriftung neben dem Ende des kurzen Schenkels, nach aussen (längs der Linie, vom Ende weg).
|
||||
(tip, if which == 0 { (-ux, -uy) } else { (ux, uy) })
|
||||
}
|
||||
_ => (end, if which == 0 { (-ux, -uy) } else { (ux, uy) }),
|
||||
};
|
||||
if look.label {
|
||||
// Kastenmitte vor der Spitze: Abstand + halbe Ausdehnung des Kastens in Richtung `label_dir`.
|
||||
let reach = mm * 1.0 + label_dir.0.abs() * label_w / 2.0 + label_dir.1.abs() * label_h / 2.0;
|
||||
let (cx, cy) = (tip.0 + label_dir.0 * reach, tip.1 + label_dir.1 * 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 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);
|
||||
let hb = (tip.0 - bnx * head_l, tip.1 - bny * head_l);
|
||||
o.extend([3.0, tip.0, tip.1, hb.0 + ux * head_hw, hb.1 + uy * head_hw, hb.0 - ux * head_hw, hb.1 - uy * head_hw]);
|
||||
n += 1;
|
||||
// Kastenmitte vor der Spitze: Abstand + halbe Ausdehnung des Kastens in Pfeilrichtung.
|
||||
let reach = mm * 1.0 + bnx.abs() * label_w / 2.0 + bny.abs() * label_h / 2.0;
|
||||
let (cx, cy) = (tip.0 + bnx * reach, tip.1 + bny * reach);
|
||||
o.extend([5.0, cx - label_w / 2.0, cy - label_h / 2.0]);
|
||||
n += 1;
|
||||
}
|
||||
let ph = SECTION_PICK_HALF.max(1.2 * mm);
|
||||
for i in 0..segs {
|
||||
let (a, b, (ux, uy)) = (pts[i], pts[i + 1], dirs[i]);
|
||||
@@ -268,6 +318,14 @@ pub fn section_polyline_styled(pts: &[(f64, f64)], sign: f64, mm: f64, label_w:
|
||||
/// `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<f64> {
|
||||
view_symbol(p0x, p0y, p1x, p1y, sign, mm, label_w, SectionMarker::Triangle, true)
|
||||
}
|
||||
|
||||
/// [276] Ansichtsmarke nach Art: `Triangle` = wie [`view_marker_sized`]; `Arrow` = kräftiger Schenkel (8 mm) in Blickrichtung
|
||||
/// mit gefülltem Dreieck (Eintrag `2 line` + `3 triangle`); sonst (`None`) kein Zeichen. Bezeichnung (wenn `label`) hinter
|
||||
/// der Mitte der Linie; das Pick-Band reicht über Zeichen und Text.
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub fn view_symbol(p0x: f64, p0y: f64, p1x: f64, p1y: f64, sign: f64, mm: f64, label_w: f64, marker: SectionMarker, label: bool) -> Vec<f64> {
|
||||
if ![p0x, p0y, p1x, p1y, sign, mm, label_w].iter().all(|x| x.is_finite()) || !(mm > 0.0) {
|
||||
return Vec::new();
|
||||
}
|
||||
@@ -279,22 +337,56 @@ 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 (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];
|
||||
let mut o: Vec<f64> = Vec::new();
|
||||
let mut n = 0.0;
|
||||
let (mut tip, mut hw) = ((cx, cy), VIEW_MARKER_HALF_MM * mm);
|
||||
match marker {
|
||||
SectionMarker::Arrow => {
|
||||
tip = (cx + bnx * SECTION_LEG_MM * mm, cy + bny * SECTION_LEG_MM * mm);
|
||||
hw = SECTION_HEAD_HALF_MM * mm;
|
||||
let hb = (tip.0 - bnx * SECTION_HEAD_LEN_MM * mm, tip.1 - bny * SECTION_HEAD_LEN_MM * mm);
|
||||
o.extend([2.0, 1.0, cx, cy, tip.0, tip.1, 3.0, tip.0, tip.1, hb.0 + ux * hw, hb.1 + uy * hw, hb.0 - ux * hw, hb.1 - uy * hw]);
|
||||
n += 2.0;
|
||||
}
|
||||
SectionMarker::None => {}
|
||||
_ => {
|
||||
tip = (cx + bnx * VIEW_MARKER_HEIGHT_MM * mm, cy + bny * VIEW_MARKER_HEIGHT_MM * mm);
|
||||
o.extend([3.0, tip.0, tip.1, cx + ux * hw, cy + uy * hw, cx - ux * hw, cy - uy * hw]);
|
||||
n += 1.0;
|
||||
}
|
||||
}
|
||||
// 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_d = if label {
|
||||
o.extend([5.0, lx - label_w / 2.0, ly - label_h / 2.0]);
|
||||
n += 1.0;
|
||||
reach + ext
|
||||
} else {
|
||||
0.0
|
||||
};
|
||||
// Pick-Band: orientiertes Rechteck von der Rückseite des Textes bis zur Spitze, breit genug für Zeichen und Text.
|
||||
let half_u = if label { hw.max(ux.abs() * label_w / 2.0 + uy.abs() * label_h / 2.0) } else { hw.max(mm) };
|
||||
let back = (cx - bnx * back_d, cy - bny * back_d);
|
||||
o.push(1.0);
|
||||
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];
|
||||
n += 1.0;
|
||||
let mut out = vec![n];
|
||||
out.extend(o);
|
||||
out
|
||||
}
|
||||
|
||||
/// [276] Linienstücke der Ansichtslinie `p0`–`p1` nach `look.line` (`[n, 2 line × n]`, Art 0/1 wie bei der Schnittlinie).
|
||||
pub fn view_line_parts(p0: (f64, f64), p1: (f64, f64), mm: f64, look: &SectionLook) -> Vec<f64> {
|
||||
let l = hypot2(p1.0 - p0.0, p1.1 - p0.1);
|
||||
if !(l > 1e-6) || ![p0.0, p0.1, p1.0, p1.1, mm].iter().all(|x| x.is_finite()) || !(mm > 0.0) {
|
||||
return Vec::new();
|
||||
}
|
||||
let (mut o, mut n) = (Vec::new(), 0usize);
|
||||
line_parts(&[p0, p1], &[((p1.0 - p0.0) / l, (p1.1 - p0.1) / l)], mm, look, &mut o, &mut n);
|
||||
let mut out = vec![n as f64];
|
||||
out.extend(o);
|
||||
out
|
||||
}
|
||||
@@ -410,11 +502,76 @@ mod tests {
|
||||
assert!(view_marker_sized(f64::NAN, 0.0, 1.0, 0.0, 1.0, 0.2, 1.0).is_empty());
|
||||
}
|
||||
|
||||
const L_LOOK: SectionLook = SectionLook { line: SectionLineMode::Ends, end_mm: 12.0, marker: SectionMarker::LAngle, at: SectionMarkerAt::Both, label: true };
|
||||
|
||||
/// Zählt Einträge je Art (2 line art 0, 2 line art 1, 3 triangle, 5 label, 1 polygon).
|
||||
fn kinds(f: &[f64]) -> (usize, usize, usize, usize, usize) {
|
||||
let (mut i, mut r) = (1, (0, 0, 0, 0, 0));
|
||||
for _ in 0..f[0] as usize {
|
||||
match f[i] {
|
||||
2.0 => {
|
||||
if f[i + 1] == 0.0 { r.0 += 1 } else { r.1 += 1 }
|
||||
i += 6;
|
||||
}
|
||||
3.0 => {
|
||||
r.2 += 1;
|
||||
i += 7;
|
||||
}
|
||||
5.0 => {
|
||||
r.3 += 1;
|
||||
i += 3;
|
||||
}
|
||||
_ => {
|
||||
r.4 += 1;
|
||||
i += 9;
|
||||
}
|
||||
}
|
||||
}
|
||||
r
|
||||
}
|
||||
|
||||
/// [276] Varianten: Linie durchgehend/Enden/keine, Marke Pfeil/L/Dreieck/keine, Ende Anfang/Ende, ohne Beschriftung.
|
||||
#[test]
|
||||
fn darstellung_varianten() {
|
||||
let pts = [(0.0, 0.0), (10.0, 0.0)];
|
||||
let run = |l: SectionLook| kinds(§ion_polyline_look(&pts, 1.0, 0.2, 1.0, &l));
|
||||
let base = SectionLook::default();
|
||||
// (dünn, kräftig, Dreieck, Label, Pick)
|
||||
assert_eq!(run(base), (1, 4, 2, 2, 1));
|
||||
assert_eq!(run(SectionLook { line: SectionLineMode::Ends, ..base }), (0, 4, 2, 2, 1));
|
||||
assert_eq!(run(SectionLook { line: SectionLineMode::None, ..base }), (0, 2, 2, 2, 1));
|
||||
assert_eq!(run(SectionLook { line: SectionLineMode::None, marker: SectionMarker::Triangle, ..base }), (0, 0, 2, 2, 1));
|
||||
assert_eq!(run(SectionLook { line: SectionLineMode::None, marker: SectionMarker::None, label: false, ..base }), (0, 0, 0, 0, 1));
|
||||
assert_eq!(run(SectionLook { marker: SectionMarker::Triangle, at: SectionMarkerAt::Start, ..base }), (1, 2, 1, 1, 1));
|
||||
assert_eq!(run(SectionLook { marker: SectionMarker::LAngle, at: SectionMarkerAt::End, label: false, ..base }), (1, 3, 0, 0, 1));
|
||||
// Dreieck am Ende: Basis auf der Linie, Spitze in Blickrichtung.
|
||||
let f = section_polyline_look(&pts, 1.0, 0.2, 1.0, &SectionLook { line: SectionLineMode::None, marker: SectionMarker::Triangle, at: SectionMarkerAt::End, label: false, ..base });
|
||||
assert_eq!(f[0], 2.0);
|
||||
assert!((f[2] - 10.0).abs() < 1e-9 && (f[3] - 0.9).abs() < 1e-9, "{f:?}");
|
||||
// Länge der Endstücke.
|
||||
let f = section_polyline_look(&pts, 1.0, 0.2, 1.0, &SectionLook { end_mm: 15.0, marker: SectionMarker::None, label: false, ..base });
|
||||
assert!((f[5] - 3.0).abs() < 1e-9, "15 mm · 0.2 = 3 m: {f:?}");
|
||||
}
|
||||
|
||||
/// [276] Ansicht: Dreieck (heute), Pfeil, keine Marke; Linie nur bei `full`/`ends`.
|
||||
#[test]
|
||||
fn ansicht_zeichen_und_linie() {
|
||||
let sym = |m, label| kinds(&view_symbol(0.0, 0.0, 10.0, 0.0, 1.0, 0.2, 1.0, m, label));
|
||||
assert_eq!(sym(SectionMarker::Triangle, true), (0, 0, 1, 1, 1));
|
||||
assert_eq!(view_symbol(0.0, 0.0, 10.0, 0.0, 1.0, 0.2, 1.0, SectionMarker::Triangle, true), view_marker_sized(0.0, 0.0, 10.0, 0.0, 1.0, 0.2, 1.0));
|
||||
assert_eq!(sym(SectionMarker::Arrow, true), (0, 1, 1, 1, 1));
|
||||
assert_eq!(sym(SectionMarker::None, false), (0, 0, 0, 0, 1));
|
||||
let look = SectionLook::default();
|
||||
assert_eq!(kinds(&view_line_parts((0.0, 0.0), (10.0, 0.0), 0.2, &look)), (1, 2, 0, 0, 0));
|
||||
assert_eq!(kinds(&view_line_parts((0.0, 0.0), (10.0, 0.0), 0.2, &SectionLook { line: SectionLineMode::Ends, ..look })), (0, 2, 0, 0, 0));
|
||||
assert_eq!(view_line_parts((0.0, 0.0), (10.0, 0.0), 0.2, &SectionLook { line: SectionLineMode::None, ..look })[0], 0.0);
|
||||
}
|
||||
|
||||
/// [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);
|
||||
let f = section_polyline_look(&[(0.0, 0.0), (10.0, 0.0)], 1.0, 0.2, 1.0, &L_LOOK);
|
||||
// 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);
|
||||
@@ -438,13 +595,13 @@ mod tests {
|
||||
}
|
||||
}
|
||||
// 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));
|
||||
assert_eq!(section_polyline_look(&[(0.0, 0.0), (10.0, 0.0)], 1.0, 0.2, 1.0, &SectionLook::default()), 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);
|
||||
let f = section_polyline_look(&[(0.0, 0.0), (10.0, 0.0), (10.0, 8.0)], 1.0, 0.2, 1.0, &L_LOOK);
|
||||
// 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);
|
||||
|
||||
@@ -330,8 +330,9 @@ pub struct Options {
|
||||
pub elevation: ElevOpts,
|
||||
pub floor_finish_mv: Option<FloorFinishDisplay>,
|
||||
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>,
|
||||
/// [176]/[276] Schnitt- bzw. Ansichtsmarken laut Modelldarstellung (die Ebene geht vor, s. [`Options::mark_look`]).
|
||||
pub section_marks_mv: Option<ModelViewSectionMarks>,
|
||||
pub elevation_marks_mv: Option<ModelViewSectionMarks>,
|
||||
/// Raumstempel.
|
||||
pub stamp: StampOpts,
|
||||
/// Bemassung.
|
||||
@@ -395,9 +396,19 @@ impl Options {
|
||||
pub fn terrain(&self, level: Option<bool>) -> Option<bool> {
|
||||
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)
|
||||
/// [276] Darstellung der Schnitt-/Ansichtslinie: Ebene > Modelldarstellung > Basis (Schnitt: Linie mit Endstücken, Pfeile
|
||||
/// an beiden Enden; Ansicht: keine Linie, Dreieck in der Mitte; beide mit Beschriftung).
|
||||
pub fn mark_look(&self, level: &DrawingLevel) -> crate::plan::misc::SectionLook {
|
||||
use crate::plan::misc::SectionLook;
|
||||
let elev = matches!(level.kind, DrawingLevelKind::Elevation);
|
||||
let mv = if elev { self.elevation_marks_mv.as_ref() } else { self.section_marks_mv.as_ref() };
|
||||
let base = SectionLook::default();
|
||||
let line = level.line_mode.or(mv.and_then(|m| m.line_mode)).filter(|x| *x != SectionLineMode::Unknown).unwrap_or(if elev { SectionLineMode::None } else { base.line });
|
||||
let marker = level.marker.or(mv.and_then(|m| m.marker)).filter(|x| *x != SectionMarker::Unknown).unwrap_or(if elev { SectionMarker::Triangle } else { base.marker });
|
||||
let at = level.marker_at.or(mv.and_then(|m| m.marker_at)).filter(|x| *x != SectionMarkerAt::Unknown).unwrap_or(base.at);
|
||||
let end_mm = level.end_length_mm.or(mv.and_then(|m| m.end_length_mm)).filter(|v| v.is_finite() && *v > 0.0).unwrap_or(base.end_mm);
|
||||
let label = level.marker_label.or(mv.and_then(|m| m.marker_label)).unwrap_or(true);
|
||||
SectionLook { line, end_mm, marker, at, label }
|
||||
}
|
||||
/// Automatische Höhenkoten in Schnitt/Ansicht: Ebene > Modelldarstellung > an.
|
||||
pub fn level_marks(&self, level: Option<bool>) -> bool {
|
||||
@@ -560,7 +571,8 @@ 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),
|
||||
section_marks_mv: mv.and_then(|m| m.section_marks.clone()),
|
||||
elevation_marks_mv: mv.and_then(|m| m.elevation_marks.clone()),
|
||||
stamp: mv.and_then(|m| m.room_stamps.as_ref()).map_or_else(StampOpts::default, |r| StampOpts { number: r.number, area: r.area, usage: r.usage, height: r.height, finish: r.finish, divider: r.divider }),
|
||||
dims: {
|
||||
let d = mv.and_then(|m| m.dimensions.as_ref());
|
||||
|
||||
@@ -563,7 +563,7 @@ fn managed(key: &str) -> &'static [&'static str] {
|
||||
"overrideRules" => &["condition", "conditions", "actions"],
|
||||
// [173] Stufen der Modelldarstellung: Basis und alle Abschnitte.
|
||||
"modelViewOptions" => &[
|
||||
"baseDetail", "doors", "windows", "stairs", "walls", "slabs", "roofs", "columns", "elevation", "site", "sectionMarks", "roomStamps", "dimensions",
|
||||
"baseDetail", "doors", "windows", "stairs", "walls", "slabs", "roofs", "columns", "elevation", "site", "sectionMarks", "elevationMarks", "roomStamps", "dimensions",
|
||||
],
|
||||
_ => &["layers"],
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user