feat(arm): 电机双向夹紧与2mm厚度公差让位,立柱减重槽及文档同步更新
This commit is contained in:
+17
-4
@@ -520,6 +520,13 @@ for (const p of DATA.parts) {
|
||||
for (let i = 0; i < p.v.length; i++) { pos[i*3] = p.v[i][0]; pos[i*3+1] = p.v[i][2]; pos[i*3+2] = -p.v[i][1]; }
|
||||
p.triCount = p.t ? p.t.length : 0;
|
||||
p.vertCount = p.v.length;
|
||||
/* 外形三围:模型坐标系 X×Y×Z 包围盒(装配零位、打印朝向 Z=高),悬停面板显示用 */
|
||||
{ let x0=1e9,y0=1e9,z0=1e9,x1=-1e9,y1=-1e9,z1=-1e9;
|
||||
for (let i = 0; i < p.v.length; i++) { const a = p.v[i];
|
||||
if (a[0]<x0)x0=a[0]; if (a[0]>x1)x1=a[0];
|
||||
if (a[1]<y0)y0=a[1]; if (a[1]>y1)y1=a[1];
|
||||
if (a[2]<z0)z0=a[2]; if (a[2]>z1)z1=a[2]; }
|
||||
p.dims = [x1-x0, y1-y0, z1-z0]; }
|
||||
const isEnv = p.name.slice(0, 4) === 'ENV_'; // 可达包络:运动学边界,不随关节动
|
||||
/* 索引按顶点数降位:单件 ≤65535 顶点时 Uint16 合法(92 件实测最大 47483),
|
||||
索引内存与上传带宽减半;超大件保留 Uint32 兜底。 */
|
||||
@@ -686,6 +693,11 @@ function pick(e) {
|
||||
的 style.background 全刷一遍,纯属多余 DOM 写入。 */
|
||||
let bomHlRow = null;
|
||||
function bomHlClear() { if (bomHlRow) { bomHlRow.style.background = ''; bomHlRow = null; } }
|
||||
function dimsStr(p) {
|
||||
if (!p.dims) return '';
|
||||
const f = d => String(Math.round(d * 10) / 10);
|
||||
return '外形 ' + f(p.dims[0]) + ' × ' + f(p.dims[1]) + ' × ' + f(p.dims[2]) + ' mm(X·Y·Z)';
|
||||
}
|
||||
function hover(e) {
|
||||
const o = pick(e); if (o === hov) return; hov = o;
|
||||
const n = document.getElementById('note');
|
||||
@@ -693,7 +705,8 @@ function hover(e) {
|
||||
const p = o.userData;
|
||||
n.style.display = 'block';
|
||||
n.innerHTML = '<b>#' + p.idx + ' ' + p.cn + '</b><br><small>' + p.name +
|
||||
' · ' + (p.printed ? '3D打印件' : '电机/已有件') + '<br>' + p.note + '</small>';
|
||||
' · ' + (p.printed ? '3D打印件' : '电机/已有件') +
|
||||
(dimsStr(p) ? '<br>' + dimsStr(p) : '') + '</small>';
|
||||
}
|
||||
function hidePart(m) {
|
||||
if (!m) return;
|
||||
@@ -835,7 +848,7 @@ for (const [gt, test] of groups) {
|
||||
const p = m.userData;
|
||||
const r = document.createElement('div'); r.className = 'row';
|
||||
r.innerHTML = '<input type="checkbox" checked><span class="chip" style="background:#' +
|
||||
p.color.toString(16).padStart(6,'0') + '"></span><label title="' + p.note + '">' +
|
||||
p.color.toString(16).padStart(6,'0') + '"></span><label title="' + p.name + '">' +
|
||||
'<span class="' + (p.printed?'pr':(p.name[0]==='M'?'mo':'ex')) + '">' + p.cn + '</span></label>' +
|
||||
'<span class="q">#' + p.idx + '</span>';
|
||||
const chk = r.querySelector('input');
|
||||
@@ -867,7 +880,7 @@ if (scrAll.length) {
|
||||
const ms = bySpec[sid], p0 = ms[0].userData;
|
||||
const r = document.createElement('div'); r.className = 'row';
|
||||
r.innerHTML = '<input type="checkbox" checked><span class="chip" style="background:#' +
|
||||
p0.color.toString(16).padStart(6,'0') + '"></span><label title="' + p0.note + '">' +
|
||||
p0.color.toString(16).padStart(6,'0') + '"></span><label>' +
|
||||
'<span class="ex">' + sid + ' ' + p0.cn.split(' · ')[0] + '</span></label>' +
|
||||
'<span class="q">' + ms.length + ' 颗</span>';
|
||||
const chk = r.querySelector('input');
|
||||
@@ -925,7 +938,7 @@ for (const p of DATA.parts) {
|
||||
tr.innerHTML = '<td>' + p.idx + '</td><td>' + p.cn + '</td><td>' + (p.vol/1000).toFixed(1) + '</td><td>' +
|
||||
(p.vol*1.24e-3).toFixed(0) + '</td>';
|
||||
tr.dataset.idx = p.idx;
|
||||
tr.title = p.note + ' / ' + p.name;
|
||||
tr.title = p.name + (dimsStr(p) ? ',' + dimsStr(p) : '');
|
||||
tb.appendChild(tr);
|
||||
}
|
||||
document.getElementById('sum').innerHTML =
|
||||
|
||||
Reference in New Issue
Block a user