mirror of
https://github.com/Matysh/houseplan-card
synced 2026-07-31 08:28:31 +00:00
room settings button: the VISUAL centre for L-shaped rooms
The owner's kitchen-living room is L-shaped, and interiorPoint() only promises 'somewhere inside' — the button sat near the seam, visibly off-centre. poleOfInaccessibility() (largest inscribed circle, grid search plus one refinement pass) puts it in the middle of the widest open space: the slab of an L, the exact centre of a rectangle or square. Cached per poly array in a WeakMap — the memoized model keeps the arrays stable, so the search runs once per geometry, not per render. Unit: square -> centre; thick-slab L -> mid-slab, always inside.
This commit is contained in:
Vendored
+4
-4
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user