[G4] Exakte Sichtbarkeit (HLR) für Ansicht und Schnitt-Projektion
Kern hlr.rs: Kanten aus ebenen Flächen (T-Stösse, Gegenflächen, koplanare und geglättete Fortsetzung), exakte Verdeckung mit linearer Tiefendifferenz, Raster-Beschleunigung. Ansicht: Umriss/Knicke statt XOR-Umriss und 2-mm-Clipping, verdeckte Kanten gestrichelt mit hiddenLines. Schnitt: Projektion aus den 3D-Körpern (Wände, Platten, Treppen, Dächer, Körper), Schnittflächen verdecken; render3d cut_polygons ohne die alte Verdeckung.
This commit is contained in:
10 files changed
+1403
-357
No files matched your search
@@ -1163,12 +1163,20 @@ fn push_quad(
|
||||
/// koennen. Berechnet zuerst die Eck-Gehrung ueber ALLE Waende (siehe
|
||||
/// `compute_wall_miters`) und extrudiert dann jede Wand mit ihren Gehrungen.
|
||||
pub fn build_walls_mesh(walls: &[WallInput]) -> Mesh {
|
||||
build_walls_mesh_owned(walls).0
|
||||
}
|
||||
|
||||
/// Wie `build_walls_mesh`, dazu je Wand das Ende ihrer Dreiecks-Indizes im Indexpuffer (Besitzer je
|
||||
/// Dreieck, z. B. fuer die exakte Sichtbarkeit im Schnitt).
|
||||
pub fn build_walls_mesh_owned(walls: &[WallInput]) -> (Mesh, Vec<usize>) {
|
||||
let mut mesh = Mesh::default();
|
||||
let miters = compute_wall_miters(walls);
|
||||
let mut ends = Vec::with_capacity(walls.len());
|
||||
for (w, m) in walls.iter().zip(miters.iter()) {
|
||||
extrude_wall_with_miters(&mut mesh, w, *m);
|
||||
ends.push(mesh.indices.len());
|
||||
}
|
||||
mesh
|
||||
(mesh, ends)
|
||||
}
|
||||
|
||||
/// TEXTURIERTER Wand-Pfad (`RenderStyle::Textured`): liefert DIESELBE Geometrie wie
|
||||
|
||||
@@ -1153,6 +1153,31 @@ pub fn cut_section(
|
||||
slabs: &[SlabInput],
|
||||
roofs: &[RoofLayerInput],
|
||||
) -> SectionOutput {
|
||||
let (cut_polygons, prisms) = cut_polygons_and_prisms(plane, walls, slabs, roofs);
|
||||
let (visible_edges, hidden_edges) = compute_view_edges(plane, &prisms);
|
||||
SectionOutput {
|
||||
cut_polygons,
|
||||
visible_edges,
|
||||
hidden_edges,
|
||||
}
|
||||
}
|
||||
|
||||
/// Nur die Cut-Polygone von `cut_section` (ohne Ansichtskanten; die exakte Projektion rechnet der Kern).
|
||||
pub fn cut_polygons(
|
||||
plane: &SectionPlane,
|
||||
walls: &[WallInput],
|
||||
slabs: &[SlabInput],
|
||||
roofs: &[RoofLayerInput],
|
||||
) -> Vec<CutPolygon> {
|
||||
cut_polygons_and_prisms(plane, walls, slabs, roofs).0
|
||||
}
|
||||
|
||||
fn cut_polygons_and_prisms(
|
||||
plane: &SectionPlane,
|
||||
walls: &[WallInput],
|
||||
slabs: &[SlabInput],
|
||||
roofs: &[RoofLayerInput],
|
||||
) -> (Vec<CutPolygon>, Vec<Prism>) {
|
||||
let mut prisms: Vec<Prism> = Vec::new();
|
||||
// Gehrte Wand-Fussabdruecke einmalig ueber die gesamte Wandkonnektivitaet
|
||||
// (dieselbe Verschneidung wie das 3D-Mesh, siehe `mesh::wall_mitered_footprints`).
|
||||
@@ -1198,13 +1223,7 @@ pub fn cut_section(
|
||||
}
|
||||
}
|
||||
|
||||
let (visible_edges, hidden_edges) = compute_view_edges(plane, &prisms);
|
||||
|
||||
SectionOutput {
|
||||
cut_polygons,
|
||||
visible_edges,
|
||||
hidden_edges,
|
||||
}
|
||||
(cut_polygons, prisms)
|
||||
}
|
||||
|
||||
// ─────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
//! werden in EINEM `draw` gezeichnet). Ein Cut-Polygon ist stets ein konvexes
|
||||
//! Rechteck (4 Ecken, siehe `section.rs`) — Fan-Triangulierung genuegt.
|
||||
|
||||
use crate::section::{cut_section, CutPolygon, SectionPlane};
|
||||
use crate::section::{cut_polygons, CutPolygon, SectionPlane};
|
||||
use dossier_hatch::hatch::{build_hatch_runs, v2, Hatch as GenHatch, HatchKind, Pattern};
|
||||
use crate::section_boolean::subtract_dominant_bands;
|
||||
use crate::types::{RoofLayerInput, SlabInput, WallInput};
|
||||
@@ -112,8 +112,7 @@ fn cut_cap_polys(
|
||||
slabs: &[SlabInput],
|
||||
roofs: &[RoofLayerInput],
|
||||
) -> Vec<CutPolygon> {
|
||||
let out = cut_section(plane, walls, slabs, roofs);
|
||||
subtract_dominant_bands(out.cut_polygons)
|
||||
subtract_dominant_bands(cut_polygons(plane, walls, slabs, roofs))
|
||||
}
|
||||
|
||||
pub fn build_cut_caps(
|
||||
|
||||
Reference in new issue
Block a user