public void Initialise(List <Point> basePath) { // Calculate the necessary number of points to represent the curves at a given resolution, to a minimum of 3 int intermediatePointCount = Math.Max(3, (int)Math.Round(controlPointSeparation * this.SampleResolution)); this.sampledPoints = SampledSpline.SampleCardinalSpline(intermediatePointCount, tension, CreateControlPoints(this.controlPointSeparation, basePath).ToArray()).ToArray(); this.sampledPointsLengths = SampledSpline.MeasurePoints(this.sampledPoints); }
public void InitialiseFromControlPoints(List <Point> controlPoints, double tension, int controlPointSeparation) { this.tension = tension; this.controlPointSeparation = controlPointSeparation; int intermediatePointCount = Math.Max(3, (int)Math.Round(controlPointSeparation * this.SampleResolution)); this.sampledPoints = SampledSpline.SampleCardinalSpline(intermediatePointCount, tension, controlPoints.ToArray()).ToArray(); this.sampledPointsLengths = SampledSpline.MeasurePoints(this.sampledPoints); }
public void Reverse() { this.sampledPoints = this.sampledPoints.Reverse().ToArray(); this.sampledPointsLengths = SampledSpline.MeasurePoints(this.sampledPoints); }
public void InitialiseWithVectorList(List <Point> basePath) { this.sampledPoints = basePath.ToArray(); this.sampledPointsLengths = SampledSpline.MeasurePoints(this.sampledPoints); }