1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | import voronoi from "./polyhedral/voronoi.js";
|
8 | import { default as cube } from "./polyhedral/cube.js";
|
9 |
|
10 | export default function() {
|
11 | var polygons = {
|
12 | type: "FeatureCollection",
|
13 | features: cube.map(function(face) {
|
14 | face = face.slice();
|
15 | face.push(face[0]);
|
16 | return {
|
17 | geometry: {
|
18 | type: "Polygon",
|
19 | coordinates: [face]
|
20 | }
|
21 | };
|
22 | })
|
23 | };
|
24 |
|
25 | var parents = [-1, 0, 1, 5, 3, 2];
|
26 |
|
27 | return voronoi()
|
28 | .polygons(polygons)
|
29 | .parents(parents)
|
30 | .angle(0)
|
31 | .scale(96.8737)
|
32 | .center([135, -45])
|
33 | .rotate([120,0]);
|
34 | }
|
35 |
|