Turns a segment, the pair [start, end], into a line object.
Example: [[0,0,0], [10,5,0]] -> { start: [0,0,0], end: [10,5,0] }
The segment
The line
Turns each segment, a pair [start, end], into a line object.
Example: three segments -> three lines, in the same order
The segments
One line per segment
Builds a line object from a start and an end point.
Example: start [0,0,0], end [10,5,0] -> { start: [0,0,0], end: [10,5,0] }
The start and end points
The line object
Builds a segment, the pair-of-points form of a line, from a start and an end point.
Example: start [0,0,0], end [10,5,0] -> [[0,0,0], [10,5,0]]
The start and end points
The segment as [start, end]
Joins each point to the next with a line, so a list of points becomes a chain of lines.
Example: [[0,0,0], [5,0,0], [5,5,0]] -> two lines, [0,0,0] to [5,0,0] and [5,0,0] to [5,5,0]
The points, in order
One line per pair of neighboring points
Pairs each start point with the end point at the same position and joins them with a line.
A pair whose two points coincide makes no line and is left out. Example: starts [[0,0,0], [5,0,0]] and ends [[0,5,0], [5,5,0]] -> two lines
The start points and the end points, in matching order
One line per pair, skipping pairs of length 0
Measures how far a point lies from a line, to the nearest point between its start and end.
A point beside the line is measured square to it, and one past either end to that end. A line whose ends meet is measured to that one point.
The line and the point
Distance in model units
Finds the point a fraction of the way along a line: 0 gives the start, 1 the end, 0.5 the middle.
A fraction outside 0 to 1 continues past the ends. Example: { start: [0,0,0], end: [10,0,0] } at 0.5 -> [5,0,0]
The line and the fraction along it
The point on the line
Straight lines between two points, held as plain objects of the form
{ start, end }, and the segment form[start, end]of the same thing. The methods here build lines, measure and transform them, convert between the two forms, place points along them and find where two lines cross. Lengths are in model units.