Merge branch 'worktree-agent-a6b600eecf6bd85ef' into claude/practical-noether-1hb2s1
# Conflicts: # src-tauri/core/src/plan/context.rs # src/plan/__golden__/komplex-ansicht-ansicht-sued.txt
This commit is contained in:
53 files changed
+680
-81
No files matched your search
@@ -68,6 +68,8 @@ pub(super) fn append_body_sections(cuts: &mut Vec<Cut>, p: &Project, bodies: &[&
|
||||
c.fill = Some(BODY_FILL.into());
|
||||
c.nse = nse;
|
||||
c.source_id = solids.get(b.index).map(|s| s.id.clone());
|
||||
// [180] Klasse des Körpers (Sichtbarkeit, Darstellungsmodus).
|
||||
c.category = solids.get(b.index).map(|s| s.category_code.clone());
|
||||
cuts.push(c);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -491,6 +491,35 @@ pub struct Output {
|
||||
pub meshes: Vec<MeshMeta>,
|
||||
/// [152] Offene Schnittlinien importierter Netze (offene/nicht-mannigfaltige Netze): Netz-Index, Linienzug.
|
||||
pub mesh_lines: Vec<(usize, Vec<[f64; 2]>)>,
|
||||
/// [180] Klasse der Bauteile hinter den Projektionskanten (`Edge::kind`, `Edge::index`; Netze über `meshes`).
|
||||
pub edge_cats: HashMap<(Kind, usize), String>,
|
||||
}
|
||||
|
||||
/// [180] Klassen der Projektions-Besitzer: Wände (Index in `walls_r`), Platten (Decken, Treppen, Stützen; Index in
|
||||
/// `slabs_r`), Dächer, Körper (Index in `extrudedSolids`).
|
||||
fn edge_categories(p: &Project, walls: &[Option<&Wall>], slabs: &[bands::SlabOwner]) -> HashMap<(Kind, usize), String> {
|
||||
let mut m = HashMap::new();
|
||||
for (i, w) in walls.iter().enumerate() {
|
||||
if let Some(w) = w {
|
||||
m.insert((Kind::Wall, i), w.category_code.clone());
|
||||
}
|
||||
}
|
||||
for (i, s) in slabs.iter().enumerate() {
|
||||
let code = match s {
|
||||
bands::SlabOwner::Ceiling(c, _) => &c.category_code,
|
||||
bands::SlabOwner::Stair(st) => &st.category_code,
|
||||
bands::SlabOwner::Column(c) => &c.category_code,
|
||||
bands::SlabOwner::None => continue,
|
||||
};
|
||||
m.insert((Kind::Slab, i), code.clone());
|
||||
}
|
||||
for (i, r) in p.roofs.as_deref().unwrap_or(&[]).iter().enumerate() {
|
||||
m.insert((Kind::Roof, i), r.category_code.clone());
|
||||
}
|
||||
for (i, b) in p.extruded_solids.as_deref().unwrap_or(&[]).iter().enumerate() {
|
||||
m.insert((Kind::Body, i), b.category_code.clone());
|
||||
}
|
||||
m
|
||||
}
|
||||
|
||||
/// [152] Ein importiertes Netz im Schnitt.
|
||||
@@ -577,6 +606,7 @@ fn compute_plane(p: &Project, level: &LevelSpec, bodies: &[BodyMesh], strip: Opt
|
||||
.collect();
|
||||
let walls: Vec<Option<&Wall>> = owners.iter().zip(&virt).map(|(o, v)| v.as_ref().or(*o)).collect();
|
||||
let slabs = slab_owners(p, &slabs_r);
|
||||
let edge_cats = edge_categories(p, &walls, &slabs);
|
||||
let cuts = attach_cut_styles(cuts, p, &plane, &walls, &slabs)?;
|
||||
let cuts = merge_monolith_cuts(cuts, &slabs_r, &stair_flight_sections(p, plane.base(), plane.u_model()));
|
||||
let base = plane.base();
|
||||
@@ -603,7 +633,7 @@ fn compute_plane(p: &Project, level: &LevelSpec, bodies: &[BodyMesh], strip: Opt
|
||||
let (mut visible, hidden) = projection_edges(p, &plane, &walls_r, &wi, &slabs_r, &bodies, &meshes, &cuts, level.hidden_lines, level.depth, strip.map_or(&[][..], |s| &s.half[..]));
|
||||
shaped_projection(&mut visible, p, &walls_r, &plane);
|
||||
let meshes = meshes.iter().map(|m| MeshMeta { id: m.mesh.id.clone(), name: m.mesh.name.clone(), category: Some(m.mesh.category_code.clone()) }).collect();
|
||||
let mut out = Output { cuts, visible, hidden, profiles: Vec::new(), earth: Vec::new(), terrain_id: None, meshes, mesh_lines };
|
||||
let mut out = Output { cuts, visible, hidden, profiles: Vec::new(), earth: Vec::new(), terrain_id: None, meshes, mesh_lines, edge_cats };
|
||||
append_terrain_profiles(&mut out, p, base, u);
|
||||
if let Some(s) = strip {
|
||||
unfold::clip_output(&mut out, s);
|
||||
|
||||
@@ -586,7 +586,14 @@ pub fn section_primitives_mv(out: &Output, mono: bool, hidden_lines: bool, vis:
|
||||
(StairPart::Rail, Some(m)) => m.o.stair.section_beyond && m.o.stair.handrail.is_some(),
|
||||
};
|
||||
// [152] Importierte Netze: Kanten nur, wenn die Kategorie gezeigt wird; Linien nach den Regeln des Netzes.
|
||||
let mesh_shown = |e: &Edge| stair_shown(e) && (e.kind != Kind::Mesh || out.meshes.get(e.index).and_then(|m| m.category.as_deref()).is_none_or(shown));
|
||||
// [180] Projektionskanten der übrigen Bauteile nach deren Klasse.
|
||||
let mesh_shown = |e: &Edge| {
|
||||
stair_shown(e)
|
||||
&& match e.kind {
|
||||
Kind::Mesh => out.meshes.get(e.index).and_then(|m| m.category.as_deref()).is_none_or(shown),
|
||||
_ => out.edge_cats.get(&(e.kind, e.index)).is_none_or(|c| shown(c)),
|
||||
}
|
||||
};
|
||||
let mesh_style = |e: &Edge, l: &mut Primitive| {
|
||||
if e.kind == Kind::Mesh {
|
||||
if let Some(s) = rules.mesh.get(&e.index) {
|
||||
|
||||
@@ -118,7 +118,7 @@ pub fn section_plan_buf(p: &Project, args: &[f64], text: &str) -> Result<Vec<u8>
|
||||
.flat_map(|(l, s)| {
|
||||
let off = s.as_ref().map_or(0.0, |s| s.offset);
|
||||
let b = if off == 0.0 { bounds } else { [bounds[0] - off, bounds[1], bounds[2] - off, bounds[3]] };
|
||||
unfold::clip_prims(crate::plan::grid_view::grid_prims(p, l, b, scale), s.as_ref())
|
||||
unfold::clip_prims(crate::plan::grid_view::grid_prims_in(p, l, b, scale, &vis), s.as_ref())
|
||||
})
|
||||
.collect();
|
||||
if !grid.is_empty() {
|
||||
|
||||
@@ -231,6 +231,7 @@ pub(super) fn merge_output(acc: &mut Option<Output>, o: Output) {
|
||||
a.profiles.extend(o.profiles);
|
||||
a.earth.extend(o.earth);
|
||||
a.mesh_lines.extend(o.mesh_lines);
|
||||
a.edge_cats.extend(o.edge_cats);
|
||||
if a.terrain_id.is_none() {
|
||||
a.terrain_id = o.terrain_id;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user