Enable reorient-shells in geometry iterator

IFC files routinely have IfcConnectedFaceSets whose faces point
inconsistently within the same shell — the result under per-vertex
normals is dark inside-out patches, and under GL_CULL_FACE it's
swiss-cheese.  reorient-shells fixes the face winding at geometry
generation time, which is the only place it can be fixed correctly;
no shader trick can recover from a mesh whose triangles disagree
among themselves.

Off by default in IfcOpenShell because it adds iterator time, but
we cache the result in the sidecar so it's a one-shot cost per file.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Dion Moult
2026-04-12 22:06:58 +10:00
parent f532624dc1
commit 0e2a62d3b7
+5
View File
@@ -270,6 +270,11 @@ void GeometryStreamer::run(const std::string& path, int num_threads) {
settings.set("use-world-coords", false);
settings.set("weld-vertices", false);
settings.set("apply-default-materials", true);
// Off by default in IfcOpenShell — makes face winding consistent within
// each shell, which we need for GL_CULL_FACE and for per-vertex normals
// to shade a solid without dark inside-out patches. Costs some iterator
// time, but results are cached in the sidecar so it's a one-shot hit.
settings.set("reorient-shells", true);
std::unique_ptr<IfcGeom::Iterator> iterator;
try {