@gridspace/raster-path 1.0.4 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.html +1 -1
- package/build/raster-path.js +4 -12
- package/build/raster-worker.js +2450 -0
- package/package.json +8 -4
- package/scripts/build-shaders.js +32 -8
- package/src/core/path-planar.js +788 -0
- package/src/core/path-radial.js +651 -0
- package/src/core/raster-config.js +185 -0
- package/src/{index.js → core/raster-path.js} +4 -12
- package/src/core/raster-planar.js +754 -0
- package/src/core/raster-tool.js +104 -0
- package/src/core/raster-worker.js +152 -0
- package/src/core/workload-calibrate.js +416 -0
- package/src/shaders/workload-calibrate.wgsl +106 -0
- package/src/test/calibrate-test.cjs +136 -0
- package/src/test/extreme-work-test.cjs +167 -0
- package/src/test/radial-thread-limit-test.cjs +152 -0
- package/src/web/index.html +1 -1
- package/build/webgpu-worker.js +0 -2800
- package/src/web/webgpu-worker.js +0 -2303
package/build/index.html
CHANGED
package/build/raster-path.js
CHANGED
|
@@ -48,13 +48,9 @@
|
|
|
48
48
|
* @property {'planar'|'radial'} mode - Rasterization mode (default: 'planar')
|
|
49
49
|
* @property {boolean} autoTiling - Automatically tile large datasets (default: true)
|
|
50
50
|
* @property {number} gpuMemorySafetyMargin - Safety margin as percentage (default: 0.8 = 80%)
|
|
51
|
-
* @property {number} maxConcurrentTiles - Max concurrent tiles for radial rasterization (default: 50)
|
|
52
51
|
* @property {number} maxGPUMemoryMB - Maximum GPU memory per tile (default: 256MB)
|
|
53
|
-
* @property {number} minTileSize - Minimum tile dimension (default: 50mm)
|
|
54
|
-
* @property {number} radialRotationOffset - Radial mode: rotation offset in degrees (default: 0, use 90 to start at Z-axis)
|
|
55
52
|
* @property {number} resolution - Grid step size in mm (required)
|
|
56
53
|
* @property {number} rotationStep - Radial mode only: degrees between rays (e.g., 1.0 = 360 rays)
|
|
57
|
-
* @property {number} trianglesPerTile - Target triangles per tile for radial rasterization (default: calculated)
|
|
58
54
|
* @property {number} batchDivisor - Testing parameter to artificially divide batch size (default: 1)
|
|
59
55
|
* @property {boolean} debug - Enable debug logging (default: false)
|
|
60
56
|
* @property {boolean} quiet - Suppress log output (default: false)
|
|
@@ -110,14 +106,10 @@ export class RasterPath {
|
|
|
110
106
|
|
|
111
107
|
// Configuration with defaults
|
|
112
108
|
this.config = {
|
|
113
|
-
workerName: config.workerName ?? "
|
|
109
|
+
workerName: config.workerName ?? "raster-worker.js",
|
|
114
110
|
maxGPUMemoryMB: config.maxGPUMemoryMB ?? 256,
|
|
115
111
|
gpuMemorySafetyMargin: config.gpuMemorySafetyMargin ?? 0.8,
|
|
116
112
|
autoTiling: config.autoTiling ?? true,
|
|
117
|
-
minTileSize: config.minTileSize ?? 50,
|
|
118
|
-
maxConcurrentTiles: config.maxConcurrentTiles ?? 10,
|
|
119
|
-
trianglesPerTile: config.trianglesPerTile, // undefined = auto-calculate
|
|
120
|
-
radialRotationOffset: config.radialRotationOffset ?? 0, // degrees
|
|
121
113
|
batchDivisor: config.batchDivisor ?? 1, // For testing batching overhead
|
|
122
114
|
debug: config.debug,
|
|
123
115
|
quiet: config.quiet
|
|
@@ -138,14 +130,14 @@ export class RasterPath {
|
|
|
138
130
|
|
|
139
131
|
return new Promise((resolve, reject) => {
|
|
140
132
|
try {
|
|
141
|
-
// Create worker from the
|
|
133
|
+
// Create worker from the raster-worker.js file
|
|
142
134
|
const workerName = this.config.workerName;
|
|
143
135
|
const isBuildVersion = import.meta.url.includes('/build/') || import.meta.url.includes('raster-path.js');
|
|
144
136
|
const workerPath = workerName
|
|
145
137
|
? new URL(workerName, import.meta.url)
|
|
146
138
|
: isBuildVersion
|
|
147
|
-
? new URL(`./
|
|
148
|
-
: new URL(
|
|
139
|
+
? new URL(`./raster-worker.js`, import.meta.url)
|
|
140
|
+
: new URL(`../core/raster-worker.js`, import.meta.url);
|
|
149
141
|
this.worker = new Worker(workerPath, { type: 'module' });
|
|
150
142
|
|
|
151
143
|
// Set up message handler
|