CARS and also better node editing
This commit is contained in:
@@ -184,13 +184,14 @@ export class PathSegment {
|
||||
const current = stepSize * i;
|
||||
points.push(this.getPointAtT(current))
|
||||
}
|
||||
return points.reduce((acc: { prev?: Vector, length: number }, cur) => {
|
||||
this.length = points.reduce((acc: { prev?: Vector, length: number }, cur) => {
|
||||
const prev = acc.prev;
|
||||
acc.prev = cur;
|
||||
if (!prev) return acc;
|
||||
acc.length += cur.dist(prev);
|
||||
return acc;
|
||||
}, { prev: undefined, length: 0 }).length
|
||||
return this.length;
|
||||
}
|
||||
|
||||
calculateEvenlySpacedPoints(spacing: number, resolution = 1) {
|
||||
|
Reference in New Issue
Block a user