Aymeric Rabot 8a5c232685 feat(core): opening-guides service — proximity/alignment geometry for openings
Pure, Three.js-free wall-local geometry that will power directly-visible
proximity guides for doors and windows (rendered in the follow-up phases):

  - sill / head height (floor → bottom edge, top edge → wall top)
  - edge-to-edge proximity clearance to the nearest neighbour on each side
    (or the wall end), with overlap suppression
  - along-wall alignment (edge/centre coincidence with a neighbour)
  - vertical alignment (shared sill / centre / top — "same sill height")
  - Figma-style equal-spacing run detection across a series of 3+ openings

Single `computeOpeningGuides` entry plus exported detectors; 23 unit tests.
Codex-reviewed — equal-spacing uses a longest-equal-window scan (a greedy
first-gap anchor dropped valid runs), edge gaps suppress straddling overlaps,
and the alignment detectors guard against the moving opening appearing in its
own sibling list.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-14 10:16:15 -04:00

85 lines
1.7 KiB
TypeScript

export {
type AlignmentAnchor,
type AlignmentGuide,
type AlignmentGuideAxis,
type AnchorKind,
type BuildingPose,
bboxAnchors,
bboxCornerAnchors,
type ResolveAlignmentInBuildingResult,
type ResolveAlignmentInput,
type ResolveAlignmentResult,
resolveAlignment,
resolveAlignmentInBuildingWorld,
} from './alignment'
export {
collectAlignmentAnchors,
type FootprintAABB,
footprintAABB,
footprintAABBAt,
footprintAABBFrom,
movingAlignmentAnchors,
movingFootprintAnchors,
nodeAlignmentAnchors,
polygonAnchors,
wallSegmentAnchors,
} from './alignment-anchors'
export {
createDragSession,
type DragSession,
type DragSessionInput,
type DragSessionOptions,
} from './drag-session'
export {
type AttachError,
type AttachResult,
canAttach,
clampYToHostTop,
getSurface,
getTopSurfaceHeight,
MAX_HOST_DEPTH,
pickHost,
type Vec3,
} from './hosting'
export {
type AxisLock,
applyAxisLock,
isMovable,
movePlanToward,
moveToward,
resolveMovable,
} from './movement'
export {
type AlongWallAlignment,
type AlongWallFeature,
computeEdgeGaps,
computeOpeningGuides,
DEFAULT_OPENING_GUIDE_TOLERANCES,
detectAlongWallAlignment,
detectEqualSpacing,
detectVerticalAlignment,
type EdgeGap,
type EqualSpacingRun,
type OpeningGuideInput,
type OpeningGuides,
type OpeningGuideTolerances,
type OpeningSpan,
type SillHeadGuide,
type VerticalAlignment,
type VerticalFeature,
type WallExtent,
} from './opening-guides'
export {
DEFAULT_ANGLE_STEP,
DEFAULT_GRID_STEP,
type SnapServices,
snapAngleToList,
snapPointAlongAngleRay,
snapPointToAngle,
snapPointToGrid,
snapScalar,
snapServices,
snapVec3ToGrid,
snapWorldXZToBuildingLocal,
} from './snap'