[253] 3D-Entourage: Low-Poly-Netze für Person (stehend/gehend), Velo, Auto, Sitzbank, Stuhl, Tische mit Stühlen

Kern furniture_3d.rs: prozedurale, geschlossene Teilnetze aus den Parametern (Höhe h einstellbar), Platzierung auf Gelände/Geschoss.
Im 3D (model3d::emit_entourage, Explosion, Cache-Stand), Cycles-Szene, 3D-Dokument (axo) und Schattenwurf; Klasse der Zeichnung ([180]);
Grundriss bleibt 2D. Beispiel :wettbewerb: 3 Personen, Auto, Velo, Bank. Nicht im IFC, nicht in Schnitt/Ansicht (TODO).
This commit is contained in:
Claude committed 2026-11-18 11:06:03 +00:00
1 parent bd201830a8
commit f96933da03
20 files changed
+879 -27

No files matched your search

+15 -4
View File
@@ -300,8 +300,14 @@ fn prepare(p: &Project, proj: &Projection, vis: &Visibility, context: bool) -> R
let q = model_of(n);
[dot(cof[0], q), dot(cof[1], q), dot(cof[2], q)]
};
let (mut vf, refs) = super::section::model_view_faces(p, vis, &view, &view_n, context && ortho)?;
if vf.faces.len() > FACE_BUDGET && context {
// [253] Entourage (Person, Auto …) als Netze im Kontext der Kopie; nur längentreu (nicht in schiefen Projektionen).
let ent = if ortho { crate::furniture_3d::with_context_meshes(p, context) } else { None };
let (pp, meshes) = match &ent {
Some(q) => (q, true),
None => (p, context && ortho),
};
let (mut vf, refs) = super::section::model_view_faces(pp, vis, &view, &view_n, meshes)?;
if vf.faces.len() > FACE_BUDGET && (context || ent.is_some()) {
(vf, _) = super::section::model_view_faces(p, vis, &view, &view_n, false)?;
}
// Modell-Normale = Mᵀ · Normale (die Normale ging über M⁻ᵀ).
@@ -317,8 +323,13 @@ fn prepare(p: &Project, proj: &Projection, vis: &Visibility, context: bool) -> R
let q = model_of(n);
[dot(r, q), dot(u, q), dot(f, q)]
};
let (mut vf, refs) = super::section::model_view_faces(p, vis, &view, &view_n, context)?;
if vf.faces.len() > FACE_BUDGET && context {
let ent = crate::furniture_3d::with_context_meshes(p, context);
let (pp, meshes) = match &ent {
Some(q) => (q, true),
None => (p, context),
};
let (mut vf, refs) = super::section::model_view_faces(pp, vis, &view, &view_n, meshes)?;
if vf.faces.len() > FACE_BUDGET && (context || ent.is_some()) {
(vf, _) = super::section::model_view_faces(p, vis, &view, &view_n, false)?;
}
let model_n: Vec<V3> = vf.faces.iter().map(|q| unit([0, 1, 2].map(|k| r[k] * q.normal[0] + u[k] * q.normal[1] + f[k] * q.normal[2])).unwrap_or([0.0, 0.0, 1.0])).collect();
+11
View File
@@ -332,3 +332,14 @@ fn testhaus_seitenrichtig_in_allen_vorgaben() {
let (e, g) = (mid(&erker, cam.clone(), 0), mid(&garage, cam, 0));
assert!(e > g, "Kamera Südost: Erker {e:.2}, Garage {g:.2}");
}
/// [253] Entourage (Auto) erscheint im 3D-Dokument; seine Klasse schaltet es ab.
#[test]
fn entourage_im_3d_dokument() {
let mut p = cubes(&[(0.0, 0.0, 0.0)]);
let n0 = lines(&prims_of(&p, serde_json::json!({"view": "southeast"}))).len();
p.drawings2d.push(serde_json::from_value(serde_json::json!({"id": "pers1", "type": "drawing2d", "levelId": "l0", "categoryCode": "24", "geom": {"shape": "libobj", "libId": "lib:auto", "at": {"x": 4.0, "y": -3.0}, "rotation": 0.5}})).unwrap());
let n1 = lines(&prims_of(&p, serde_json::json!({"view": "southeast"}))).len();
assert!(n1 > n0 + 10, "{n0} -> {n1}");
assert_eq!(lines(&prims_of(&p, serde_json::json!({"view": "southeast", "hasVis": true, "invisible": ["24"]}))).len(), n0, "Klasse aus");
}