I’ve recently worked with
three.js curve entities and discovered something that confused me.
Let’s say you create an instance of
CurvePath and add some curve objects to it. If you want to sample evenly distributed points from that
CurvePath, you call
.getSpacedPoints(). The problem is that
.getSpacedPoints() returns different results if the
CurvePath object is closed via
This example shows the effect of
.closePath(). IMO the result is correct because points are distributed over the entire path.
The next example uses
.autoClose and seems to be incorrect because there is no sampling of points in the last line curve.
The problem is that
.closePath() creates an additional line curve in order to connect the last and the first point of the path.
.autoClose instead doesn’t create a curve but just adds the first point twice to the
points array in
.getPoints(). This variation looks confusing to me and i would prefer an uniform behavior.
Maybe one solution: Enhance the
.add() method of
CurvePath. The implementation could evaluate
.autoClose and adjust the
curves array property if necessary via