[300] Planqualität 1💯 Ansicht-Silhouette 0.25 nur vom eigenen Haus, Nachbar-Kanten 0.09, Höhenkoten-Text 2.5 mm; Befunde in TODO
This commit is contained in:
16 files changed
+81
-28
No files matched your search
@@ -33,7 +33,8 @@ const DIM_TEXT_HEIGHT_MM: f64 = 2.5;
|
||||
// Höhenkote (SIA 400 B.5.4), fixe Modell-Meter.
|
||||
const KOTE_TRI_SIZE_M: f64 = 0.15;
|
||||
const KOTE_TRI_HALF_W_M: f64 = KOTE_TRI_SIZE_M * 0.6;
|
||||
const KOTE_TEXT_HEIGHT_M: f64 = 0.2;
|
||||
// [300] 0.25 (2.5 mm bei 1:100) wie Masszahlen und Raumstempel, vorher 0.2 (kleiner als jede andere Beschriftung).
|
||||
const KOTE_TEXT_HEIGHT_M: f64 = 0.25;
|
||||
const KOTE_TEXT_GAP_M: f64 = 0.08;
|
||||
|
||||
// Detail-/Schnitt-Verweis und Punktmarke, fixe Modell-Meter.
|
||||
@@ -3593,7 +3594,7 @@ mod tests {
|
||||
assert!(!hs.is_empty());
|
||||
for h in &hs {
|
||||
let paper_mm = h / scale * 1000.0;
|
||||
assert!((paper_mm - 2.0).abs() < 1e-9, "1:{scale}: {paper_mm} mm");
|
||||
assert!((paper_mm - 2.5).abs() < 1e-9, "1:{scale}: {paper_mm} mm");
|
||||
}
|
||||
let tri = out.iter().find_map(|q| if let Primitive::Polygon { pts, .. } = q { Some(pts[0].x) } else { None });
|
||||
assert_eq!(tri, Some(-1.2 * scale / 100.0), "1:{scale}");
|
||||
|
||||
@@ -25,6 +25,7 @@ impl Role {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
pub(super) struct Face {
|
||||
pub(super) pts: Vec<Pt>,
|
||||
/// Tiefe je Ecke ([G4]).
|
||||
|
||||
@@ -40,8 +40,10 @@ pub(crate) use cull::fascia_quads;
|
||||
const EDGE_INK: &str = "#2b3039";
|
||||
const EDGE_MM: f64 = 0.13;
|
||||
/// [140] Silhouette (Umriss aller Bauteile zusammen) mittelstark: hebt den Baukörper von Details (0.13) ab;
|
||||
/// Terrainlinie kräftig ([`GROUND_MM`]).
|
||||
const SILHOUETTE_MM: f64 = 0.18;
|
||||
/// Terrainlinie kräftig ([`GROUND_MM`]). [300] 0.25 statt 0.18: bei 1:100 war der Unterschied zu 0.13 nicht zu sehen.
|
||||
const SILHOUETTE_MM: f64 = 0.25;
|
||||
/// [300] Kanten von Kontext-Netzen (Nachbarn, Umgebungsklassen) feiner als Details des eigenen Hauses.
|
||||
const CONTEXT_MM: f64 = 0.09;
|
||||
/// [140] Abstand (m), bis zu dem eine Kante als Teil der Silhouette gilt.
|
||||
const SILHOUETTE_TOL: f64 = 2e-3;
|
||||
const FRAME_MM: f64 = 0.13;
|
||||
@@ -884,7 +886,9 @@ pub fn elevation_primitives_ren(p: &Project, level: &LevelSpec, shadows: bool, m
|
||||
});
|
||||
let mut prims: Vec<Primitive> = items.into_iter().map(|it| it.prim).collect();
|
||||
// Exakt sichtbare Kanten liegen über allen Füllungen (Füllungen: sichtbare Teile, `visible_fills`).
|
||||
let silhouette = Silhouette::of(&faces);
|
||||
// [300] Silhouette nur des eigenen Hauses: ein Nachbar dahinter (Kontext) machte dessen Umriss zur inneren Kante (0.13).
|
||||
let own: Vec<Face> = faces.iter().filter(|f| !(f.role == Role::Mesh && category(f).is_some_and(crate::import_context::is_context_class))).cloned().collect();
|
||||
let silhouette = Silhouette::of(&own);
|
||||
for e in &edges {
|
||||
acc.add(e.a[0], e.a[1]);
|
||||
acc.add(e.b[0], e.b[1]);
|
||||
@@ -899,6 +903,9 @@ pub fn elevation_primitives_ren(p: &Project, level: &LevelSpec, shadows: bool, m
|
||||
*dash = Some(Some(HIDDEN_DASH.to_vec()));
|
||||
}
|
||||
prims.push(l);
|
||||
} else if e.owner > 0 && faces.get(e.owner as usize - 1).is_some_and(|f| f.role == Role::Mesh && category(f).is_some_and(crate::import_context::is_context_class)) {
|
||||
let l = line(v2(e.a[0], e.a[1]), v2(e.b[0], e.b[1]), "elevation-outline", CONTEXT_MM, EDGE_INK);
|
||||
prims.push(match ov { Some(o) => o.restyle(l), None => l });
|
||||
} else if silhouette.on(e.a, e.b) {
|
||||
let l = line(v2(e.a[0], e.a[1]), v2(e.b[0], e.b[1]), "elevation-outline", SILHOUETTE_MM, EDGE_INK);
|
||||
prims.push(match ov { Some(o) => o.restyle(l), None => l });
|
||||
|
||||
@@ -1287,3 +1287,46 @@ fn fenster_in_bogenwand_wie_im_3d() {
|
||||
assert!((gap - mid).abs() < 0.01, "{bulge:?}/{reveal}: Flügelteilung bei {gap}, auf dem Bogen/der Sehne {mid}");
|
||||
}
|
||||
}
|
||||
|
||||
/// [300] Linienhierarchie der Ansicht: Silhouette des Hauses deutlich kräftiger als Details (0.13), Nachbarn (Kontext)
|
||||
/// feiner als Details — sonst steht das Nachbarhaus gleich stark wie das eigene.
|
||||
#[test]
|
||||
fn ansicht_haus_kraeftiger_als_nachbar() {
|
||||
use crate::mesh_view::tests::cube;
|
||||
assert!(SILHOUETTE_MM >= EDGE_MM + 0.1, "Silhouette {SILHOUETTE_MM} zu nah an {EDGE_MM}");
|
||||
let (positions, indices) = cube(6.0, 8.0, 2.0, 3.0, 0.0, 2.0);
|
||||
let nb = ContextObject::ImportedMesh(ImportedMesh { id: "nb".into(), name: "nb".into(), category_code: "12".into(), positions, indices, ..Default::default() });
|
||||
// Ein grösserer Nachbar HINTER dem Haus darf dessen Umriss nicht zu einer inneren Kante machen.
|
||||
let (positions, indices) = cube(-1.0, 6.0, 5.0, 6.0, 0.0, 6.0);
|
||||
let bg = ContextObject::ImportedMesh(ImportedMesh { id: "bg".into(), name: "bg".into(), category_code: "12".into(), positions, indices, ..Default::default() });
|
||||
let level = LevelSpec { kind: "elevation".into(), line: Some([Vec2 { x: -5.0, y: -1.0 }, Vec2 { x: 12.0, y: -1.0 }]), direction_sign: Some(1.0), ..Default::default() };
|
||||
let p = Project {
|
||||
context: Some(vec![nb, bg]),
|
||||
walls: vec![Wall { id: "w".into(), start: Vec2 { x: 0.0, y: 0.0 }, end: Vec2 { x: 4.0, y: 0.0 }, height: 3.0, ..Default::default() }],
|
||||
..Default::default()
|
||||
};
|
||||
let (prims, _) = elevation_primitives(&p, &level, false, false, &Visibility::default(), 100.0).unwrap().unwrap();
|
||||
// u = x + 5: Haus 5…9, Nachbar 11…13.
|
||||
let w_of = |lo: f64, hi: f64| -> Vec<f64> {
|
||||
prims
|
||||
.iter()
|
||||
.filter_map(|q| match q {
|
||||
Primitive::Line { a, b, cls, weight_mm, .. } if cls == "elevation-outline" && a.x.min(b.x) > lo && a.x.max(b.x) < hi => Some(*weight_mm),
|
||||
_ => None,
|
||||
})
|
||||
.collect()
|
||||
};
|
||||
let house = w_of(4.9, 9.1);
|
||||
let neighbour = w_of(10.9, 13.1);
|
||||
assert!(!house.is_empty() && !neighbour.is_empty(), "{house:?} {neighbour:?}");
|
||||
assert!(house.iter().any(|&w| w >= EDGE_MM + 0.1), "Haus: {house:?}");
|
||||
let top: Vec<f64> = prims
|
||||
.iter()
|
||||
.filter_map(|q| match q {
|
||||
Primitive::Line { a, b, cls, weight_mm, .. } if cls == "elevation-outline" && (a.y - 3.0).abs() < 1e-6 && (b.y - 3.0).abs() < 1e-6 && a.x.min(b.x) > 4.9 && a.x.max(b.x) < 9.1 => Some(*weight_mm),
|
||||
_ => None,
|
||||
})
|
||||
.collect();
|
||||
assert!(!top.is_empty() && top.iter().all(|&w| w >= EDGE_MM + 0.1), "Oberkante des Hauses (Nachbar dahinter): {top:?}");
|
||||
assert!(neighbour.iter().all(|&w| w < EDGE_MM), "Nachbar: {neighbour:?}");
|
||||
}
|
||||
Reference in new issue
Block a user