2
0

changed spreading points to closest instead of farest center

This commit is contained in:
2018-08-05 16:43:36 +02:00
parent 1502da81ed
commit 6e741272c5

View File

@@ -75,8 +75,7 @@ export class GuillocheDirective implements OnChanges {
private spreadLines(points: Point[]) {
const indexMiddle = Math.floor(points.length * 0.5);
const pointMiddle = points[indexMiddle];
const closestCenter = this.getFarestCenter(pointMiddle);
// const closestCenter = this.getClosestCenter(pointMiddle);
const closestCenter = this.getClosestCenter(pointMiddle);
const radius = this.Δ(pointMiddle, closestCenter);
const spreadPoints = [];
const group = this.canvas.append('g').attr('id', 'spread-points');
@@ -90,7 +89,6 @@ export class GuillocheDirective implements OnChanges {
}
spreadPoints.sort((a, b) => {
// return this.Δ(a, pointMiddle) - this.Δ(b, pointMiddle);
// Good possibility to align orientation points outsite
return this.Δ(b, pointMiddle) - this.Δ(a, pointMiddle);
});