Merge branch 'worktree-agent-afa7129a33e49a518' into claude/practical-noether-1hb2s1
This commit is contained in:
12 files changed
+91
-28
No files matched your search
@@ -311,14 +311,41 @@ pub fn elevation_primitives_with(p: &Project, level: &LevelSpec, shadows: bool,
|
||||
let all = p.openings.as_deref().unwrap_or(&[]);
|
||||
openings.retain(|op| all.iter().find(|o| o.id == op.id).is_none_or(|o| shown(&o.category_code) && host_shown(o)));
|
||||
}
|
||||
// [173] Fensterteilung (Flügel, Sprossen, Kämpfer) nach der Modelldarstellung.
|
||||
// [184] Ohne ausdrückliche Wahl folgt sie dem Detailgrad der Öffnung wie Grundriss und Schnitt (grob/vereinfacht: keine).
|
||||
// [184] Darstellung der Öffnungen nach Detailgrad, EINE Auflösung wie Grundriss und Schnitt (`opening_detail`):
|
||||
// grob = nur Öffnungsumriss mit Glas-/Blattfläche (kein Rahmen, keine Teilung, keine Laibung, keine Bank);
|
||||
// mittel = Rahmen, Teilung und Laibungsschatten, aber ohne Fensterbank; fein = volles Profil.
|
||||
// Die Fensterteilung (Flügel, Sprossen, Kämpfer) folgt sonst dem Detailgrad (grob: keine) oder `elevationDivision`.
|
||||
for op in openings.iter_mut() {
|
||||
let Some(o) = p.openings.as_deref().unwrap_or(&[]).iter().find(|o| o.id == op.id && o.kind != ElementKind::Door) else { continue };
|
||||
if !win.elevation_division.unwrap_or_else(|| mvo.opening_detail(false, o.detail_level) != crate::plan::style::Detail::Grob) {
|
||||
let Some(o) = p.openings.as_deref().unwrap_or(&[]).iter().find(|o| o.id == op.id) else { continue };
|
||||
let door = o.kind == ElementKind::Door;
|
||||
op.look = mvo.opening_detail(door, o.detail_level);
|
||||
if !door && !win.elevation_division.unwrap_or(op.look != crate::plan::style::Detail::Grob) {
|
||||
op.divisions.clear();
|
||||
op.sash_rects.clear();
|
||||
}
|
||||
if op.look != crate::plan::style::Detail::Fein {
|
||||
op.sill.clear();
|
||||
}
|
||||
if op.look == crate::plan::style::Detail::Grob {
|
||||
op.divisions.clear();
|
||||
op.sash_rects.clear();
|
||||
op.symbol.clear();
|
||||
op.frame = None;
|
||||
if op.shape.is_none() {
|
||||
// Glas und Blatt ersetzt die Füllung des Umrisses.
|
||||
op.glass_only = !op.glass.is_empty();
|
||||
op.glass.clear();
|
||||
op.door_leaf.clear();
|
||||
}
|
||||
}
|
||||
// [184] Storenkasten in der Ansicht nur mit `windows.shadingBox` (Basis aus, wie Grundriss und Schnitt).
|
||||
if !door && win.shading_box && op.shape.is_none() {
|
||||
let sh = p.window_type(o).and_then(|t| t.shading.as_ref()).filter(|s| s.create);
|
||||
let h = sh.map_or(0.0, |s| s.r#box.height.max(0.0));
|
||||
if h > 1e-4 {
|
||||
op.shading = Some([op.pts[3], op.pts[2], [op.pts[2][0], op.pts[2][1] + h], [op.pts[3][0], op.pts[3][1] + h]]);
|
||||
}
|
||||
}
|
||||
}
|
||||
// [171] Formöffnung: Fassaden-Schraffur auch auf den Füllstücken zwischen Umriss und Rechteck-Loch der Wand
|
||||
// (sonst bleibt um ein Rundfenster ein ungemustertes Quadrat).
|
||||
@@ -644,7 +671,18 @@ pub fn elevation_primitives_with(p: &Project, level: &LevelSpec, shadows: bool,
|
||||
let glass_fill = ov.as_ref().and_then(|o| o.fill.as_deref()).unwrap_or(if mono { GLASS_FILL_MONO } else { GLASS_FILL_COLOR });
|
||||
let leaf_fill = ov.as_ref().and_then(|o| o.fill.as_deref()).unwrap_or(if mono { "#ffffff" } else { DOOR_LEAF_FILL_COLOR });
|
||||
let frame_pts = op.shape.as_ref().map_or(op.frame.as_ref().map_or(&op.pts[..], |f| &f[..]), |(o, _, _, _)| &o[..]);
|
||||
push(poly_prim(to_vec(frame_pts), if mono { "#ffffff" } else { FRAME_FILL_COLOR }, ink, frame_mm, id));
|
||||
// [184] Grob: der Umriss trägt selbst die Glas- bzw. Blattfläche (kein Rahmen).
|
||||
let outline_fill = if op.look == crate::plan::style::Detail::Grob && op.shape.is_none() {
|
||||
if op.glass_only { glass_fill } else { leaf_fill }
|
||||
} else if mono {
|
||||
"#ffffff"
|
||||
} else {
|
||||
FRAME_FILL_COLOR
|
||||
};
|
||||
push(poly_prim(to_vec(frame_pts), outline_fill, ink, frame_mm, id));
|
||||
if let Some(b) = &op.shading {
|
||||
push(poly_prim(to_vec(b), if mono { "#ffffff" } else { FRAME_FILL_COLOR }, ink, edge_mm, id));
|
||||
}
|
||||
if let Some((_, g, _, _)) = &op.shape {
|
||||
push(poly_prim(to_vec(g), glass_fill, ink, edge_mm, id));
|
||||
}
|
||||
@@ -660,7 +698,7 @@ pub fn elevation_primitives_with(p: &Project, level: &LevelSpec, shadows: bool,
|
||||
for r in &op.door_leaf {
|
||||
push(poly_prim(to_vec(r), leaf_fill, ink, edge_mm, id));
|
||||
}
|
||||
if shadows && op.shape.is_none() {
|
||||
if shadows && op.shape.is_none() && op.look != crate::plan::style::Detail::Grob {
|
||||
let q = &op.pts;
|
||||
let lerp = |a: Pt, b: Pt, t: f64| -> Pt { [a[0] + (b[0] - a[0]) * t, a[1] + (b[1] - a[1]) * t] };
|
||||
let quad_at = |fa: f64, fz: f64| lerp(lerp(q[0], q[1], fa), lerp(q[3], q[2], fa), fz);
|
||||
|
||||
@@ -18,6 +18,12 @@ pub(super) struct ProjOpening {
|
||||
pub(super) shape: Option<(Vec<Pt>, Vec<Pt>, Vec<Vec<Pt>>, String)>,
|
||||
/// [105] Rahmen-Umriss, wenn er über die Rohbauöffnung hinausgeht (Zargenspiegel, Bekleidung).
|
||||
pub(super) frame: Option<[Pt; 4]>,
|
||||
/// [184] Detailgrad der Darstellung (Element > Modelldarstellung > Massstab; `mod.rs` setzt ihn nach dem Sammeln).
|
||||
pub(super) look: crate::plan::style::Detail,
|
||||
/// [184] Storenkasten über der Öffnung (nur mit `windows.shadingBox`).
|
||||
pub(super) shading: Option<[Pt; 4]>,
|
||||
/// [184] Grob: Umriss füllt mit Glas (statt Türblatt), weil die Öffnung verglast war.
|
||||
pub(super) glass_only: bool,
|
||||
}
|
||||
|
||||
/// Türzarge in der Ansicht ([105]) von der sichtbaren Seite: `outer` = über die Rohbaukante hinaus
|
||||
@@ -289,7 +295,7 @@ pub(super) fn collect_openings(p: &Project, frame: &[f64; 9], win: &crate::plan:
|
||||
if shape.is_some() {
|
||||
// Formöffnung ([G3]): ohne Flügel-/Sprossenteilung, Türblatt und Symbole (Rechteck-Raster).
|
||||
let round = p.openings.as_deref().unwrap_or(&[]).iter().any(|o| o.id == ids[k] && !crate::opening_shape::has_flat_bottom(o));
|
||||
out.push(ProjOpening { pts, depth, glass: Vec::new(), door_leaf: Vec::new(), divisions: Vec::new(), sash_rects: Vec::new(), sill: if round { Vec::new() } else { sill }, symbol: Vec::new(), id: ids[k].to_string(), shape, frame: None });
|
||||
out.push(ProjOpening { pts, depth, glass: Vec::new(), door_leaf: Vec::new(), divisions: Vec::new(), sash_rects: Vec::new(), sill: if round { Vec::new() } else { sill }, symbol: Vec::new(), id: ids[k].to_string(), shape, frame: None, look: crate::plan::style::Detail::Fein, shading: None, glass_only: false });
|
||||
continue;
|
||||
}
|
||||
let mut sash_rects = sash_rects;
|
||||
@@ -307,7 +313,7 @@ pub(super) fn collect_openings(p: &Project, frame: &[f64; 9], win: &crate::plan:
|
||||
sash_rects.push(r(bd.clear / w, 1.0 - bd.clear / w, 1.0 - bd.clear / h));
|
||||
}
|
||||
}
|
||||
out.push(ProjOpening { pts, depth, glass, door_leaf, divisions, sash_rects, sill, symbol, id: ids[k].to_string(), shape, frame: pts_frame });
|
||||
out.push(ProjOpening { pts, depth, glass, door_leaf, divisions, sash_rects, sill, symbol, id: ids[k].to_string(), shape, frame: pts_frame, look: crate::plan::style::Detail::Fein, shading: None, glass_only: false });
|
||||
}
|
||||
surface_openings(p, frame, &mut out);
|
||||
out
|
||||
@@ -346,6 +352,6 @@ pub(super) fn surface_openings(p: &Project, frame: &[f64; 9], out: &mut Vec<Proj
|
||||
});
|
||||
let depth = plane_depth.map_or(own, |d| d.min(own));
|
||||
let glass = if o.kind == ElementKind::Window { vec![quad(fw).0] } else { Vec::new() };
|
||||
out.push(ProjOpening { pts, depth, glass, door_leaf: Vec::new(), divisions: Vec::new(), sash_rects: Vec::new(), sill: Vec::new(), symbol: Vec::new(), id: o.id.clone(), shape: None, frame: None });
|
||||
out.push(ProjOpening { pts, depth, glass, door_leaf: Vec::new(), divisions: Vec::new(), sash_rects: Vec::new(), sill: Vec::new(), symbol: Vec::new(), id: o.id.clone(), shape: None, frame: None, look: crate::plan::style::Detail::Fein, shading: None, glass_only: false });
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user