Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const points = 1500;
const fibonacciSpherePoints = getFibonacciSpherePoints(points, radius);
for (var i = 0; i < fibonacciSpherePoints.length; i++) {
const point = fibonacciSpherePoints[i];
const geometry = new THREE.SphereGeometry(0.02);
const material = new THREE.MeshBasicMaterial({ color: 0xFF0000 });
const sphere = new THREE.Mesh(geometry, material);
sphere.position.x = point.x;
sphere.position.y = point.y;
sphere.position.z = point.z;
this.scene.add(sphere);
}
const pointsLatLong = fibonacciSpherePoints.map(({ x, y, z }) => Coordinate.cart([x, y, z]).spherical());
const voronoi = geoDelaunay(pointsLatLong);
console.log(voronoi);
const landMaterial = new THREE.MeshBasicMaterial({ color: 0x7cfc00, transparent: true });
const oceanMaterial = new THREE.MeshBasicMaterial({ color: 0x0f2342, transparent: true });
const materials = [landMaterial, oceanMaterial];
// const tileMeshes: { mesh: THREE.Mesh, materialIndex: number }[] = [];
// const totalGeometry = new THREE.Geometry();
const centerGeometry = new THREE.BufferGeometry();
const centerMaterial = new THREE.PointsMaterial({ size: .05, color: 0x0000FF });
const centerPositions = [];
for (const center of voronoi.centers) {
const centerPoint = Coordinate.spherical([radius, center[0], center[1]]).cartesian();