diff --git a/src/gpu/raster-worker.js b/src/gpu/raster-worker.js index 3abe7863..5b532b07 120000 --- a/src/gpu/raster-worker.js +++ b/src/gpu/raster-worker.js @@ -1 +1 @@ -../../node_modules/@gridspace/raster-path/src/web/webgpu-worker.js \ No newline at end of file +../../../gs-raster-path/build/webgpu-worker.js \ No newline at end of file diff --git a/src/gpu/raster.js b/src/gpu/raster.js index 5ebcfa64..107e9b6f 120000 --- a/src/gpu/raster.js +++ b/src/gpu/raster.js @@ -1 +1 @@ -../../node_modules/@gridspace/raster-path/src/index.js \ No newline at end of file +../../../gs-raster-path/build/raster-path.js \ No newline at end of file diff --git a/src/kiri/mode/cam/topo3.js b/src/kiri/mode/cam/topo3.js index 980bdfdf..262fa309 100644 --- a/src/kiri/mode/cam/topo3.js +++ b/src/kiri/mode/cam/topo3.js @@ -108,11 +108,15 @@ export class Topo { } if (webGPU) { + console.log({ tool }); // invert tool Z offset for gpu code - let gputool = toolOffset.slice(); - for (let i=0; i newPoint(j * xmult + xoff, 0, v).setA(-i * degPerRow)); rows.push(points); diff --git a/src/kiri/run/worker.js b/src/kiri/run/worker.js index 23958136..27e8b570 100644 --- a/src/kiri/run/worker.js +++ b/src/kiri/run/worker.js @@ -68,16 +68,18 @@ self.uuid = ((Math.random() * Date.now()) | 0).toString(36); /** * @returns {RasterPath} */ -self.get_raster_gpu = async function() { - let gpu = self.raster_gpu; - if (!gpu) { - gpu = self.raster_gpu = new RasterPath({ - workerName: "/lib/gpu/raster-worker.js", - quiet: true - }); - await gpu.init(); - await gpu.initWorkerPool(); - } +self.get_raster_gpu = async function({ mode, resolution, rotationStep }) { + console.log({ mode, resolution, rotationStep }); + let gpu = new RasterPath({ + mode, + resolution, + rotationStep, + workerName: "/lib/gpu/raster-worker.js", + maxWorkers: 20, + quiet: false, + debug: true, + }); + await gpu.init(); return gpu; };