Skip to content

fix(core): prevent unbounded slab corner miters#500

Merged
wass08 merged 2 commits into
mainfrom
fix/slab-infinite-point
Jul 16, 2026
Merged

fix(core): prevent unbounded slab corner miters#500
wass08 merged 2 commits into
mainfrom
fix/slab-infinite-point

Conversation

@wass08

@wass08 wass08 commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • bound slab corner miters so near-parallel wall-offset edges cannot create runaway vertices
  • fall back to local offset endpoints for non-finite or over-limit intersections
  • add the exact copied Wawa House slab and wall coordinates as a regression test

Root cause

Two consecutive stored slab edges were nearly collinear but received slightly different wall-derived offsets. Intersecting their infinite offset lines amplified the tiny angular difference into a vertex 44,952 m away.

Test plan

  • bun run build
  • bun run check-types
  • bun test in packages/core (942 passing)
  • recomputed all 15 slabs in the copied Wawa House draft with no unbounded coordinates

Note

Low Risk
Localized change to render-time corner joining in slab-polygon with a conservative ratio cap and existing parallel-edge fallback; regression test covers the reported case.

Overview
Renderable slab polygons no longer blow up when two consecutive edges are almost collinear but get slightly different wall offsets. Corner construction still intersects offset lines for normal miters, but if the intersection is non-finite or the miter reaches farther than 10× the larger edge offset (MAX_CORNER_MITER_RATIO), it falls back to the two local offset endpoints instead of a runaway vertex (the failure mode that produced ~45 km spikes).

A regression test uses real Wawa House slab/wall coordinates and asserts the rendered ring stays near the stored footprint (extent and longest edge bounds).

Reviewed by Cursor Bugbot for commit 4b0786a. Bugbot is set up for automated code reviews on this repo. Configure here.

@wass08 wass08 merged commit 4f0aa7f into main Jul 16, 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