core: exclude dangling walls from room polygons#499
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
How to test
bun test packages/core/src/lib/space-detection.test.ts.Screenshots / screen recording
N/A — the malformed private-project geometry was reproduced programmatically; the regression is covered by room-boundary assertions.
Checklist
bun devbun checkto verify)mainbranchNote
Medium Risk
Changes core room-graph extraction used by space detection, auto slabs/ceilings, and
wallClosesRoom; logic is localized and regression-tested but affects all wall-driven geometry sync.Overview
Room detection in
extractRoomsno longer treats half-edge face walks that trace out and back along dangling walls or graph bridges as a single room boundary.After a walk closes,
splitIntoSimpleCyclespeels off simple cycles whenever a vertex repeats, and only those cycles become room polygons andboundaryFaces. Incomplete walks are dropped unless the traversal returns to the starting half-edge.A regression test covers a closed four-wall room plus an interior branch from a corner: the detected space stays the original square (four walls, correct area) without pulling the branch into the boundary.
Reviewed by Cursor Bugbot for commit 2dc83bc. Bugbot is set up for automated code reviews on this repo. Configure here.