Merge branch 'worktree-agent-ab029230363ec44f6' into claude/practical-noether-1hb2s1
# Conflicts: # TODO.md # src-tauri/core/src/cmd_transform.rs # src/plan/__golden__/komplex-ansicht-ansicht-sued.txt # src/plan/__golden__/komplex-grundriss-eg-100.txt # src/plan/__golden__/komplex-grundriss-eg-50.txt # src/plan/__golden__/komplex-grundriss-og-50.txt # src/state/projectSlice.ts
This commit is contained in:
51 files changed
+1304
-231
No files matched your search
@@ -125,11 +125,11 @@ fn soffits(c: &Ctx, cut: f64, limit: f64, out: &mut Vec<Primitive>, bounds: &mut
|
||||
let fps = super::domains::wall_footprints(c);
|
||||
let mut res = Vec::new();
|
||||
for (ce, zb) in list {
|
||||
for q in &ce.outline {
|
||||
bounds.acc(q.x, q.y);
|
||||
let pts: Vec<[f64; 2]> = ce.ring_xy();
|
||||
for q in &pts {
|
||||
bounds.acc(q[0], q[1]);
|
||||
}
|
||||
let greyed = Some(c.greyed(&ce.category_code));
|
||||
let pts: Vec<[f64; 2]> = ce.outline.iter().map(|v| [v.x, v.y]).collect();
|
||||
let holes: Vec<Vec<[f64; 2]>> = crate::opening_shape::ceiling_hole_rings(p, ce).iter().filter(|h| h.len() >= 3).map(|h| h.iter().map(|v| [v.x, v.y]).collect()).collect();
|
||||
let merged = crate::polygon_holes::merge_holes(&pts, &holes, 1e-4);
|
||||
let layers = ceiling_layers(p, ce)?;
|
||||
@@ -350,7 +350,7 @@ fn room_labels(c: &Ctx, soffits: &[Soffit], roofs: &[RoofUnder], out: &mut Vec<P
|
||||
return;
|
||||
}
|
||||
for room in c.p.rooms.as_deref().unwrap_or(&[]).iter().filter(|r| r.floor_id == c.a.floor && c.vis(&r.category_code, &r.id) && r.boundary.len() >= 3) {
|
||||
let pts: Vec<[f64; 2]> = room.boundary.iter().map(|v| [v.x, v.y]).collect();
|
||||
let pts: Vec<[f64; 2]> = room.ring_xy();
|
||||
let at = room.stamp_anchor.unwrap_or(pv(crate::room_area::label_point(&pts)));
|
||||
let z = soffits.iter().filter(|s| super::pick::point_in_polygon(at.x, at.y, &s.ring)).map(|s| s.z).fold(f64::INFINITY, f64::min);
|
||||
let mut lines = Vec::new();
|
||||
|
||||
@@ -279,10 +279,10 @@ pub(super) fn terrain_footprint(p: &Project, floor: &str) -> Vec<Vec<Vec2>> {
|
||||
}
|
||||
let ring = |pts: &[Vec2]| -> Option<crate::flat::Polygon> { (pts.len() >= 3 && pts.iter().all(ok)).then(|| vec![pts.iter().map(|q| [q.x, q.y]).collect()]) };
|
||||
for c in p.ceilings.as_deref().unwrap_or(&[]).iter().filter(|c| on(&c.floor_id)) {
|
||||
parts.extend(ring(&c.outline));
|
||||
parts.extend(ring(&c.ring()));
|
||||
}
|
||||
for r in p.rooms.as_deref().unwrap_or(&[]).iter().filter(|r| on(&r.floor_id)) {
|
||||
parts.extend(ring(&r.boundary));
|
||||
parts.extend(ring(&r.ring()));
|
||||
}
|
||||
for s in p.extruded_solids.as_deref().unwrap_or(&[]).iter().filter(|s| on(&s.level_id) && s.operation.as_deref() != Some("subtract")) {
|
||||
parts.extend(ring(&s.points));
|
||||
|
||||
@@ -574,8 +574,9 @@ fn ceilings(c: &Ctx, out: &mut Vec<Primitive>, bounds: &mut Bounds) -> Result<()
|
||||
let fps = wall_footprints(c);
|
||||
for (ce, zone) in list {
|
||||
let out_start = out.len();
|
||||
for q in &ce.outline {
|
||||
bounds.acc(q.x, q.y);
|
||||
let pts: Vec<[f64; 2]> = ce.ring_xy();
|
||||
for q in &pts {
|
||||
bounds.acc(q[0], q[1]);
|
||||
}
|
||||
let ov = c.overrides(Some(ceiling_kind(p, ce)), &ce.category_code, ceiling_type_name(p, ce));
|
||||
let color = ov.color.as_deref().or(ce.color.as_deref());
|
||||
@@ -585,7 +586,6 @@ fn ceilings(c: &Ctx, out: &mut Vec<Primitive>, bounds: &mut Bounds) -> Result<()
|
||||
if ce.outline.len() < 3 {
|
||||
continue;
|
||||
}
|
||||
let pts: Vec<[f64; 2]> = ce.outline.iter().map(|v| [v.x, v.y]).collect();
|
||||
let holes: Vec<Vec<[f64; 2]>> = crate::opening_shape::ceiling_hole_rings(p, ce).iter().map(|h| h.iter().map(|v| [v.x, v.y]).collect()).collect();
|
||||
let merged = crate::polygon_holes::merge_holes(&pts, &holes, 1e-4);
|
||||
let layers = ceiling_layers(p, ce)?;
|
||||
@@ -1305,7 +1305,8 @@ fn place_stamp(ring: &[[f64; 2]], candidates: &[Vec2], obst: &super::stamp_place
|
||||
|
||||
fn rooms(c: &Ctx, out: &mut Vec<Primitive>, bounds: &mut Bounds, obstacles: &super::stamp_place::Obstacles) {
|
||||
for room in c.p.rooms.as_deref().unwrap_or(&[]).iter().filter(|r| r.floor_id == c.a.floor && c.vis(&r.category_code, &r.id)) {
|
||||
for q in &room.boundary {
|
||||
let ring = room.ring();
|
||||
for q in ring.iter() {
|
||||
bounds.acc(q.x, q.y);
|
||||
}
|
||||
let ov = c.overrides(Some("room"), &room.category_code, Some(&room.name));
|
||||
@@ -1314,9 +1315,9 @@ fn rooms(c: &Ctx, out: &mut Vec<Primitive>, bounds: &mut Bounds, obstacles: &sup
|
||||
if room.boundary.len() < 3 {
|
||||
continue;
|
||||
}
|
||||
let pts: Vec<[f64; 2]> = room.boundary.iter().map(|v| [v.x, v.y]).collect();
|
||||
let res = crate::room_area::evaluate(&pts, 0.0);
|
||||
out.push(polygon(room.boundary.clone(), &with_alpha(color, ROOM_FILL_ALPHA), color, LAYER_LINE_MM * c.a.detail.layer_factor(), no_hatch(), greyed, None, Pick::Room(&room.id)));
|
||||
let pts: Vec<[f64; 2]> = ring.iter().map(|v| [v.x, v.y]).collect();
|
||||
let res = crate::ring_arc::evaluate(&room.boundary, room.boundary_bulge.as_deref(), 0.0);
|
||||
out.push(polygon(ring.into_owned(), &with_alpha(color, ROOM_FILL_ALPHA), color, LAYER_LINE_MM * c.a.detail.layer_factor(), no_hatch(), greyed, None, Pick::Room(&room.id)));
|
||||
if c.a.detail == Detail::Grob && !c.a.auto_coarse {
|
||||
continue;
|
||||
}
|
||||
@@ -1782,7 +1783,7 @@ fn outside_stamps(c: &Ctx, rooms: &[Primitive]) -> Vec<Vec<[f64; 2]>> {
|
||||
for q in rooms {
|
||||
let Primitive::Text { at, doc, extra_lines, base_pt, room_id: Some(id), .. } = q else { continue };
|
||||
let Some(room) = c.p.rooms.as_deref().unwrap_or(&[]).iter().find(|r| &r.id == id) else { continue };
|
||||
let ring: Vec<[f64; 2]> = room.boundary.iter().map(|v| [v.x, v.y]).collect();
|
||||
let ring: Vec<[f64; 2]> = room.ring_xy();
|
||||
if ring.len() < 3 || crate::surface_pattern::point_in([at.x, at.y], &ring) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ pub fn own_finish_rooms<'a>(c: &Ctx<'a>) -> Vec<(&'a Room, &'a Component, Vec<P>
|
||||
.filter(|r| r.floor_id == c.a.floor && r.boundary.len() >= 3 && c.vis(&r.category_code, &r.id))
|
||||
.filter_map(|r| {
|
||||
let comp = crate::room_book::finish_component(c.p, r.floor_finish.as_deref())?;
|
||||
let ring: Vec<P> = r.boundary.iter().map(|v| [v.x, v.y]).collect();
|
||||
let ring: Vec<P> = r.ring_xy();
|
||||
ring.iter().all(|q| q[0].is_finite() && q[1].is_finite()).then_some((r, comp, ring))
|
||||
})
|
||||
.collect()
|
||||
@@ -135,7 +135,7 @@ pub fn room_segments(comp: &Component, ring: &[P], scale: f64) -> Option<(Vec<(P
|
||||
}
|
||||
|
||||
pub fn wet_rooms(c: &Ctx) -> Vec<Vec<P>> {
|
||||
c.p.rooms.as_deref().unwrap_or(&[]).iter().filter(|r| r.floor_id == c.a.floor && r.boundary.len() >= 3 && is_wet_room(r)).map(|r| r.boundary.iter().map(|v| [v.x, v.y]).collect()).collect()
|
||||
c.p.rooms.as_deref().unwrap_or(&[]).iter().filter(|r| r.floor_id == c.a.floor && r.boundary.len() >= 3 && is_wet_room(r)).map(|r| r.ring_xy()).collect()
|
||||
}
|
||||
|
||||
/// Aussparungen: Raumstempel (Rechteck mit Luft) aus den schon gesetzten Raum-Primitiven, Möbel/Symbole
|
||||
|
||||
@@ -166,7 +166,7 @@ fn component_occluders(c: &Ctx, range: &ViewRange, out: &mut Vec<crate::hlr::Fac
|
||||
continue;
|
||||
}
|
||||
if let Some(d) = depth(zb, zt) {
|
||||
let ring: Vec<[f64; 2]> = ce.outline.iter().map(|q| [q.x, q.y]).collect();
|
||||
let ring: Vec<[f64; 2]> = ce.ring_xy();
|
||||
out.extend(occluder(&ring, d));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user