Skip to content

core: exclude dangling walls from room polygons#499

Merged
wass08 merged 1 commit into
mainfrom
fix/dangling-wall-room-boundaries
Jul 15, 2026
Merged

core: exclude dangling walls from room polygons#499
wass08 merged 1 commit into
mainfrom
fix/dangling-wall-room-boundaries

Conversation

@wass08

@wass08 wass08 commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

What does this PR do?

  • Decomposes half-edge face walks into simple cycles before generating room polygons.
  • Excludes dangling wall and graph-bridge excursions that previously introduced repeated vertices and self-intersections into auto-generated slabs and ceilings.
  • Rejects incomplete face walks and adds a regression test for a closed room with a dangling interior wall.

How to test

  1. Run bun test packages/core/src/lib/space-detection.test.ts.
  2. Draw a closed four-wall room, then add a wall branch from one boundary vertex into the room.
  3. Confirm the detected room, auto slab, and auto ceiling retain the original simple boundary without a triangular fill bleeding outside the room.

Screenshots / screen recording

N/A — the malformed private-project geometry was reproduced programmatically; the regression is covered by room-boundary assertions.

Checklist

  • I've tested this locally with bun dev
  • My code follows the existing code style (run bun check to verify)
  • I've updated relevant documentation (if applicable)
  • This PR targets the main branch

Note

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 extractRooms no 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, splitIntoSimpleCycles peels off simple cycles whenever a vertex repeats, and only those cycles become room polygons and boundaryFaces. 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.

@wass08 wass08 merged commit 78223d6 into main Jul 15, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant