Merge branch 'worktree-agent-ac8c9c9df6bb084df' into claude/practical-noether-1hb2s1
This commit is contained in:
25 files changed
+519
-68
No files matched your search
@@ -229,6 +229,13 @@ Wer zu einer ID mehr wissen will (Entscheide, Tests, Bilder), sucht dort nach `*
|
||||
|
||||
## Schnitt und Ansicht
|
||||
|
||||
- ◐ **[178]** Deckenauflager an Aussenwänden (11.11., Wunsch Maintainer). Decke endet an der Aussenkante des Kerns
|
||||
([33] `layer_positions`), Aussendämmung/Putz laufen an der Stirn durch — abgeleitet, Umriss bleibt
|
||||
(`model3d/bearing.rs`: Platten-Umriss minus Aussenschicht-Streifen, wo vor der Wand keine Decke liegt → `emit_slabs`
|
||||
für 3D/Schnitt/Ansicht und `floor_context` für die 3D-Wandbänder). Schalter je Decke `Ceiling.edgeAtOutline`
|
||||
(Objekt-Info „Auflager bis Kern“, aus = wie Umriss). Offen: Deckenkante im Grundriss folgt noch dem Umriss;
|
||||
Bogenwände unverändert; Platte ohne Wand in gleicher Höhe (UG-Decke über Lichtschacht/kurzer Fundamentwand im
|
||||
Musterhaus komplex) bleibt bis Umriss; nicht in der Tauri-App/auf dem Mac geprüft. · S
|
||||
- ◐ **[G4]** Exakte Sichtbarkeit (HLR, Kern `hlr.rs`). Füllungen der Ansicht bleiben Maler-Ordnung (bei Gauben liegt
|
||||
eine Füllung über einer verdeckten Kante); Durchdringungslinien sich schneidender Körper fehlen; Gelände/
|
||||
Kontext-Netze nicht in der Projektion. · XL
|
||||
|
||||
@@ -3035,6 +3035,12 @@ pub struct Ceiling {
|
||||
#[serde(rename = "loadBearing", default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
pub load_bearing: Option<bool>,
|
||||
/// [178] Deckenrand an Aussenwänden: `true` = Platte bis an den Umriss (über die Aussenschichten der
|
||||
/// Wand); fehlt/`false` = Auflager bis Aussenkante der tragenden Schicht, Aussendämmung/Putz laufen
|
||||
/// an der Deckenstirn durch.
|
||||
#[serde(rename = "edgeAtOutline", default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
pub edge_at_outline: Option<bool>,
|
||||
/// Geschlossener Umriss im Grundriss (Meter). Der Schlusspunkt wird NICHT
|
||||
/// dupliziert (die letzte Kante läuft von outline[n-1] zu outline[0]).
|
||||
pub outline: Vec<Vec2>,
|
||||
|
||||
@@ -0,0 +1,364 @@
|
||||
//! [178] Deckenauflager an Aussenwänden: Die Geschossdecke endet an der Aussenkante der tragenden Schicht
|
||||
//! (Kern nach [33] `layer_positions`) einer mehrschichtigen Aussenwand; die Schichten davor (Aussendämmung,
|
||||
//! Putz, Bekleidung) laufen an der Deckenstirn ohne Unterbruch durch. Der Deckenumriss im Modell bleibt;
|
||||
//! abgeleitet wird der Platten-Umriss ([`bearing_outlines`]): Umriss minus Aussenschicht-Streifen. Er gilt
|
||||
//! für die Platte (`emit_slabs`: 3D, Schnitt, Ansicht) und für den Decken-Ausschnitt der 3D-Wandbänder
|
||||
//! (`floor_context`): die Aussenschicht-Bänder liegen dann ausserhalb und werden nicht mehr ausgeschnitten.
|
||||
//!
|
||||
//! Aussenwand heisst hier geometrisch, je Stück der Wandlänge: Ein Punkt knapp vor der Aussenfläche
|
||||
//! (Schicht 0) liegt ausserhalb des Deckenumrisses. Wo die Decke vor der Wand weiterläuft (Anbau, Balkon),
|
||||
//! bleibt sie. Innenwände (Decke beidseits), einschalige Wände, Bogenwände, Wände ohne Höhen-Überlappung mit
|
||||
//! der Platte und Decken mit `edgeAtOutline` (Verhalten „wie Deckenumriss") bleiben unverändert.
|
||||
|
||||
use super::*;
|
||||
use kernel2d::point_in_outline;
|
||||
use std::collections::HashSet;
|
||||
|
||||
/// Abstand (m) des Prüfpunkts vor der Aussenfläche.
|
||||
const PROBE: f64 = 0.05;
|
||||
/// Mindestüberlappung (m) Wand ↔ Platte in der Höhe.
|
||||
const Z_EPS: f64 = 1e-4;
|
||||
/// Abtastschritt (m) längs der Wand für den Prüfpunkt; Wechsel per Bisektion genau.
|
||||
const STEP: f64 = 0.1;
|
||||
|
||||
/// Aussenschichten einer geraden, mehrschichtigen Wand: Querversatz (linke Normale ab Achse) der
|
||||
/// Aussenfläche und der Aussenkante des Kerns.
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
pub(crate) struct OuterFaces {
|
||||
pub o_out: f64,
|
||||
pub o_core: f64,
|
||||
}
|
||||
|
||||
pub(crate) fn outer_faces(p: &Project, w: &Wall) -> Option<OuterFaces> {
|
||||
if w.is_external == Some(false) || crate::wall_arc::WallArc::of_wall(w).is_some() {
|
||||
return None;
|
||||
}
|
||||
let layers = &p.wall_type(w)?.layers;
|
||||
if layers.len() < 2 || !layers.iter().all(|l| l.thickness.is_finite() && l.thickness >= 0.0) {
|
||||
return None;
|
||||
}
|
||||
let count = crate::plan::overrides::layer_positions(p, layers).iter().take_while(|s| **s == "above").count();
|
||||
if count == 0 || count >= layers.len() {
|
||||
return None;
|
||||
}
|
||||
let outer: f64 = layers[..count].iter().map(|l| l.thickness).sum();
|
||||
let total = Project::type_thickness(layers);
|
||||
if !(outer > 1e-6 && total > outer) {
|
||||
return None;
|
||||
}
|
||||
let o_out = joins::reference_offset(wall_reference(w), total) - total / 2.0;
|
||||
Some(OuterFaces { o_out, o_core: o_out + outer })
|
||||
}
|
||||
|
||||
/// Achsrichtung (Einheitsvektor), linke Normale, Länge; `None` bei entarteter Achse.
|
||||
fn axis(w: &Wall) -> Option<([f64; 2], [f64; 2], f64)> {
|
||||
let (dx, dy) = (w.end.x - w.start.x, w.end.y - w.start.y);
|
||||
let l = hypot2(dx, dy);
|
||||
if !(l > 1e-9) {
|
||||
return None;
|
||||
}
|
||||
let u = [dx / l, dy / l];
|
||||
Some((u, [-u[1], u[0]], l))
|
||||
}
|
||||
|
||||
fn overlaps_z(p: &Project, w: &Wall, c: &Ceiling) -> bool {
|
||||
let (wb, wt) = p.wall_vertical_extent(w);
|
||||
let (cb, ct) = p.ceiling_vertical_extent(c);
|
||||
wt.min(ct) - wb.max(cb) > Z_EPS
|
||||
}
|
||||
|
||||
/// Achslage (m ab Wandstart), an der die Schnittlinie `cut` den Querversatz `o` trifft.
|
||||
fn cut_param(w: &Wall, u: [f64; 2], n: [f64; 2], o: f64, cut: &joins::Line) -> Option<f64> {
|
||||
let q = [w.start.x + n[0] * o, w.start.y + n[1] * o];
|
||||
let den = u[0] * cut.dir.y - u[1] * cut.dir.x;
|
||||
let s = ((cut.point.x - q[0]) * cut.dir.y - (cut.point.y - q[1]) * cut.dir.x) / den;
|
||||
(den.abs() > 1e-12 && s.is_finite()).then_some(s)
|
||||
}
|
||||
|
||||
/// Achsbereich des Wandkörpers zwischen den Stosslinien (T-Stoss: ab der Fläche der Durchgangswand).
|
||||
fn body_range(w: &Wall, f: &OuterFaces, cuts: &WallCuts) -> Option<[f64; 2]> {
|
||||
let (u, n, l) = axis(w)?;
|
||||
let ends = |cut: Option<joins::Line>, default: f64, start: bool| -> f64 {
|
||||
let Some(c) = cut else { return default };
|
||||
let ps: Vec<f64> = [f.o_out, f.o_core].iter().filter_map(|&o| cut_param(w, u, n, o, &c)).filter(|s| s.abs() < 2.0 * l).collect();
|
||||
if ps.is_empty() { return default }
|
||||
if start { ps.iter().copied().fold(f64::INFINITY, f64::min).max(0.0) } else { ps.iter().copied().fold(f64::NEG_INFINITY, f64::max).min(l) }
|
||||
};
|
||||
let r = [ends(cuts.start_cut, 0.0, true), ends(cuts.end_cut, l, false)];
|
||||
(r[1] - r[0] > 1e-6).then_some(r)
|
||||
}
|
||||
|
||||
/// Achs-Intervalle `[a, b]` (m ab Wandstart, innerhalb `range`), auf denen der Punkt vor der Aussenfläche
|
||||
/// ausserhalb des Umrisses liegt.
|
||||
fn exterior_spans(w: &Wall, f: &OuterFaces, outline: &[KVec], [t0, t1]: [f64; 2]) -> Vec<[f64; 2]> {
|
||||
let Some((u, n, _)) = axis(w) else { return Vec::new() };
|
||||
let l = t1 - t0;
|
||||
let outside = |t: f64| {
|
||||
let (o, t) = (f.o_out - PROBE, t0 + t);
|
||||
!point_in_outline(KVec::new(w.start.x + u[0] * t + n[0] * o, w.start.y + u[1] * t + n[1] * o), outline)
|
||||
};
|
||||
let steps = ((l / STEP).ceil() as usize).clamp(8, 4096);
|
||||
let edge = |mut a: f64, mut b: f64, a_out: bool| {
|
||||
for _ in 0..40 {
|
||||
let m = (a + b) / 2.0;
|
||||
if outside(m) == a_out { a = m } else { b = m }
|
||||
}
|
||||
(a + b) / 2.0
|
||||
};
|
||||
let mut spans = Vec::new();
|
||||
let (mut prev_t, mut prev) = (0.0, outside(0.0));
|
||||
let mut from = prev.then_some(0.0);
|
||||
for i in 1..=steps {
|
||||
let t = l * i as f64 / steps as f64;
|
||||
let cur = outside(t);
|
||||
if cur != prev {
|
||||
let x = edge(prev_t, t, prev);
|
||||
match from.take() {
|
||||
Some(a) => spans.push([a, x]),
|
||||
None => from = Some(x),
|
||||
}
|
||||
}
|
||||
(prev_t, prev) = (t, cur);
|
||||
}
|
||||
if let Some(a) = from {
|
||||
spans.push([a, l]);
|
||||
}
|
||||
spans.retain(|s| s[1] - s[0] > 1e-6);
|
||||
spans.iter().map(|s| [s[0] + t0, s[1] + t0]).collect()
|
||||
}
|
||||
|
||||
/// Grundriss-Streifen der Aussenschichten (Aussenfläche bis Aussenkante Kern) über `[a, b]`; an den
|
||||
/// Wandenden an den Gehrungs-/Stosslinien (`cuts`) abgeschnitten wie der Wandkörper (`wall_footprint`).
|
||||
fn outer_strip(w: &Wall, f: &OuterFaces, cuts: &WallCuts, [a, b]: [f64; 2], [t0, t1]: [f64; 2]) -> Option<Vec<[f64; 2]>> {
|
||||
let (u, n, l) = axis(w)?;
|
||||
let at = |t: f64, o: f64, cut: Option<joins::Line>| -> [f64; 2] {
|
||||
let q = [w.start.x + u[0] * t + n[0] * o, w.start.y + u[1] * t + n[1] * o];
|
||||
let Some(c) = cut else { return q };
|
||||
let den = u[0] * c.dir.y - u[1] * c.dir.x;
|
||||
if den.abs() < 1e-12 {
|
||||
return q;
|
||||
}
|
||||
let s = ((c.point.x - q[0]) * c.dir.y - (c.point.y - q[1]) * c.dir.x) / den;
|
||||
if s.is_finite() && s.abs() < l { [q[0] + u[0] * s, q[1] + u[1] * s] } else { q }
|
||||
};
|
||||
let (sc, ec) = ((a <= t0 + 1e-9).then_some(cuts.start_cut).flatten(), (b >= t1 - 1e-9).then_some(cuts.end_cut).flatten());
|
||||
let (a, b) = (if sc.is_some() { 0.0 } else { a }, if ec.is_some() { l } else { b });
|
||||
Some(vec![at(a, f.o_out, sc), at(b, f.o_out, ec), at(b, f.o_core, ec), at(a, f.o_core, sc)])
|
||||
}
|
||||
|
||||
/// Abzugs-Streifen einer Wand für eine Decke (leer: Wand trägt die Decke nicht als Aussenwand).
|
||||
pub(crate) fn wall_cutters(p: &Project, w: &Wall, cuts: &WallCuts, c: &Ceiling) -> Vec<Vec<[f64; 2]>> {
|
||||
let Some(f) = outer_faces(p, w) else { return Vec::new() };
|
||||
if cuts.covered || c.edge_at_outline == Some(true) || c.outline.len() < 3 || !overlaps_z(p, w, c) {
|
||||
return Vec::new();
|
||||
}
|
||||
let k: Vec<KVec> = c.outline.iter().map(|v| KVec::new(v.x, v.y)).collect();
|
||||
let Some(range) = body_range(w, &f, cuts) else { return Vec::new() };
|
||||
exterior_spans(w, &f, &k, range).into_iter().filter_map(|s| outer_strip(w, &f, cuts, s, range)).collect()
|
||||
}
|
||||
|
||||
fn ring_area(r: &[[f64; 2]]) -> f64 {
|
||||
(0..r.len()).map(|i| { let (a, b) = (r[i], r[(i + 1) % r.len()]); a[0] * b[1] - b[0] * a[1] }).sum::<f64>().abs() / 2.0
|
||||
}
|
||||
|
||||
fn bbox_of(pts: impl Iterator<Item = [f64; 2]>) -> [f64; 4] {
|
||||
pts.fold([f64::INFINITY, f64::INFINITY, f64::NEG_INFINITY, f64::NEG_INFINITY], |b, q| [b[0].min(q[0]), b[1].min(q[1]), b[2].max(q[0]), b[3].max(q[1])])
|
||||
}
|
||||
|
||||
/// Platten-Umrisse aller Decken (Index wie `Project::ceilings`), s. [`bearing_outlines`].
|
||||
pub(crate) fn ceiling_bearing_outlines(p: &Project) -> Vec<Option<Vec<crate::flat::Polygon>>> {
|
||||
bearing_outlines(p, |_| true, None)
|
||||
}
|
||||
|
||||
/// Platten-Umrisse je Decke (Index wie `Project::ceilings`; nur Decken mit `only`): `None` = Umriss
|
||||
/// unverändert, sonst die Polygone (Ring 0 aussen, weitere Löcher) nach Abzug der Aussenschicht-Streifen
|
||||
/// der Aussenwände, die die Platte in der Höhe überlappen. `known`: schon gerechnete Schnittlinien je Wand-id
|
||||
/// (sonst je betroffenes Geschoss neu).
|
||||
pub(crate) fn bearing_outlines(p: &Project, only: impl Fn(&Ceiling) -> bool, known: Option<&HashMap<String, WallCuts>>) -> Vec<Option<Vec<crate::flat::Polygon>>> {
|
||||
let ceilings = p.ceilings.as_deref().unwrap_or(&[]);
|
||||
let mut out = vec![None; ceilings.len()];
|
||||
let todo: Vec<usize> = (0..ceilings.len()).filter(|&i| only(&ceilings[i]) && ceilings[i].edge_at_outline != Some(true) && ceilings[i].outline.len() >= 3).collect();
|
||||
if todo.is_empty() {
|
||||
return out;
|
||||
}
|
||||
let walls: Vec<&Wall> = p.walls.iter().filter(|w| outer_faces(p, w).is_some() && todo.iter().any(|&i| overlaps_z(p, w, &ceilings[i]))).collect();
|
||||
if walls.is_empty() {
|
||||
return out;
|
||||
}
|
||||
// Verschneidung nur der Geschosse mit solchen Wänden (wie `compute_joins_by_floor`).
|
||||
let floors: HashSet<&str> = walls.iter().map(|w| w.floor_id.as_str()).collect();
|
||||
let mut joins: HashMap<&str, WallCuts> = HashMap::new();
|
||||
for (floor, idx) in floor_groups(p) {
|
||||
if !floors.contains(floor) || known.is_some() {
|
||||
continue;
|
||||
}
|
||||
let (jw, finite) = floor_join_input(p, &idx);
|
||||
let mut cuts = floor_join_cuts(&jw, finite);
|
||||
trim_at_columns(p, &idx, &mut cuts);
|
||||
for (&i, c) in idx.iter().zip(cuts) {
|
||||
joins.insert(p.walls[i].id.as_str(), c);
|
||||
}
|
||||
}
|
||||
let none = WallCuts::default();
|
||||
for ci in todo {
|
||||
let c = &ceilings[ci];
|
||||
let ring: Vec<[f64; 2]> = c.outline.iter().map(|v| [v.x, v.y]).collect();
|
||||
let cb = bbox_of(ring.iter().copied());
|
||||
let cutters: Vec<crate::flat::Polygon> = walls
|
||||
.iter()
|
||||
.flat_map(|w| wall_cutters(p, w, known.and_then(|k| k.get(&w.id)).or_else(|| joins.get(w.id.as_str())).unwrap_or(&none), c))
|
||||
.filter(|s| {
|
||||
let b = bbox_of(s.iter().copied());
|
||||
b[0] < cb[2] && b[2] > cb[0] && b[1] < cb[3] && b[3] > cb[1]
|
||||
})
|
||||
.map(|s| vec![s])
|
||||
.collect();
|
||||
if cutters.is_empty() {
|
||||
continue;
|
||||
}
|
||||
let rest = crate::polygon_bool::difference(&[vec![ring.clone()]], &cutters);
|
||||
let rest: Vec<crate::flat::Polygon> = rest.into_iter().filter(|poly| poly.first().is_some_and(|r| r.len() >= 3)).collect();
|
||||
// Streifen nur berührt (Umriss endet schon am Kern): Umriss exakt behalten (kein Raster-Runden).
|
||||
let area = |poly: &crate::flat::Polygon| poly.iter().enumerate().map(|(i, r)| if i == 0 { ring_area(r) } else { -ring_area(r) }).sum::<f64>();
|
||||
if (rest.iter().map(area).sum::<f64>() - ring_area(&ring)).abs() < 1e-6 {
|
||||
continue;
|
||||
}
|
||||
out[ci] = Some(rest);
|
||||
}
|
||||
out
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::plan::section::{compute_section, Cut, Kind, LevelSpec};
|
||||
|
||||
/// Beispielprojekt (Aussenwand Putz 2 / EPS 16 / Backstein 15 / Innenputz 1.5 cm, Achse mittig), Decke C1
|
||||
/// bis an die Aussenfläche der Wände gezogen (bisher: Platte über Dämmung und Putz).
|
||||
fn sample(edge_at_outline: Option<bool>) -> Project {
|
||||
let mut p: Project = serde_json::from_str(include_str!("../../tests/fixtures/sample_project.json")).unwrap();
|
||||
let h = 0.345 / 2.0;
|
||||
let c = &mut p.ceilings.as_mut().unwrap()[0];
|
||||
c.outline = [(-h, -h), (5.0 + h, -h), (5.0 + h, 4.0 + h), (-h, 4.0 + h)].iter().map(|&(x, y)| Vec2 { x, y }).collect();
|
||||
c.edge_at_outline = edge_at_outline;
|
||||
p
|
||||
}
|
||||
|
||||
/// Schnitt quer durch W1 (y = 0, aussen bei y < 0) und W3, bei x = 1 (abseits der Innenwand W9).
|
||||
fn section(p: &Project) -> Vec<Cut> {
|
||||
let l = LevelSpec { kind: "section".into(), line: Some([Vec2 { x: 1.0, y: -1.0 }, Vec2 { x: 1.0, y: 5.0 }]), ..Default::default() };
|
||||
compute_section(p, &l, &[]).unwrap().unwrap().cuts
|
||||
}
|
||||
|
||||
fn bb(c: &Cut) -> [f64; 4] {
|
||||
c.pts.iter().fold([f64::INFINITY, f64::NEG_INFINITY, f64::INFINITY, f64::NEG_INFINITY], |b, q| [b[0].min(q[0]), b[1].max(q[0]), b[2].min(q[1]), b[3].max(q[1])])
|
||||
}
|
||||
|
||||
/// Bänder von W1 eines Bauteils: u-Bereich und senkrecht vereinigte v-Spannen.
|
||||
fn w1_band(cuts: &[Cut], comp: &str) -> ([f64; 2], Vec<[f64; 2]>) {
|
||||
let mut u = [f64::INFINITY, f64::NEG_INFINITY];
|
||||
let mut spans: Vec<[f64; 2]> = Vec::new();
|
||||
for c in cuts.iter().filter(|c| c.kind == Kind::Wall && c.source_id.as_deref() == Some("W1") && c.component_id.as_deref() == Some(comp)) {
|
||||
let b = bb(c);
|
||||
u = [u[0].min(b[0]), u[1].max(b[1])];
|
||||
spans.push([b[2], b[3]]);
|
||||
}
|
||||
spans.sort_by(|a, b| a[0].total_cmp(&b[0]));
|
||||
let mut merged: Vec<[f64; 2]> = Vec::new();
|
||||
for s in spans {
|
||||
match merged.last_mut() {
|
||||
Some(m) if s[0] <= m[1] + 1e-6 => m[1] = m[1].max(s[1]),
|
||||
_ => merged.push(s),
|
||||
}
|
||||
}
|
||||
(u, merged)
|
||||
}
|
||||
|
||||
fn slab_range(cuts: &[Cut], comp: &str) -> [f64; 4] {
|
||||
cuts.iter().filter(|c| c.kind == Kind::Slab && c.component_id.as_deref() == Some(comp)).map(bb).fold([f64::INFINITY, f64::NEG_INFINITY, f64::INFINITY, f64::NEG_INFINITY], |a, b| [a[0].min(b[0]), a[1].max(b[1]), a[2].min(b[2]), a[3].max(b[3])])
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn schnitt_decke_endet_an_aussenkante_backstein_daemmung_durchgehend() {
|
||||
let p = sample(None);
|
||||
let cuts = section(&p);
|
||||
let (brick_u, _) = w1_band(&cuts, "brick");
|
||||
let (eps_u, eps_z) = w1_band(&cuts, "insulation");
|
||||
let (ext_u, ext_z) = w1_band(&cuts, "render-ext");
|
||||
// Aussenfläche bei u = 1 − 0.1725, Kern 0.18 dahinter.
|
||||
assert!((ext_u[0] - (1.0 - 0.1725)).abs() < 1e-6 && (brick_u[0] - (1.0 - 0.1725 + 0.18)).abs() < 1e-6, "{ext_u:?} {brick_u:?}");
|
||||
let concrete = slab_range(&cuts, "concrete");
|
||||
assert!(concrete[0].is_finite());
|
||||
assert!((concrete[0] - brick_u[0]).abs() < 1e-6, "Platte ab u = {}, Backstein aussen bei {}", concrete[0], brick_u[0]);
|
||||
// Keine Deckenschicht vor der Aussenkante Kern.
|
||||
let any_slab_u0 = cuts.iter().filter(|c| c.kind == Kind::Slab && c.stair_id.is_none()).map(|c| bb(c)[0]).fold(f64::INFINITY, f64::min);
|
||||
assert!(any_slab_u0 >= brick_u[0] - 1e-6, "Deckenschicht ab {any_slab_u0}");
|
||||
// EPS und Aussenputz laufen an der Deckenstirn ohne Unterbruch über die ganze Wandhöhe.
|
||||
assert!((eps_u[1] - brick_u[0]).abs() < 1e-6, "{eps_u:?}");
|
||||
for (name, z) in [("EPS", &eps_z), ("Aussenputz", &ext_z)] {
|
||||
assert_eq!(z.len(), 1, "{name}: {z:?}");
|
||||
assert!(z[0][0] <= concrete[2] + 1e-6 && z[0][1] >= concrete[3] - 1e-6, "{name} {z:?} gegen Platte {concrete:?}");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn wie_deckenumriss_bleibt_beim_alten() {
|
||||
let p = sample(Some(true));
|
||||
let cuts = section(&p);
|
||||
assert!((slab_range(&cuts, "concrete")[0] - (1.0 - 0.1725)).abs() < 1e-6);
|
||||
let (_, eps_z) = w1_band(&cuts, "insulation");
|
||||
assert!(eps_z.len() > 1, "EPS von der Platte unterbrochen: {eps_z:?}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn einschalige_wand_und_innenwand_unveraendert() {
|
||||
// Einschalig: nur der Backstein bleibt im Aussenwandtyp.
|
||||
let mut p = sample(None);
|
||||
for t in p.wall_types.iter_mut().filter(|t| t.id == "aw") {
|
||||
t.layers.retain(|l| l.component_id == "brick");
|
||||
}
|
||||
assert!(ceiling_bearing_outlines(&p).iter().all(|o| o.is_none()));
|
||||
// Innenwand W9 (Decke beidseits): kein Abzug.
|
||||
let p = sample(None);
|
||||
let w9 = p.walls.iter().find(|w| w.id == "W9").unwrap();
|
||||
assert!(wall_cutters(&p, w9, &WallCuts::default(), &p.ceilings.as_ref().unwrap()[0]).is_empty());
|
||||
// Umriss schon bis Kern (Beispiel: Achse liegt in der Dämmung, Kern 7.5 mm dahinter): nur der
|
||||
// Streifen ausserhalb des Kerns fällt weg.
|
||||
let mut q: Project = serde_json::from_str(include_str!("../../tests/fixtures/sample_project.json")).unwrap();
|
||||
let c = &mut q.ceilings.as_mut().unwrap()[0];
|
||||
c.outline = [(0.0075, 0.0075), (5.0 - 0.0075, 0.0075), (5.0 - 0.0075, 4.0 - 0.0075), (0.0075, 4.0 - 0.0075)].iter().map(|&(x, y)| Vec2 { x, y }).collect();
|
||||
assert!(ceiling_bearing_outlines(&q).iter().all(|o| o.is_none()), "Umriss am Kern bleibt exakt");
|
||||
}
|
||||
|
||||
/// Decke läuft vor einem Teil der Wand weiter (Anbau/Balkon): dort bleibt sie, sonst endet sie am Kern.
|
||||
#[test]
|
||||
fn decke_vor_der_wand_bleibt_nur_dort() {
|
||||
let mut p = sample(None);
|
||||
let h = 0.345 / 2.0;
|
||||
let c = &mut p.ceilings.as_mut().unwrap()[0];
|
||||
// Auskragung vor W1 zwischen x = 3 und 4 (bis y = −1.5).
|
||||
c.outline = [(-h, -h), (3.0, -h), (3.0, -1.5), (4.0, -1.5), (4.0, -h), (5.0 + h, -h), (5.0 + h, 4.0 + h), (-h, 4.0 + h)].iter().map(|&(x, y)| Vec2 { x, y }).collect();
|
||||
let polys = ceiling_bearing_outlines(&p)[0].clone().expect("beschnitten");
|
||||
let inside = |x: f64, y: f64| polys.iter().any(|poly| point_in_outline(KVec::new(x, y), &poly[0].iter().map(|q| KVec::new(q[0], q[1])).collect::<Vec<_>>()));
|
||||
assert!(!inside(1.0, -0.1), "vor dem Kern abgezogen");
|
||||
assert!(inside(1.0, 0.05), "über dem Kern bleibt");
|
||||
assert!(inside(3.5, -0.1) && inside(3.5, -1.0), "Auskragung bleibt");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn dreid_platte_bis_kern_und_aussenschichten_ungeschnitten() {
|
||||
let p = sample(None);
|
||||
let slabs = emit_slabs(&p);
|
||||
let concrete = slabs.iter().find(|s| s.cut.as_ref().and_then(|c| c.component_id.as_deref()) == Some("concrete")).unwrap();
|
||||
let min_y = concrete.outline.iter().map(|q| q[1]).fold(f64::INFINITY, f64::min);
|
||||
assert!((min_y - (-0.1725 + 0.18)).abs() < 1e-6, "{min_y}");
|
||||
let (zb, zt) = p.ceiling_vertical_extent(&p.ceilings.as_ref().unwrap()[0]);
|
||||
let walls = emit_walls(&p, true).unwrap();
|
||||
let top = |comp: &str| walls.iter().filter(|w| w.wall_id == "W1" && w.cut.as_ref().and_then(|c| c.component_id.as_deref()) == Some(comp)).map(|w| w.base_elevation + w.height).fold(f64::NEG_INFINITY, f64::max);
|
||||
assert!(top("insulation") >= zt - 1e-6 && top("render-ext") >= zt - 1e-6, "Aussenschichten bis {} / {}, Platte bis {zt}", top("insulation"), top("render-ext"));
|
||||
// Der Kern wird von der stärkeren Betonschicht weiterhin ausgeschnitten (wie bisher).
|
||||
let z = zb + 0.1;
|
||||
assert!(!walls.iter().any(|w| w.wall_id == "W1" && w.cut.as_ref().and_then(|c| c.component_id.as_deref()) == Some("brick") && w.base_elevation < z && w.base_elevation + w.height > z));
|
||||
assert!(walls.iter().any(|w| w.wall_id == "W1" && w.cut.as_ref().and_then(|c| c.component_id.as_deref()) == Some("insulation") && w.base_elevation < z && w.base_elevation + w.height > z));
|
||||
}
|
||||
}
|
||||
@@ -29,25 +29,34 @@ pub fn emit_slabs(p: &Project) -> Vec<RSlab> {
|
||||
let mut layers_of: Vec<Option<&[Layer]>> = Vec::new();
|
||||
let mut w = FlatWriter::new();
|
||||
let count = w.slot();
|
||||
// [178] Auflager an Aussenwänden: Platte bis Aussenkante Kern (abgeleiteter Umriss, Modell unverändert).
|
||||
let bearing = super::bearing::ceiling_bearing_outlines(p);
|
||||
let v2 = |r: &[[f64; 2]]| -> Vec<Vec2> { r.iter().map(|q| Vec2 { x: q[0], y: q[1] }).collect() };
|
||||
for (ci, c) in p.ceilings.as_deref().unwrap_or(&[]).iter().enumerate() {
|
||||
if c.outline.len() < 3 {
|
||||
continue;
|
||||
}
|
||||
let (z_bottom, z_top) = p.ceiling_vertical_extent(c);
|
||||
let layers = ceiling_layers(p, c);
|
||||
w.ring(&c.outline);
|
||||
// Aussparungen inkl. der Deckenöffnungen ([103]).
|
||||
let openings = crate::opening_shape::ceiling_hole_rings(p, c);
|
||||
w.num(openings.len() as f64);
|
||||
for o in &openings {
|
||||
w.ring(o);
|
||||
let parts: Vec<(Vec<Vec2>, Vec<Vec<Vec2>>)> = match bearing.get(ci).cloned().flatten() {
|
||||
Some(polys) => polys.iter().map(|poly| (v2(&poly[0]), poly[1..].iter().map(|h| v2(h)).chain(openings.iter().cloned()).collect())).collect(),
|
||||
None => vec![(c.outline.clone(), openings)],
|
||||
};
|
||||
for (outline, holes) in parts {
|
||||
w.ring(&outline);
|
||||
w.num(holes.len() as f64);
|
||||
for o in &holes {
|
||||
w.ring(o);
|
||||
}
|
||||
w.num(z_bottom).num(z_top).num(layers.map_or(0, |l| l.len()) as f64);
|
||||
for l in layers.unwrap_or(&[]) {
|
||||
w.num(l.thickness);
|
||||
}
|
||||
ceilings.push((ci, c));
|
||||
layers_of.push(layers);
|
||||
}
|
||||
w.num(z_bottom).num(z_top).num(layers.map_or(0, |l| l.len()) as f64);
|
||||
for l in layers.unwrap_or(&[]) {
|
||||
w.num(l.thickness);
|
||||
}
|
||||
ceilings.push((ci, c));
|
||||
layers_of.push(layers);
|
||||
}
|
||||
if ceilings.is_empty() {
|
||||
return vec![];
|
||||
|
||||
@@ -22,6 +22,7 @@ use crate::jsnum::round;
|
||||
|
||||
// Teile der 3D-Ableitung ([162] aus einer Datei aufgeteilt).
|
||||
mod ceilings;
|
||||
mod bearing;
|
||||
mod columns;
|
||||
mod walls;
|
||||
mod openings;
|
||||
|
||||
@@ -574,20 +574,29 @@ pub(crate) fn floor_join_cuts(jw: &[JoinWall], finite: bool) -> Vec<WallCuts> {
|
||||
}
|
||||
|
||||
pub(crate) fn floor_context(p: &Project, floor_id: &str, with_ceilings: bool) -> FloorContext {
|
||||
floor_context_with(p, floor_id, with_ceilings, None)
|
||||
}
|
||||
|
||||
/// Wie [`floor_context`]; `joins`: schon gerechnete Schnittlinien je Wand-id (für den Deckenrand [178]).
|
||||
pub(crate) fn floor_context_with(p: &Project, floor_id: &str, with_ceilings: bool, joins: Option<&HashMap<String, WallCuts>>) -> FloorContext {
|
||||
let only = |c: &Ceiling| with_ceilings && c.floor_id == floor_id && c.outline.len() >= 3;
|
||||
// [178] Platte bis Aussenkante Kern: die Aussenschicht-Bänder der Aussenwand liegen ausserhalb und laufen durch.
|
||||
let bearing = if with_ceilings { super::bearing::bearing_outlines(p, only, joins) } else { Vec::new() };
|
||||
let ceilings: Vec<CeilingIn> = p
|
||||
.ceilings
|
||||
.as_deref()
|
||||
.unwrap_or(&[])
|
||||
.iter()
|
||||
.filter(|c| with_ceilings && c.floor_id == floor_id && c.outline.len() >= 3)
|
||||
.map(|c| {
|
||||
.enumerate()
|
||||
.filter(|(_, c)| only(c))
|
||||
.flat_map(|(ci, c)| {
|
||||
let (z_bottom, z_top) = p.ceiling_vertical_extent(c);
|
||||
CeilingIn {
|
||||
z_bottom,
|
||||
z_top,
|
||||
outline: c.outline.iter().map(|v| kv(*v)).collect(),
|
||||
layers: ceiling_layers(p, c).map(|ls| ls.iter().map(|l| (l.thickness, p.component(&l.component_id).map(|k| k.join_priority))).collect()),
|
||||
}
|
||||
let layers: Option<Vec<(f64, Option<f64>)>> = ceiling_layers(p, c).map(|ls| ls.iter().map(|l| (l.thickness, p.component(&l.component_id).map(|k| k.join_priority))).collect());
|
||||
let outlines: Vec<Vec<KVec>> = match bearing.get(ci).cloned().flatten() {
|
||||
Some(polys) => polys.iter().map(|poly| poly[0].iter().map(|q| KVec::new(q[0], q[1])).collect()).collect(),
|
||||
None => vec![c.outline.iter().map(|v| kv(*v)).collect()],
|
||||
};
|
||||
outlines.into_iter().map(move |outline| CeilingIn { z_bottom, z_top, outline, layers: layers.clone() })
|
||||
})
|
||||
.collect();
|
||||
let roofs: Vec<RoofIn> = p
|
||||
@@ -636,7 +645,7 @@ pub fn emit_walls_with(p: &Project, layered: bool, pockets: bool) -> Result<Vec<
|
||||
let by_wall = p.openings_by_wall();
|
||||
for wall in &p.walls {
|
||||
// Schnitt-Eingabe: nur die Dächer ([G2]); Decken rechnet der Schnitt selbst (Dominanz).
|
||||
let ctx = contexts.entry(wall.floor_id.as_str()).or_insert_with(|| floor_context(p, &wall.floor_id, layered));
|
||||
let ctx = contexts.entry(wall.floor_id.as_str()).or_insert_with(|| floor_context_with(p, &wall.floor_id, layered, Some(&joins)));
|
||||
let openings = by_wall.get(wall.id.as_str()).map_or(&[][..], |v| v.as_slice());
|
||||
let cuts = joins.get(&wall.id).map_or_else(WallCuts::default, |c| if layered { c.clone() } else { section_cuts(c) });
|
||||
wall_pieces(p, &maps, wall, ctx, openings, cuts, layered, pockets, &mut out);
|
||||
|
||||
@@ -65,6 +65,9 @@ pub struct Model3dCache {
|
||||
sig: Option<(u64, u64)>,
|
||||
maps: Vec<String>,
|
||||
joins: HashMap<String, JoinEntry>,
|
||||
/// [178] Decken-Eingabe je Geschoss (je `layered`) beim letzten Aufruf: Der Deckenrand hängt von den Wänden
|
||||
/// ab; ändert er sich, werden die Wände des Geschosses neu gerechnet.
|
||||
ceilings: [HashMap<String, Vec<crate::wall_bands::CeilingIn>>; 2],
|
||||
/// Je `layered` (0/1): Wand-Stand → Körper.
|
||||
walls: [HashMap<u64, WallEntry>; 2],
|
||||
/// Je Detailgrad (Bits): Wand-Stand → Einbauteile.
|
||||
@@ -164,6 +167,23 @@ impl Model3dCache {
|
||||
// Wandkörper.
|
||||
let joins = self.joins(p);
|
||||
let mut contexts: HashMap<&str, crate::wall_bands::FloorContext> = HashMap::new();
|
||||
// [178] Geschoss-Kontexte vorab (Deckenrand aus den Wänden): geänderte Decken-Eingabe → Geschoss neu.
|
||||
let mut ctx_changed: std::collections::HashSet<&str> = std::collections::HashSet::new();
|
||||
if layered {
|
||||
let mut prev = std::mem::take(&mut self.ceilings[1]);
|
||||
for wall in &p.walls {
|
||||
if contexts.contains_key(wall.floor_id.as_str()) {
|
||||
continue;
|
||||
}
|
||||
let ctx = model3d::floor_context_with(p, &wall.floor_id, true, Some(&joins));
|
||||
let inputs = ctx.ceiling_inputs();
|
||||
if prev.remove(&wall.floor_id).as_ref() != Some(&inputs) {
|
||||
ctx_changed.insert(wall.floor_id.as_str());
|
||||
}
|
||||
self.ceilings[1].insert(wall.floor_id.clone(), inputs);
|
||||
contexts.insert(wall.floor_id.as_str(), ctx);
|
||||
}
|
||||
}
|
||||
let mut old = std::mem::take(&mut self.walls[layered as usize]);
|
||||
let mut fresh: HashMap<u64, WallEntry> = HashMap::with_capacity(p.walls.len());
|
||||
let mut rebuilt = (0, 0);
|
||||
@@ -172,10 +192,10 @@ impl Model3dCache {
|
||||
let os: Vec<u64> = hosted(&wall.id).iter().map(|&i| opening_stamps[i]).collect();
|
||||
let cuts = joins.get(&wall.id).map_or_else(WallCuts::default, |c| if layered { c.clone() } else { model3d::section_cuts(c) });
|
||||
let e = match old.remove(&stamp) {
|
||||
Some(e) if e.openings == os && e.cuts == cuts => e,
|
||||
Some(e) if e.openings == os && e.cuts == cuts && !ctx_changed.contains(wall.floor_id.as_str()) => e,
|
||||
_ => {
|
||||
rebuilt.0 += 1;
|
||||
let ctx = contexts.entry(wall.floor_id.as_str()).or_insert_with(|| model3d::floor_context(p, &wall.floor_id, layered));
|
||||
let ctx = contexts.entry(wall.floor_id.as_str()).or_insert_with(|| model3d::floor_context_with(p, &wall.floor_id, layered, Some(&joins)));
|
||||
let refs: Vec<&Opening> = hosted(&wall.id).iter().map(|&i| &openings[i]).collect();
|
||||
let mut pieces = Vec::new();
|
||||
model3d::wall_pieces(p, &self.maps, wall, ctx, &refs, cuts.clone(), layered, true, &mut pieces);
|
||||
|
||||
@@ -568,6 +568,7 @@ fn ceiling_selection(root: &Map<String, Value>, c: &Value) -> Result<J, String>
|
||||
.v("singleLayer", Value::Bool(arr(field(wt, "layers")).len() <= 1))
|
||||
.v("isExternal", Value::Bool(field(c, "isExternal").and_then(Value::as_bool).unwrap_or(false)))
|
||||
.v("loadBearing", Value::Bool(field(c, "loadBearing").and_then(Value::as_bool).unwrap_or(false)))
|
||||
.v("edgeAtOutline", Value::Bool(field(c, "edgeAtOutline").and_then(Value::as_bool).unwrap_or(false)))
|
||||
.n("area", area)
|
||||
.n("volume", area * thickness)
|
||||
.v("ceilingTypes", type_choices(root, "ceilingTypes"))
|
||||
|
||||
@@ -200,6 +200,11 @@ pub struct FloorContext {
|
||||
}
|
||||
|
||||
impl FloorContext {
|
||||
/// Die Decken (Eingabe) — der 3D-Cache ([58]) vergleicht sie: der Deckenrand [178] hängt von den Wänden ab.
|
||||
pub fn ceiling_inputs(&self) -> Vec<CeilingIn> {
|
||||
self.ceilings.iter().map(|c| c.0.clone()).collect()
|
||||
}
|
||||
|
||||
pub fn new(ceilings: Vec<CeilingIn>, roofs: Vec<RoofIn>) -> Self {
|
||||
FloorContext {
|
||||
ceilings: ceilings
|
||||
|
||||
@@ -26,9 +26,9 @@
|
||||
<polygon points="0.6,1.88564 6.4,1.88564 6.4,0.5 0.6,0.5" fill="#b8735c" stroke="none" stroke-width="0"/>
|
||||
<polygon points="4.2,7.08564 5.2,7.08564 5.2,6.73897 4.2,6.73897" fill="#9aa0a6" stroke="none" stroke-width="0"/>
|
||||
<polygon points="4.2,7.08564 5.2,7.08564 5.2,6.91231 4.2,6.91231" fill="#9aa0a6" stroke="none" stroke-width="0"/>
|
||||
<polygon points="1,4.54564 6,4.54564 6,4.48564 1,4.48564" fill="#c9c2b3" stroke="none" stroke-width="0"/>
|
||||
<polygon points="1,4.58564 6,4.58564 6,4.54564 1,4.54564" fill="#ffffff" stroke="none" stroke-width="0"/>
|
||||
<polygon points="1,4.78564 6,4.78564 6,4.58564 1,4.58564" fill="#9aa0a6" stroke="none" stroke-width="0"/>
|
||||
<polygon points="1.0075,4.54564 5.9925,4.54564 5.9925,4.48564 1.0075,4.48564" fill="#c9c2b3" stroke="none" stroke-width="0"/>
|
||||
<polygon points="1.0075,4.58564 5.9925,4.58564 5.9925,4.54564 1.0075,4.54564" fill="#ffffff" stroke="none" stroke-width="0"/>
|
||||
<polygon points="1.0075,4.78564 5.9925,4.78564 5.9925,4.58564 1.0075,4.58564" fill="#9aa0a6" stroke="none" stroke-width="0"/>
|
||||
<polygon points="5.8275,7.08564 6.1725,7.08564 6.1725,4.48564 5.8275,4.48564" fill="#ffffff" stroke="none" stroke-width="0"/>
|
||||
<polygon points="1.1725,7.08564 1.1725,4.48564 0.8275,4.48564 0.8275,7.08564" fill="#ffffff" stroke="none" stroke-width="0"/>
|
||||
<polygon points="3.325,7.08564 3.475,7.08564 3.475,4.48564 3.325,4.48564" fill="#8c5544" stroke="none" stroke-width="0"/>
|
||||
|
||||
|
Before Width: | Height: | Size: 8.4 KiB After Width: | Height: | Size: 8.4 KiB |
@@ -5,14 +5,10 @@
|
||||
<polygon points="5.8275,4.78564 5.8425,4.78564 5.8425,7.08564 5.8275,7.08564" fill="#0f0f0f" stroke="#0f0f0f" stroke-width="0.012"/>
|
||||
<polygon points="5.8425,4.78564 5.9925,4.78564 5.9925,7.08564 5.8425,7.08564" fill="#0f0f0f" stroke="#0f0f0f" stroke-width="0.012"/>
|
||||
<polygon points="5.8425,1.88564 5.9925,1.88564 5.9925,4.58564 5.8425,4.58564" fill="#0f0f0f" stroke="#0f0f0f" stroke-width="0.012"/>
|
||||
<polygon points="6,4.48564 6.1525,4.48564 6.1525,7.08564 6,7.08564" fill="#0f0f0f" stroke="#0f0f0f" stroke-width="0.012"/>
|
||||
<polygon points="5.9925,4.78564 6,4.78564 6,7.08564 5.9925,7.08564" fill="#0f0f0f" stroke="#0f0f0f" stroke-width="0.012"/>
|
||||
<polygon points="5.9925,4.54564 6,4.54564 6,4.58564 5.9925,4.58564" fill="#0f0f0f" stroke="#0f0f0f" stroke-width="0.012"/>
|
||||
<polygon points="5.9925,1.88564 6.1525,1.88564 6.1525,7.08564 5.9925,7.08564" fill="#0f0f0f" stroke="#0f0f0f" stroke-width="0.012"/>
|
||||
<polygon points="6.1525,1.88564 6.1725,1.88564 6.1725,7.08564 6.1525,7.08564" fill="#0f0f0f" stroke="#0f0f0f" stroke-width="0.012"/>
|
||||
<polygon points="0.8275,1.88564 0.8475,1.88564 0.8475,7.08564 0.8275,7.08564" fill="#0f0f0f" stroke="#0f0f0f" stroke-width="0.012"/>
|
||||
<polygon points="0.8475,4.48564 1,4.48564 1,7.08564 0.8475,7.08564" fill="#0f0f0f" stroke="#0f0f0f" stroke-width="0.012"/>
|
||||
<polygon points="1,4.78564 1.0075,4.78564 1.0075,7.08564 1,7.08564" fill="#0f0f0f" stroke="#0f0f0f" stroke-width="0.012"/>
|
||||
<polygon points="1,4.54564 1.0075,4.54564 1.0075,4.58564 1,4.58564" fill="#0f0f0f" stroke="#0f0f0f" stroke-width="0.012"/>
|
||||
<polygon points="0.8475,1.88564 1.0075,1.88564 1.0075,7.08564 0.8475,7.08564" fill="#0f0f0f" stroke="#0f0f0f" stroke-width="0.012"/>
|
||||
<polygon points="1.0075,4.78564 1.1575,4.78564 1.1575,7.08564 1.0075,7.08564" fill="#0f0f0f" stroke="#0f0f0f" stroke-width="0.012"/>
|
||||
<polygon points="1.0075,1.88564 1.1575,1.88564 1.1575,4.58564 1.0075,4.58564" fill="#0f0f0f" stroke="#0f0f0f" stroke-width="0.012"/>
|
||||
<polygon points="1.1575,4.78564 1.1725,4.78564 1.1725,7.08564 1.1575,7.08564" fill="#0f0f0f" stroke="#0f0f0f" stroke-width="0.012"/>
|
||||
@@ -20,14 +16,10 @@
|
||||
<polygon points="3.34,4.78564 3.46,4.78564 3.46,7.08564 3.34,7.08564" fill="#0f0f0f" stroke="#0f0f0f" stroke-width="0.012"/>
|
||||
<polygon points="3.46,4.78564 3.475,4.78564 3.475,7.08564 3.46,7.08564" fill="#0f0f0f" stroke="#0f0f0f" stroke-width="0.012"/>
|
||||
<polygon points="5.8275,1.88564 5.8425,1.88564 5.8425,4.48564 5.8275,4.48564" fill="#0f0f0f" stroke="#0f0f0f" stroke-width="0.012"/>
|
||||
<polygon points="5.9925,1.88564 6.1525,1.88564 6.1525,4.48564 5.9925,4.48564" fill="#0f0f0f" stroke="#0f0f0f" stroke-width="0.012"/>
|
||||
<polygon points="0.8475,1.88564 1.0075,1.88564 1.0075,4.48564 0.8475,4.48564" fill="#0f0f0f" stroke="#0f0f0f" stroke-width="0.012"/>
|
||||
<polygon points="1.1575,1.88564 1.1725,1.88564 1.1725,4.48564 1.1575,4.48564" fill="#0f0f0f" stroke="#0f0f0f" stroke-width="0.012"/>
|
||||
<polygon points="1,4.48564 1.0075,4.48564 1.0075,4.54564 1,4.54564" fill="#0f0f0f" stroke="#0f0f0f" stroke-width="0.012"/>
|
||||
<polygon points="1.1575,4.48564 5.8425,4.48564 5.8425,4.54564 1.1575,4.54564" fill="#0f0f0f" stroke="#0f0f0f" stroke-width="0.012"/>
|
||||
<polygon points="5.9925,4.48564 6,4.48564 6,4.54564 5.9925,4.54564" fill="#0f0f0f" stroke="#0f0f0f" stroke-width="0.012"/>
|
||||
<polygon points="1.1575,4.54564 5.8425,4.54564 5.8425,4.58564 1.1575,4.58564" fill="#0f0f0f" stroke="#0f0f0f" stroke-width="0.012"/>
|
||||
<polygon points="1,4.58564 6,4.58564 6,4.78564 1,4.78564" fill="#0f0f0f" stroke="#0f0f0f" stroke-width="0.012"/>
|
||||
<polygon points="1.0075,4.58564 5.9925,4.58564 5.9925,4.78564 1.0075,4.78564" fill="#0f0f0f" stroke="#0f0f0f" stroke-width="0.012"/>
|
||||
<polygon points="0.6,0.5 6.4,0.5 6.4,0.73094 0.6,0.73094" fill="#0f0f0f" stroke="#0f0f0f" stroke-width="0.012"/>
|
||||
<polygon points="4.2,5.69897 4.2,5.99364 5.2,5.99364 5.2,5.69897" fill="#0f0f0f" stroke="#0f0f0f" stroke-width="0.012"/>
|
||||
<polygon points="0.6,0.5 0.6,0.73094 6.4,0.73094 6.4,0.5" fill="none" stroke="#1f242c" stroke-width="0.025"/>
|
||||
|
||||
|
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 5.7 KiB |
@@ -592,6 +592,8 @@ export const de = {
|
||||
"objinfo.ceiling.buildup": "Aufbau",
|
||||
"objinfo.ceiling.thickness": "Dicke",
|
||||
"objinfo.ceiling.preset": "Deckenaufbau",
|
||||
"objinfo.ceiling.bearingCore": "Auflager bis Kern",
|
||||
"objinfo.ceiling.bearingCoreHint": "An mehrschichtigen Aussenwänden endet die Decke an der Aussenkante der tragenden Schicht; Dämmung und Putz laufen davor durch. Aus: Decke bis an den Umriss.",
|
||||
"objinfo.ceiling.refFloor": "Referenzgeschoss",
|
||||
"objinfo.ceiling.top": "Oberkante (OK)",
|
||||
"objinfo.ceiling.bottom": "Unterkante (UK)",
|
||||
|
||||
@@ -591,6 +591,8 @@ export const en: Record<TranslationKey, string> = {
|
||||
"objinfo.ceiling.buildup": "Build-up",
|
||||
"objinfo.ceiling.thickness": "Thickness",
|
||||
"objinfo.ceiling.preset": "Ceiling style",
|
||||
"objinfo.ceiling.bearingCore": "Bearing to core",
|
||||
"objinfo.ceiling.bearingCoreHint": "At multi-layer exterior walls the slab ends at the outer face of the load-bearing layer; insulation and render run past it. Off: slab up to its outline.",
|
||||
"objinfo.ceiling.refFloor": "Reference floor",
|
||||
"objinfo.ceiling.top": "Top (OK)",
|
||||
"objinfo.ceiling.bottom": "Bottom (UK)",
|
||||
|
||||
@@ -81,6 +81,12 @@ export type Ceiling = {
|
||||
isExternal?: boolean;
|
||||
/** Tragend (IFC `LoadBearing`); fehlt = nicht angegeben. */
|
||||
loadBearing?: boolean;
|
||||
/**
|
||||
* [178] Deckenrand an Aussenwänden: `true` = Platte bis an den Umriss (über die Aussenschichten der
|
||||
* Wand); fehlt/`false` = Auflager bis Aussenkante der tragenden Schicht, Aussendämmung/Putz laufen
|
||||
* an der Deckenstirn durch.
|
||||
*/
|
||||
edgeAtOutline?: boolean;
|
||||
/**
|
||||
* Geschlossener Umriss im Grundriss (Meter). Der Schlusspunkt wird NICHT
|
||||
* dupliziert (die letzte Kante läuft von outline[n-1] zu outline[0]).
|
||||
|
||||
@@ -419,6 +419,8 @@ export interface PanelHostValue {
|
||||
onSetWallRoofAttach: (attach: "auto" | "on" | "off") => void;
|
||||
/** Aussenbauteil/tragend der gewählten Wand bzw. Decke ([97]/[98]); `false` = Feld weg. */
|
||||
onSetBuildingFlags: (flags: { isExternal?: boolean; loadBearing?: boolean }) => void;
|
||||
/** [178] Deckenrand der gewählten Decke: `true` = bis an den Umriss, `false` = Auflager bis Kern (Standard). */
|
||||
onSetCeilingEdgeAtOutline?: (edgeAtOutline: boolean) => void;
|
||||
/** Ansichtsschraffur ([100]) an der gewählten Wand bzw. am gewählten Dach drehen/versetzen. */
|
||||
onSetSurfacePatternPlacement?: (patch: { surfacePatternAngle?: number; surfacePatternOffset?: { x: number; y: number } }) => void;
|
||||
/** Weist der Wand einen Wandtyp-Preset (mehrschichtiger Aufbau) zu. */
|
||||
|
||||
@@ -90,6 +90,17 @@ export function CeilingSection({
|
||||
</div>
|
||||
<UValueRow project={storeProject} kind="ceiling" typeId={ceiling.typeId} />
|
||||
|
||||
{/* [178] Deckenrand an Aussenwänden: Auflager bis Aussenkante Kern (Standard) oder wie Umriss. */}
|
||||
<div className="objinfo-field" title={t("objinfo.ceiling.bearingCoreHint")}>
|
||||
<span className="objinfo-flabel">{t("objinfo.ceiling.bearingCore")}</span>
|
||||
<input
|
||||
type="checkbox"
|
||||
data-testid="objinfo-ceiling-bearingCore"
|
||||
checked={!ceiling.edgeAtOutline}
|
||||
onChange={(e) => host.onSetCeilingEdgeAtOutline?.(!e.target.checked)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Fläche + Volumen (read-only). */}
|
||||
<div className="objinfo-field">
|
||||
<span className="objinfo-flabel">{t("objinfo.ceiling.area")}</span>
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
viewBox -4.2 0 37.045 17.378
|
||||
bytes 194655
|
||||
bytes 196335
|
||||
circle 4
|
||||
g 1
|
||||
line 440
|
||||
line 437
|
||||
path 2
|
||||
polygon 1027
|
||||
polygon 1045
|
||||
polyline 154
|
||||
rect 1
|
||||
svg 1
|
||||
text 4
|
||||
hash 8dcebfa489878dcc
|
||||
hash 673ad0ec9c6ff4d1
|
||||
@@ -41,24 +41,24 @@ roofLayers[].polygon[] [3] x281
|
||||
slabs [70]
|
||||
slabs[].color [3] x70
|
||||
slabs[].outline [12]
|
||||
slabs[].outline [14] x5
|
||||
slabs[].outline [21] x4
|
||||
slabs[].outline [22] x5
|
||||
slabs[].outline [24]
|
||||
slabs[].outline [33] x5
|
||||
slabs[].outline [41] x5
|
||||
slabs[].outline [4] x49
|
||||
slabs[].outline [51] x5
|
||||
slabs[].outline[] [2] x806
|
||||
walls [1489]
|
||||
slabs[].outline [55] x5
|
||||
slabs[].outline[] [2] x906
|
||||
walls [1492]
|
||||
walls[].arcCenter [2] x832
|
||||
walls[].color [3] x1489
|
||||
walls[].end [2] x1489
|
||||
walls[].endCut [4] x1162
|
||||
walls[].holes [1] x84
|
||||
walls[].color [3] x1492
|
||||
walls[].end [2] x1492
|
||||
walls[].endCut [4] x1105
|
||||
walls[].holes [1] x90
|
||||
walls[].holes [2] x25
|
||||
walls[].holes [3] x14
|
||||
walls[].layers [0] x1489
|
||||
walls[].start [2] x1489
|
||||
walls[].startCut [4] x1164
|
||||
walls[].topDrop [2] x103
|
||||
walls[].topPlane [3] x259
|
||||
hash e65de53f576b2bf9
|
||||
walls[].layers [0] x1492
|
||||
walls[].start [2] x1492
|
||||
walls[].startCut [4] x1107
|
||||
walls[].topDrop [2] x115
|
||||
walls[].topPlane [3] x271
|
||||
hash d213e50f1373f98b
|
||||
@@ -1,11 +1,11 @@
|
||||
viewBox 4.457 0 21.343 17.378
|
||||
bytes 33634
|
||||
bytes 28680
|
||||
circle 4
|
||||
g 1
|
||||
line 44
|
||||
polygon 176
|
||||
polyline 17
|
||||
line 39
|
||||
polygon 141
|
||||
polyline 16
|
||||
rect 1
|
||||
svg 1
|
||||
text 3
|
||||
hash c94d4102e772735b
|
||||
hash d2dde45c8a663cfa
|
||||
@@ -1,9 +1,9 @@
|
||||
viewBox 0.1 0 6.8 7.586
|
||||
bytes 7943
|
||||
bytes 7991
|
||||
g 1
|
||||
line 7
|
||||
polygon 58
|
||||
polyline 4
|
||||
rect 1
|
||||
svg 1
|
||||
hash 2c007ba03a679a15
|
||||
hash 4ab158ddf2aaa6ce
|
||||
@@ -28,4 +28,4 @@ walls[].start [2] x59
|
||||
walls[].startCut [4] x47
|
||||
walls[].topDrop [2] x6
|
||||
walls[].topPlane [3] x6
|
||||
hash a131fee4170591f5
|
||||
hash 5cbc613628e29bb6
|
||||
@@ -1,9 +1,9 @@
|
||||
viewBox 0.1 0 6.8 7.586
|
||||
bytes 6317
|
||||
bytes 5429
|
||||
g 1
|
||||
line 21
|
||||
polygon 31
|
||||
polygon 23
|
||||
polyline 4
|
||||
rect 1
|
||||
svg 1
|
||||
hash 3ad55e8289524c3b
|
||||
hash 8e8fd80e9c2fedf3
|
||||
@@ -30,16 +30,19 @@ const hole: { x: number; y: number }[] = [
|
||||
{ x: 2, y: 2.5 },
|
||||
]; // 1x1, vollständig innerhalb des 5x4-Umrisses
|
||||
|
||||
// [178] Platte hier „wie Deckenumriss" (sonst endet sie an der Aussenkante Backstein, 7.5 mm innerhalb).
|
||||
const base: Project = { ...sampleProject, ceilings: sampleProject.ceilings!.map((c) => ({ ...c, edgeAtOutline: true })) };
|
||||
|
||||
function projectWithHole(): Project {
|
||||
return {
|
||||
...sampleProject,
|
||||
ceilings: sampleProject.ceilings!.map((c) => (c.id === "C1" ? { ...c, openings: [hole] } : c)),
|
||||
...base,
|
||||
ceilings: base.ceilings!.map((c) => (c.id === "C1" ? { ...c, openings: [hole] } : c)),
|
||||
};
|
||||
}
|
||||
|
||||
describe("emitSlabs (via pickGeometry) — Decken-Aussparungen", () => {
|
||||
it("ohne openings: Slab-Outline unverändert (Regression)", () => {
|
||||
const slabs = pickGeometry(sampleProject).slabs.filter((s) => s.ceilingId === "C1");
|
||||
const slabs = pickGeometry(base).slabs.filter((s) => s.ceilingId === "C1");
|
||||
expect(slabs.length).toBe(3); // 3 Schichten
|
||||
for (const s of slabs) {
|
||||
expect(s.outline.length).toBe(4);
|
||||
@@ -47,6 +50,12 @@ describe("emitSlabs (via pickGeometry) — Decken-Aussparungen", () => {
|
||||
}
|
||||
});
|
||||
|
||||
it("[178] Auflager bis Kern: Platte endet an der Aussenkante Backstein (Umriss je Seite 7.5 mm kleiner)", () => {
|
||||
const slabs = pickGeometry(sampleProject).slabs.filter((s) => s.ceilingId === "C1");
|
||||
expect(slabs.length).toBe(3);
|
||||
for (const s of slabs) expect(ringArea(s.outline)).toBeCloseTo((5 - 0.015) * (4 - 0.015), 4);
|
||||
});
|
||||
|
||||
it("mit einem 1x1-Loch: jede Schicht bekommt denselben erweiterten Ring (mehr Vertices, Fläche = Aussen - Loch)", () => {
|
||||
const slabs = pickGeometry(projectWithHole()).slabs.filter((s) => s.ceilingId === "C1");
|
||||
expect(slabs.length).toBe(3); // Anzahl Schichten unverändert
|
||||
|
||||
@@ -42,6 +42,9 @@ export function buildElementAttributesHost(c: FlatHostOpts) {
|
||||
if (selection?.kind === "wall") updateWall(selection.id, patch);
|
||||
else if (selection?.kind === "ceiling") updateCeiling(selection.id, patch);
|
||||
},
|
||||
onSetCeilingEdgeAtOutline: (edgeAtOutline) => {
|
||||
if (selection?.kind === "ceiling") updateCeiling(selection.id, { edgeAtOutline: edgeAtOutline || undefined });
|
||||
},
|
||||
onSetWallType: (wallTypeId) => {
|
||||
if (selection?.kind === "wall")
|
||||
updateWall(selection.id, { wallTypeId });
|
||||
|
||||
@@ -172,6 +172,8 @@ export interface CeilingInfo {
|
||||
/** Aussenbauteil / tragend ([97]/[98]). */
|
||||
isExternal: boolean;
|
||||
loadBearing: boolean;
|
||||
/** [178] Platte bis an den Umriss statt Auflager bis Aussenkante Kern der Aussenwand. */
|
||||
edgeAtOutline: boolean;
|
||||
/** Aktuelle Gesamtdicke (Meter). */
|
||||
thickness: number;
|
||||
/** Ob der aktuelle Aufbau-Typ einschichtig ist (1 Schicht). */
|
||||
|
||||
Reference in new issue
Block a user