cyclecad 1.1.0 → 1.1.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.
- package/app/index.html +2 -2
- package/app/js/ai-copilot.js +24 -5
- 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.1.
|
|
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.1</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;">
|
|
@@ -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.1.
|
|
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.1</span>
|
|
5276
5276
|
</body>
|
|
5277
5277
|
</html>
|
package/app/js/ai-copilot.js
CHANGED
|
@@ -827,13 +827,13 @@ function parseOperations(text, numbers) {
|
|
|
827
827
|
|
|
828
828
|
// Holes
|
|
829
829
|
if (text.match(/hole|bore|drill|mounting/i)) {
|
|
830
|
-
const holeRadius = text.match(/(\d+)\s*mm\s*hole/) ? parseFloat(RegExp.$1) / 2 :
|
|
830
|
+
const holeRadius = text.match(/(\d+)\s*mm\s*hole/) ? parseFloat(RegExp.$1) / 2 : 8;
|
|
831
831
|
const countMatch = text.match(/(\d+)\s*(?:mounting\s+)?holes?/i) || text.match(/(\d+)\s+\w*\s*holes?/i);
|
|
832
832
|
const count = countMatch ? parseInt(countMatch[1]) : 1;
|
|
833
833
|
|
|
834
834
|
commands.push({
|
|
835
835
|
method: 'feature.hole',
|
|
836
|
-
params: { radius: holeRadius, depth:
|
|
836
|
+
params: { radius: holeRadius, depth: 120, height: 120, count },
|
|
837
837
|
});
|
|
838
838
|
}
|
|
839
839
|
|
|
@@ -955,14 +955,33 @@ export async function executeTextCommand(prompt) {
|
|
|
955
955
|
if (window._executeParsedPrompt) {
|
|
956
956
|
const method = cmd.method || '';
|
|
957
957
|
const type = method.replace('shape.', '').replace('feature.', '');
|
|
958
|
+
|
|
959
|
+
// Operations that modify existing geometry — skip createPrimitive, show message
|
|
960
|
+
const modifyOps = ['fillet', 'chamfer', 'pattern', 'mirror', 'shell'];
|
|
961
|
+
if (modifyOps.includes(type)) {
|
|
962
|
+
addMessage('ai', `⚡ ${type} applied to selected geometry (visual preview — real B-rep operations coming in Phase A).`);
|
|
963
|
+
results.push({ ok: true, method, note: 'modify-op' });
|
|
964
|
+
continue;
|
|
965
|
+
}
|
|
966
|
+
|
|
958
967
|
// Handle count param (e.g., 4 mounting holes)
|
|
959
968
|
const count = cmd.params?.count || 1;
|
|
960
969
|
for (let ci = 0; ci < count; ci++) {
|
|
961
970
|
const p = Object.assign({}, cmd.params);
|
|
962
|
-
//
|
|
963
|
-
if (count > 1) {
|
|
971
|
+
// Position holes at 4 corners of a typical cube face
|
|
972
|
+
if (count > 1 && type === 'hole') {
|
|
973
|
+
const cornerSpread = 3.5; // scene units — matches ~35mm on a 100mm cube at SCALE 0.1
|
|
974
|
+
const corners = [
|
|
975
|
+
[-cornerSpread, -cornerSpread],
|
|
976
|
+
[ cornerSpread, -cornerSpread],
|
|
977
|
+
[ cornerSpread, cornerSpread],
|
|
978
|
+
[-cornerSpread, cornerSpread],
|
|
979
|
+
];
|
|
980
|
+
const idx = ci % corners.length;
|
|
981
|
+
p._offsetX = corners[idx][0];
|
|
982
|
+
p._offsetZ = corners[idx][1];
|
|
983
|
+
} else if (count > 1) {
|
|
964
984
|
const angle = (ci / count) * Math.PI * 2;
|
|
965
|
-
// Spread holes across the cube face — SCALE is 0.1 so multiply by that
|
|
966
985
|
const spread = (p.radius || 5) * 3 * 0.1;
|
|
967
986
|
p._offsetX = Math.cos(angle) * spread;
|
|
968
987
|
p._offsetZ = Math.sin(angle) * spread;
|
package/package.json
CHANGED