Merge branch 'worktree-agent-a0efa41aca12320a1' into claude/practical-noether-1hb2s1
# Conflicts: # TODO.md
This commit is contained in:
46 files changed
+1976
-336
No files matched your search
@@ -1351,7 +1351,8 @@ pub fn elevation_primitives_with(p: &Project, level: &LevelSpec, shadows: bool,
|
||||
let frame = frame_of(&plane);
|
||||
let mut walls = model3d::emit_walls_with(p, false, false)?;
|
||||
let mut slabs = model3d::emit_slabs(p);
|
||||
slabs.extend(model3d::emit_stairs(p, false));
|
||||
// Ortbeton-Läufe kommen im 3D als Netz; in der Ansicht als ein Block je Tritt ([151]).
|
||||
slabs.extend(model3d::emit_stairs_elevation(p));
|
||||
extend_wall_corners(p, &mut walls, (frame[6], frame[8]));
|
||||
let mut faces = project_faces(&frame, &walls, &slabs, &[]);
|
||||
cull_under_roofs(p, &frame, &walls, &mut faces);
|
||||
|
||||
@@ -1554,6 +1554,17 @@ fn stair_flight_sections(p: &Project, base: (f64, f64), u: (f64, f64)) -> HashMa
|
||||
let (rings, _) = cut_mesh(&m.positions, &idx, base, u);
|
||||
polys.entry(st.id.clone()).or_default().extend(rings_to_polygons(&rings));
|
||||
}
|
||||
// [151] Podestplatten derselben Treppen gehören zur exakten Fläche (sonst ersetzt die Laufplatte sie).
|
||||
let with_flights: std::collections::HashSet<String> = polys.keys().cloned().collect();
|
||||
for s in model3d::emit_stairs(p, false) {
|
||||
if !with_flights.contains(&s.ceiling_id) || s.monolith.is_none() {
|
||||
continue;
|
||||
}
|
||||
let m = crate::solid_bool::Mesh::prism(&s.outline, s.z_bottom, s.z_top);
|
||||
let idx: Vec<f64> = m.indices.iter().map(|&i| i as f64).collect();
|
||||
let (rings, _) = cut_mesh(&m.positions, &idx, base, u);
|
||||
polys.entry(s.ceiling_id.clone()).or_default().extend(rings_to_polygons(&rings));
|
||||
}
|
||||
polys
|
||||
.into_iter()
|
||||
.map(|(id, list)| {
|
||||
@@ -3423,6 +3434,32 @@ mod tests {
|
||||
assert!(pts.len() < 2 * 15 + 10, "{pts:?}");
|
||||
}
|
||||
|
||||
/// [151] U-Betontreppe längs durch Lauf 1 geschnitten: Laufplatte exakt UND die Podestplatte im Schnitt.
|
||||
#[test]
|
||||
fn u_treppe_lauf_und_podest_im_schnitt() {
|
||||
let mut p = sample();
|
||||
let st = &mut p.stairs.as_mut().unwrap()[0];
|
||||
st.shape = StairShape::U;
|
||||
st.start = Vec2 { x: 3.15, y: 0.35 };
|
||||
st.dir = Vec2 { x: 0.0, y: 1.0 };
|
||||
st.run_length = 2.0;
|
||||
st.run2_length = Some(2.0);
|
||||
st.turn = Some(-1.0);
|
||||
st.gap = Some(0.1);
|
||||
st.landing_length = Some(0.9);
|
||||
st.width = 0.9;
|
||||
st.step_count = 15.0;
|
||||
st.total_rise = Some(2.6);
|
||||
let l = LevelSpec { kind: "section".into(), line: Some([Vec2 { x: 3.15, y: -1.0 }, Vec2 { x: 3.15, y: 5.0 }]), ..Default::default() };
|
||||
let out = compute_section(&p, &l, &[]).unwrap().unwrap();
|
||||
let pts: Vec<[f64; 2]> = out.cuts.iter().filter(|c| c.stair_id.as_deref() == Some("ST1")).flat_map(|c| c.pts.clone()).collect();
|
||||
// Podest: y 2.35 … 3.25 (u = y + 1), Oberkante 8 Steigungen
|
||||
let top = 8.0 * 2.6 / 15.0;
|
||||
assert!(pts.iter().any(|q| (q[0] - 4.25).abs() < 1e-6 && (q[1] - top).abs() < 1e-6), "{pts:?}");
|
||||
// Lauf 1 ab y = 0.35 (u = 1.35) bis zum Podest
|
||||
assert!(pts.iter().any(|q| (q[0] - 1.35).abs() < 1e-6), "{pts:?}");
|
||||
}
|
||||
|
||||
/// [95][T2] Schnitt durch die Tasche in der Bogenwand (radial) und unter schräger Oberkante.
|
||||
#[test]
|
||||
fn schnitt_durch_die_tasche_bogen_und_dach() {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//! kommt aus `kernel2d` (`stair_geometry`, `stair_cut`, `stair_outline`), Farbe, Pick-ID und
|
||||
//! Graustufen setzt der Aufrufer (`plan/stairs.rs`, [K3d]).
|
||||
//!
|
||||
//! Eingabe: Treppen-Parameter (16 Zahlen, s. `stair.rs`), Gesamt-Steighöhe, Schnitthöhe über der
|
||||
//! Eingabe: Treppen-Parameter (21 Zahlen, s. `stair.rs`), Gesamt-Steighöhe, Schnitthöhe über der
|
||||
//! Treppen-UK, Strichstärke `lw_mm` (Papier-mm), `filled_arrow` (0/1).
|
||||
//!
|
||||
//! Ausgabe `[n, Eintrag × n]`, Reihenfolge = Zeichenreihenfolge:
|
||||
@@ -72,7 +72,7 @@ pub fn plan_stair(params: &[f64], total_rise: f64, cut_rise: f64, lw_mm: f64, fi
|
||||
o.line(CLS_TREAD, tr.pts[1], tr.pts[2], lw_mm * if is_below { 1.0 } else { 0.6 }, !is_below);
|
||||
}
|
||||
}
|
||||
if let Some(l) = &geo.landing {
|
||||
for l in geo.landing.iter().chain(geo.landing2.iter()) {
|
||||
if l.len() >= 3 {
|
||||
o.polygon(l, lw_mm * 0.7, false);
|
||||
}
|
||||
|
||||
@@ -18,6 +18,8 @@ pub fn stair_label(s: &Stair) -> String {
|
||||
let shape = match s.shape {
|
||||
StairShape::Straight => "Gerade",
|
||||
StairShape::L => "L-Treppe",
|
||||
StairShape::U => "U-Treppe",
|
||||
StairShape::StraightLanding => "Podesttreppe",
|
||||
_ => "Wendel",
|
||||
};
|
||||
format!("{shape} {} STG", js_number(s.step_count))
|
||||
@@ -51,7 +53,7 @@ pub fn plan_stairs(c: &Ctx, out: &mut Vec<Primitive>, bounds: &mut Bounds) {
|
||||
bounds.acc(q.x, q.y);
|
||||
}
|
||||
}
|
||||
for q in geo.landing.iter().flatten() {
|
||||
for q in geo.landing.iter().chain(geo.landing2.iter()).flatten() {
|
||||
bounds.acc(q.x, q.y);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user