[284] Review vor der Beta: Träger im Varianten-/Umbaufilter, Gefällelinie wandert mit, Export nur Auswahl mit Geländern, Gruppen, Fang-Cache, Cmd+A, Geschoss löschen
Träger fehlten in design_options (hidden/outside) und section::without_elements (3D, Schnitt, Kennzahlen, IFC im Filter); slope.from/to in cmd_transform, geo_translate, geo_rebase; selection_filter mit railings/trees; group_ops mit Trägern/Geländern/Bäumen; snap_model MODEL_FIELDS mit beams; selectAll mit Geländern; deleteLevel entfernt Dächer, Stützen, Träger, Geländer; Robustheits-Regression für neue Bauteile mit Randwerten (kein Panic).
This commit is contained in:
17 files changed
+149
-10
No files matched your search
@@ -10,7 +10,7 @@ Wer zu einer ID mehr wissen will (Entscheide, Tests, Bilder), sucht dort nach `*
|
||||
stehen im Archiv („Bewusst nicht übernommen“).
|
||||
- **Grösse** (eine Person mit Agenten): S ≤ 1 Tag · M ≤ 1 Woche · L ≤ 1 Monat · XL > 1 Monat.
|
||||
Steht keine Grösse im Archiv, ist sie hier geschätzt.
|
||||
- **IDs sind stabil.** Neue ID = nächste freie Zahl nach der höchsten im Archiv und hier (aktuell 283);
|
||||
- **IDs sind stabil.** Neue ID = nächste freie Zahl nach der höchsten im Archiv und hier (aktuell 284);
|
||||
nie eine ID wiederverwenden oder umnummerieren. Präfix-IDs (`[K]`, `[G]`, `[T]`, `[B]`, `[C]`) bleiben.
|
||||
- **Pro Punkt:** was fehlt · wo im Code · Grösse. Höchstens ein bis drei Sätze je Punkt;
|
||||
Messwerte und Befunde gehören in den Commit.
|
||||
@@ -61,6 +61,7 @@ Kennwort, anonym) als PDF; Austausch mit Fachplanern über DXF/IFC.
|
||||
- ◐ **[281]** Geneigte Decken und Rampen (18.11.; Lücke 8; nicht auf dem Mac geprüft): `Ceiling.slope`, Befehl `rampe`, Schnitt/Ansicht/3D/IFC (`IfcRamp`) umgesetzt. Offen: Wandschichten werden von geneigten Decken nicht eingeschnitten, Wandoberkante folgt der Decke nicht; STEP-Export schreibt die Platte waagrecht (truck kennt `slope` nicht); Sonne: geneigte Decke wirft Hüllprisma-Schatten, empfängt keinen; Rampenlauf ohne Material-/Typzuordnung im IFC; Rampen-Umriss unter Schnittebene gestrichelt; Griff für die Gefällelinie fehlt. · M
|
||||
- ◐ **[280]** Träger/Unterzug als eigenes Bauteil (17.11.; Lücke 9; nicht auf dem Mac geprüft): `Project.beams`, Befehl `traeger`, IFC `IfcBeam`, Griffe umgesetzt (`Beam::as_column`, läuft durch Stützen-Code). Offen: `Group` ohne `beamIds` (Träger laufen über `columnIds`; Transformation bewegt nur EIN gewähltes Element des Kanals, in betretener Gruppe gezeichneter Träger wird nicht Mitglied, ungeprüft); keine Stütze-Träger-Verschneidung/Anschlussdetails; Profile nur als Text (kein Katalog, keine Gewichte); nur rechteckig und waagrecht; Deckenspiegel mit Unterzügen fehlt; Fassadenträger über mehrere Geschosse nur via `topOffset`; IFC-Import liest `IfcBeam` weiter als Körper ([B4]/[B5]); Attribute-Panel (Strich, Schraffur, Poché) für Träger nicht verdrahtet. · M
|
||||
- ◐ **[276]** Schnitt-/Ansichtslinie im Plan einstellbar wie Archicad (17.11.): `lineMode`, Linientyp, Stift, Marker je Linie, Vorgabe in der Modelldarstellung (`plan/misc.rs`, `plan/context.rs`, `SectionLookFields.tsx`). Offen: nicht auf dem Mac geprüft; Linientyp/Stift in der Modelldarstellung wählbar machen; Marke „Kreis mit Pfeil“ für Ansichten; Marken-Versatz unabhängig von der Linie. · S
|
||||
- ◐ **[284]** Review der Stränge seit `9f32c71f` ([271]–[283], [B5], [256], [266]) auf echte Fehler vor der Beta (18.11.). Behoben: Träger fehlten im Varianten-Filter (`design_options.rs`) und in `without_elements` (Umbau/Variante in 3D, Schnitt, Kennzahlen, IFC); Gefällelinie der geneigten Decke wanderte beim Verschieben/Drehen/Kopieren und beim Projekt-Verschieben nicht mit; Export „nur Auswahl“ nahm alle Geländer/Bäume mit; Zeichnen in betretener Gruppe nahm Träger/Geländer/Bäume nicht auf; Fang-Cache ohne `beams`; Cmd+A ohne Geländer; Geschoss löschen liess Dächer, Stützen, Träger, Geländer verwaist; Robustheits-Test für die neuen Bauteile mit Randwerten (kein Panic gefunden). Offen: Geschoss löschen lässt 2D, Körper, Bäume, Kameras des Geschosses stehen (`projectSlice.ts::deleteLevel`) · S; Fixtures `core/tests/fixtures/robust/*.json` ohne Geländer/Rampe/Einheiten (neu aus `dossier-cli … migrate` erzeugen) · S; Geländer fehlen in Darstellungs-Regeln (`plan/overrides.rs`), „Klasse der Auswahl“ (`layers.rs::selection_category_codes`) und Mass-Assoziation (`dim_assoc.rs`) · S. Nicht in der Tauri-App geprüft; TS-Seite nur vitest/tsc (WASM nicht neu gebaut).
|
||||
- ◐ **[283]** UX-Prüfung der Wettbewerbs-Funktionen [271]–[281] (18.11., Chromium/Linux; Befunde behoben, Bilder `doc/review-283/`). Objekt-Info-Höhe 18.11. verbessert (rechts oben Gewichte 2 : 1, Layout v18, „Bezugspunkt“ bleibt offen — zugeklappt versteckte er die X/Y-Felder; Splitter/Abschnitt-Zustand werden schon gemerkt; Bild `doc/review-283/objektinfo-hoehe.png`). Offen: nicht in der Tauri-App geprüft. · M
|
||||
- ◐ **[271]** Umbaufilter wie Archicad (17.11.): `renovation`-Status an Bauteilen, Etappen, Filter je Ebene/Vorlage/Ausschnitt, Kern `renovation.rs`, Panel „Umbau“, Exporte (IFC/OBJ/STEP/DXF/Blender/Cycles) folgen der Ansicht (`export/exportView.ts`), Möbel/Linien/Bäume (Baum-`status` = Umbau-Status). Offen: 3D-Fenster nur im Code angebunden, Bild nie angesehen (kein render3d unter Linux); Blender-Paket ohne Umbau-Farben (nur Ausblenden); keine Filter-Wahl in Ansichts-/Werkzeugleiste; eigene Filter nur im Modell, nicht in der Oberfläche; Filter-Vorschau spiegelt `renovation::builtin` in `model/renovation.ts` (sauberer: Anteile in `filter_list` mitliefern); Ersatzstück der Öffnung nur, wo die Schnittebene sie trifft; Masse/Texte nur mit ausdrücklichem Status; Bäume/Möbel ohne Kategorie-Ebene bleiben im DXF auf ihrer Ebene, Baum-Beschriftungen auf der Textebene; Panel-Bild nur hell/1280×800; Tauri/Mac nicht geprüft (`doc/RELEASE-1.0.md` 13.37). · M
|
||||
- ◐ **[274]** Umbau je Schicht: Sanierung mehrschichtiger Wände, Decken, Dächer (17.11., typbasiert; `renovation::build_up`, Panel „Sanierung“, IFC `Dossier_Umbau.Schichten*`). Offen: Bogenwände ohne gestrichelte Abbruch-Kanten; im Schnitt Abbruch-Kontur schwarz statt gelb, Aussenkante der Abbruch-Schicht unter der schweren Schnittkante durchgezogen; 3D/Ansicht nur Farbe der äussersten Schicht (Dach nur Eindeckung), 3D-Bild nicht angesehen; DXF ohne Umbau-Layer je Schicht (Plan-Primitive ohne Schicht-Index); Decken im Grundriss nur Linie ohne Füllung; Endzustand hebt nur die Dachhaut, anschliessende Wände/Giebel nicht angepasst; Achse bei dünnerem neuem Aufbau bleibt in der Wand; Instanz-Schichtliste bewusst nicht; render3d und Tauri/Mac nicht angesehen (`doc/RELEASE-1.0.md` 13.39/13.39b). · M
|
||||
|
||||
@@ -154,3 +154,22 @@ fn umbaufilter_wie_stuetze() {
|
||||
assert_eq!(with("abbruch"), 0);
|
||||
assert!(with("neubau") > 0);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn varianten_blenden_traeger_aus() {
|
||||
// [284] Träger in Variante B: in der Hauptkombination (A) ausgeblendet, in B sichtbar.
|
||||
let mut p = project(json!({"designOption": {"set": "s", "option": "b"}}));
|
||||
p.design_option_sets = Some(vec![serde_json::from_value(json!({"id": "s", "name": "Tragwerk", "options": [{"id": "a", "name": "A"}, {"id": "b", "name": "B"}], "primary": "a"})).unwrap()]);
|
||||
let with = |f: Value| {
|
||||
let t = json!({"floor": "eg", "show": ["30", "50"], "grey": [], "scale": 50, "global": true, "mono": true, "designOptions": f}).to_string();
|
||||
plan_domains(&p, &PlanArgs::parse(1.0, &t).unwrap()).unwrap().columns.len()
|
||||
};
|
||||
assert_eq!(with(json!({})), 0, "Hauptkombination ohne Träger der Variante B");
|
||||
assert!(with(json!("Tragwerk=B")) > 0);
|
||||
assert!(crate::design_options::Combination::primary(&p).hidden(&p).contains("T1"));
|
||||
// 3D, Schnitt, Kennzahlen und Exporte rechnen auf dem gefilterten Projekt: dort fehlt der Träger.
|
||||
assert!(crate::renovation::project_for_text(&p, "{}").beams.as_deref().unwrap_or(&[]).is_empty());
|
||||
// Umbau: abgebrochener Träger fehlt im Neubau-Zustand.
|
||||
let q = project(json!({"renovation": {"status": "demolish"}}));
|
||||
assert!(crate::renovation::project_in_state(&q, Some("neubau"), None).beams.as_deref().unwrap_or(&[]).is_empty());
|
||||
}
|
||||
@@ -1393,7 +1393,7 @@ pub fn query(root: &Map<String, Value>, p: &Project, v: &Value) -> Option<Result
|
||||
// ── Gruppen-Zuordnung ────────────────────────────────────────────────────────
|
||||
|
||||
/// Mitglieds-Listen einer Gruppe und ihre Element-Listen (Reihenfolge wie `KEYS` in der Hülle).
|
||||
const MEMBER_KEYS: [(&str, &str); 8] = [
|
||||
const MEMBER_KEYS: [(&str, &str); 11] = [
|
||||
("wallIds", "walls"),
|
||||
("drawingIds", "drawings2d"),
|
||||
("ceilingIds", "ceilings"),
|
||||
@@ -1402,6 +1402,10 @@ const MEMBER_KEYS: [(&str, &str); 8] = [
|
||||
("columnIds", "columns"),
|
||||
("roofIds", "roofs"),
|
||||
("openingIds", "openings"),
|
||||
// [284] Träger liegen im Auswahlkanal der Stützen; Geländer und Bäume eigene Listen.
|
||||
("columnIds", "beams"),
|
||||
("railingIds", "railings"),
|
||||
("treeIds", "trees"),
|
||||
];
|
||||
|
||||
/// Zeichnet man in einer betretenen Gruppe (`group` = innerste aktive Gruppe), werden die neu
|
||||
@@ -1443,7 +1447,7 @@ pub fn group_ops(root: &Map<String, Value>, ops: &[Op], group: &str) -> Vec<Op>
|
||||
}
|
||||
};
|
||||
arr(m.get(key)).iter().for_each(&mut push);
|
||||
if let Some((_, ids)) = added.iter().find(|(k, _)| *k == key) {
|
||||
for (_, ids) in added.iter().filter(|(k, _)| *k == key) {
|
||||
ids.iter().for_each(|id| push(&Value::String(id.clone())));
|
||||
}
|
||||
m.insert(key.into(), Value::Array(list));
|
||||
|
||||
@@ -415,6 +415,10 @@ fn mv_ceiling(c: &Value, xf: &Xf) -> Value {
|
||||
f.push(("openings", Value::Array(arr(field(c, "openings")).iter().map(|h| xf.pts(Some(h))).collect())));
|
||||
}
|
||||
f.extend(flip_bulges(c, xf, &["outlineBulge"], &["openingsBulge"]));
|
||||
// [284] Gefällelinie der geneigten Decke/Rampe wandert mit (sonst kippt die Ebene beim Verschieben/Drehen).
|
||||
if let Some(s) = field(c, "slope").filter(|s| s.is_object()) {
|
||||
f.push(("slope", with_all(s, vec![("from", xf.pt_of(field(s, "from"))), ("to", xf.pt_of(field(s, "to")))])));
|
||||
}
|
||||
with_all(c, f)
|
||||
}
|
||||
|
||||
@@ -1697,6 +1701,24 @@ mod tests {
|
||||
assert_eq!(ops[0]["items"][0]["position"], json!({"x":4,"y":3}));
|
||||
}
|
||||
|
||||
/// [284] Geneigte Decke: die Gefällelinie wandert beim Verschieben und Kopieren mit (sonst kippt die Ebene).
|
||||
#[test]
|
||||
fn gefaellelinie_wandert_mit() {
|
||||
let c = json!({"id":"C","outline":[{"x":0,"y":0},{"x":4,"y":0},{"x":4,"y":2},{"x":0,"y":2}],"slope":{"from":{"x":0,"y":1},"to":{"x":4,"y":1},"rise":0.5,"ramp":true}});
|
||||
let r = root(json!({"ceilings":[c]}));
|
||||
let run = |mode: &str| {
|
||||
let req: TransformReq = serde_json::from_value(json!({"sel":{"wallIds":[],"ceilingIds":["C"]},"op":"move","pts":[[0, 0], [3, 1]],"mode":mode,"count":1,"stamp":"s"})).unwrap();
|
||||
transform_ops(&r, &Project::default(), &req).iter().map(|o| o.to_json()).collect::<Vec<_>>()
|
||||
};
|
||||
let ops = run("move");
|
||||
assert_eq!(ops[0]["entity"]["slope"], json!({"from":{"x":3,"y":2},"to":{"x":7,"y":2},"rise":0.5,"ramp":true}));
|
||||
let ops = run("copy");
|
||||
assert_eq!(ops[0]["items"][0]["slope"]["from"], json!({"x":3,"y":2}));
|
||||
// Verschieben des Projekts (Bezugspunkt, Welt-Koordinaten im Export) ebenso.
|
||||
let p = crate::geo_translate::project_patch(&r, 1.0, 2.0);
|
||||
assert_eq!(p["ceilings"][0]["slope"]["to"], json!({"x":5.0,"y":3.0}));
|
||||
}
|
||||
|
||||
/// [213] Kameras: Standpunkt und Ziel werden abgebildet, Höhen und Bildwinkel bleiben; Kopien heissen „… Kopie“.
|
||||
#[test]
|
||||
fn kameras_transformieren() {
|
||||
|
||||
@@ -182,7 +182,7 @@ impl Combination {
|
||||
}
|
||||
)*};
|
||||
}
|
||||
each!(ceilings, roofs, stairs, columns, extruded_solids, rooms, railings);
|
||||
each!(ceilings, roofs, stairs, columns, beams, extruded_solids, rooms, railings);
|
||||
for d in &p.drawings2d {
|
||||
if !self.shows(d.design_option.as_ref()) {
|
||||
out.insert(d.id.clone());
|
||||
@@ -276,7 +276,7 @@ impl Edit {
|
||||
}
|
||||
)*};
|
||||
}
|
||||
each!(ceilings, roofs, stairs, columns, extruded_solids, rooms, railings);
|
||||
each!(ceilings, roofs, stairs, columns, beams, extruded_solids, rooms, railings);
|
||||
// 2D-Elemente (Möbel, Linien, Masse, Texte): nur die, die einer anderen Variante angehören — ohne Zugehörigkeit
|
||||
// stehen sie im Hauptmodell, wo sie nicht grau werden (sonst wäre jede Beschriftung grau).
|
||||
for d in &p.drawings2d {
|
||||
|
||||
@@ -97,6 +97,10 @@ pub fn translate_project(p: &Project, dx: f64, dy: f64) -> Project {
|
||||
for h in c.openings.iter_mut().flatten() {
|
||||
shift_all(h, dx, dy);
|
||||
}
|
||||
if let Some(s) = &mut c.slope {
|
||||
s.from = shift(s.from, dx, dy);
|
||||
s.to = shift(s.to, dx, dy);
|
||||
}
|
||||
}
|
||||
for r in out.roofs.iter_mut().flatten() {
|
||||
shift_all(&mut r.outline, dx, dy);
|
||||
@@ -115,6 +119,10 @@ pub fn translate_project(p: &Project, dx: f64, dy: f64) -> Project {
|
||||
for c in out.columns.iter_mut().flatten() {
|
||||
c.position = shift(c.position, dx, dy);
|
||||
}
|
||||
for b in out.beams.iter_mut().flatten() {
|
||||
b.start = shift(b.start, dx, dy);
|
||||
b.end = shift(b.end, dx, dy);
|
||||
}
|
||||
for t in out.trees.iter_mut().flatten() {
|
||||
t.position = shift(t.position, dx, dy);
|
||||
}
|
||||
|
||||
@@ -142,6 +142,12 @@ fn shift_element(key: &str, e: &Value, dx: f64, dy: f64) -> (Value, bool) {
|
||||
let n: Vec<Value> = h.iter().map(|h| shift_all(Some(h), dx, dy)).collect();
|
||||
m.insert("openings".into(), Value::Array(n));
|
||||
}
|
||||
// [284] Gefällelinie der geneigten Decke/Rampe.
|
||||
if let Some(s) = e.get("slope").filter(|s| s.is_object()) {
|
||||
let mut s = obj(s);
|
||||
shift_pts_fields(&mut s, &["from", "to"], dx, dy, &[]);
|
||||
m.insert("slope".into(), Value::Object(s));
|
||||
}
|
||||
}
|
||||
"roofs" => {
|
||||
shift_pts_fields(&mut m, &[], dx, dy, &["outline"]);
|
||||
|
||||
@@ -453,6 +453,10 @@ pub fn without_elements(p: &Project, ids: &HashSet<String>) -> Project {
|
||||
if let Some(v) = &mut q.columns {
|
||||
v.retain(|x| !ids.contains(&x.id));
|
||||
}
|
||||
// [284] Träger (sonst blieben sie in 3D, Schnitt und Exporten trotz Umbau-/Variantenfilter stehen).
|
||||
if let Some(v) = &mut q.beams {
|
||||
v.retain(|x| !ids.contains(&x.id));
|
||||
}
|
||||
// [279] Geländer.
|
||||
if let Some(v) = &mut q.railings {
|
||||
v.retain(|x| !ids.contains(&x.id));
|
||||
|
||||
@@ -8,7 +8,7 @@ use serde_json::{Map, Value};
|
||||
use std::collections::HashSet;
|
||||
|
||||
/// Projekt-Liste → (Mitglieds-ids der Art).
|
||||
const KINDS: [(&str, &str); 9] = [
|
||||
const KINDS: [(&str, &str); 11] = [
|
||||
("walls", "wallIds"),
|
||||
("drawings2d", "drawingIds"),
|
||||
("ceilings", "ceilingIds"),
|
||||
@@ -19,6 +19,9 @@ const KINDS: [(&str, &str); 9] = [
|
||||
("beams", "columnIds"),
|
||||
("roofs", "roofIds"),
|
||||
("openings", "openingIds"),
|
||||
// [284] Geländer und Bäume: sonst gingen beim Export „nur Auswahl“ alle mit.
|
||||
("railings", "railingIds"),
|
||||
("trees", "treeIds"),
|
||||
];
|
||||
|
||||
/// Gekürzte Listen (alle acht Schlüssel, fehlende Listen = leer); Elemente in Listen-Reihenfolge, auch Doppelte.
|
||||
@@ -55,7 +58,8 @@ mod tests {
|
||||
assert_eq!(p["rooms"], json!([]));
|
||||
assert_eq!(p["drawings2d"], json!([]));
|
||||
assert_eq!(p["roofs"], json!([]));
|
||||
assert_eq!(p.len(), 9);
|
||||
assert_eq!(p.len(), 11);
|
||||
assert_eq!(p["railings"], json!([]));
|
||||
assert!(p.get("layers").is_none());
|
||||
}
|
||||
}
|
||||
@@ -299,6 +299,7 @@ fn candidate_codes(p: &Project) -> HashSet<String> {
|
||||
codes.extend(p.extruded_solids.iter().flatten().map(|e| e.category_code.clone()));
|
||||
codes.extend(p.columns.iter().flatten().map(|e| e.category_code.clone()));
|
||||
codes.extend(p.beams.iter().flatten().map(|e| e.category_code.clone()));
|
||||
codes.extend(p.railings.iter().flatten().map(|e| e.category_code.clone()));
|
||||
codes
|
||||
}
|
||||
|
||||
|
||||
@@ -487,7 +487,7 @@ struct PartKey {
|
||||
}
|
||||
|
||||
/// Felder, aus denen der Modell-Teil sammelt (ändert sich eines, wird neu gesammelt).
|
||||
const MODEL_FIELDS: [&str; 8] = ["walls", "wallTypes", "rooms", "ceilings", "roofs", "stairs", "columns", "extrudedSolids"];
|
||||
const MODEL_FIELDS: [&str; 9] = ["walls", "wallTypes", "rooms", "ceilings", "roofs", "stairs", "columns", "beams", "extrudedSolids"];
|
||||
const DRAWING_FIELDS: [&str; 1] = ["drawings2d"];
|
||||
/// So viele Teile je Art und abgelegte Geschosse bleiben (älteste fallen weg).
|
||||
const KEEP: usize = 6;
|
||||
|
||||
@@ -1054,5 +1054,59 @@ fn regression_strichmuster_winzig() {
|
||||
});
|
||||
}
|
||||
|
||||
/// [284] Neue Bauteile ([278] Einheiten, [279] Geländer, [280] Träger, [281] geneigte Decken) mit Randwerten:
|
||||
/// leere/entartete Achsen, Länge 0, Masse 0/negativ/1e300, Gefällelinie der Länge 0, Steigung ±1e300.
|
||||
#[test]
|
||||
fn regression_neue_bauteile_randwerte() {
|
||||
let rail = |id: &str, pts: Value, extra: Value| {
|
||||
let mut r = json!({"id": id, "type": "railing", "floorId": "eg", "categoryCode": "41", "points": pts, "height": 1.0, "kind": "bars"});
|
||||
r.as_object_mut().unwrap().extend(extra.as_object().unwrap().clone());
|
||||
r
|
||||
};
|
||||
let p = |x: f64, y: f64| json!({"x": x, "y": y});
|
||||
let railings = vec![
|
||||
rail("r0", json!([]), json!({})),
|
||||
rail("r1", json!([p(1.0, 1.0)]), json!({"closed": true})),
|
||||
rail("r2", json!([p(1.0, 1.0), p(1.0, 1.0)]), json!({"kind": "glass"})),
|
||||
rail("r3", json!([p(1.0, 1.0), p(1e300, 1.0)]), json!({"kind": "solid"})),
|
||||
rail("r4", json!([p(1.0, 1.0), p(3.0, 1.0)]), json!({"height": 0.0, "barSpacing": 0.0, "barSize": 0.0, "kind": "perforated"})),
|
||||
rail("r5", json!([p(1.0, 1.0), p(3.0, 1.0), p(3.0, 3.0)]), json!({"height": 1e300, "baseOffset": -1e300, "thickness": 1e300, "handrailSize": 1e300, "closed": true})),
|
||||
rail("r6", json!([p(1.0, 1.0), p(1e12, 1.0)]), json!({"barSpacing": 1e-300})),
|
||||
rail("r7", json!([p(1.0, 1.0), p(3.0, 1.0)]), json!({"height": -1.0, "thickness": -1.0, "handrail": true})),
|
||||
];
|
||||
let beam = |id: &str, s: Value, e: Value, extra: Value| {
|
||||
let mut b = json!({"id": id, "type": "beam", "floorId": "eg", "categoryCode": "50", "start": s, "end": e, "width": 0.25, "height": 0.4});
|
||||
b.as_object_mut().unwrap().extend(extra.as_object().unwrap().clone());
|
||||
b
|
||||
};
|
||||
let beams = vec![
|
||||
beam("b0", p(1.0, 1.0), p(1.0, 1.0), json!({})),
|
||||
beam("b1", p(1.0, 1.0), p(4.0, 1.0), json!({"width": 0.0, "height": 0.0})),
|
||||
beam("b2", p(1.0, 1.0), p(4.0, 1.0), json!({"width": -1.0, "height": 1e300, "topOffset": -1e300})),
|
||||
beam("b3", p(1.0, 1.0), p(1e300, 1.0), json!({"topOffset": 1e300})),
|
||||
beam("b4", p(1.0, 1.0), p(1.0 + 1e-12, 1.0), json!({"width": 1e300})),
|
||||
];
|
||||
let slopes = [
|
||||
json!({"from": p(0.0, 0.0), "to": p(0.0, 0.0), "rise": 1.0}),
|
||||
json!({"from": p(0.0, 0.0), "to": p(5.0, 0.0), "rise": 0.0, "ramp": true}),
|
||||
json!({"from": p(0.0, 0.0), "to": p(0.0, 0.0), "rise": 1.0, "ramp": true}),
|
||||
json!({"from": p(0.0, 0.0), "to": p(5.0, 0.0), "rise": 1e300}),
|
||||
json!({"from": p(0.0, 0.0), "to": p(5.0, 0.0), "rise": -1e300, "ramp": true}),
|
||||
json!({"from": p(0.0, 0.0), "to": p(1e-300, 0.0), "rise": 1.0}),
|
||||
json!({"from": p(1e300, 0.0), "to": p(-1e300, 0.0), "rise": 1.0, "ramp": true}),
|
||||
];
|
||||
for (i, s) in slopes.iter().enumerate() {
|
||||
let (rl, bm) = (railings.clone(), beams.clone());
|
||||
regression(&format!("neue Bauteile, Gefälle {i}"), |m| {
|
||||
m.insert("railings".into(), Value::Array(rl));
|
||||
m.insert("beams".into(), Value::Array(bm));
|
||||
m.insert("units".into(), json!([{"id": "u1", "name": "A"}, {"id": "u1", "name": "doppelt"}]));
|
||||
item(m, "ceilings", 0)["slope"] = s.clone();
|
||||
item(m, "rooms", 0)["unitId"] = json!(if i % 2 == 0 { "u1" } else { "fehlt" });
|
||||
item(m, "rooms", 0)["roomCount"] = json!(if i % 2 == 0 { 1e300 } else { -1.0 });
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
#[path = "robustness/op_fuzz.rs"]
|
||||
mod op_fuzz;
|
||||
@@ -96,7 +96,7 @@
|
||||
// component_name, PSETS ([141] Stütze mit Höhenabschnitten, je Abschnitt ein eigenes beschnittenes
|
||||
// Profil; EIN IfcColumn mit n Extrusionen in einer SweptSolid-Darstellung, Placement auf dem tiefsten
|
||||
// Abschnitt; Material und Materialzuordnung wie COLUMN; die Mengen stehen fertig in PSETS)
|
||||
// BEAM = 27 ([280] Träger), Felder wie COLUMN: structure, id, label, PTS (Grundriss-Rechteck), z_rel, depth (Querschnitts-
|
||||
// BEAM = 28 ([280] Träger), Felder wie COLUMN: structure, id, label, PTS (Grundriss-Rechteck), z_rel, depth (Querschnitts-
|
||||
// höhe), component_id (−1 = keine), component_name, PSETS; IfcBeam (BEAM, in IFC2x3 ohne PredefinedType),
|
||||
// Profil-Extrusion senkrecht über dem Rechteck; Schlüssel `beam/<id>`; Material wie bei den Stützen
|
||||
// (steht VOR END_COLUMNS).
|
||||
|
||||
@@ -126,6 +126,8 @@ export function hasContent(p: Project): boolean {
|
||||
(p.rooms?.length ?? 0) > 0 ||
|
||||
(p.columns?.length ?? 0) > 0 ||
|
||||
(p.beams?.length ?? 0) > 0 ||
|
||||
(p.railings?.length ?? 0) > 0 ||
|
||||
(p.trees?.length ?? 0) > 0 ||
|
||||
(p.extrudedSolids?.length ?? 0) > 0 ||
|
||||
(p.context?.length ?? 0) > 0
|
||||
);
|
||||
|
||||
@@ -842,13 +842,19 @@ export function createProjectSlice(
|
||||
p.walls.filter((w) => w.floorId === id).map((w) => w.id),
|
||||
);
|
||||
const removedCeilingIds = new Set((p.ceilings ?? []).filter((c) => c.floorId === id).map((c) => c.id));
|
||||
const removedRoofIds = new Set((p.roofs ?? []).filter((r) => r.floorId === id).map((r) => r.id));
|
||||
return [
|
||||
...fieldOps(p, "drawingLevels", recomputeFloorElevations(p.drawingLevels.filter((z) => z.id !== id))),
|
||||
...removeItems(p, "walls", removedWallIds),
|
||||
...removeItems(p, "ceilings", (c) => c.floorId === id),
|
||||
...removeItems(p, "stairs", (s) => s.floorId === id),
|
||||
...removeItems(p, "rooms", (r) => r.floorId === id),
|
||||
...removeItems(p, "openings", (o) => removedWallIds.has(o.hostWallId) || (!!o.hostCeilingId && removedCeilingIds.has(o.hostCeilingId))),
|
||||
// [284] Auch die übrigen Bauteile des Geschosses (sonst hingen sie unsichtbar an einem fehlenden Geschoss).
|
||||
...removeItems(p, "roofs", removedRoofIds),
|
||||
...removeItems(p, "columns", (c) => c.floorId === id),
|
||||
...removeItems(p, "beams", (b) => b.floorId === id),
|
||||
...removeItems(p, "railings", (r) => r.floorId === id),
|
||||
...removeItems(p, "openings", (o) => removedWallIds.has(o.hostWallId) || (!!o.hostCeilingId && removedCeilingIds.has(o.hostCeilingId)) || (!!o.hostRoofId && removedRoofIds.has(o.hostRoofId))),
|
||||
];
|
||||
});
|
||||
},
|
||||
|
||||
@@ -23,6 +23,11 @@ describe("selectAllIds", () => {
|
||||
expect(selectAllHasAny(ids)).toBe(true);
|
||||
});
|
||||
|
||||
it("[284] nimmt Geländer des Geschosses mit", () => {
|
||||
const q = { ...p, railings: [{ id: "g1", type: "railing", floorId: "eg", categoryCode: "41", points: [{ x: 0, y: 0 }, { x: 2, y: 0 }], height: 1, kind: "bars" }, { id: "g2", type: "railing", floorId: "og", categoryCode: "41", points: [{ x: 0, y: 0 }, { x: 2, y: 0 }], height: 1, kind: "bars" }] } as Project;
|
||||
expect(selectAllIds(q, "eg").railings).toEqual(["g1"]);
|
||||
});
|
||||
|
||||
it("wählt die Schattenfläche der Sonnenstudie (Entf blendet sie aus), nur im Geschoss-Grundriss", () => {
|
||||
expect(p.sunStudy?.show).toBe(true);
|
||||
expect(selectAllIds(p, "eg").site).toEqual(["sunStudy"]);
|
||||
|
||||
@@ -25,6 +25,8 @@ export function selectAllIds(project: Project, levelId: string): Partial<Selecti
|
||||
const solids = (project.extrudedSolids ?? []).filter((s) => s.levelId === levelId).map((s) => s.id);
|
||||
// [280] Träger liegen im Auswahlkanal der Stützen.
|
||||
const columnIds = [...(project.columns ?? []), ...(project.beams ?? [])].filter((c) => c.floorId === levelId).map((c) => c.id);
|
||||
// [284] Geländer des Geschosses.
|
||||
const railings = (project.railings ?? []).filter((r) => r.floorId === levelId).map((r) => r.id);
|
||||
// [213] Kameras des Geschosses (Symbol im Grundriss), gesperrte bleiben.
|
||||
const cameras = (project.cameras ?? []).filter((c) => c.floorId === levelId && !c.locked).map((c) => c.id);
|
||||
// Schnittführungs-Symbole sind projektweit (kein floorId; plan/context.rs, plan_section_lines).
|
||||
@@ -53,6 +55,7 @@ export function selectAllIds(project: Project, levelId: string): Partial<Selecti
|
||||
rooms: roomIds,
|
||||
solids,
|
||||
columns: columnIds,
|
||||
railings,
|
||||
cameras,
|
||||
roofs: roofIds,
|
||||
contextObjects,
|
||||
|
||||
Reference in new issue
Block a user