UNPKG

668 BJavaScriptView Raw
1import {ccw} from '../counter-clockwise';
2import {centroid} from '../centroid';
3import {rotateRzRyRx} from '../rotation';
4
5export function polygon(polygons, options, point, angles){
6
7 for (var i = polygons.length - 1; i >= 0; i--) {
8
9 var ploygon = polygons[i];
10
11 for (var j = ploygon.length - 1; j >= 0; j--) {
12 var p = ploygon[j];
13 p.rotated = rotateRzRyRx({x : point.x(p), y : point.y(p), z : point.z(p)}, angles);
14 p.projected = options.project(p.rotated, options);
15 }
16
17 ploygon.ccw = ccw(ploygon);
18 ploygon.centroid = centroid(ploygon);
19 }
20 return polygons;
21}