1 | import {ccw} from '../counter-clockwise';
|
2 | import {centroid} from '../centroid';
|
3 | import {rotateRzRyRx} from '../rotation';
|
4 |
|
5 | export 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 | }
|