[109] [102] Schraffuren und Linientypen nach SIA 400:2000 (Fig. 34, B.3, B.8.4.1)
Beton unbewehrt wie Stahlbeton gekreuzt; Backstein/Kalksandstein 45°/135° gleiche Teilung; Dämmstoffe als Parallelen quer zur Schicht (Dämmschlange bleibt als Alternative); Mörtel, Gips, Putz, Estrich und Metall leer; neue Muster wood (Holz massiv), woodBased (Holzwerkstoff), barrier (Sperrschicht); Naturstein paarweise bei 1/3; Glas, Sperrschicht, Stahl M 1:1 neu; Punktierte Linie, Linientyp Sperrschicht. Standards aktualisieren erkennt frühere Standard-Namen.
This commit is contained in:
17 files changed
+413
-109
No files matched your search
@@ -1712,6 +1712,9 @@ Reihenfolge = Abhängigkeiten. Neue Geometrie entsteht in Rust ([K]).
|
||||
gibt den stabilen Referenz-Massstab (wie Druckansicht) an WebGPU- und native Fläche (`native2d_frame`
|
||||
`dashScale`); SVG-Rückfall: Linientypen in Papier-mm im Plot-Massstab, unter `non-scaling-stroke` über die
|
||||
meet-Variable `--plan-dash-k` (`dashArrayCss`). Test: Modell-Periode bei zwei Zoomstufen gleich und = Druck-SVG.
|
||||
Nachtrag 31.10. (SIA 400 B.3): „Punktlinie" heisst „Punktierte Linie" (B.3.2), neu „Sperrschicht (Wind, Dampf,
|
||||
Wasser)" (Fig. 34). Offen: Kanten über der Schnittebene zeichnet der Grundriss gestrichelt (`OVERHEAD_DASH`), B.3.3
|
||||
verlangt Strichpunkt (mittel); Strichlinie im Norm-Muster Strich:Lücke ≈ 1.5:1 (unsere 2:1).
|
||||
Offen: Bildschirm (WebGPU/macOS) nicht angesehen; CPU-Rückfall (> 8 Einträge) verliert Punkte. · S
|
||||
- ✅ **[80] PDF mit Ebenen.** (30.10.) jsPDF kennt keine optionalen Inhalte → `export/pdfLayers.ts` schreibt Optional Content
|
||||
selbst (OCG je Ebenenname, `/OC … BDC … EMC` im Seitenstrom, `/Properties`, `/OCProperties` im Katalog; gleiche Namen auf
|
||||
@@ -1926,7 +1929,21 @@ Reihenfolge = Abhängigkeiten. Neue Geometrie entsteht in Rust ([K]).
|
||||
(`standards.rs::update_plan/update_ops`, Abfragen `standardsUpdatePlan/-Ops`). Geprüft: Rust-/vitest-Tests,
|
||||
Druck-SVG-Schnitte 1:50 aller Standard-Baustoffe angesehen (Linux). Offen: render3d-Ribbons nicht visuell
|
||||
geprüft (Metal nur macOS, WebGPU nicht im Browser); Ribbon-Breite konstant in der Welt wie die Trennlinien;
|
||||
SVG-PlanView-Rückfall ohne Strichmuster der Musterlinien; nicht in der Tauri-App geprüft. · M
|
||||
SVG-PlanView-Rückfall ohne Strichmuster der Musterlinien; nicht in der Tauri-App geprüf
|
||||
Nachtrag 31.10. (Maintainer: „Gewisse Schraffuren entsprechen immer noch nicht SIA", Abgleich mit SIA 400:2000
|
||||
B.8.3.1 Fig. 34, B.8.4.1, Fig. 28/36–39): Beton unbewehrt = Stahlbeton (Kreuzschraffur, nicht mehr gestrichelt);
|
||||
Backstein/Kalksandstein 45°/135° gleiche Teilung 0.075 m (1.5 mm in 1:50); **Dämmstoffe = Parallelen quer zur
|
||||
Schicht** (Fig. 34/37/38, eine Schraffur „SIA Dämmstoffe" für Mineral-/Steinwolle, EPS, XPS, Holzfaser,
|
||||
Trittschall; die Dämmschlange bleibt als „Dämmung weich, Schlaufe (nicht SIA)"); Mörtel/Gips/Putz/Estrich und
|
||||
Metall (Alu) leer, Füllung weiss; Holz massiv/Brett/Parkett/Schalung neues Muster `wood` (dichte 45°, unregelmässig),
|
||||
Kantholz/Lattung Kreuz, Holzwerkstoff neues Muster `woodBased` (Dreiergruppen), Naturstein Paare bei ⅓ Teilung,
|
||||
Glas Parallelen längs (`std-h-glas`), neu Baustoff „Abdichtung / Sperrschicht" mit Muster `barrier` und Linientyp
|
||||
„Sperrschicht (Wind, Dampf, Wasser)", „SIA Stahl M 1:1" (B.8.4.1: grösser als 1:10 schraffiert). 1:100 („häufig
|
||||
schwarz", Fig. 36) = Detailgrad grob, kein eigenes Modellfeld. „Standards aktualisieren": frühere Standard-Namen
|
||||
(`former_names`) gelten nicht als umbenannt und bekommen den neuen Namen. Geprüft: Rust-/vitest-Tests, CLI-Szene
|
||||
1:20/1:50/1:100 aller Standard-Baustoffe neben Fig. 34 angesehen (Linux). Offen: Porenbeton, Keramik, Faserzement,
|
||||
Erdreich, Kies ohne SIA-Sinnbild (Konvention); dünne Sperrschicht in 1:50 kaum vom Umriss zu unterscheiden; nicht
|
||||
in der Tauri-App geprüft. · M
|
||||
- ◐ **[105] Fenster/Türen: Rahmen-Detail, Anschlag je Seite, Türzargen-Arten.** (29.10., Wunsch Maintainer „so tief wie
|
||||
ArchiCAD“) Neue optionale Modellfelder (nur Rust-Modell): `frameDetail` am Fenster-/Türtyp und feldweise an der Öffnung
|
||||
(`Opening.frameDetail`): Blendrahmen-Breite je Seite, Tiefe/Lage, Flügelrahmen (Breite, Tiefe, Überschlag), Pfosten/
|
||||
|
||||
@@ -247,12 +247,21 @@ pub enum HatchPattern {
|
||||
/// Kies/Geröll ([109]): kleine Kreise auf gestreutem Raster.
|
||||
#[serde(rename = "gravel")]
|
||||
Gravel,
|
||||
/// Naturstein ([109]): Diagonale in Doppellinien.
|
||||
/// Naturstein ([109], SIA 400 Fig. 34): Diagonale paarweise (zweite Linie bei ⅓ der Teilung).
|
||||
#[serde(rename = "stone")]
|
||||
Stone,
|
||||
/// Punktfeld ([109], Putz): feine Punkte im versetzten Raster.
|
||||
#[serde(rename = "dots")]
|
||||
Dots,
|
||||
/// Holzwerkstoffe (SIA 400 Fig. 34): 45°-Linien in Dreiergruppen.
|
||||
#[serde(rename = "woodBased")]
|
||||
WoodBased,
|
||||
/// Holz massiv (SIA 400 Fig. 34): dichte Parallelen mit unregelmässigem Abstand (Maserung).
|
||||
#[serde(rename = "wood")]
|
||||
Wood,
|
||||
/// Sperrschicht (Wind, Dampf, Wasser; SIA 400 Fig. 34): kräftige Strichlinie auf der Schichtmitte.
|
||||
#[serde(rename = "barrier")]
|
||||
Barrier,
|
||||
#[serde(other)]
|
||||
#[ts(skip)]
|
||||
Unknown,
|
||||
|
||||
@@ -2066,6 +2066,9 @@ fn write_hatch_words(out: &mut Vec<f64>, h: &HatchRender, color: f64) {
|
||||
HatchPattern::Gravel => 10.0,
|
||||
HatchPattern::Stone => 11.0,
|
||||
HatchPattern::Dots => 12.0,
|
||||
HatchPattern::WoodBased => 13.0,
|
||||
HatchPattern::Wood => 14.0,
|
||||
HatchPattern::Barrier => 15.0,
|
||||
_ => 2.0,
|
||||
};
|
||||
let kind = match h.kind {
|
||||
|
||||
@@ -529,7 +529,7 @@ fn dash_seg(a: V2, b: V2, cycle: &[f64]) -> Vec<(V2, V2)> {
|
||||
fn is_curve_pattern(p: Pattern) -> bool {
|
||||
matches!(
|
||||
p,
|
||||
Pattern::Insulation | Pattern::InsulationHard | Pattern::InsulationWave | Pattern::Timber | Pattern::Earth | Pattern::Gravel | Pattern::Stone | Pattern::Dots
|
||||
Pattern::Insulation | Pattern::InsulationHard | Pattern::InsulationWave | Pattern::Timber | Pattern::Earth | Pattern::Gravel | Pattern::Stone | Pattern::Dots | Pattern::WoodBased | Pattern::Wood | Pattern::Barrier
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -249,7 +249,7 @@ fn fill_parallel(poly: &[V2], angle: f64, spacing: f64, out: &mut Vec<(V2, V2)>)
|
||||
fn is_generated(p: Pattern) -> bool {
|
||||
matches!(
|
||||
p,
|
||||
Pattern::Insulation | Pattern::InsulationHard | Pattern::InsulationWave | Pattern::Timber | Pattern::Earth | Pattern::Gravel | Pattern::Stone | Pattern::Dots
|
||||
Pattern::Insulation | Pattern::InsulationHard | Pattern::InsulationWave | Pattern::Timber | Pattern::Earth | Pattern::Gravel | Pattern::Stone | Pattern::Dots | Pattern::WoodBased | Pattern::Wood | Pattern::Barrier
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
+195
-83
@@ -43,7 +43,7 @@ pub fn line_styles() -> Vec<Value> {
|
||||
dash("std-ls-voll", "Volllinie", Value::Null),
|
||||
dash("std-ls-strich-fein", "Strichlinie", json!([3, 1.5])),
|
||||
dash("std-ls-strich-grob", "Strichlinie lang", json!([6, 2])),
|
||||
dash("std-ls-punkt", "Punktlinie", json!([0, 1])),
|
||||
dash("std-ls-punkt", "Punktierte Linie", json!([0, 1])),
|
||||
dash("std-ls-strichpunkt", "Strichpunktlinie (Achse)", json!([12, 1.5, 0, 1.5])),
|
||||
dash("std-ls-strichzweipunkt", "Strich-Zweipunktlinie", json!([12, 1.5, 0, 1.5, 0, 1.5])),
|
||||
dash("std-ls-grundstueck", "Grundstücksgrenze", json!([8, 1.5, 0, 1.5, 0, 1.5])),
|
||||
@@ -52,15 +52,21 @@ pub fn line_styles() -> Vec<Value> {
|
||||
"kind": "zigzag", "zigzag": {"amplitude": 1.5, "wavelength": 4}}),
|
||||
dash("std-ls-schraffur-strich", "Strichlinie kurz", json!([1, 0.7])),
|
||||
dash("std-ls-schraffur-punkt", "Punktlinie kurz", json!([0.5, 1.6])),
|
||||
// SIA 400 Fig. 34: Sperrschicht als 2D-Linie (mit kräftiger Strichstärke zeichnen).
|
||||
dash("std-ls-sperrschicht", "Sperrschicht (Wind, Dampf, Wasser)", json!([3, 3])),
|
||||
]
|
||||
}
|
||||
|
||||
/// Schnittschraffuren nach SIA 400 ([109]). Abstände im Modell (Linienschar: `spacing_m`, intern
|
||||
/// `scale = spacing_m · 90 / 8`), gewählt für 1:50 (≈ 1–2 mm Papier) und noch ruhig in 1:100; Winkel in
|
||||
/// Grad; Musterlinien 0.10 mm (dichte Muster) bzw. 0.13 mm (Dämmung, Holz, Backstein) — deutlich feiner als
|
||||
/// die Schnittkante (0.35–0.5 mm). Schicht-Muster (Dämmschlange, Zickzack, Welle, Holzkreuz) spannen über
|
||||
/// die ganze Schichtdicke und laufen entlang der Schicht (`relativeToWall`); `scale` streckt dort die
|
||||
/// Musterlänge relativ zur Dicke.
|
||||
/// Schnittschraffuren (Sinnbilder) nach SIA 400:2000, B.8.3.1 Fig. 34 ([109]). Abstände im Modell senkrecht zu
|
||||
/// den Linien (Linienschar: `spacing_m`, intern `scale = spacing_m · 90 / 8`), gemessen an Fig. 34 und an den
|
||||
/// 1:50-Beispielen Fig. 37/39 (Backstein, Beton: 1.5 mm Papier in 1:50 → 0.075 m; Holz massiv halb so weit);
|
||||
/// Winkel in Grad. Musterlinien dünn (B.3.3: Schraffuren = dünne Volllinie, 0.10 mm). Schicht-Muster spannen
|
||||
/// über die ganze Schichtdicke und laufen entlang der Schicht (`relativeToWall`).
|
||||
///
|
||||
/// Massstab (B.8.3.1): „Die Dichte der Sinnbilder ist dem Massstab anzupassen" — die Abstände sind für 1:50
|
||||
/// gewählt und skalieren als Modell-Längen mit (1:20 gröber, 1:100 feiner). „Bei 1:100 und kleiner häufig
|
||||
/// schwarz oder ein gleichbleibendes Sinnbild für alle Baustoffe" (Fig. 36) = Detailgrad „grob" (Wand als
|
||||
/// schwarze Sammelfläche). Stahl (B.8.4.1): 1:50…1:10 schwarz, grösser schraffiert → „SIA Stahl M 1:1".
|
||||
pub fn hatches() -> Vec<Value> {
|
||||
let lines = |id: &str, name: &str, pattern: &str, spacing_m: f64, angle: f64, rel: bool, lw: f64, ls: &str| {
|
||||
let scale = (spacing_m * 90.0 / 8.0 * 1e4).round() / 1e4;
|
||||
@@ -73,58 +79,69 @@ pub fn hatches() -> Vec<Value> {
|
||||
}
|
||||
v
|
||||
};
|
||||
let layer = |id: &str, name: &str, pattern: &str, scale: f64| {
|
||||
json!({"id": id, "name": name, "pattern": pattern, "scale": scale, "angle": 0, "relativeToWall": true, "color": INK, "lineWeight": 0.13})
|
||||
let layer = |id: &str, name: &str, pattern: &str, scale: f64, lw: f64| {
|
||||
json!({"id": id, "name": name, "pattern": pattern, "scale": scale, "angle": 0, "relativeToWall": true, "color": INK, "lineWeight": lw})
|
||||
};
|
||||
let solid = |id: &str, name: &str, color: &str| json!({"id": id, "name": name, "pattern": "solid", "scale": 1, "angle": 0, "color": color});
|
||||
let empty = |id: &str, name: &str| json!({"id": id, "name": name, "pattern": "none", "scale": 1, "angle": 0, "color": INK});
|
||||
vec![
|
||||
json!({"id": "std-h-ohne", "name": "SIA Ohne Schraffur", "pattern": "none", "scale": 1, "angle": 0, "color": INK}),
|
||||
// Stahlbeton: Kreuzschraffur 45°/135°, bildschirmfest.
|
||||
lines("std-h-stahlbeton", "SIA Stahlbeton", "crosshatch", 0.07, 45.0, false, 0.1, ""),
|
||||
// Beton unbewehrt: Diagonale 45°, unterbrochen.
|
||||
lines("std-h-beton", "SIA Beton unbewehrt", "diagonal", 0.07, 45.0, false, 0.1, "std-ls-schraffur-strich"),
|
||||
// Mauerwerk Backstein: Diagonale 45° zur Wand.
|
||||
lines("std-h-backstein", "SIA Backstein", "diagonal", 0.06, 45.0, true, 0.13, ""),
|
||||
// Kalksandstein: Diagonale gegenläufig (135°), enger.
|
||||
lines("std-h-kalksandstein", "SIA Kalksandstein", "diagonal", 0.045, 135.0, true, 0.1, ""),
|
||||
// Porenbeton: Diagonale 45°, weit, lange Striche.
|
||||
empty("std-h-ohne", "SIA Ohne Schraffur"),
|
||||
// Fig. 34 „Bewehrter und unbewehrter Beton": ein Sinnbild — Kreuzschraffur 45°/135°.
|
||||
lines("std-h-stahlbeton", "SIA Stahlbeton", "crosshatch", 0.075, 45.0, false, 0.1, ""),
|
||||
lines("std-h-beton", "SIA Beton unbewehrt", "crosshatch", 0.075, 45.0, false, 0.1, ""),
|
||||
// Fig. 34 Backsteine: 45° (zur Wand), 1.5 mm in 1:50.
|
||||
lines("std-h-backstein", "SIA Backstein", "diagonal", 0.075, 45.0, true, 0.1, ""),
|
||||
// Fig. 34 Kalksandsteine: wie Backstein, gegenläufig 135°.
|
||||
lines("std-h-kalksandstein", "SIA Kalksandstein", "diagonal", 0.075, 135.0, true, 0.1, ""),
|
||||
// Porenbeton: in SIA 400 ohne Sinnbild (nur Kurzzeichen MP) — Konvention: 45°, weit, gestrichelt.
|
||||
lines("std-h-porenbeton", "SIA Porenbeton", "diagonal", 0.09, 45.0, true, 0.1, "std-ls-strich-fein"),
|
||||
// Holz im Querschnitt: Diagonalkreuz je Feld über die Dicke.
|
||||
layer("std-h-holz", "SIA Holz (Querschnitt)", "timber", 1.0),
|
||||
// Brettsperrholz: Lamellenfugen längs der Schicht.
|
||||
// Fig. 34 Vollholz im Querschnitt: Kreuz je Holz (Feld über die Schichtdicke).
|
||||
layer("std-h-holz", "SIA Holz (Querschnitt)", "timber", 1.0, 0.1),
|
||||
// Fig. 34 Holz massiv / Fig. 28 Brett: dichte 45°-Linien, unregelmässig (Maserung).
|
||||
lines("std-h-holz-massiv", "SIA Holz massiv", "wood", 0.0375, 45.0, true, 0.1, ""),
|
||||
// Fig. 34 Brettschichtholz: Lamellen-Linien längs der Schicht.
|
||||
lines("std-h-bsp", "SIA Brettsperrholz", "diagonal", 0.04, 90.0, true, 0.1, ""),
|
||||
// Holzwerkstoff (Span-/OSB-Platte): kurze, gestreute Späne.
|
||||
json!({"id": "std-h-holzwerkstoff", "name": "SIA Holzwerkstoff", "kind": "vector", "lines": "random", "pattern": "diagonal", "scale": 1,
|
||||
"angle": 30, "color": INK, "lineWeight": 0.1, "density": 2, "lengthMin": 0.15, "lengthMax": 0.3, "seed": 7}),
|
||||
// Dämmung weich (Mineral-/Steinwolle, Trittschall): Dämmschlange über die ganze Dicke.
|
||||
layer("std-h-daemmung-weich", "SIA Dämmung weich", "insulation", 1.0),
|
||||
// Hartschaum: Zickzack über die Dicke; XPS dichter als EPS (SIA 400 unterscheidet sie nicht).
|
||||
layer("std-h-eps", "SIA Dämmung EPS", "insulationHard", 1.0),
|
||||
layer("std-h-xps", "SIA Dämmung XPS", "insulationHard", 0.7),
|
||||
// Holzfaser: Welle über die Dicke.
|
||||
layer("std-h-holzfaser", "SIA Dämmung Holzfaser", "insulationWave", 1.0),
|
||||
solid("std-h-gips", "SIA Gips", "#cfcfcf"),
|
||||
// Putz (innen/aussen): feines, ruhiges Punktfeld entlang der Schicht (Teilung 2 cm). Eine Schraffur
|
||||
// ohne Massstabsgrenze: in 1:100 und gröber wird sie ein feiner Grauton, wer Putz dort leer will,
|
||||
// wählt „SIA Ohne Schraffur".
|
||||
json!({"id": "std-h-putz", "name": "SIA Putz", "pattern": "dots", "scale": 0.4, "angle": 0, "relativeToWall": true, "color": INK, "lineWeight": 0.1}),
|
||||
// Keramik (Fliesen, Platten): feines Kreuzraster 45°.
|
||||
// Fig. 34 Holzwerkstoffe: 45°-Linien in Dreiergruppen (Teilung 2.5 mm in 1:50).
|
||||
lines("std-h-holzwerkstoff", "SIA Holzwerkstoff", "woodBased", 0.125, 45.0, true, 0.1, ""),
|
||||
// Fig. 34 Dämmstoffe (Fig. 37/38): Parallelen quer zur Schicht über die ganze Dicke; SIA 400
|
||||
// unterscheidet weiche/harte Dämmung nicht.
|
||||
lines("std-h-daemmung-weich", "SIA Dämmstoffe", "diagonal", 0.035, 0.0, true, 0.1, ""),
|
||||
// Dämmschlange (DIN 1356) als Alternative, kein SIA-Sinnbild.
|
||||
layer("std-h-daemmung-schlaufe", "Dämmung weich, Schlaufe (nicht SIA)", "insulation", 1.0, 0.13),
|
||||
// Fig. 34 Mörtel, Gips, Verputz: leer (Farbe violett nur bei farbiger Darstellung). Estrich ist Mörtel.
|
||||
empty("std-h-gips", "SIA Gips"),
|
||||
empty("std-h-putz", "SIA Putz"),
|
||||
empty("std-h-estrich", "SIA Estrich"),
|
||||
// Keramik, Faserzement: in SIA 400 ohne Sinnbild — Konvention: feines Kreuzraster bzw. dichte 135°.
|
||||
lines("std-h-keramik", "SIA Keramik", "crosshatch", 0.015, 45.0, false, 0.1, ""),
|
||||
// Faserzement: dichte Diagonale 135° (Plattenwerkstoff, gegenläufig zu Backstein/Beton).
|
||||
lines("std-h-faserzement", "SIA Faserzement", "diagonal", 0.02, 135.0, false, 0.1, ""),
|
||||
// Estrich/Überzug: feines Punktfeld (punktierte Diagonale).
|
||||
lines("std-h-estrich", "SIA Estrich", "diagonal", 0.025, 45.0, false, 0.1, "std-ls-schraffur-punkt"),
|
||||
// Fig. 34 Stahl (Schnitt): schwarz (B.8.4.1: 1:50 bis 1:10); grössere Massstäbe schraffiert (Stahl M 1:1).
|
||||
solid("std-h-stahl", "SIA Stahl", INK),
|
||||
solid("std-h-alu", "SIA Aluminium", "#8c8c8c"),
|
||||
// Naturstein: Diagonale in Doppellinien.
|
||||
lines("std-h-naturstein", "SIA Naturstein", "stone", 0.08, 45.0, false, 0.1, ""),
|
||||
// Erdreich: Flechtmuster kurzer Striche ±45°.
|
||||
lines("std-h-stahl-detail", "SIA Stahl M 1:1", "diagonal", 0.075, 45.0, false, 0.1, ""),
|
||||
// Fig. 34 Metall (ausser Stahl): leer (hellblau nur farbig).
|
||||
empty("std-h-alu", "SIA Aluminium"),
|
||||
// Fig. 34 Naturstein allgemein: 45°-Linien paarweise (zweite bei ⅓ der Teilung).
|
||||
lines("std-h-naturstein", "SIA Naturstein", "stone", 0.1125, 45.0, true, 0.1, ""),
|
||||
// Fig. 34 Glas: Parallelen längs der Scheibe.
|
||||
lines("std-h-glas", "SIA Glas", "diagonal", 0.008, 90.0, true, 0.1, ""),
|
||||
// Fig. 34 Sperrschichten (Wind, Dampf, Wasser): kräftige Strichlinie schwarz/weiss.
|
||||
layer("std-h-sperrschicht", "SIA Sperrschicht", "barrier", 1.0, 0.5),
|
||||
// Erdreich, Kies: in SIA 400 ohne Sinnbild (B.3.3 nur Terrainlinien) — Konvention.
|
||||
lines("std-h-erdreich", "SIA Erdreich", "earth", 0.0889, 45.0, false, 0.1, ""),
|
||||
// Kies/Sauberkeitsschicht: kleine Kreise gestreut.
|
||||
lines("std-h-kies", "SIA Kies / Sauberkeitsschicht", "gravel", 0.0889, 0.0, false, 0.1, ""),
|
||||
]
|
||||
}
|
||||
|
||||
/// Frühere Namen von Standard-Einträgen: wer den alten Namen noch trägt, hat nicht umbenannt —
|
||||
/// „Standards aktualisieren" setzt dort den heutigen Namen (Begriffe nach SIA 400).
|
||||
fn former_names(id: &str) -> &'static [&'static str] {
|
||||
match id {
|
||||
"std-h-daemmung-weich" => &["SIA Dämmung weich"],
|
||||
"std-ls-punkt" => &["Punktlinie"],
|
||||
_ => &[],
|
||||
}
|
||||
}
|
||||
|
||||
/// Ein Standard-Baustoff.
|
||||
struct Mat<'a> {
|
||||
id: &'a str,
|
||||
@@ -164,34 +181,36 @@ pub fn components() -> Vec<Value> {
|
||||
Mat { id: "std-c-backstein", name: "Backstein", abbrev: "BS", fill: "#ffffff", elev: "#b5653f", hatch: "std-h-backstein", lambda: Some(0.44), density: Some(1100.0), rf: "RF1", tex: Some(("Bricks104", 1.0)), prio: 50.0, pattern: sp("runningBond", None, 0.26, Some(0.075), None) },
|
||||
Mat { id: "std-c-kalksandstein", name: "Kalksandstein", abbrev: "KS", fill: "#ffffff", elev: "#e4e1d8", hatch: "std-h-kalksandstein", lambda: Some(1.0), density: Some(1800.0), rf: "RF1", tex: None, prio: 55.0, pattern: sp("runningBond", None, 0.25, Some(0.125), None) },
|
||||
Mat { id: "std-c-porenbeton", name: "Porenbeton", abbrev: "PB", fill: "#ffffff", elev: "#e8e8e4", hatch: "std-h-porenbeton", lambda: Some(0.11), density: Some(400.0), rf: "RF1", tex: None, prio: 45.0, pattern: sp("runningBond", None, 0.6, Some(0.25), None) },
|
||||
Mat { id: "std-c-holz", name: "Holz massiv", abbrev: "HO", fill: "#ffffff", elev: "#c8a26a", hatch: "std-h-holz", lambda: Some(0.13), density: Some(450.0), rf: "RF3", tex: Some(("Wood095", 1.0)), prio: 40.0, pattern: None },
|
||||
Mat { id: "std-c-holz", name: "Holz massiv", abbrev: "HO", fill: "#ffffff", elev: "#c8a26a", hatch: "std-h-holz-massiv", lambda: Some(0.13), density: Some(450.0), rf: "RF3", tex: Some(("Wood095", 1.0)), prio: 40.0, pattern: None },
|
||||
Mat { id: "std-c-bsp", name: "Brettsperrholz", abbrev: "BSP", fill: "#ffffff", elev: "#d6b47e", hatch: "std-h-bsp", lambda: Some(0.12), density: Some(470.0), rf: "RF3", tex: Some(("Wood095", 1.0)), prio: 60.0, pattern: sp("lines", Some("horizontal"), 0.6, None, None) },
|
||||
Mat { id: "std-c-holzwerkstoff", name: "Holzwerkstoff (OSB/Spanplatte)", abbrev: "OSB", fill: "#ffffff", elev: "#d9b98a", hatch: "std-h-holzwerkstoff", lambda: Some(0.13), density: Some(650.0), rf: "RF3", tex: Some(("Chipboard001", 1.0)), prio: 35.0, pattern: sp("grid", None, 1.25, Some(2.5), None) },
|
||||
Mat { id: "std-c-mineralwolle", name: "Mineralwolle", abbrev: "MW", fill: "#ffffff", elev: "#efe6a8", hatch: "std-h-daemmung-weich", lambda: Some(0.035), density: Some(20.0), rf: "RF1", tex: None, prio: 20.0, pattern: None },
|
||||
Mat { id: "std-c-steinwolle", name: "Steinwolle", abbrev: "SW", fill: "#ffffff", elev: "#d9cfa0", hatch: "std-h-daemmung-weich", lambda: Some(0.036), density: Some(100.0), rf: "RF1", tex: None, prio: 21.0, pattern: None },
|
||||
Mat { id: "std-c-eps", name: "EPS", abbrev: "EPS", fill: "#ffffff", elev: "#f2f2f2", hatch: "std-h-eps", lambda: Some(0.034), density: Some(20.0), rf: "RF3", tex: None, prio: 22.0, pattern: None },
|
||||
Mat { id: "std-c-xps", name: "XPS", abbrev: "XPS", fill: "#ffffff", elev: "#cfe3ef", hatch: "std-h-xps", lambda: Some(0.033), density: Some(35.0), rf: "RF3", tex: None, prio: 23.0, pattern: None },
|
||||
Mat { id: "std-c-holzfaser", name: "Holzfaser", abbrev: "HF", fill: "#ffffff", elev: "#b08a5a", hatch: "std-h-holzfaser", lambda: Some(0.04), density: Some(140.0), rf: "RF3", tex: None, prio: 24.0, pattern: None },
|
||||
Mat { id: "std-c-eps", name: "EPS", abbrev: "EPS", fill: "#ffffff", elev: "#f2f2f2", hatch: "std-h-daemmung-weich", lambda: Some(0.034), density: Some(20.0), rf: "RF3", tex: None, prio: 22.0, pattern: None },
|
||||
Mat { id: "std-c-xps", name: "XPS", abbrev: "XPS", fill: "#ffffff", elev: "#cfe3ef", hatch: "std-h-daemmung-weich", lambda: Some(0.033), density: Some(35.0), rf: "RF3", tex: None, prio: 23.0, pattern: None },
|
||||
Mat { id: "std-c-holzfaser", name: "Holzfaser", abbrev: "HF", fill: "#ffffff", elev: "#b08a5a", hatch: "std-h-daemmung-weich", lambda: Some(0.04), density: Some(140.0), rf: "RF3", tex: None, prio: 24.0, pattern: None },
|
||||
Mat { id: "std-c-trittschall", name: "Trittschalldämmung", abbrev: "TSD", fill: "#ffffff", elev: "#efe6a8", hatch: "std-h-daemmung-weich", lambda: Some(0.035), density: Some(100.0), rf: "RF1", tex: None, prio: 19.0, pattern: None },
|
||||
Mat { id: "std-c-gipskarton", name: "Gipskarton", abbrev: "GK", fill: "#cfcfcf", elev: "#f4f4f2", hatch: "std-h-gips", lambda: Some(0.25), density: Some(800.0), rf: "RF1", tex: Some(("Plaster001", 1.0)), prio: 12.0, pattern: None },
|
||||
Mat { id: "std-c-gipskarton", name: "Gipskarton", abbrev: "GK", fill: "#ffffff", elev: "#f4f4f2", hatch: "std-h-gips", lambda: Some(0.25), density: Some(800.0), rf: "RF1", tex: Some(("Plaster001", 1.0)), prio: 12.0, pattern: None },
|
||||
Mat { id: "std-c-innenputz", name: "Innenputz", abbrev: "IP", fill: "#ffffff", elev: "#f5f3ee", hatch: "std-h-putz", lambda: Some(0.7), density: Some(1400.0), rf: "RF1", tex: Some(("Plaster001", 1.0)), prio: 10.0, pattern: None },
|
||||
Mat { id: "std-c-aussenputz", name: "Aussenputz", abbrev: "AP", fill: "#ffffff", elev: "#e9e3d6", hatch: "std-h-putz", lambda: Some(0.87), density: Some(1800.0), rf: "RF1", tex: Some(("Plaster001", 1.0)), prio: 10.0, pattern: None },
|
||||
Mat { id: "std-c-zementestrich", name: "Zementestrich", abbrev: "ZE", fill: "#ffffff", elev: "#cfcac0", hatch: "std-h-estrich", lambda: Some(1.4), density: Some(2000.0), rf: "RF1", tex: Some(("Concrete048", 2.0)), prio: 30.0, pattern: None },
|
||||
// Bodenbeläge ([100]): Muster im Grundriss (Oberseite der Decke) und im 3D.
|
||||
Mat { id: "std-c-parkett", name: "Parkett", abbrev: "PA", fill: "#ffffff", elev: "#c9a06b", hatch: "std-h-holz", lambda: Some(0.13), density: Some(650.0), rf: "RF3", tex: Some(("Wood095", 1.0)), prio: 8.0, pattern: sp("runningBond", None, 0.6, Some(0.1), None) },
|
||||
Mat { id: "std-c-parkett", name: "Parkett", abbrev: "PA", fill: "#ffffff", elev: "#c9a06b", hatch: "std-h-holz-massiv", lambda: Some(0.13), density: Some(650.0), rf: "RF3", tex: Some(("Wood095", 1.0)), prio: 8.0, pattern: sp("runningBond", None, 0.6, Some(0.1), None) },
|
||||
Mat { id: "std-c-keramik", name: "Keramikplatten", abbrev: "KP", fill: "#ffffff", elev: "#d8d4cc", hatch: "std-h-keramik", lambda: Some(1.3), density: Some(2300.0), rf: "RF1", tex: None, prio: 9.0, pattern: sp("grid", None, 0.3, Some(0.3), None) },
|
||||
Mat { id: "std-c-glas", name: "Glas", abbrev: "GL", fill: "#d6ecf3", elev: "#a9c8d4", hatch: "std-h-ohne", lambda: Some(1.0), density: Some(2500.0), rf: "RF1", tex: None, prio: 70.0, pattern: None },
|
||||
Mat { id: "std-c-glas", name: "Glas", abbrev: "GL", fill: "#ffffff", elev: "#a9c8d4", hatch: "std-h-glas", lambda: Some(1.0), density: Some(2500.0), rf: "RF1", tex: None, prio: 70.0, pattern: None },
|
||||
Mat { id: "std-c-stahl", name: "Stahl", abbrev: "ST", fill: INK, elev: "#7d8287", hatch: "std-h-stahl", lambda: Some(50.0), density: Some(7850.0), rf: "RF1", tex: Some(("Metal063", 1.0)), prio: 110.0, pattern: None },
|
||||
Mat { id: "std-c-aluminium", name: "Aluminium", abbrev: "AL", fill: "#8c8c8c", elev: "#b9bcbf", hatch: "std-h-alu", lambda: Some(160.0), density: Some(2700.0), rf: "RF1", tex: Some(("Metal063", 1.0)), prio: 105.0, pattern: None },
|
||||
Mat { id: "std-c-aluminium", name: "Aluminium", abbrev: "AL", fill: "#ffffff", elev: "#b9bcbf", hatch: "std-h-alu", lambda: Some(160.0), density: Some(2700.0), rf: "RF1", tex: Some(("Metal063", 1.0)), prio: 105.0, pattern: None },
|
||||
Mat { id: "std-c-naturstein", name: "Naturstein", abbrev: "NS", fill: "#ffffff", elev: "#bcb6a8", hatch: "std-h-naturstein", lambda: Some(2.3), density: Some(2600.0), rf: "RF1", tex: Some(("Marble012", 1.0)), prio: 90.0, pattern: sp("polygonal", None, 0.45, Some(0.35), None) },
|
||||
Mat { id: "std-c-erdreich", name: "Erdreich", abbrev: "ER", fill: "#ffffff", elev: "#8a7a62", hatch: "std-h-erdreich", lambda: Some(2.0), density: Some(1800.0), rf: "RF1", tex: Some(("Ground103", 2.0)), prio: 5.0, pattern: None },
|
||||
Mat { id: "std-c-kies", name: "Kies / Sauberkeitsschicht", abbrev: "KI", fill: "#ffffff", elev: "#b3aca0", hatch: "std-h-kies", lambda: Some(2.0), density: Some(2000.0), rf: "RF1", tex: Some(("Gravel043", 1.0)), prio: 6.0, pattern: None },
|
||||
// Sperrschicht (Abdichtung, Dampfbremse, Windpapier; SIA 400 Fig. 34).
|
||||
Mat { id: "std-c-sperrschicht", name: "Abdichtung / Sperrschicht", abbrev: "AB", fill: "#ffffff", elev: "#3a3a3a", hatch: "std-h-sperrschicht", lambda: Some(0.17), density: Some(1100.0), rf: "RF3", tex: None, prio: 2.0, pattern: None },
|
||||
// Bekleidungen / Eindeckungen: Ansichtsschraffur als Hauptsache.
|
||||
Mat { id: "std-c-luft", name: "Luftschicht / Hinterlüftung", abbrev: "LU", fill: "#ffffff", elev: "#ffffff", hatch: "std-h-ohne", lambda: None, density: None, rf: "RF1", tex: None, prio: 1.0, pattern: None },
|
||||
Mat { id: "std-c-lattung-v", name: "Holzlattung vertikal", abbrev: "LV", fill: "#ffffff", elev: "#b98d55", hatch: "std-h-holz", lambda: Some(0.13), density: Some(450.0), rf: "RF3", tex: Some(("Wood095", 1.0)), prio: 41.0, pattern: sp("lines", Some("vertical"), 0.08, None, None) },
|
||||
Mat { id: "std-c-lattung-h", name: "Holzlattung horizontal", abbrev: "LH", fill: "#ffffff", elev: "#b98d55", hatch: "std-h-holz", lambda: Some(0.13), density: Some(450.0), rf: "RF3", tex: Some(("Wood095", 1.0)), prio: 41.0, pattern: sp("lines", Some("horizontal"), 0.08, None, None) },
|
||||
Mat { id: "std-c-boden-deckel", name: "Holzschalung Boden-Deckel", abbrev: "BD", fill: "#ffffff", elev: "#a9824f", hatch: "std-h-holz", lambda: Some(0.13), density: Some(450.0), rf: "RF3", tex: Some(("WoodSiding008", 1.0)), prio: 41.0, pattern: sp("boardBatten", Some("vertical"), 0.2, None, Some(0.06)) },
|
||||
Mat { id: "std-c-schindeln", name: "Holzschindeln", abbrev: "SCH", fill: "#ffffff", elev: "#9c8566", hatch: "std-h-holz", lambda: Some(0.13), density: Some(450.0), rf: "RF3", tex: Some(("Wood095", 0.5)), prio: 41.0, pattern: sp("shingles", None, 0.1, Some(0.12), None) },
|
||||
Mat { id: "std-c-boden-deckel", name: "Holzschalung Boden-Deckel", abbrev: "BD", fill: "#ffffff", elev: "#a9824f", hatch: "std-h-holz-massiv", lambda: Some(0.13), density: Some(450.0), rf: "RF3", tex: Some(("WoodSiding008", 1.0)), prio: 41.0, pattern: sp("boardBatten", Some("vertical"), 0.2, None, Some(0.06)) },
|
||||
Mat { id: "std-c-schindeln", name: "Holzschindeln", abbrev: "SCH", fill: "#ffffff", elev: "#9c8566", hatch: "std-h-holz-massiv", lambda: Some(0.13), density: Some(450.0), rf: "RF3", tex: Some(("Wood095", 0.5)), prio: 41.0, pattern: sp("shingles", None, 0.1, Some(0.12), None) },
|
||||
Mat { id: "std-c-trapezblech", name: "Trapezblech", abbrev: "TB", fill: INK, elev: "#9aa1a6", hatch: "std-h-stahl", lambda: Some(50.0), density: Some(7850.0), rf: "RF1", tex: Some(("CorrugatedSteel005", 1.0)), prio: 108.0, pattern: sp("trapezoid", Some("vertical"), 0.2, None, Some(0.06)) },
|
||||
Mat { id: "std-c-faserzement", name: "Faserzementplatten", abbrev: "FZ", fill: "#ffffff", elev: "#a6a8a6", hatch: "std-h-faserzement", lambda: Some(0.6), density: Some(1800.0), rf: "RF1", tex: None, prio: 42.0, pattern: sp("grid", None, 1.25, Some(0.625), None) },
|
||||
Mat { id: "std-c-tonziegel", name: "Tonziegel", abbrev: "ZI", fill: "#ffffff", elev: "#b3583c", hatch: "std-h-backstein", lambda: Some(1.0), density: Some(1900.0), rf: "RF1", tex: Some(("RoofingTiles013A", 1.0)), prio: 15.0, pattern: sp("grid", Some("horizontal"), 0.21, Some(0.34), None) },
|
||||
@@ -321,7 +340,7 @@ fn merge_plan(root: &Map<String, Value>) -> (Vec<Value>, HashMap<String, String>
|
||||
// ergänzt nur). „Aktualisieren" gleicht Standard-Einträge (gleiche id wie ein Eintrag der Bibliothek) mit
|
||||
// der heutigen Definition ab. Regel:
|
||||
// - Verglichen werden nur die vom Standard geführten Felder (`managed`); Name und eigene Zusatzfelder
|
||||
// bleiben unangetastet. Ein vom Standard geführtes Feld, das die neue Definition nicht mehr hat, wird
|
||||
// bleiben unangetastet — ausser der Name ist ein früherer Standard-Name ([`former_names`]). Ein vom Standard geführtes Feld, das die neue Definition nicht mehr hat, wird
|
||||
// entfernt (z. B. ein früherer `lineStyleId`).
|
||||
// - Ob jemand einen Standard-Eintrag selbst geändert hat, lässt sich nicht erkennen (frühere Fassungen sind
|
||||
// nicht gespeichert). Darum nennt der Plan jede Abweichung einzeln; vorgewählt sind alle Einträge,
|
||||
@@ -450,12 +469,18 @@ fn update_changes(root: &Map<String, Value>) -> (Vec<Change>, usize) {
|
||||
for std in &items {
|
||||
let Some(id) = std["id"].as_str() else { continue };
|
||||
let Some(old) = existing.iter().find(|e| e["id"] == id) else { continue };
|
||||
let (new, fields) = updated(key, old, std, &valid, &ids);
|
||||
let (mut new, mut fields) = updated(key, old, std, &valid, &ids);
|
||||
// Früherer Standard-Name: nicht umbenannt, heutigen Namen setzen.
|
||||
let former = name_key(old).is_some_and(|n| former_names(id).iter().any(|f| f.to_lowercase() == n));
|
||||
if former && name_key(old) != name_key(std) {
|
||||
new["name"] = std["name"].clone();
|
||||
fields.push("name".into());
|
||||
}
|
||||
if fields.is_empty() {
|
||||
continue;
|
||||
}
|
||||
let name = old["name"].as_str().unwrap_or(id).to_string();
|
||||
let renamed = name_key(old) != name_key(std);
|
||||
let renamed = !former && name_key(old) != name_key(std);
|
||||
out.push((key.to_string(), id.to_string(), name, fields, renamed, new));
|
||||
}
|
||||
}
|
||||
@@ -538,19 +563,106 @@ mod tests {
|
||||
let tb = p.components.iter().find(|c| c.id == "std-c-trapezblech").unwrap().material.as_ref().unwrap();
|
||||
assert!(tb.color.is_none() && tb.library_id.as_deref() == Some("CorrugatedSteel005"));
|
||||
// Linientypen
|
||||
for name in ["Volllinie", "Strichlinie", "Strichlinie lang", "Punktlinie", "Strichpunktlinie (Achse)", "Strich-Zweipunktlinie", "Grundstücksgrenze", "Bruchlinie (Zickzack)"] {
|
||||
for name in ["Volllinie", "Strichlinie", "Strichlinie lang", "Punktierte Linie", "Strichpunktlinie (Achse)", "Strich-Zweipunktlinie", "Grundstücksgrenze", "Bruchlinie (Zickzack)"] {
|
||||
assert!(p.line_styles.iter().any(|l| l.name == name), "{name}");
|
||||
}
|
||||
}
|
||||
|
||||
/// Sinnbilder nach SIA 400:2000 Fig. 34 (B.8.3.1) und B.8.4.1.
|
||||
#[test]
|
||||
fn putz_keramik_faserzement_haben_schraffur() {
|
||||
fn sinnbilder_nach_sia_400() {
|
||||
use crate::model::HatchPattern as P;
|
||||
let r = apply(&empty_root(), &merge_ops(&empty_root()));
|
||||
let p: Project = serde_json::from_value(Value::Object(r)).unwrap();
|
||||
for (comp, hatch) in [("std-c-innenputz", "std-h-putz"), ("std-c-aussenputz", "std-h-putz"), ("std-c-keramik", "std-h-keramik"), ("std-c-faserzement", "std-h-faserzement")] {
|
||||
assert_eq!(p.components.iter().find(|c| c.id == comp).unwrap().hatch_id, hatch);
|
||||
let of = |comp: &str| {
|
||||
let c = p.components.iter().find(|c| c.id == comp).unwrap_or_else(|| panic!("{comp}"));
|
||||
p.hatches.iter().find(|h| h.id == c.hatch_id).unwrap_or_else(|| panic!("{comp}: Schraffur"))
|
||||
};
|
||||
let spacing = |comp: &str| of(comp).scale * 8.0 / 90.0;
|
||||
// Beton bewehrt und unbewehrt: dieselbe Kreuzschraffur, durchgezogen.
|
||||
for c in ["std-c-beton", "std-c-stahlbeton"] {
|
||||
assert_eq!(of(c).pattern, P::Crosshatch, "{c}");
|
||||
assert!(of(c).line_style_id.is_none(), "{c}");
|
||||
assert!((spacing(c) - 0.075).abs() < 1e-3, "{c}");
|
||||
}
|
||||
assert_eq!(p.hatches.iter().find(|h| h.id == "std-h-putz").unwrap().pattern, crate::model::HatchPattern::Dots);
|
||||
// Backstein 45°, Kalksandstein 135°, gleiche Teilung.
|
||||
assert_eq!((of("std-c-backstein").pattern, of("std-c-backstein").angle), (P::Diagonal, 45.0));
|
||||
assert_eq!((of("std-c-kalksandstein").pattern, of("std-c-kalksandstein").angle), (P::Diagonal, 135.0));
|
||||
assert!((spacing("std-c-backstein") - spacing("std-c-kalksandstein")).abs() < 1e-9);
|
||||
// Dämmstoffe: eine Schraffur, Parallelen quer zur Schicht.
|
||||
for c in ["std-c-mineralwolle", "std-c-steinwolle", "std-c-eps", "std-c-xps", "std-c-holzfaser", "std-c-trittschall"] {
|
||||
let h = of(c);
|
||||
assert_eq!((h.id.as_str(), h.pattern, h.angle, h.relative_to_wall), ("std-h-daemmung-weich", P::Diagonal, 0.0, Some(true)), "{c}");
|
||||
}
|
||||
// Mörtel, Gips, Verputz (und Estrich) leer; Metall leer, Stahl schwarz.
|
||||
for c in ["std-c-innenputz", "std-c-aussenputz", "std-c-gipskarton", "std-c-zementestrich", "std-c-aluminium"] {
|
||||
assert_eq!(of(c).pattern, P::None, "{c}");
|
||||
assert_eq!(p.components.iter().find(|k| k.id == c).unwrap().color, "#ffffff", "{c}");
|
||||
}
|
||||
assert_eq!(of("std-c-stahl").pattern, P::Solid);
|
||||
// Holz: massiv/Brett dichte Maserung, Kantholz (Lattung) Kreuz, Holzwerkstoff Dreiergruppen.
|
||||
for c in ["std-c-holz", "std-c-parkett", "std-c-boden-deckel", "std-c-schindeln"] {
|
||||
assert_eq!(of(c).pattern, P::Wood, "{c}");
|
||||
}
|
||||
assert_eq!(of("std-c-lattung-v").pattern, P::Timber);
|
||||
assert_eq!(of("std-c-holzwerkstoff").pattern, P::WoodBased);
|
||||
assert!(of("std-c-holzwerkstoff").lines.is_none() && of("std-c-holzwerkstoff").kind.is_none());
|
||||
assert_eq!(of("std-c-naturstein").pattern, P::Stone);
|
||||
assert_eq!((of("std-c-glas").pattern, of("std-c-glas").angle), (P::Diagonal, 90.0));
|
||||
assert_eq!(of("std-c-sperrschicht").pattern, P::Barrier);
|
||||
assert!(p.hatches.iter().any(|h| h.id == "std-h-stahl-detail" && h.pattern == P::Diagonal));
|
||||
assert!(p.line_styles.iter().any(|l| l.name == "Punktierte Linie"));
|
||||
}
|
||||
|
||||
/// Ein Projekt mit den Standards vom 30.10. ([109]) bekommt über „Aktualisieren" die SIA-Fassung: alle
|
||||
/// Abweichungen vorgewählt (auch der frühere Name „SIA Dämmung weich"), danach nichts mehr offen.
|
||||
#[test]
|
||||
fn aktualisieren_bringt_sia_fassung_in_alte_projekte() {
|
||||
let mut root = apply(&empty_root(), &merge_ops(&empty_root()));
|
||||
let hs = root.get_mut("hatches").unwrap().as_array_mut().unwrap();
|
||||
hs.retain(|h| !["std-h-holz-massiv", "std-h-glas", "std-h-sperrschicht", "std-h-stahl-detail", "std-h-daemmung-schlaufe"].contains(&h["id"].as_str().unwrap()));
|
||||
for h in hs.iter_mut() {
|
||||
match h["id"].as_str().unwrap() {
|
||||
"std-h-daemmung-weich" => *h = json!({"id": "std-h-daemmung-weich", "name": "SIA Dämmung weich", "pattern": "insulation", "scale": 1, "angle": 0, "relativeToWall": true, "color": INK, "lineWeight": 0.13}),
|
||||
"std-h-beton" => {
|
||||
h["pattern"] = json!("diagonal");
|
||||
h["lineStyleId"] = json!("std-ls-schraffur-strich");
|
||||
}
|
||||
"std-h-putz" => h["pattern"] = json!("dots"),
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
hs.push(json!({"id": "std-h-eps", "name": "SIA Dämmung EPS", "pattern": "insulationHard", "scale": 1, "angle": 0, "relativeToWall": true, "color": INK}));
|
||||
for c in root.get_mut("components").unwrap().as_array_mut().unwrap() {
|
||||
if c["id"] == "std-c-eps" {
|
||||
c["hatchId"] = json!("std-h-eps");
|
||||
}
|
||||
if c["id"] == "std-c-holz" || c["id"] == "std-c-glas" {
|
||||
c["hatchId"] = json!("std-h-holz");
|
||||
}
|
||||
}
|
||||
let plan = update_plan(&root);
|
||||
let ch = plan["changes"].as_array().unwrap();
|
||||
let find = |id: &str| ch.iter().find(|c| c["id"] == id).unwrap_or_else(|| panic!("{id}"));
|
||||
assert_eq!(find("std-h-daemmung-weich")["renamed"], false, "früherer Standard-Name");
|
||||
assert!(find("std-h-daemmung-weich")["fields"].as_array().unwrap().iter().any(|f| f == "name"));
|
||||
assert!(ch.iter().all(|c| c["renamed"] == false));
|
||||
let all: Vec<String> = ch.iter().map(|c| format!("{}:{}", c["collection"].as_str().unwrap(), c["id"].as_str().unwrap())).collect();
|
||||
let after = apply_all(&root, &update_ops(&root, &all));
|
||||
let get = |k: &str, id: &str| after[k].as_array().unwrap().iter().find(|e| e["id"] == id).unwrap().clone();
|
||||
assert_eq!(get("hatches", "std-h-daemmung-weich")["name"], "SIA Dämmstoffe");
|
||||
assert_eq!(get("hatches", "std-h-daemmung-weich")["pattern"], "diagonal");
|
||||
assert_eq!(get("hatches", "std-h-beton")["pattern"], "crosshatch");
|
||||
assert!(get("hatches", "std-h-beton").get("lineStyleId").is_none());
|
||||
assert_eq!(get("hatches", "std-h-putz")["pattern"], "none");
|
||||
assert_eq!(get("components", "std-c-eps")["hatchId"], "std-h-daemmung-weich");
|
||||
assert_eq!(get("components", "std-c-holz")["hatchId"], "std-h-holz-massiv");
|
||||
assert_eq!(get("components", "std-c-glas")["hatchId"], "std-h-glas");
|
||||
assert_eq!(get("components", "std-c-glas")["color"], "#ffffff");
|
||||
assert!(update_plan(&after)["changes"].as_array().unwrap().is_empty());
|
||||
assert_eq!(update_plan(&after)["added"], 0);
|
||||
let p: Project = serde_json::from_value(Value::Object(after)).unwrap();
|
||||
assert!(crate::project_refs::dangling_refs(&p).is_empty());
|
||||
}
|
||||
|
||||
fn alt_projekt() -> Map<String, Value> {
|
||||
@@ -560,18 +672,18 @@ mod tests {
|
||||
let hs = root.get_mut("hatches").unwrap().as_array_mut().unwrap();
|
||||
hs.retain(|h| h["id"] != "std-h-putz");
|
||||
for h in hs.iter_mut() {
|
||||
if h["id"] == "std-h-eps" {
|
||||
if h["id"] == "std-h-daemmung-weich" {
|
||||
h["pattern"] = json!("insulation");
|
||||
}
|
||||
if h["id"] == "std-h-xps" {
|
||||
h["name"] = json!("Meine XPS");
|
||||
h["pattern"] = json!("diagonal");
|
||||
if h["id"] == "std-h-kalksandstein" {
|
||||
h["name"] = json!("Meine KS");
|
||||
h["pattern"] = json!("crosshatch");
|
||||
}
|
||||
}
|
||||
hs.push(json!({"id": "mine", "name": "Eigene", "pattern": "diagonal", "scale": 1, "angle": 0, "color": "#000"}));
|
||||
for c in root.get_mut("components").unwrap().as_array_mut().unwrap() {
|
||||
if c["id"] == "std-c-innenputz" {
|
||||
c["hatchId"] = json!("std-h-ohne");
|
||||
c["hatchId"] = json!("std-h-backstein");
|
||||
}
|
||||
}
|
||||
root
|
||||
@@ -603,22 +715,22 @@ mod tests {
|
||||
assert_eq!(plan["added"], 1, "Putz-Schraffur fehlt");
|
||||
let ch = plan["changes"].as_array().unwrap();
|
||||
let find = |id: &str| ch.iter().find(|c| c["id"] == id);
|
||||
assert_eq!(find("std-h-eps").unwrap()["fields"], json!(["pattern"]));
|
||||
assert_eq!(find("std-h-eps").unwrap()["renamed"], false);
|
||||
assert_eq!(find("std-h-xps").unwrap()["renamed"], true, "umbenannt: abgewählt");
|
||||
assert!(find("std-h-xps").unwrap()["fields"].as_array().unwrap().iter().any(|f| f == "pattern"));
|
||||
assert_eq!(find("std-h-daemmung-weich").unwrap()["fields"], json!(["pattern"]));
|
||||
assert_eq!(find("std-h-daemmung-weich").unwrap()["renamed"], false);
|
||||
assert_eq!(find("std-h-kalksandstein").unwrap()["renamed"], true, "umbenannt: abgewählt");
|
||||
assert!(find("std-h-kalksandstein").unwrap()["fields"].as_array().unwrap().iter().any(|f| f == "pattern"));
|
||||
assert_eq!(find("std-c-innenputz").unwrap()["fields"], json!(["hatchId"]), "Verweis zeigt künftig auf die ergänzte Putz-Schraffur");
|
||||
assert!(find("mine").is_none() && find("std-h-beton").is_none(), "Eigenes und Unverändertes nicht");
|
||||
let ops = update_ops(&root, &["hatches:std-h-eps".to_string(), "components:std-c-innenputz".to_string()]);
|
||||
assert!(find("mine").is_none() && find("std-h-backstein").is_none(), "Eigenes und Unverändertes nicht");
|
||||
let ops = update_ops(&root, &["hatches:std-h-daemmung-weich".to_string(), "components:std-c-innenputz".to_string()]);
|
||||
let after = apply_all(&root, &ops);
|
||||
let get = |k: &str, id: &str| after[k].as_array().unwrap().iter().find(|e| e["id"] == id).unwrap().clone();
|
||||
assert_eq!(get("hatches", "std-h-eps")["pattern"], "insulationHard");
|
||||
assert_eq!(get("hatches", "std-h-xps")["pattern"], "diagonal", "nicht gewählt: bleibt");
|
||||
assert_eq!(get("hatches", "std-h-daemmung-weich")["pattern"], "diagonal");
|
||||
assert_eq!(get("hatches", "std-h-kalksandstein")["pattern"], "crosshatch", "nicht gewählt: bleibt");
|
||||
assert_eq!(get("components", "std-c-innenputz")["hatchId"], "std-h-putz");
|
||||
assert!(after["hatches"].as_array().unwrap().iter().any(|h| h["id"] == "std-h-putz"));
|
||||
let left = update_plan(&after);
|
||||
assert_eq!(left["added"], 0);
|
||||
assert!(left["changes"].as_array().unwrap().iter().all(|c| c["id"] == "std-h-xps"));
|
||||
assert!(left["changes"].as_array().unwrap().iter().all(|c| c["id"] == "std-h-kalksandstein"));
|
||||
let all: Vec<String> = left["changes"].as_array().unwrap().iter().map(|c| format!("{}:{}", c["collection"].as_str().unwrap(), c["id"].as_str().unwrap())).collect();
|
||||
let done = apply_all(&after, &update_ops(&after, &all));
|
||||
assert!(update_plan(&done)["changes"].as_array().unwrap().is_empty());
|
||||
@@ -630,13 +742,13 @@ mod tests {
|
||||
fn aktualisieren_entfernt_nicht_mehr_gefuehrte_felder_und_laesst_zusatzfelder() {
|
||||
let mut root = apply(&empty_root(), &merge_ops(&empty_root()));
|
||||
for h in root.get_mut("hatches").unwrap().as_array_mut().unwrap() {
|
||||
if h["id"] == "std-h-eps" {
|
||||
if h["id"] == "std-h-daemmung-weich" {
|
||||
h["lineStyleId"] = json!("std-ls-voll");
|
||||
h["myNote"] = json!("bleibt");
|
||||
}
|
||||
}
|
||||
let after = apply_all(&root, &update_ops(&root, &["hatches:std-h-eps".to_string()]));
|
||||
let eps = after["hatches"].as_array().unwrap().iter().find(|h| h["id"] == "std-h-eps").unwrap();
|
||||
let after = apply_all(&root, &update_ops(&root, &["hatches:std-h-daemmung-weich".to_string()]));
|
||||
let eps = after["hatches"].as_array().unwrap().iter().find(|h| h["id"] == "std-h-daemmung-weich").unwrap();
|
||||
assert!(eps.get("lineStyleId").is_none());
|
||||
assert_eq!(eps["myNote"], "bleibt");
|
||||
}
|
||||
@@ -651,14 +763,14 @@ mod tests {
|
||||
fn gleichnamige_bleiben_und_verweise_zeigen_darauf() {
|
||||
let mut root = empty_root();
|
||||
root.insert("components".into(), json!([{"id": "brick", "name": "backstein ", "color": "#8c5544", "hatchId": "x", "joinPriority": 50}]));
|
||||
root.insert("lineStyles".into(), json!([{"id": "thin", "name": "Strichlinie kurz", "color": "#000", "dash": [1, 0.7]}]));
|
||||
root.insert("lineStyles".into(), json!([{"id": "thin", "name": "Strichlinie", "color": "#000", "dash": [3, 1.5]}]));
|
||||
let r = apply(&root, &merge_ops(&root));
|
||||
let comps = r["components"].as_array().unwrap();
|
||||
assert_eq!(comps.iter().filter(|c| c["name"].as_str().unwrap().trim().eq_ignore_ascii_case("backstein")).count(), 1);
|
||||
assert_eq!(comps[0]["color"], "#8c5544", "vorhandenes Bauteil unverändert");
|
||||
let iw = r["wallTypes"].as_array().unwrap().iter().find(|t| t["id"] == "std-wt-iw-backstein").unwrap();
|
||||
assert_eq!(iw["layers"][1]["componentId"], "brick");
|
||||
let pb = r["hatches"].as_array().unwrap().iter().find(|h| h["id"] == "std-h-beton").unwrap();
|
||||
let pb = r["hatches"].as_array().unwrap().iter().find(|h| h["id"] == "std-h-porenbeton").unwrap();
|
||||
assert_eq!(pb["lineStyleId"], "thin");
|
||||
}
|
||||
}
|
||||
@@ -51,6 +51,9 @@ fn pattern_id(p: HatchPattern) -> f64 {
|
||||
HatchPattern::Gravel => 10.0,
|
||||
HatchPattern::Stone => 11.0,
|
||||
HatchPattern::Dots => 12.0,
|
||||
HatchPattern::WoodBased => 13.0,
|
||||
HatchPattern::Wood => 14.0,
|
||||
HatchPattern::Barrier => 15.0,
|
||||
_ => 0.0,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,6 +51,9 @@ pub enum Pattern {
|
||||
Gravel = 10,
|
||||
Stone = 11,
|
||||
Dots = 12,
|
||||
WoodBased = 13,
|
||||
Wood = 14,
|
||||
Barrier = 15,
|
||||
}
|
||||
|
||||
impl Pattern {
|
||||
@@ -68,6 +71,9 @@ impl Pattern {
|
||||
10 => Pattern::Gravel,
|
||||
11 => Pattern::Stone,
|
||||
12 => Pattern::Dots,
|
||||
13 => Pattern::WoodBased,
|
||||
14 => Pattern::Wood,
|
||||
15 => Pattern::Barrier,
|
||||
_ => Pattern::Diagonal,
|
||||
}
|
||||
}
|
||||
@@ -427,6 +433,7 @@ pub fn build_hatch_runs(poly: &[V2], hatch: &Hatch) -> Vec<Run> {
|
||||
Pattern::Earth => return earth_runs(poly, hatch, scale),
|
||||
Pattern::Gravel => return gravel_runs(poly, hatch, scale),
|
||||
Pattern::Dots => return dots_runs(poly, hatch, scale),
|
||||
Pattern::Barrier => return barrier_runs(poly, hatch, scale),
|
||||
_ => {}
|
||||
}
|
||||
let spacing_m = 8.0 * scale * PX_TO_M;
|
||||
@@ -434,6 +441,9 @@ pub fn build_hatch_runs(poly: &[V2], hatch: &Hatch) -> Vec<Run> {
|
||||
let dir1 = rotate(v2(0.0, -1.0), rot);
|
||||
let a1 = jsnum::atan2(dir1.y, dir1.x);
|
||||
let anchor = hatch.origin.unwrap_or(v2(0.0, 0.0));
|
||||
if pattern == Pattern::Wood {
|
||||
return wood_runs(poly, a1, spacing_m, anchor, hatch.seed.unwrap_or(0.0));
|
||||
}
|
||||
let mut runs: Vec<Run> = hatch_line_family(poly, a1, spacing_m, 0.0, anchor)
|
||||
.into_iter()
|
||||
.map(|(a, b)| match (&hatch.motif, pattern) {
|
||||
@@ -446,12 +456,72 @@ pub fn build_hatch_runs(poly: &[V2], hatch: &Hatch) -> Vec<Run> {
|
||||
runs.push(vec![a, b]);
|
||||
}
|
||||
}
|
||||
// Naturstein: jede Musterlinie als Doppellinie (zweite um 18 % des Abstands versetzt).
|
||||
// Naturstein (SIA 400 Fig. 34): Linien paarweise, die zweite um ⅓ der Teilung versetzt.
|
||||
if pattern == Pattern::Stone {
|
||||
for (a, b) in hatch_line_family(poly, a1, spacing_m, 0.18 * spacing_m, anchor) {
|
||||
for (a, b) in hatch_line_family(poly, a1, spacing_m, spacing_m / 3.0, anchor) {
|
||||
runs.push(vec![a, b]);
|
||||
}
|
||||
}
|
||||
// Holzwerkstoffe (SIA 400 Fig. 34): Dreiergruppen bei 0, 0.2 und 0.4 der Teilung.
|
||||
if pattern == Pattern::WoodBased {
|
||||
for f in [0.2, 0.4] {
|
||||
for (a, b) in hatch_line_family(poly, a1, spacing_m, f * spacing_m, anchor) {
|
||||
runs.push(vec![a, b]);
|
||||
}
|
||||
}
|
||||
}
|
||||
runs
|
||||
}
|
||||
|
||||
/// Holz massiv (SIA 400 Fig. 34): dichte Parallelen mit unregelmässigem Abstand (Maserung) — Linie `k`
|
||||
/// liegt bei `k · Teilung` ± 15 % (deterministisch je Linie und `seed`, modellraum-stabil).
|
||||
fn wood_runs(poly: &[V2], angle_rad: f64, spacing_m: f64, anchor: V2, seed: f64) -> Vec<Run> {
|
||||
if poly.len() < 3 || spacing_m <= 1e-9 {
|
||||
return Vec::new();
|
||||
}
|
||||
let dir = v2(jsnum::cos(angle_rad), jsnum::sin(angle_rad));
|
||||
let nrm = v2(-dir.y, dir.x);
|
||||
let (mut d_min, mut d_max) = (f64::INFINITY, f64::NEG_INFINITY);
|
||||
for p in poly {
|
||||
let d = (p.x - anchor.x) * nrm.x + (p.y - anchor.y) * nrm.y;
|
||||
d_min = d_min.min(d);
|
||||
d_max = d_max.max(d);
|
||||
}
|
||||
let (first, last) = ((d_min / spacing_m).floor() - 1.0, (d_max / spacing_m).ceil() + 1.0);
|
||||
if !(last - first).is_finite() || last - first > 1e6 {
|
||||
return Vec::new();
|
||||
}
|
||||
let mut runs = Vec::new();
|
||||
let mut k = first;
|
||||
while k <= last {
|
||||
let jitter = Mulberry32 { a: hash_cell(k, 0.0, seed) }.next() - 0.5;
|
||||
let d = (k + 0.3 * jitter) * spacing_m;
|
||||
let p0 = v2(anchor.x + nrm.x * d, anchor.y + nrm.y * d);
|
||||
runs.extend(clip_line_to_polygon(p0, dir, poly).into_iter().map(|(a, b)| vec![a, b]));
|
||||
k += 1.0;
|
||||
}
|
||||
runs
|
||||
}
|
||||
|
||||
/// Sperrschicht (Wind, Dampf, Wasser; SIA 400 Fig. 34): Strichlinie auf der Mittellinie der Schicht,
|
||||
/// Strich = Lücke = 0.15 m · scale (1:50 → 3 mm). Die Breite gibt die Strichstärke der Schraffur.
|
||||
fn barrier_runs(poly: &[V2], hatch: &Hatch, scale: f64) -> Vec<Run> {
|
||||
let Some(b) = band_frame(poly, hatch, scale) else { return Vec::new() };
|
||||
let dash = 0.15 * scale;
|
||||
if !(dash > 1e-6) || (b.u1 - b.u0) / dash > BAND_MAX_POINTS {
|
||||
return Vec::new();
|
||||
}
|
||||
let mut runs = Vec::new();
|
||||
for &(vc, _) in &b.rows {
|
||||
let mut i = ((b.u0 - b.ua) / (2.0 * dash)).floor();
|
||||
while b.ua + 2.0 * i * dash <= b.u1 {
|
||||
let s = b.ua + 2.0 * i * dash;
|
||||
for (sa, sb) in clip_segment_to_polygon(b.at(s, vc), b.at(s + dash, vc), poly) {
|
||||
runs.push(vec![sa, sb]);
|
||||
}
|
||||
i += 1.0;
|
||||
}
|
||||
}
|
||||
runs
|
||||
}
|
||||
|
||||
@@ -1177,10 +1247,67 @@ mod tests {
|
||||
assert!(phases.len() >= 2, "{phases:?}");
|
||||
}
|
||||
|
||||
/// Abstände der Musterlinien senkrecht zur Linienrichtung (Winkel 0 ⇒ Linien senkrecht zu x im
|
||||
/// Musterraum), gemessen als Schnittpunkte mit der waagrechten Mittellinie eines Quadrats.
|
||||
fn offsets_on_row(runs: &[Run], y: f64) -> Vec<f64> {
|
||||
let mut xs: Vec<f64> = runs
|
||||
.iter()
|
||||
.filter_map(|r| {
|
||||
let (a, b) = (r[0], r[r.len() - 1]);
|
||||
((a.y - y) * (b.y - y) <= 0.0 && (b.y - a.y).abs() > 1e-12).then(|| a.x + (y - a.y) / (b.y - a.y) * (b.x - a.x))
|
||||
})
|
||||
.collect();
|
||||
xs.sort_by(|a, b| a.partial_cmp(b).unwrap());
|
||||
xs
|
||||
}
|
||||
|
||||
/// SIA 400 Fig. 34: Naturstein = 45°-Linien paarweise (zweite Linie bei ⅓ der Teilung), Holzwerkstoffe =
|
||||
/// Dreiergruppen (0, 0.2, 0.4 der Teilung), Holz massiv = dichte Linien mit unregelmässigem Abstand.
|
||||
#[test]
|
||||
fn naturstein_holzwerkstoff_holz_nach_sia() {
|
||||
let sq = band(1.0, 1.0);
|
||||
let mut h = hatch(Pattern::Stone);
|
||||
h.angle = 0.0;
|
||||
let sp = 8.0 * h.scale * PX_TO_M;
|
||||
let xs = offsets_on_row(&build_hatch_runs(&sq, &h), 0.5);
|
||||
let gaps: Vec<f64> = xs.windows(2).map(|w| ((w[1] - w[0]) / sp * 100.0).round() / 100.0).collect();
|
||||
assert!(gaps.iter().all(|g| (*g - 0.33).abs() < 0.011 || (*g - 0.67).abs() < 0.011), "{gaps:?}");
|
||||
h.pattern = Pattern::WoodBased;
|
||||
let xs = offsets_on_row(&build_hatch_runs(&sq, &h), 0.5);
|
||||
let gaps: Vec<f64> = xs.windows(2).map(|w| ((w[1] - w[0]) / sp * 100.0).round() / 100.0).collect();
|
||||
assert!(gaps.iter().all(|g| (*g - 0.2).abs() < 0.011 || (*g - 0.6).abs() < 0.011), "{gaps:?}");
|
||||
assert!(gaps.iter().filter(|g| (**g - 0.2).abs() < 0.011).count() > gaps.len() / 2, "je Gruppe zwei enge Abstände");
|
||||
h.pattern = Pattern::Wood;
|
||||
let a = build_hatch_runs(&sq, &h);
|
||||
assert_eq!(a, build_hatch_runs(&sq, &h), "stabil");
|
||||
let xs = offsets_on_row(&a, 0.5);
|
||||
let gaps: Vec<f64> = xs.windows(2).map(|w| (w[1] - w[0]) / sp).collect();
|
||||
let (lo, hi) = gaps.iter().fold((f64::INFINITY, 0.0f64), |(l, u), g| (l.min(*g), u.max(*g)));
|
||||
assert!(lo > 0.6 && hi < 1.4 && hi - lo > 0.2, "unregelmässig, aber ohne Berührung: {lo}…{hi}");
|
||||
let mean = gaps.iter().sum::<f64>() / gaps.len() as f64;
|
||||
assert!((mean - 1.0).abs() < 0.05, "{mean}");
|
||||
}
|
||||
|
||||
/// Sperrschicht (SIA 400 Fig. 34): Strich-Lücke gleich lang auf der Mittellinie der Schicht.
|
||||
#[test]
|
||||
fn sperrschicht_strichlinie_in_der_mitte() {
|
||||
let mut h = hatch(Pattern::Barrier);
|
||||
h.angle = 0.0;
|
||||
h.scale = 1.0;
|
||||
let thin = band(1.0, 0.004);
|
||||
let runs = build_hatch_runs(&thin, &h);
|
||||
assert!(runs.len() >= 3, "{}", runs.len());
|
||||
for r in &runs {
|
||||
assert!(r.iter().all(|p| (p.y - 0.002).abs() < 1e-9), "Mittellinie");
|
||||
}
|
||||
let lens: Vec<f64> = runs.iter().map(|r| r[r.len() - 1].x - r[0].x).collect();
|
||||
assert!(lens.iter().filter(|l| (**l - 0.15).abs() < 1e-9).count() >= 2, "{lens:?}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn schichtmuster_entartet_leer() {
|
||||
let p = vec![v2(0.0, 0.0), v2(f64::INFINITY, 0.0), v2(1.0, 1.0)];
|
||||
for pat in [Pattern::InsulationHard, Pattern::InsulationWave, Pattern::Timber, Pattern::Earth, Pattern::Gravel, Pattern::Stone, Pattern::Dots] {
|
||||
for pat in [Pattern::InsulationHard, Pattern::InsulationWave, Pattern::Timber, Pattern::Earth, Pattern::Gravel, Pattern::Stone, Pattern::Dots, Pattern::WoodBased, Pattern::Wood, Pattern::Barrier] {
|
||||
assert!(build_hatch_runs(&p, &hatch(pat)).is_empty(), "{pat:?}");
|
||||
}
|
||||
// Linie ohne Dicke
|
||||
|
||||
@@ -1562,6 +1562,9 @@ export const de = {
|
||||
"pattern.earth": "Erdreich",
|
||||
"pattern.gravel": "Kies",
|
||||
"pattern.dots": "Punktfeld (Putz)",
|
||||
"pattern.wood": "Holz massiv (Maserung)",
|
||||
"pattern.woodBased": "Holzwerkstoff (Dreiergruppen)",
|
||||
"pattern.barrier": "Sperrschicht (Strichlinie)",
|
||||
"pattern.diagonal": "Diagonal",
|
||||
"pattern.crosshatch": "Kreuzschraffur",
|
||||
"pattern.custom": "Eigenes Motiv",
|
||||
|
||||
@@ -1553,6 +1553,9 @@ export const en: Record<TranslationKey, string> = {
|
||||
"pattern.earth": "Earth",
|
||||
"pattern.gravel": "Gravel",
|
||||
"pattern.dots": "Dot field (plaster)",
|
||||
"pattern.wood": "Solid timber (grain)",
|
||||
"pattern.woodBased": "Wood-based panel (groups of three)",
|
||||
"pattern.barrier": "Barrier layer (dashed)",
|
||||
"pattern.diagonal": "Diagonal",
|
||||
"pattern.crosshatch": "Crosshatch",
|
||||
"pattern.custom": "Custom motif",
|
||||
|
||||
@@ -590,16 +590,17 @@ function annotations(): Drawing2D[] {
|
||||
const dl = "detail-traufe";
|
||||
// Lage abseits des Geländes (Kontext wird auf allen Ebenen gezeichnet), Ursprung x = 60 m.
|
||||
const Q = (x: number, y: number) => P(DETAIL_X + x, y);
|
||||
const layer = (id: string, x0: number, y0: number, x1: number, y1: number, hatchId: string, fillColor = "#ffffff") =>
|
||||
add(id, dl, "85", { shape: "rect", min: Q(x0, y0), max: Q(x1, y1) }, { hatchId, fillColor, weightMm: 0.25, lineStyleId: "std-ls-voll" });
|
||||
const layer = (id: string, x0: number, y0: number, x1: number, y1: number, hatchId: string, fillColor = "#ffffff", hatchAngleDeg?: number) =>
|
||||
add(id, dl, "85", { shape: "rect", min: Q(x0, y0), max: Q(x1, y1) }, { hatchId, fillColor, weightMm: 0.25, lineStyleId: "std-ls-voll", ...(hatchAngleDeg != null ? { hatchAngleDeg } : {}) });
|
||||
layer("det-aussenputz", 0, 0, 0.02, 2.0, "std-h-putz");
|
||||
layer("det-eps", 0.02, 0, 0.2, 2.0, "std-h-eps");
|
||||
// Dämmstoffe (SIA 400 Fig. 34): Linien quer zur senkrechten Schicht.
|
||||
layer("det-eps", 0.02, 0, 0.2, 2.0, "std-h-daemmung-weich", "#ffffff", 90);
|
||||
layer("det-bs-unten", 0.2, 0, 0.375, 0.99, "std-h-backstein");
|
||||
layer("det-bs-oben", 0.2, 1.37, 0.375, 2.0, "std-h-backstein");
|
||||
layer("det-decke", 0.2, 0.99, 1.4, 1.24, "std-h-stahlbeton");
|
||||
layer("det-tsd", 0.375, 1.24, 1.4, 1.28, "std-h-daemmung-weich");
|
||||
layer("det-estrich", 0.375, 1.28, 1.4, 1.345, "std-h-estrich");
|
||||
layer("det-parkett", 0.375, 1.345, 1.4, 1.36, "std-h-holz");
|
||||
layer("det-parkett", 0.375, 1.345, 1.4, 1.36, "std-h-holz-massiv");
|
||||
layer("det-putz-unten", 0.375, 0, 0.39, 0.99, "std-h-putz");
|
||||
layer("det-putz-decke", 0.39, 0.98, 1.4, 0.99, "std-h-putz");
|
||||
add("det-randstreifen", dl, "85", { shape: "line", a: Q(0.38, 1.24), b: Q(0.38, 1.36) }, { lineStyleId: "std-ls-strich-fein", weightMm: 0.18 });
|
||||
|
||||
+25
-11
@@ -32,17 +32,21 @@ describe("Standard-Bibliothek ([100]–[102])", () => {
|
||||
it("zählt, was „Standards laden“ hinzufügt (Rückmeldung)", () => {
|
||||
const empty = { ...emptyProject, components: [], hatches: [], lineStyles: [], wallTypes: [], ceilingTypes: [], roofTypes: [] };
|
||||
const c = standardsMergeCounts(standardsMergeOps(empty));
|
||||
expect(c.components).toBe(34);
|
||||
expect(c.components).toBe(35);
|
||||
expect(c.lineStyles).toBeGreaterThan(5);
|
||||
expect(c.wallTypes + c.ceilingTypes + c.roofTypes).toBe(5);
|
||||
expect(standardsMergeCounts(standardsMergeOps(withStandards(empty)))).toEqual({ lineStyles: 0, hatches: 0, components: 0, wallTypes: 0, ceilingTypes: 0, roofTypes: 0 });
|
||||
});
|
||||
|
||||
it("Putz, Keramik und Faserzement haben eine Schraffur", () => {
|
||||
it("Sinnbilder nach SIA 400 Fig. 34: Putz leer, Dämmung quer, Beton gekreuzt", () => {
|
||||
const p = withStandards({ ...emptyProject, components: [], hatches: [], lineStyles: [], wallTypes: [], ceilingTypes: [], roofTypes: [] });
|
||||
const hatchOf = (name: string) => p.hatches.find((h) => h.id === p.components.find((c) => c.name === name)!.hatchId)!;
|
||||
expect(hatchOf("Innenputz").pattern).toBe("dots");
|
||||
expect(hatchOf("Aussenputz").pattern).toBe("dots");
|
||||
expect(hatchOf("Innenputz").pattern).toBe("none");
|
||||
expect(hatchOf("Aussenputz").pattern).toBe("none");
|
||||
expect(hatchOf("Beton").pattern).toBe("crosshatch");
|
||||
expect(hatchOf("EPS").pattern).toBe("diagonal");
|
||||
expect(hatchOf("EPS").angle).toBe(0);
|
||||
expect(hatchOf("Holzwerkstoff (OSB/Spanplatte)").pattern).toBe("woodBased");
|
||||
expect(hatchOf("Keramikplatten").pattern).toBe("crosshatch");
|
||||
expect(hatchOf("Faserzementplatten").pattern).toBe("diagonal");
|
||||
});
|
||||
@@ -50,21 +54,31 @@ describe("Standard-Bibliothek ([100]–[102])", () => {
|
||||
it("„Standards aktualisieren“: alte Definitionen auf heutigen Stand, Auswahl, ein Op-Satz", () => {
|
||||
const full = withStandards({ ...emptyProject, components: [], hatches: [], lineStyles: [], wallTypes: [], ceilingTypes: [], roofTypes: [] });
|
||||
expect(standardsUpdatePlan(full).changes).toEqual([]);
|
||||
// Stand 29.10.: EPS mit alter Schraffur, Putz ohne Schraffur, XPS umbenannt
|
||||
// Stand 30.10.: Dämmschlange unter dem früheren Namen, Putz-Schraffur fehlt, Kalksandstein umbenannt
|
||||
const old = {
|
||||
...full,
|
||||
hatches: full.hatches.filter((h) => h.id !== "std-h-putz").map((h) => (h.id === "std-h-eps" ? { ...h, pattern: "insulation" as const } : h.id === "std-h-xps" ? { ...h, name: "Meine XPS", pattern: "diagonal" as const } : h)),
|
||||
hatches: full.hatches
|
||||
.filter((h) => h.id !== "std-h-putz")
|
||||
.map((h) =>
|
||||
h.id === "std-h-daemmung-weich"
|
||||
? { ...h, name: "SIA Dämmung weich", pattern: "insulation" as const }
|
||||
: h.id === "std-h-kalksandstein"
|
||||
? { ...h, name: "Mein KS", pattern: "crosshatch" as const }
|
||||
: h,
|
||||
),
|
||||
components: full.components.map((c) => (c.id === "std-c-innenputz" ? { ...c, hatchId: "std-h-ohne" } : c)),
|
||||
};
|
||||
const plan = standardsUpdatePlan(old);
|
||||
expect(plan.added).toBe(1);
|
||||
expect(plan.changes.map((c) => c.id).sort()).toEqual(["std-c-innenputz", "std-h-eps", "std-h-xps"]);
|
||||
expect(plan.changes.find((c) => c.id === "std-h-xps")!.renamed).toBe(true);
|
||||
expect(plan.changes.map((c) => c.id).sort()).toEqual(["std-c-innenputz", "std-h-daemmung-weich", "std-h-kalksandstein"]);
|
||||
expect(plan.changes.find((c) => c.id === "std-h-kalksandstein")!.renamed).toBe(true);
|
||||
expect(plan.changes.find((c) => c.id === "std-h-daemmung-weich")!.renamed).toBe(false);
|
||||
const selected = plan.changes.filter((c) => !c.renamed).map(standardsChangeKey);
|
||||
const after = applyOps(old, standardsUpdateOps(old, selected));
|
||||
expect(after.hatches.find((h) => h.id === "std-h-eps")!.pattern).toBe("insulationHard");
|
||||
expect(after.hatches.find((h) => h.id === "std-h-xps")!.pattern).toBe("diagonal");
|
||||
const dae = after.hatches.find((h) => h.id === "std-h-daemmung-weich")!;
|
||||
expect([dae.name, dae.pattern]).toEqual(["SIA Dämmstoffe", "diagonal"]);
|
||||
expect(after.hatches.find((h) => h.id === "std-h-kalksandstein")!.pattern).toBe("crosshatch");
|
||||
expect(after.components.find((c) => c.id === "std-c-innenputz")!.hatchId).toBe("std-h-putz");
|
||||
expect(standardsUpdatePlan(after).changes.map((c) => c.id)).toEqual(["std-h-xps"]);
|
||||
expect(standardsUpdatePlan(after).changes.map((c) => c.id)).toEqual(["std-h-kalksandstein"]);
|
||||
});
|
||||
});
|
||||
@@ -1370,7 +1370,10 @@ export type HatchPattern =
|
||||
| "earth"
|
||||
| "gravel"
|
||||
| "stone"
|
||||
| "dots";
|
||||
| "dots"
|
||||
| "woodBased"
|
||||
| "wood"
|
||||
| "barrier";
|
||||
|
||||
/** Eine wiederverwendbare Schraffur (Hatch Manager). */
|
||||
export type HatchStyle = {
|
||||
|
||||
@@ -118,6 +118,9 @@ const PATTERN_CODE: Record<string, number> = {
|
||||
gravel: 10,
|
||||
stone: 11,
|
||||
dots: 12,
|
||||
woodBased: 13,
|
||||
wood: 14,
|
||||
barrier: 15,
|
||||
};
|
||||
|
||||
/** Ein Hatch-Datensatz (auch Eingabe der Einzel-Bindungen in `glPlanHatch.ts`). */
|
||||
|
||||
@@ -33,6 +33,9 @@ const PATTERN_OPTIONS: { value: HatchPattern; labelKey: string }[] = [
|
||||
{ value: "earth", labelKey: "pattern.earth" },
|
||||
{ value: "gravel", labelKey: "pattern.gravel" },
|
||||
{ value: "dots", labelKey: "pattern.dots" },
|
||||
{ value: "wood", labelKey: "pattern.wood" },
|
||||
{ value: "woodBased", labelKey: "pattern.woodBased" },
|
||||
{ value: "barrier", labelKey: "pattern.barrier" },
|
||||
{ value: "custom", labelKey: "pattern.custom" },
|
||||
];
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ describe("polyUsesPattern — gradient", () => {
|
||||
|
||||
describe("polyUsesPattern — Kern-Generator-Muster ([109])", () => {
|
||||
it("Schicht-/Streumuster laufen über buildHatchRuns, nicht über <pattern>-Kacheln", () => {
|
||||
for (const pattern of ["insulation", "insulationHard", "insulationWave", "timber", "earth", "gravel", "stone", "dots"] as const) {
|
||||
for (const pattern of ["insulation", "insulationHard", "insulationWave", "timber", "earth", "gravel", "stone", "dots", "wood", "woodBased", "barrier"] as const) {
|
||||
expect(isGeneratedPattern(pattern)).toBe(true);
|
||||
expect(polyUsesPattern(hatch({ pattern }))).toBe(false);
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ export function needsPattern(pattern: HatchRender["pattern"]): boolean {
|
||||
|
||||
/**
|
||||
* Muster, die der Kern-Generator als Linien/Polylinien erzeugt ([109]: Dämmschlange, Zickzack, Welle, Holzkreuz,
|
||||
* Naturstein, Erdreich, Kies, Punktfeld) — der SVG-Rückfall zeichnet sie wie GL/Druck-SVG aus
|
||||
* Naturstein, Erdreich, Kies, Punktfeld; Holz massiv, Holzwerkstoffe, Sperrschicht nach SIA 400) — der SVG-Rückfall zeichnet sie wie GL/Druck-SVG aus
|
||||
* `buildHatchRuns` (eine Implementierung) statt als `<pattern>`-Kachel.
|
||||
*/
|
||||
export function isGeneratedPattern(pattern: HatchRender["pattern"]): boolean {
|
||||
@@ -39,7 +39,10 @@ export function isGeneratedPattern(pattern: HatchRender["pattern"]): boolean {
|
||||
pattern === "earth" ||
|
||||
pattern === "gravel" ||
|
||||
pattern === "stone" ||
|
||||
pattern === "dots"
|
||||
pattern === "dots" ||
|
||||
pattern === "woodBased" ||
|
||||
pattern === "wood" ||
|
||||
pattern === "barrier"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user