2016-03-29 00:26:58 +02:00
|
|
|
import THREE from 'three.js';
|
|
|
|
|
|
|
|
export default function optimizePaths(slices, settings) {
|
2016-05-06 19:54:25 +02:00
|
|
|
console.log('opimize paths');
|
2016-03-29 00:26:58 +02:00
|
|
|
|
2016-04-23 00:24:01 +02:00
|
|
|
const start = new THREE.Vector2(0, 0);
|
2016-03-29 00:26:58 +02:00
|
|
|
|
2016-04-23 00:24:01 +02:00
|
|
|
for (let layer = 0; layer < slices.length; layer ++) {
|
|
|
|
const slice = slices[layer];
|
2016-03-29 00:26:58 +02:00
|
|
|
|
2016-05-06 19:54:25 +02:00
|
|
|
const end = slice.optimizePaths(start);
|
2016-03-29 00:26:58 +02:00
|
|
|
|
2016-05-06 19:54:25 +02:00
|
|
|
start.copy(end);
|
2016-03-29 00:26:58 +02:00
|
|
|
}
|
|
|
|
}
|