Repository navigation
node closest points
< Previous: Distance | Next: Area >
Where two things come nearest: a point on each, and the distance between them. A region measures to its outline, including from inside it.
Category: Data | Add menu: Data > Closest Points
The measure twin of Distance, which answers only for two points. This one takes anything: a point and a curve, two splines, a field of dots and an outline. It hands back both ends of the gap as points, so wiring them into a Segment draws the connector. You see where the nearest approach is, not only how far it is.
- From (any): the thing, or things, being measured.
- To (any): what they are measured against.
- From Point (point): the point on the From side where the two come nearest.
- To Point (point): the matching point on the To side.
- Distance (number): the gap between those two points.
Always, and that includes from inside it. A point inside a shape gets a positive distance to the nearest edge rather than zero.
That is what makes this a thinness measure: how narrow a band is at its narrowest, or how close an inner outline comes to an outer one. A node that answered zero from inside could not tell you that.
The two sides are not symmetrical, and it is worth knowing which is which.
- From is split into items, the same way the rest of the library counts one thing, so a region and its holes are measured together rather than as separate shapes.
- To is taken as one thing, whatever is wired into it.
- A list in gives a list out, item for item: one answer per item of From, each measured against the whole of To. So a whole field of dots can be probed against an outline in a single node.
- An item with nothing to project from falls back to its centroid. An item with neither curves nor points has no centroid either, and is skipped rather than guessed at.
Lines and arcs are answered exactly. Splines are converged, and every projection goes through the same function the Pen uses to insert an anchor on a spline, so this node and the Pen can never disagree about where a curve passes closest to a point.
Two curves that do not cross are measured exactly. The distance used to be approximate there; on one measured pair it read 74.376 where the answer is 63.285. Where they do cross it reads zero exactly, and straight edges and arcs were always exact.
This is contained to this node on purpose. Dragging an anchor, inserting with the Pen and Slide to Extreme are untouched.
- Distance: two points, straight line, nothing else.
- Nearest Point: one point projected onto one thing, when you already know which side you want.
- Area: the other measure on this flyout.
- Data nodes: the rest of the category.
Found a bug or have feedback? Open an issue | Docs home | Videos | Credits
Getting Started
- Welcome
- How Locus came to be
- Videos
- Community & support
- Installing & launching
- Licensing & activation
- Beta License Agreement
- Core concepts
- Interface tour
- Your first pattern
Modeling - Drawing
- Canvas basics
- Points
- Typing coordinates
- Lines, rays & segments
- Circles & arcs
- Ellipses
- Compass & straightedge
- Rectangles & squares
- Splines
- The spline menu
- Segments
- Add Extremes
- Constraining with Shift
Modeling - Editing
- Selecting objects
- Transform tools
- Align & distribute
- Duplicate, detach & ownership
- Regions & booleans
- Flatten
- Expand Strokes
- Cleanup
- Weld & seams
- Style palettes & Re-ink
Annotation
Layers
Modeling Menus
- File
-
Edit
- Undo and Redo
- Group
- Ungroup
- Copy
- Paste
- Paste in Place
- Duplicate
- Duplicate in Place
- Hide
- Reverse Direction
- Convert to Spline
- Cut Spline
- Close Spline
- Compound paths
- Unhide All
- Detach
- Bake
- Clean Up: Merge Coincident Points
- Copy Style
- Reference in Nodes
- Snap to Points
- Snap to Objects
- Snap to Intersections
- Snap to Guides
- View
-
Draw
- Select
- Point
- Pen
- Segment
- Line
- Ray
- Circle: Center Point
- Circle: Center Radius
- Circle: Through 3 Points
- Arc: Center, Start, End
- Straightedge
- Compass
- Compass: Radius
- Ellipse: Center + Axes
- Elliptical Arc
- Rectangle: XY-Aligned
- Rectangle: Directed
- Square
- Regular Polygon: Edge
- Regular Polygon: Center, Vertex
- Regular Polygon: Center, Edge Midpoint
- Dimension: Linear
- Dimension: Angle
- Dimension: Radial
- Label
- Construct
- Combine
- Transform
- Select
- Nodes
The Nodes Window
- Basics of visual programming
- How the node graph works
- Sockets & wires
- Adding & connecting nodes
- Sliders & number inputs
- Keeping the node graph tidy
- View menu (Nodes)
- Lists & collections
- Constants & unit conversions
Node Library
- Overview
- Input
-
Primitives
- Point
- Point: Polar
- Segment
- Line
- Ray
- Circle: Center Point
- Circle: Center Radius
- Circle: Apollonius
- Circle Tangent to...
- Circle: 3 Points
- Arc
- Ellipse
- Elliptical Arc
- Rectangle: XY-Aligned
- Rectangle: Directed
- Square
- Regular Polygon: Edge
- Regular Polygon: Center
- Rectangular Grid
- Oblique Grid
- Triangular Grid
- Construct
- Transform
- Image & Fields
- Combine
-
Data
- Measure
- Numbers
- Lists
- Select
- Clean up
- Display
Clusters
Bridging Modeling & Nodes
Patterns & Symmetry
Image-Driven Fields
Saving, Exporting & Files
Preferences & Language
CLI
- CLI server
- Locus Shell
- CLI commands
- Tangent circles
- Tick and strike
- Making regions
- Boolean commands
- The node graph from the command line
Reference
