cyclecad 1.0.8 → 1.1.0
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/app/index.html +4 -4
- package/app/js/ai-copilot.js +24 -16
- package/package.json +1 -1
package/app/index.html
CHANGED
|
@@ -1419,7 +1419,7 @@
|
|
|
1419
1419
|
<span class="splash-logo-cycle">cycle</span><span class="splash-logo-cad">CAD</span>
|
|
1420
1420
|
</div>
|
|
1421
1421
|
<p class="splash-subtitle">Parametric 3D CAD Modeler for the Mechanical Designer</p>
|
|
1422
|
-
<p style="display:inline-block; color:#0066cc; font-size:1rem; margin:12px 0 0 0; letter-spacing:2px; font-family:monospace; font-weight:700; background:rgba(0,102,204,0.08); border:1.5px solid rgba(0,102,204,0.25); border-radius:8px; padding:5px 20px;">v1.0
|
|
1422
|
+
<p style="display:inline-block; color:#0066cc; font-size:1rem; margin:12px 0 0 0; letter-spacing:2px; font-family:monospace; font-weight:700; background:rgba(0,102,204,0.08); border:1.5px solid rgba(0,102,204,0.25); border-radius:8px; padding:5px 20px;">v1.1.0</p>
|
|
1423
1423
|
</div>
|
|
1424
1424
|
<div class="splash-options">
|
|
1425
1425
|
<button class="splash-button splash-button-primary" id="btn-empty-project" style="grid-column: 1 / -1;">
|
|
@@ -2906,8 +2906,8 @@
|
|
|
2906
2906
|
const mesh = result.mesh || result;
|
|
2907
2907
|
// Apply position offset for multi-item placement (e.g., 4 holes around a part)
|
|
2908
2908
|
if (pParams._offsetX || pParams._offsetZ) {
|
|
2909
|
-
mesh.position.x += (pParams._offsetX || 0)
|
|
2910
|
-
mesh.position.z += (pParams._offsetZ || 0)
|
|
2909
|
+
mesh.position.x += (pParams._offsetX || 0);
|
|
2910
|
+
mesh.position.z += (pParams._offsetZ || 0);
|
|
2911
2911
|
}
|
|
2912
2912
|
addToScene(mesh);
|
|
2913
2913
|
if (result.wireframe) addToScene(result.wireframe);
|
|
@@ -5272,6 +5272,6 @@
|
|
|
5272
5272
|
</div>
|
|
5273
5273
|
</div>
|
|
5274
5274
|
|
|
5275
|
-
<span id="version-badge" style="position:fixed;bottom:42px;left:50%;transform:translateX(-50%);z-index:999;font-size:0.9rem;color:rgba(255,255,255,0.9);letter-spacing:0.1em;white-space:nowrap;padding:6px 16px;user-select:all;pointer-events:auto;font-family:monospace;font-weight:700;background:rgba(0,0,0,0.7);border:1px solid rgba(88,166,255,0.4);border-radius:6px;text-shadow:0 1px 3px rgba(0,0,0,0.5);" title="cycleCAD version">cycleCAD v1.0
|
|
5275
|
+
<span id="version-badge" style="position:fixed;bottom:42px;left:50%;transform:translateX(-50%);z-index:999;font-size:0.9rem;color:rgba(255,255,255,0.9);letter-spacing:0.1em;white-space:nowrap;padding:6px 16px;user-select:all;pointer-events:auto;font-family:monospace;font-weight:700;background:rgba(0,0,0,0.7);border:1px solid rgba(88,166,255,0.4);border-radius:6px;text-shadow:0 1px 3px rgba(0,0,0,0.5);" title="cycleCAD version">cycleCAD v1.1.0</span>
|
|
5276
5276
|
</body>
|
|
5277
5277
|
</html>
|
package/app/js/ai-copilot.js
CHANGED
|
@@ -668,23 +668,29 @@ function parseNaturalLanguage(text) {
|
|
|
668
668
|
const numbers = extractNumbers(text);
|
|
669
669
|
let preview = '';
|
|
670
670
|
|
|
671
|
-
// Detect
|
|
672
|
-
const
|
|
673
|
-
const shapeParams = parseShapeParams(text, shapeType, numbers);
|
|
671
|
+
// Detect operations first — if text is purely an operation (add holes, fillet, etc.), skip shape creation
|
|
672
|
+
const ops = parseOperations(text, numbers);
|
|
674
673
|
|
|
675
|
-
if
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
674
|
+
// Only create a shape if text is NOT purely an operation command
|
|
675
|
+
const isOperationOnly = ops.length > 0 && text.match(/^(add|make|put|drill|bore|cut|fillet|chamfer|round|mirror|pattern)\b/i);
|
|
676
|
+
|
|
677
|
+
if (!isOperationOnly) {
|
|
678
|
+
// Detect primary shape
|
|
679
|
+
const shapeType = detectShapeType(text);
|
|
680
|
+
const shapeParams = parseShapeParams(text, shapeType, numbers);
|
|
681
|
+
|
|
682
|
+
if (shapeParams) {
|
|
683
|
+
commands.push({
|
|
684
|
+
method: `shape.${shapeType}`,
|
|
685
|
+
params: shapeParams,
|
|
686
|
+
});
|
|
687
|
+
preview += `Create ${shapeType}`;
|
|
688
|
+
}
|
|
681
689
|
}
|
|
682
690
|
|
|
683
|
-
// Detect operations
|
|
684
|
-
const ops = parseOperations(text, numbers);
|
|
685
691
|
commands.push(...ops);
|
|
686
692
|
if (ops.length > 0) {
|
|
687
|
-
preview += ops.map((op) =>
|
|
693
|
+
preview += (preview ? ' ' : '') + ops.map((op) => `${op.method.split('.')[1]}`).join(' + ');
|
|
688
694
|
}
|
|
689
695
|
|
|
690
696
|
// Detect material
|
|
@@ -820,13 +826,14 @@ function parseOperations(text, numbers) {
|
|
|
820
826
|
const commands = [];
|
|
821
827
|
|
|
822
828
|
// Holes
|
|
823
|
-
if (text.match(/hole|bore|drill/i)) {
|
|
829
|
+
if (text.match(/hole|bore|drill|mounting/i)) {
|
|
824
830
|
const holeRadius = text.match(/(\d+)\s*mm\s*hole/) ? parseFloat(RegExp.$1) / 2 : 5;
|
|
825
|
-
const
|
|
831
|
+
const countMatch = text.match(/(\d+)\s*(?:mounting\s+)?holes?/i) || text.match(/(\d+)\s+\w*\s*holes?/i);
|
|
832
|
+
const count = countMatch ? parseInt(countMatch[1]) : 1;
|
|
826
833
|
|
|
827
834
|
commands.push({
|
|
828
835
|
method: 'feature.hole',
|
|
829
|
-
params: { radius: holeRadius, count },
|
|
836
|
+
params: { radius: holeRadius, depth: 100, count },
|
|
830
837
|
});
|
|
831
838
|
}
|
|
832
839
|
|
|
@@ -955,7 +962,8 @@ export async function executeTextCommand(prompt) {
|
|
|
955
962
|
// Offset multiple items so they don't stack
|
|
956
963
|
if (count > 1) {
|
|
957
964
|
const angle = (ci / count) * Math.PI * 2;
|
|
958
|
-
|
|
965
|
+
// Spread holes across the cube face — SCALE is 0.1 so multiply by that
|
|
966
|
+
const spread = (p.radius || 5) * 3 * 0.1;
|
|
959
967
|
p._offsetX = Math.cos(angle) * spread;
|
|
960
968
|
p._offsetZ = Math.sin(angle) * spread;
|
|
961
969
|
}
|
package/package.json
CHANGED