[280] Träger/Unterzug als eigenes Bauteil: Project.beams, Plan (gestrichelt mit Achse), Schnitt, Ansicht, 3D, IFC IfcBeam, DXF, Befehl traeger, Objekt-Info, Griffe, Beispiel Musterhaus komplex
This commit is contained in:
97 files changed
+1479
-81
No files matched your search
@@ -30,6 +30,7 @@ pub const NOT_FOR_DRAWINGS: &[&str] = &[
|
||||
"rooms",
|
||||
"units",
|
||||
"columns",
|
||||
"beams",
|
||||
"trees",
|
||||
"cameras",
|
||||
"extrudedSolids",
|
||||
|
||||
@@ -1705,6 +1705,12 @@ pub fn room_stamp_spots(p: &Project, floor: &str, show: &HashSet<String>, scale:
|
||||
|
||||
/// `columnLabel` (für `object_name`).
|
||||
pub fn column_label(col: &Column) -> String {
|
||||
// [280] Träger (als Stütze ausgewertet): Breite × Höhe des Querschnitts.
|
||||
if col.r#type == "beam" {
|
||||
if let ColumnProfile::Rect { depth, .. } = &col.profile {
|
||||
return format!("Träger {}×{}", to_fixed(depth * 100.0, 0), to_fixed(col.height * 100.0, 0));
|
||||
}
|
||||
}
|
||||
match &col.profile {
|
||||
ColumnProfile::Round { radius } => format!("Stütze Ø{}", to_fixed(radius * 200.0, 0)),
|
||||
ColumnProfile::Rect { width, depth } => format!("Stütze {}×{}", to_fixed(width * 100.0, 0), to_fixed(depth * 100.0, 0)),
|
||||
@@ -1714,7 +1720,12 @@ pub fn column_label(col: &Column) -> String {
|
||||
pub(super) fn columns(c: &Ctx, out: &mut Vec<Primitive>) {
|
||||
let p = c.p;
|
||||
let range = super::view_range::ViewRange::of(p, &c.a.floor);
|
||||
for col in p.columns.as_deref().unwrap_or(&[]).iter().filter(|k| k.floor_id == c.a.floor && c.vis(&k.category_code, &k.id)) {
|
||||
// [280] Träger laufen als Stützen mit `type == "beam"` durch denselben Code (Rechteck um die Achsmitte).
|
||||
let beams = p.beams.as_deref().unwrap_or(&[]).iter().filter(|k| k.floor_id == c.a.floor && c.vis(&k.category_code, &k.id)).map(|b| std::borrow::Cow::Owned(b.as_column(p)));
|
||||
let cols = p.columns.as_deref().unwrap_or(&[]).iter().filter(|k| k.floor_id == c.a.floor && c.vis(&k.category_code, &k.id)).map(std::borrow::Cow::Borrowed);
|
||||
for col in cols.chain(beams) {
|
||||
let col: &Column = &col;
|
||||
let is_beam = col.r#type == "beam";
|
||||
let (zb, zt) = p.column_vertical_extent(col);
|
||||
let zone = range.classify(zb, zt);
|
||||
if zone == super::view_range::Zone::Hidden {
|
||||
@@ -1723,7 +1734,7 @@ pub(super) fn columns(c: &Ctx, out: &mut Vec<Primitive>) {
|
||||
let out_start = out.len();
|
||||
let greyed = Some(c.greyed(&col.category_code));
|
||||
let category = c.cat(&col.category_code);
|
||||
let ov = c.overrides(Some("column"), &col.category_code, Some(&column_label(col)));
|
||||
let ov = c.overrides(Some(if is_beam { "beam" } else { "column" }), &col.category_code, Some(&column_label(col)));
|
||||
let lw = ov.lineweight.unwrap_or_else(|| resolve_stroke_weight(col.stroke_weight, col.stroke_weight_source, category, category.map_or(WALL_FALLBACK_MM, |k| k.lw)));
|
||||
let color = ov.color.as_deref().or(col.color.as_deref());
|
||||
let cat_color = category.map(|k| k.color.as_str());
|
||||
@@ -1767,15 +1778,37 @@ pub(super) fn columns(c: &Ctx, out: &mut Vec<Primitive>) {
|
||||
for i in 0..n {
|
||||
out.push(line(fp[i], fp[(i + 1) % n], "column-view", LAYER_JOINT_MM * c.a.detail.layer_factor(), None, stroke, greyed));
|
||||
}
|
||||
if let Some(d) = range.restyle_dash(zone) {
|
||||
// [280] Träger über der Schnitthöhe (Unterzug) immer gestrichelt, dazu die Achse als Strichpunktlinie.
|
||||
let dash = if is_beam && zone == super::view_range::Zone::Above { Some(&super::view_range::ABOVE_DASH[..]) } else { range.restyle_dash(zone) };
|
||||
if let Some(d) = dash {
|
||||
super::view_range::restyle(out, out_start, d);
|
||||
}
|
||||
if is_beam {
|
||||
if let ColumnProfile::Rect { width: len, .. } = &col.profile {
|
||||
let (ux, uy) = (crate::jsnum::cos(col.rotation), crate::jsnum::sin(col.rotation));
|
||||
out.push(Primitive::Line {
|
||||
a: Vec2 { x: col.position.x - ux * len / 2.0, y: col.position.y - uy * len / 2.0 },
|
||||
b: Vec2 { x: col.position.x + ux * len / 2.0, y: col.position.y + uy * len / 2.0 },
|
||||
cls: "beam-axis".into(),
|
||||
weight_mm: lw * 0.5,
|
||||
dash: Some(Some(super::line_pattern::AXIS.to_vec())),
|
||||
zigzag: None,
|
||||
motif: None,
|
||||
color: Some(stroke.to_string().into()),
|
||||
drawing_id: None,
|
||||
opening_id: None,
|
||||
stair_id: None,
|
||||
greyed,
|
||||
opacity: None,
|
||||
});
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
// [141] Geschnittene Wände, die in der (geschnittenen) Stütze enden: prioritärere Wand beschneidet
|
||||
// die Stütze, gleiches Bauteil verschmilzt (Kontur über diesen Schichten fehlt).
|
||||
let (mut clip, mut merge): (Vec<Vec<Vec2>>, Vec<crate::plan::wall_poche::WallFootprint>) = (Vec::new(), Vec::new());
|
||||
if zone == super::view_range::Zone::Cut {
|
||||
if zone == super::view_range::Zone::Cut && !is_beam {
|
||||
use super::wall_columns::{band_polys, relation, wall_meets_column, Rel};
|
||||
for w in p.walls.iter().filter(|w| w.floor_id == c.a.floor && c.vis(&w.category_code, &w.id)) {
|
||||
let (zb, zt) = p.wall_vertical_extent(w);
|
||||
|
||||
@@ -1508,6 +1508,9 @@ fn renovation_layers(cx: &mut Ctx, cats: &[&LayerCategory]) -> HashMap<String, S
|
||||
for c in p.columns.iter().flatten() {
|
||||
items.push((&c.id, &c.category_code, crate::renovation::status_of(c.renovation.as_ref())));
|
||||
}
|
||||
for c in p.beams.iter().flatten() {
|
||||
items.push((&c.id, &c.category_code, crate::renovation::status_of(c.renovation.as_ref())));
|
||||
}
|
||||
for o in p.openings.iter().flatten() {
|
||||
items.push((&o.id, &o.category_code, crate::renovation::status_of(crate::renovation::opening_renovation(p, o))));
|
||||
}
|
||||
@@ -1531,7 +1534,8 @@ fn emit_entries(cx: &mut Ctx, main: &mut Buf, entries: &[Entry], layer_by_code:
|
||||
// 2) Rückverweise Primitiv → Kategorie.
|
||||
let code_by_wall: HashMap<&str, &str> = project.walls.iter().map(|w| (w.id.as_str(), w.category_code.as_str())).collect();
|
||||
let code_by_drawing: HashMap<&str, &str> = project.drawings2d.iter().map(|d| (d.id.as_str(), d.category_code.as_str())).collect();
|
||||
let code_by_column: HashMap<&str, &str> = project.columns.iter().flatten().map(|c| (c.id.as_str(), c.category_code.as_str())).collect();
|
||||
// [280] Träger tragen im Plan ihre Kennung als `column_id`.
|
||||
let code_by_column: HashMap<&str, &str> = project.columns.iter().flatten().map(|c| (c.id.as_str(), c.category_code.as_str())).chain(project.beams.iter().flatten().map(|c| (c.id.as_str(), c.category_code.as_str()))).collect();
|
||||
let code_by_room: HashMap<&str, &str> = project.rooms.iter().flatten().map(|r| (r.id.as_str(), r.category_code.as_str())).collect();
|
||||
let layer_of_code = |m: &HashMap<&str, &str>, id: &str| -> Option<String> { layer_by_code.get(m.get(id).copied().unwrap_or("")).cloned() };
|
||||
let drawing_layer = |id: Option<&String>, fallback: &str| -> String {
|
||||
|
||||
@@ -155,7 +155,11 @@ pub(super) fn face_overrides(p: &Project, faces: &mut [Face], v: RuleView) {
|
||||
let layers = p.roof_layers(r);
|
||||
surf_ov(p, v, "roof", &r.category_code, None, &layers, Some(0))
|
||||
}),
|
||||
Role::Column => p.columns.as_deref().unwrap_or(&[]).iter().find(|c| c.id == id).and_then(|c| surf_ov(p, v, "column", &c.category_code, Some(&super::super::domains::column_label(c)), &[], None)),
|
||||
Role::Column => match p.columns.as_deref().unwrap_or(&[]).iter().find(|c| c.id == id) {
|
||||
Some(c) => surf_ov(p, v, "column", &c.category_code, Some(&super::super::domains::column_label(c)), &[], None),
|
||||
// [280] Träger
|
||||
None => p.beams.as_deref().unwrap_or(&[]).iter().find(|b| b.id == id).and_then(|b| surf_ov(p, v, "beam", &b.category_code, Some(&super::super::domains::column_label(&b.as_column(p))), &[], None)),
|
||||
},
|
||||
Role::Mesh => p.context.as_deref().unwrap_or(&[]).iter().find_map(|c| match c {
|
||||
ContextObject::ImportedMesh(m) if m.id == id => Some(m),
|
||||
_ => None,
|
||||
|
||||
@@ -265,6 +265,9 @@ pub fn elevation_primitives_ren(p: &Project, level: &LevelSpec, shadows: bool, m
|
||||
for c in p.columns.as_deref().unwrap_or(&[]) {
|
||||
col_cat.entry(c.id.as_str()).or_insert(c.category_code.as_str());
|
||||
}
|
||||
for b in p.beams.as_deref().unwrap_or(&[]) {
|
||||
col_cat.entry(b.id.as_str()).or_insert(b.category_code.as_str());
|
||||
}
|
||||
let mut mesh_cat: HashMap<&str, &str> = HashMap::new();
|
||||
for c in p.context.as_deref().unwrap_or(&[]) {
|
||||
match c {
|
||||
|
||||
@@ -422,7 +422,9 @@ pub fn subtract_voids(prims: Vec<Primitive>, p: &Project, cut_z: f64) -> Vec<Pri
|
||||
}
|
||||
// Maps wie in TS: bei doppelter id gewinnt der letzte Eintrag.
|
||||
let ceilings: HashMap<&str, &Ceiling> = p.ceilings.as_deref().unwrap_or(&[]).iter().map(|c| (c.id.as_str(), c)).collect();
|
||||
let columns: HashMap<&str, &Column> = p.columns.as_deref().unwrap_or(&[]).iter().map(|c| (c.id.as_str(), c)).collect();
|
||||
// [280] Träger als Stützen (virtuell).
|
||||
let beam_cols: Vec<Column> = p.beams.as_deref().unwrap_or(&[]).iter().map(|b| b.as_column(p)).collect();
|
||||
let columns: HashMap<&str, &Column> = p.columns.as_deref().unwrap_or(&[]).iter().chain(beam_cols.iter()).map(|c| (c.id.as_str(), c)).collect();
|
||||
let ring_of = |pts: &[Vec2]| -> Vec<[f64; 2]> { pts.iter().map(|q| [q.x, q.y]).collect() };
|
||||
// [G1] Abzugskörper beliebiger Form: Grundriss des Körpers im Höhenbereich des Bauteils.
|
||||
let cutters_for = |z0: f64, z1: f64| -> Vec<CutPoly> {
|
||||
|
||||
@@ -159,6 +159,15 @@ fn component_occluders(c: &Ctx, range: &ViewRange, out: &mut Vec<crate::hlr::Fac
|
||||
out.extend(occluder(&ring, d));
|
||||
}
|
||||
}
|
||||
// [280] Träger verdecken die Aufsicht importierter Netze wie Stützen.
|
||||
for b in p.beams.as_deref().unwrap_or(&[]).iter().filter(|k| k.floor_id == c.a.floor && c.vis(&k.category_code, &k.id)) {
|
||||
let col = b.as_column(p);
|
||||
let (zb, zt) = p.column_vertical_extent(&col);
|
||||
if let Some(d) = depth(zb, zt) {
|
||||
let ring: Vec<[f64; 2]> = crate::model3d::column_footprint(&col).iter().map(|q| [q.x, q.y]).collect();
|
||||
out.extend(occluder(&ring, d));
|
||||
}
|
||||
}
|
||||
for ce in p.ceilings.as_deref().unwrap_or(&[]).iter().filter(|x| c.vis(&x.category_code, &x.id)) {
|
||||
let (zb, zt) = p.ceiling_vertical_extent(ce);
|
||||
let zone = range.classify(zb, zt);
|
||||
|
||||
@@ -350,6 +350,11 @@ pub fn hidden_elements(p: &Project, v: RuleView) -> HashSet<String> {
|
||||
out.insert(c.id.clone());
|
||||
}
|
||||
}
|
||||
for b in p.beams.iter().flatten() {
|
||||
if test("beam", &b.category_code, Some(&super::domains::column_label(&b.as_column(p)))) {
|
||||
out.insert(b.id.clone());
|
||||
}
|
||||
}
|
||||
for r in p.rooms.iter().flatten() {
|
||||
if test("room", &r.category_code, Some(&r.name)) {
|
||||
out.insert(r.id.clone());
|
||||
|
||||
@@ -126,6 +126,8 @@ pub enum SlabOwner<'a> {
|
||||
Ceiling(&'a Ceiling, Option<usize>),
|
||||
Stair(&'a Stair),
|
||||
Column(&'a Column),
|
||||
/// [280] Träger.
|
||||
Beam(&'a Beam),
|
||||
}
|
||||
|
||||
/// Je emittierter Platte (Deckenschicht, Treppentritt, Podest) ihre Herkunft (`RSlab::source`).
|
||||
@@ -138,6 +140,7 @@ pub fn slab_owners<'a>(p: &'a Project, slabs: &[RSlab]) -> Vec<SlabOwner<'a>> {
|
||||
SlabSource::Ceiling { index, layer } => ceilings.get(index).map_or(SlabOwner::None, |c| SlabOwner::Ceiling(c, layer)),
|
||||
SlabSource::Stair { index } => stairs.get(index).map_or(SlabOwner::None, SlabOwner::Stair),
|
||||
SlabSource::Column { index } => p.columns.as_deref().and_then(|c| c.get(index)).map_or(SlabOwner::None, SlabOwner::Column),
|
||||
SlabSource::Beam { index } => p.beams.as_deref().and_then(|c| c.get(index)).map_or(SlabOwner::None, SlabOwner::Beam),
|
||||
SlabSource::None => SlabOwner::None,
|
||||
})
|
||||
.collect()
|
||||
@@ -685,14 +688,20 @@ pub(super) fn attach_cut_styles(cuts: Vec<Cut>, p: &Project, plane: &Plane, wall
|
||||
cp.category = Some(st.category_code.clone());
|
||||
}
|
||||
// [141] Stütze: Stil und Rang ihres Bauteils (wie im Grundriss); ohne Bauteil dominiert sie.
|
||||
SlabOwner::Column(c) => {
|
||||
cp.source_id = Some(c.id.clone());
|
||||
cp.category = Some(c.category_code.clone());
|
||||
let comp = c.component_id.as_deref().filter(|s| !s.is_empty()).and_then(|id| p.component(id));
|
||||
// [280] Träger genauso (eigene Felder, gleiche Auflösung).
|
||||
o @ (SlabOwner::Column(_) | SlabOwner::Beam(_)) => {
|
||||
let (id, code, component_id, hatch_id, hatch_source, foreground, foreground_source) = match o {
|
||||
SlabOwner::Column(c) => (&c.id, &c.category_code, &c.component_id, &c.hatch_id, c.hatch_source, &c.foreground, c.foreground_source),
|
||||
SlabOwner::Beam(c) => (&c.id, &c.category_code, &c.component_id, &c.hatch_id, c.hatch_source, &c.foreground, c.foreground_source),
|
||||
_ => unreachable!(),
|
||||
};
|
||||
cp.source_id = Some(id.clone());
|
||||
cp.category = Some(code.clone());
|
||||
let comp = component_id.as_deref().filter(|s| !s.is_empty()).and_then(|id| p.component(id));
|
||||
if let Some(k) = comp {
|
||||
let category = p.layer_category(&c.category_code);
|
||||
let hid = resolve_hatch_id(c.hatch_id.as_deref(), c.hatch_source, category, Some(&k.hatch_id)).unwrap_or(&k.hatch_id);
|
||||
if let Some(h) = resolve_hatch(p, hid, None, resolve_foreground(k, c.foreground.as_deref(), category, c.foreground_source), None) {
|
||||
let category = p.layer_category(code);
|
||||
let hid = resolve_hatch_id(hatch_id.as_deref(), hatch_source, category, Some(&k.hatch_id)).unwrap_or(&k.hatch_id);
|
||||
if let Some(h) = resolve_hatch(p, hid, None, resolve_foreground(k, foreground.as_deref(), category, foreground_source), None) {
|
||||
cp.fill = Some(poche_fill(h.pattern).to_string());
|
||||
cp.hatch = Some(h);
|
||||
}
|
||||
|
||||
@@ -602,6 +602,7 @@ pub(crate) fn edge_categories(p: &Project, walls: &[Option<&Wall>], slabs: &[ban
|
||||
bands::SlabOwner::Ceiling(c, _) => &c.category_code,
|
||||
bands::SlabOwner::Stair(st) => &st.category_code,
|
||||
bands::SlabOwner::Column(c) => &c.category_code,
|
||||
bands::SlabOwner::Beam(c) => &c.category_code,
|
||||
bands::SlabOwner::None => continue,
|
||||
};
|
||||
m.insert((Kind::Slab, i), code.clone());
|
||||
@@ -628,6 +629,7 @@ pub(crate) fn edge_ids(p: &Project, walls: &[Option<&Wall>], slabs: &[bands::Sla
|
||||
bands::SlabOwner::Ceiling(c, _) => &c.id,
|
||||
bands::SlabOwner::Stair(st) => &st.id,
|
||||
bands::SlabOwner::Column(c) => &c.id,
|
||||
bands::SlabOwner::Beam(c) => &c.id,
|
||||
bands::SlabOwner::None => continue,
|
||||
};
|
||||
m.insert((Kind::Slab, i), id.clone());
|
||||
|
||||
@@ -329,7 +329,7 @@ impl<'a> SectionMv<'a> {
|
||||
pos.get(li).copied()
|
||||
})
|
||||
.collect();
|
||||
let columns = p.columns.as_deref().unwrap_or(&[]).iter().map(|c| c.id.clone()).collect();
|
||||
let columns = p.columns.as_deref().unwrap_or(&[]).iter().map(|c| c.id.clone()).chain(p.beams.iter().flatten().map(|b| b.id.clone())).collect();
|
||||
SectionMv { o, layer_pos, columns }
|
||||
}
|
||||
|
||||
|
||||
@@ -348,6 +348,7 @@ pub(crate) fn model_view_faces(p: &Project, vis: &Visibility, view: &dyn Fn([f64
|
||||
Some(SlabOwner::Ceiling(c, _)) => (Some(c.id.clone()), false, false),
|
||||
Some(SlabOwner::Stair(s)) => (Some(s.id.clone()), true, false),
|
||||
Some(SlabOwner::Column(c)) => (Some(c.id.clone()), false, true),
|
||||
Some(SlabOwner::Beam(c)) => (Some(c.id.clone()), false, true),
|
||||
_ => (None, false, false),
|
||||
},
|
||||
Kind::Roof => (roofs.get(i).map(|r| r.id.clone()), false, false),
|
||||
|
||||
Reference in new issue
Block a user