Import
Example
Notes
- Give the points, the grid spacing and the radius in the same unit. Paper tools use millimetres.
snap()tries the nearest target first, then the grid. If it finds none, it returns your point withsnapped: false.snapToTargets()does not use the grid.- Convert screen pixels to your unit before the call.
Constructor
Methods
snap
snapToTargets
snapRadius, else the point unchanged.
setGridSpacing
setSnapRadius
drawingSnapTargets
Snap candidates from a drawing’s primitives: line ends, arc centres, region corners, and optionally segment midpoints.drawingIntersections
planSnapTargets
placementSnap
Where a placement ghost goes for one cursor position.placedOutline
The outline placed, as the placement ghost draws it: turned byrotation (radians, counter-clockwise seen from above, as PlacementSnap.rotation) about the origin and moved to at.
snappedMove
Snap a body move the way a placement snaps its ghost: the outlinecorners (drawing metres) moved by [dx, dy] lock a corner onto a snap point, else land flush on a wall face.
workingGridToWorld
workingGridToLocal
workingGridNode
nearestWorkingGridNode
pickWorkingGridNode
alignWorkingGridToEdge
workingGridToProjectAxes
Types
SnapResult
SnapTargetOptions
The points in a drawing that a snap can lock onto — the geometry a dimension or a dragged vertex should land exactly on.Skip primitives belonging to this element — a vertex must not snap to the very geometry it is
dragging.
DrawingSnapPoint
The package does not export this type by name.SnapIntersectionOptions
The package does not export this type by name.DrawingIntersections type
The package does not export this type by name.SnapTarget
The wall face edges that the frame of this opening stands back from: a nearer one wins over it.
PlacementSnapInput
The package does not export this type by name.XZ
The package does not export this type by name.PlacementWall
A wall’s axis and thickness on the plan, in plan XZ metres: what a placement snaps against.SnapOutcome
The package does not export this type by name.BodyAlignmentContext
The package does not export this type by name.BodyAlignment
The package does not export this type by name.WorkingGridNode type
SnapPointKind
The package does not export this type by name.SnapFeature
PlanSnapResult
The gap brackets of an
equal-gap result: each clear gap, face to face, along its axis.The length that
label writes, in metres, so that a host can say the same number: a draft’s run
(length), an equal clear gap (gap), a square working grid’s step (grid), the move of an
opening to fit (shift) or a measured clearance (clearance).