[171] Plan-Review Runde 2: Schatten nur im Ansichtsbereich, Flächenzeile nach Rundungsschritt, Rundfenster in Schnitt und Ansicht, Wand unter Rohdecke, OG-Ecken in der Ansicht, Höhenkoten neben dem Gebauten
Tests je Fix (sun.rs, domains.rs, section/tests.rs, elevation/tests.rs, viewportPlan.test.ts), Goldens Plan/CLI neu (OG/DG Schatten, Schnitt A, Ansicht Süd). TODO.md [171] mit offenen Befunden.
This commit is contained in:
24 files changed
+334
-59
No files matched your search
@@ -671,6 +671,8 @@ pub(super) fn apply_wall_termination(bands: Vec<Cut>, walls: &[Option<&Wall>]) -
|
||||
if slab_bands.is_empty() {
|
||||
return bands;
|
||||
}
|
||||
// [171] Lage aller Platten- und Wandbänder (für Wände ohne `sliceTermination`, s. `end_below_floor_buildup`).
|
||||
let bands_meta: Vec<(Kind, [f64; 4], Option<f64>, Option<String>)> = bands.iter().map(|b| (b.kind, bbox(&b.pts), b.join_priority, b.source_id.clone())).collect();
|
||||
let mut out = Vec::with_capacity(bands.len());
|
||||
for b in bands {
|
||||
if b.kind != Kind::Wall {
|
||||
@@ -679,7 +681,7 @@ pub(super) fn apply_wall_termination(bands: Vec<Cut>, walls: &[Option<&Wall>]) -
|
||||
}
|
||||
let term = walls.get(b.index).copied().flatten().and_then(|w| w.slice_termination);
|
||||
let (Some(term @ (SliceTermination::Below | SliceTermination::Above)), Some(jp)) = (term, b.join_priority) else {
|
||||
out.push(b);
|
||||
out.extend(end_below_floor_buildup(b, &bands_meta));
|
||||
continue;
|
||||
};
|
||||
let wb = bbox(&b.pts);
|
||||
@@ -711,6 +713,36 @@ pub(super) fn apply_wall_termination(bands: Vec<Cut>, walls: &[Option<&Wall>]) -
|
||||
out
|
||||
}
|
||||
|
||||
/// [171] Wand von unten ohne Wand darüber (einfaches Musterhaus: Innenwand EG bis OK Fertigboden OG): sie endet
|
||||
/// unter der tragenden Platte, die sie dominiert, statt mit ihrem Rest durch Trittschalldämmung und Unterlagsboden
|
||||
/// zu stechen. Nur wenn der Rest über der Platte (< 0.5 m) ganz im Plattenaufbau liegt und keine andere Wand darauf
|
||||
/// steht (sonst bleibt der Stoss wie bisher: Wand darüber, Aufbau stösst an).
|
||||
fn end_below_floor_buildup(b: Cut, meta: &[(Kind, [f64; 4], Option<f64>, Option<String>)]) -> Vec<Cut> {
|
||||
const EPS: f64 = 1e-6;
|
||||
let (Some(jp), true) = (b.join_priority, b.pts.len() >= 3) else { return vec![b] };
|
||||
let wb = bbox(&b.pts);
|
||||
let covers_u = |r: &[f64; 4]| r[0] <= wb[0] + EPS && r[1] >= wb[1] - EPS;
|
||||
// Unterste dominierende Platte, die die Wand ganz quert und knapp unter der Wandkrone endet (bei dünnen
|
||||
// Putzschichten dominiert auch der Unterlagsboden; die Wand endet trotzdem unter der Rohdecke).
|
||||
let Some(slab) = meta
|
||||
.iter()
|
||||
.filter(|(k, r, p, _)| *k == Kind::Slab && p.is_some_and(|q| q > jp) && covers_u(r) && r[2] > wb[2] + EPS && r[3] < wb[3] - EPS && wb[3] - r[3] < 0.5)
|
||||
.map(|m| m.1)
|
||||
.min_by(|a, b| a[2].total_cmp(&b[2]))
|
||||
else {
|
||||
return vec![b];
|
||||
};
|
||||
let stack_top = meta.iter().filter(|(k, r, _, _)| *k == Kind::Slab && covers_u(r) && r[2] >= slab[3] - 1e-4 && r[2] < wb[3]).map(|m| m.1[3]).fold(slab[3], f64::max);
|
||||
if wb[3] > stack_top + 1e-4 {
|
||||
return vec![b];
|
||||
}
|
||||
let wall_above = meta.iter().any(|(k, r, _, src)| *k == Kind::Wall && *src != b.source_id && r[0] < wb[1] - EPS && r[1] > wb[0] + EPS && r[2] >= slab[3] - 1e-4 && r[2] <= wb[3] + 1e-4);
|
||||
if wall_above {
|
||||
return vec![b];
|
||||
}
|
||||
clip_band(b, [wb[0], wb[1], wb[2], slab[2]])
|
||||
}
|
||||
|
||||
/// Band auf das Rechteck `[u0, u1, v0, v1]` beschnitten; ein Band mit Anschlag-Nase ([94], kein
|
||||
/// Rechteck) behält seine Form.
|
||||
fn clip_band(b: Cut, r: [f64; 4]) -> Vec<Cut> {
|
||||
|
||||
@@ -30,9 +30,11 @@ pub(super) fn shaped_wall_cuts(cuts: &mut [Cut], p: &Project, walls_r: &[RWall],
|
||||
}
|
||||
let (rx, ry) = (base.0 - wall.start.x, base.1 - wall.start.y);
|
||||
let along = (rx * u.1 - ry * u.0) / den;
|
||||
if along <= from + 1e-4 || along >= to - 1e-4 {
|
||||
// [171] Auch genau am Rand des Rechtecks (Sehne fast 0): sonst bliebe dort das Rechteck-Loch ohne Fenster.
|
||||
if along < from - 1e-4 || along > to + 1e-4 {
|
||||
continue;
|
||||
}
|
||||
let along = along.clamp(from, to);
|
||||
let (zb, zt) = opening_extent(p, wall, o);
|
||||
let Some(poly) = crate::opening_shape::opening_outline(o, to - from, zt - zb) else { continue };
|
||||
let Some((lo, hi)) = crate::opening_shape::v_range(&poly, along - from) else { continue };
|
||||
|
||||
@@ -561,6 +561,55 @@ fn rundbogen_im_schnitt() {
|
||||
assert!(!ys.is_empty() && ys.iter().all(|y| *y < want + 5e-3), "kein Sturz/Kasten über dem Bogen: {ys:?}");
|
||||
}
|
||||
|
||||
/// [171] Rundfenster, Schnitt genau am Rand seines Rechtecks (Musterhaus komplex, Schnitt B-B im DG): die Wand
|
||||
/// ist dort ganz (Sehne 0), statt eines leeren Rechteck-Lochs ohne Fenster.
|
||||
#[test]
|
||||
fn rundfenster_schnitt_am_rand_ohne_loch() {
|
||||
let mut p = sample_flush();
|
||||
for o in p.openings.iter_mut().flatten().filter(|o| o.id == "O1") {
|
||||
o.shape = Some(OpeningShape::Rund);
|
||||
o.height = o.width;
|
||||
}
|
||||
let o1 = p.openings.as_deref().unwrap().iter().find(|o| o.id == "O1").unwrap().clone();
|
||||
let w1 = p.walls.iter().find(|w| w.id == o1.host_wall_id).unwrap().clone();
|
||||
let (u, n) = axis_frame(&w1);
|
||||
let (zb, zt) = opening_extent(&p, &w1, &o1);
|
||||
for m in [o1.position, o1.position + o1.width, o1.position + 1e-5] {
|
||||
let c = (w1.start.x + u.0 * m, w1.start.y + u.1 * m);
|
||||
let l = LevelSpec { kind: "section".into(), line: Some([Vec2 { x: c.0 - n.0 * 3.0, y: c.1 - n.1 * 3.0 }, Vec2 { x: c.0 + n.0 * 3.0, y: c.1 + n.1 * 3.0 }]), ..Default::default() };
|
||||
let out = compute_section(&p, &l, &[]).unwrap().unwrap();
|
||||
let mut iv: Vec<(f64, f64)> = out.cuts.iter().filter(|c| c.kind == Kind::Wall && c.source_id.as_deref() == Some("W1")).map(|c| c.pts.iter().fold((f64::INFINITY, f64::NEG_INFINITY), |(l, h), q| (l.min(q[1]), h.max(q[1])))).collect();
|
||||
iv.sort_by(|a, b| a.0.total_cmp(&b.0));
|
||||
// Die Wandbänder decken die ganze Fensterhöhe ohne Lücke.
|
||||
let mut reach = zb;
|
||||
for (lo, hi) in &iv {
|
||||
if *lo <= reach + 1e-3 {
|
||||
reach = reach.max(*hi);
|
||||
}
|
||||
}
|
||||
assert!(reach >= zt, "Wand bei {m}: Lücke über {reach} ({zb}..{zt}) {iv:?}");
|
||||
}
|
||||
}
|
||||
|
||||
/// [171] Innenwand des EG ohne Wand darüber (einfaches Musterhaus, W9): sie endet unter der tragenden Platte und
|
||||
/// sticht nicht durch Trittschalldämmung und Unterlagsboden des OG.
|
||||
#[test]
|
||||
fn wand_von_unten_sticht_nicht_durch_den_bodenaufbau() {
|
||||
let p = sample();
|
||||
let out = compute_section(&p, &level(&p, "schnitt-a"), &[]).unwrap().unwrap();
|
||||
let w9_top = out.cuts.iter().filter(|c| c.kind == Kind::Wall && c.source_id.as_deref() == Some("W9")).flat_map(|c| c.pts.iter().map(|q| q[1])).fold(f64::NEG_INFINITY, f64::max);
|
||||
let slab_bottom = out.cuts.iter().filter(|c| c.kind == Kind::Slab && c.component_id.as_deref() == Some("concrete")).flat_map(|c| c.pts.iter().map(|q| q[1])).fold(f64::INFINITY, f64::min);
|
||||
assert!(w9_top.is_finite() && slab_bottom.is_finite());
|
||||
assert!(w9_top <= slab_bottom + 1e-6, "W9 bis {w9_top}, Platte ab {slab_bottom}");
|
||||
// Der Bodenaufbau über W9 bleibt durchgehend (ein Band je Schicht über die Wand hinweg).
|
||||
let (u0, u1) = out.cuts.iter().filter(|c| c.kind == Kind::Wall && c.source_id.as_deref() == Some("W9")).flat_map(|c| c.pts.iter().map(|q| q[0])).fold((f64::INFINITY, f64::NEG_INFINITY), |(l, h), x| (l.min(x), h.max(x)));
|
||||
let over = out.cuts.iter().filter(|c| c.kind == Kind::Slab && c.component_id.as_deref() == Some("screed")).any(|c| {
|
||||
let (l, h) = c.pts.iter().fold((f64::INFINITY, f64::NEG_INFINITY), |(l, h), q| (l.min(q[0]), h.max(q[0])));
|
||||
l < u0 - 0.01 && h > u1 + 0.01
|
||||
});
|
||||
assert!(over, "Unterlagsboden ohne Unterbruch über W9");
|
||||
}
|
||||
|
||||
/// [T2]/[G3]/[106] Bogenwand: Rundbogen-Fenster im Schnitt (Wand bis an den Bogen) und Schichteinzug
|
||||
/// am Sturz (Sehne zwischen den Laibungen).
|
||||
#[test]
|
||||
@@ -907,3 +956,4 @@ fn puffer_hat_zwei_gruppen() {
|
||||
let none = section_plan_buf(&p, &[0.0, 0.0], r#"{"level":{"kind":"section"}}"#).unwrap();
|
||||
assert!(crate::plan::buf::decode(&none).unwrap().1.is_empty());
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user