Restrict ground occluder to recessed slabs

This commit is contained in:
sudhir
2026-04-20 11:25:36 +05:30
parent 71ddb7052b
commit df9c4e499f
2 changed files with 19 additions and 2 deletions
@@ -55,7 +55,16 @@ export const SiteRenderer = ({ node }: { node: SiteNode }) => {
}) })
const next = nodeList const next = nodeList
.filter((n): n is SlabNode => n.type === 'slab' && n.visible && n.polygon.length >= 3) .filter(
(n): n is SlabNode =>
n.type === 'slab' &&
n.visible &&
n.polygon.length >= 3 &&
// Only recessed slabs should punch through the site ground.
// Positive slabs are real floor geometry and should not create a
// ghost footprint in the background ground fill.
(n.elevation ?? 0.05) < 0,
)
.filter((n) => { .filter((n) => {
if (!Number.isFinite(lowestLevelIndex)) return true if (!Number.isFinite(lowestLevelIndex)) return true
const parentLevel = n.parentId ? levelIndexById.get(n.parentId as string) : undefined const parentLevel = n.parentId ? levelIndexById.get(n.parentId as string) : undefined
@@ -38,7 +38,15 @@ export const GroundOccluder = () => {
const polygons: [number, number][][] = [] const polygons: [number, number][][] = []
Object.values(nodes).forEach((node) => { Object.values(nodes).forEach((node) => {
if (!(node.type === 'slab' && node.visible && node.polygon.length >= 3)) { if (
!(
node.type === 'slab' &&
node.visible &&
node.polygon.length >= 3 &&
// Only recessed slabs should punch through the ground plane.
(node.elevation ?? 0.05) < 0
)
) {
return return
} }