@jbroll/jscad-modeling 2.13.0 → 2.13.1
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.
|
@@ -3,28 +3,24 @@
|
|
|
3
3
|
"allow": [
|
|
4
4
|
"Bash(wc:*)",
|
|
5
5
|
"Bash(git add:*)",
|
|
6
|
-
"Bash(git commit
|
|
6
|
+
"Bash(git commit:*)",
|
|
7
|
+
"Bash(git checkout:*)",
|
|
8
|
+
"Bash(git push:*)",
|
|
7
9
|
"Bash(gh auth:*)",
|
|
8
|
-
"Bash(gh issue create --title \"perf\\(modeling\\): O\\(n²\\) array concatenation in extrudeFromSlices.js\" --body \"$\\(cat <<''EOF''\n## Summary\n`extrudeFromSlices.js` uses `Array.concat\\(\\)` inside a loop, causing O\\(n²\\) memory operations.\n\n## Usage Frequency: VERY HIGH\nThis function is the core of all extrusion operations:\n- `extrudeLinearGeom2.js`\n- `extrudeRotate.js` \n- `extrudeHelical.js`\n\nEvery extrusion operation goes through this code path.\n\n## Problem\n**File:** `packages/modeling/src/operations/extrusions/extrudeFromSlices.js`\n**Lines:** 84, 98, 102-103, 108\n\n```javascript\nfor \\(let s = 0; s < numberOfSlices; s++\\) {\n // ...\n if \\(prevSlice\\) {\n polygons = polygons.concat\\(extrudeWalls\\(prevSlice, currentSlice\\)\\) // Creates new array each iteration\n }\n}\n// ...\npolygons = polygons.concat\\(endPolygons\\)\npolygons = polygons.concat\\(startPolygons\\)\n```\n\nEach `concat\\(\\)` creates a new array and copies all existing elements. For N slices, this performs O\\(n²\\) copy operations.\n\n## Suggested Fix\nUse `push\\(\\)` with spread operator:\n\n```javascript\nfor \\(let s = 0; s < numberOfSlices; s++\\) {\n if \\(prevSlice\\) {\n polygons.push\\(...extrudeWalls\\(prevSlice, currentSlice\\)\\)\n }\n}\npolygons.push\\(...endPolygons\\)\npolygons.push\\(...startPolygons\\)\n```\n\n## Impact\nHigh - affects performance of all extrusion operations, especially with many slices.\nEOF\n\\)\")",
|
|
9
|
-
"Bash(gh issue create --repo jscad/OpenJSCAD.org --title \"perf\\(modeling\\): O\\(n²\\) array concatenation in extrudeFromSlices.js\" --body \"$\\(cat <<''EOF''\n## Summary\n`extrudeFromSlices.js` uses `Array.concat\\(\\)` inside a loop, causing O\\(n²\\) memory operations.\n\n## Usage Frequency: VERY HIGH\nThis function is the core of all extrusion operations:\n- `extrudeLinearGeom2.js`\n- `extrudeRotate.js` \n- `extrudeHelical.js`\n\nEvery extrusion operation goes through this code path.\n\n## Problem\n**File:** `packages/modeling/src/operations/extrusions/extrudeFromSlices.js` \n**Lines:** 84, 98, 102-103, 108\n\n```javascript\nfor \\(let s = 0; s < numberOfSlices; s++\\) {\n // ...\n if \\(prevSlice\\) {\n polygons = polygons.concat\\(extrudeWalls\\(prevSlice, currentSlice\\)\\) // Creates new array each iteration\n }\n}\n// ...\npolygons = polygons.concat\\(endPolygons\\)\npolygons = polygons.concat\\(startPolygons\\)\n```\n\nEach `concat\\(\\)` creates a new array and copies all existing elements. For N slices, this performs O\\(n²\\) copy operations.\n\n## Suggested Fix\nUse `push\\(\\)` with spread operator:\n\n```javascript\nfor \\(let s = 0; s < numberOfSlices; s++\\) {\n if \\(prevSlice\\) {\n polygons.push\\(...extrudeWalls\\(prevSlice, currentSlice\\)\\)\n }\n}\npolygons.push\\(...endPolygons\\)\npolygons.push\\(...startPolygons\\)\n```\n\n## Impact\nHigh - affects performance of all extrusion operations, especially with many slices.\nEOF\n\\)\")",
|
|
10
|
-
"Bash(gh issue create --repo jscad/OpenJSCAD.org --title \"perf\\(modeling\\): O\\(n²\\) array concatenation in scissionGeom3.js\" --body \"$\\(cat <<''EOF''\n## Summary\n`scissionGeom3.js` uses `Array.concat\\(\\)` inside nested loops, causing O\\(n²\\) memory operations.\n\n## Usage Frequency: LOW\nUsed only by `scission\\(\\)` operation which splits a geometry into disconnected pieces. Most typical models don''t use scission - it''s a specialized operation for:\n- Separating imported models that contain multiple parts\n- Post-processing boolean results that created separate islands\n\n**Typical model usage:** Rare - maybe 1% of models\n\n## Problem\n**File:** `packages/modeling/src/operations/booleans/scissionGeom3.js` \n**Lines:** 40-42\n\n```javascript\nconst indexesPerPolygon = polygons.map\\(\\(polygon\\) => {\n let indexes = []\n polygon.vertices.forEach\\(\\(point\\) => {\n indexes = indexes.concat\\(findMapping\\(indexesPerPoint, vec3.snap\\(temp, point, eps\\)\\)\\)\n }\\)\n return { e: 1, d: sortNb\\(indexes\\) }\n}\\)\n```\n\nFor each vertex of each polygon, `concat\\(\\)` creates a new array. With N polygons averaging V vertices, this is O\\(N*V\\) array allocations.\n\n## Suggested Fix\nUse `push\\(\\)` with spread:\n\n```javascript\nconst indexesPerPolygon = polygons.map\\(\\(polygon\\) => {\n const indexes = []\n polygon.vertices.forEach\\(\\(point\\) => {\n indexes.push\\(...findMapping\\(indexesPerPoint, vec3.snap\\(temp, point, eps\\)\\)\\)\n }\\)\n return { e: 1, d: sortNb\\(indexes\\) }\n}\\)\n```\n\n## Impact\nLow overall \\(rare operation\\), but when used on complex geometry it can be slow.\nEOF\n\\)\")",
|
|
11
10
|
"Bash(gh issue create:*)",
|
|
12
|
-
"Bash(npm run bench:*)",
|
|
13
11
|
"Bash(gh issue view:*)",
|
|
14
|
-
"Bash(git commit -m \"$\\(cat <<''EOF''\nperf\\(modeling\\): add benchmark suite for performance testing\n\nAdds benchmarks for:\n- Booleans \\(union, subtract, intersect at varying complexity\\)\n- Extrusions \\(extrudeLinear, extrudeRotate with varying slices\\)\n- Measurements \\(boundingBox, volume, area\\)\n- Transforms \\(translate, rotate, scale, center\\)\n- Utils \\(flatten with varying array sizes\\)\n\nRun with: npm run bench\n\nCo-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>\nEOF\n\\)\")",
|
|
15
12
|
"Bash(gh issue comment:*)",
|
|
13
|
+
"Bash(gh pr create:*)",
|
|
14
|
+
"Bash(npm run bench:*)",
|
|
16
15
|
"Bash(npm test:*)",
|
|
16
|
+
"Bash(npm install)",
|
|
17
|
+
"Bash(npm whoami:*)",
|
|
17
18
|
"Bash(npx ava:*)",
|
|
18
19
|
"Bash(node -e:*)",
|
|
19
|
-
"Bash(git commit:*)",
|
|
20
20
|
"Bash(ls:*)",
|
|
21
21
|
"Bash(grep:*)",
|
|
22
|
-
"Bash(npm install)",
|
|
23
|
-
"Bash(git checkout:*)",
|
|
24
|
-
"Bash(git push:*)",
|
|
25
|
-
"Bash(gh pr create:*)",
|
|
26
22
|
"Bash(cat:*)",
|
|
27
|
-
"Bash(npm
|
|
23
|
+
"Bash(npm run test:tsd:*)"
|
|
28
24
|
]
|
|
29
25
|
}
|
|
30
26
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbroll/jscad-modeling",
|
|
3
|
-
"version": "2.13.
|
|
3
|
+
"version": "2.13.1",
|
|
4
4
|
"description": "Constructive Solid Geometry (CSG) Library for JSCAD (performance-optimized fork)",
|
|
5
5
|
"homepage": "https://github.com/jbroll/OpenJSCAD.org",
|
|
6
6
|
"repository": "https://github.com/jbroll/OpenJSCAD.org",
|