@floless/app 0.110.0 → 0.111.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/dist/floless-server.cjs +484 -67
- package/dist/skills/floless-app-steel-model/SKILL.md +5 -1
- package/dist/skills/floless-app-steel-takeoff/SKILL.md +120 -8
- package/dist/skills/steel-drawing-abbreviations/references/standard-us-abbreviations.md +6 -0
- package/dist/web/app.css +73 -9
- package/dist/web/aware.js +4 -4
- package/dist/web/index.html +19 -0
- package/dist/web/steel-editor.html +59 -31
- package/dist/web/workspaces.js +417 -6
- package/package.json +1 -1
|
@@ -3351,7 +3351,7 @@ function updateConnCrumb(){
|
|
|
3351
3351
|
const el=document.getElementById('connCrumb'); if(!el) return;
|
|
3352
3352
|
const cs=view3d?connSelInfo():null;
|
|
3353
3353
|
if(!cs){ el.style.display='none'; el.innerHTML=''; return; }
|
|
3354
|
-
const name=(cs.kind
|
|
3354
|
+
const name=connKindLabel(cs.kind)+' · '+cs.main;
|
|
3355
3355
|
let html='<button class=seg data-lvl=root data-tip="Back to the model (deselect)">Model</button><span class=sep>▸</span>';
|
|
3356
3356
|
if(cs.whole){ html+='<span class="seg cur">'+esc(name)+'</span>'; }
|
|
3357
3357
|
else{
|
|
@@ -3371,7 +3371,7 @@ async function connModifyRequest(j){
|
|
|
3371
3371
|
if(!j) return;
|
|
3372
3372
|
try{await window.flushContract();}catch(_){}
|
|
3373
3373
|
try{persist();}catch(_){}
|
|
3374
|
-
const kindName=j.kind
|
|
3374
|
+
const kindName=connKindLabel(j.kind).toLowerCase();
|
|
3375
3375
|
const onMember=j.main?' on member '+j.main:'';
|
|
3376
3376
|
const label=j.kind==='custom'&&j.name?' ("'+j.name+'")':'';
|
|
3377
3377
|
const instruction='Modify the '+kindName+' connection "'+j.id+'"'+label+onMember+' (sheet '+((P&&P.sheet)||'?')+') — adjust, replace or move it per my request.';
|
|
@@ -3539,7 +3539,7 @@ function panel(){
|
|
|
3539
3539
|
return;
|
|
3540
3540
|
}
|
|
3541
3541
|
const isBP=j.kind==='base-plate',pp=j.params||{};const savedFav=favMatch(j);
|
|
3542
|
-
const plate=(partsById||{})[cs.conn+':plate']||null;
|
|
3542
|
+
const plate=(partsById||{})[cs.conn+':plate']||(partsById||{})[cs.conn+':plateA']||null; // a gusset carries plateA/plateB, not a single :plate
|
|
3543
3543
|
const dim=(n)=>(n==null?'<span style="color:var(--mut)">auto</span>':esc(fmtFtIn(Number(n)/25.4)));
|
|
3544
3544
|
const kv=(l,val)=>`<div style="display:flex;justify-content:space-between;gap:8px;font-size:12px;margin:3px 0"><span style="color:var(--mut)">${esc(l)}</span><span style="font-variant-numeric:tabular-nums">${val}</span></div>`;
|
|
3545
3545
|
const sec=t=>`<div class=divrow><hr><span class=sect style="margin:0">${esc(t)}</span><hr></div>`;
|
|
@@ -3547,7 +3547,7 @@ function panel(){
|
|
|
3547
3547
|
let body='';
|
|
3548
3548
|
if(isBP)body=sec('Plate')+kv('Size',sz)+kv('Thickness',plate?dim(plate.thickness):dim(pp.thickness))+sec('Anchors')+kv('Grid (cols × rows)',esc(`${pp.boltCols||2} × ${pp.boltRows||2}`))+kv('Diameter',pp.boltDia?dim(pp.boltDia):dim(24));
|
|
3549
3549
|
else body=sec('Plate')+kv('Size',sz)+kv('Thickness',plate?dim(plate.thickness):dim(pp.plateThickness))+sec('Bolts')+kv('Grid (cols × rows)',esc(`${pp.boltCols||1} × ${pp.boltRows||3}`))+kv('Diameter',pp.boltDia?dim(pp.boltDia):dim(20))+sec('Weld')+kv('Leg',pp.weldLeg?dim(pp.weldLeg):dim(6));
|
|
3550
|
-
p.innerHTML=`<span class=badge>${
|
|
3550
|
+
p.innerHTML=`<span class=badge>${connKindLabel(cs.kind)}</span>
|
|
3551
3551
|
<div class=row style="margin:0 0 6px"><span class=chip style="border-color:var(--brand);color:#bfdbfe">Parametric — editable</span></div>
|
|
3552
3552
|
<div class="row hint" style="margin:0 0 2px">On <button class=pilllink id=cmpMember data-tip="Select ${esc(j.main)}">${esc(j.main)}</button> · ${cs.childIds.length} parts</div>
|
|
3553
3553
|
<div class="row hint" style="margin:0 0 6px;font-size:11px">Double-click to enter and pick a part · <b>Esc</b> steps back.</div>
|
|
@@ -3558,7 +3558,7 @@ function panel(){
|
|
|
3558
3558
|
${isBP?`<button class=ghostw id=cmpTrim data-tip="Pick a point on ${esc(j.main)} — trim or extend the column so its base seats there (snaps to framing levels)">⭶ Trim / Extend column to base…</button>`:''}
|
|
3559
3559
|
<button class=ghostw id=cmpAsk data-tip="Record a request for your terminal AI to modify / replace / move this connection">Modify connection…</button>
|
|
3560
3560
|
<button class=danger id=cmpDel data-tip="Remove this whole connection">Delete connection</button>
|
|
3561
|
-
<button class="ghostw${savedFav?' faved':''}" id=cmpFav data-tip="${savedFav?'Edit this favourite’s name or category':('Save this connection to your Favourites — reusable on any '+(
|
|
3561
|
+
<button class="ghostw${savedFav?' faved':''}" id=cmpFav data-tip="${savedFav?'Edit this favourite’s name or category':('Save this connection to your Favourites — reusable on any '+favHostNoun(cs.kind))}">${savedFav?'★ Saved to Favourites':'★ Save to Favourites'}</button>
|
|
3562
3562
|
</div>`;
|
|
3563
3563
|
const toMember=()=>{if(window.Steel3DView&&window.Steel3DView.clearConnSel)window.Steel3DView.clearConnSel();selIds=new Set([j.main]);selDimIds.clear();sel3dDimIds.clear();selGridIds.clear();render();};
|
|
3564
3564
|
{const b=document.getElementById('cmpMember');if(b)b.onclick=toMember;}
|
|
@@ -3576,7 +3576,7 @@ function panel(){
|
|
|
3576
3576
|
{const jids=selJointIds();
|
|
3577
3577
|
if(jids.size>=2&&selIsConnOnly()){
|
|
3578
3578
|
const js=(C.joints||[]).filter(j=>j&&jids.has(j.id));
|
|
3579
|
-
const kinds=new Set(js.map(j=>j.kind
|
|
3579
|
+
const kinds=new Set(js.map(j=>connKindLabel(j.kind).toLowerCase()));
|
|
3580
3580
|
const noun=kinds.size===1?[...kinds][0]+'s':'connections';
|
|
3581
3581
|
const nMem=new Set(js.map(j=>j.main)).size;
|
|
3582
3582
|
p.innerHTML=`<h3>${js.length} connections selected</h3>
|
|
@@ -3597,7 +3597,7 @@ function panel(){
|
|
|
3597
3597
|
const suf=ci>=0?selPart.slice(ci+1):'';const pp=j.params||{};const multi=selList.length>1;
|
|
3598
3598
|
const loc=j.at==='base'?'Base':j.at==='end1'?'End end':'Start end';
|
|
3599
3599
|
const pk=/^(bolt|head)/.test(suf)?'bolt':/^(fn|ln|nut)/.test(suf)?'nut':/^weld/.test(suf)?'weld':/^cope/.test(suf)?'cope':/^stiff/.test(suf)?'stiff':/^(rod|anchor)/.test(suf)?'rod':(((partsById||{})[selPart]||{}).group==='anchor-plate')?'aplate':/^wsh/.test(suf)?'washer':/^wp/.test(suf)?'wplate':'plate'; // the embedded bearing plate → keyed on its 'anchor-plate' GROUP, not an id prefix, so an imported custom-mesh part whose id happens to start "ap" isn't misread as one
|
|
3600
|
-
const kindName=j.kind
|
|
3600
|
+
const kindName=connKindLabel(j.kind);
|
|
3601
3601
|
const head=({bolt:(multi?'Bolts':'Bolt'),nut:(multi?'Nuts':'Nut'),weld:'Weld',cope:'Cope',stiff:'Stiffener',rod:(multi?'Anchor rods':'Anchor rod'),washer:'Washer',wplate:'Washer plate',aplate:'Anchor plate'})[pk]||kindName;
|
|
3602
3602
|
const el=(partsById||{})[selPart]||null;const lbl=el&&el.meta&&el.meta.label;
|
|
3603
3603
|
const DEF={plateThickness:10,weldLeg:6,clearance:13,boltDia:20,boltPitch:70,copeRadius:12.7}; // engine defaults (mirror the member panel's spF defaults)
|
|
@@ -3609,7 +3609,10 @@ function panel(){
|
|
|
3609
3609
|
const kv=(l,val)=>`<div style="display:flex;justify-content:space-between;gap:8px;font-size:12px;margin:3px 0"><span style="color:var(--mut)">${l}</span><span style="font-variant-numeric:tabular-nums">${val}</span></div>`;
|
|
3610
3610
|
const sec=t=>`<div class=divrow><hr><span class=sect style="margin:0">${t}</span><hr></div>`;
|
|
3611
3611
|
let body='';
|
|
3612
|
-
|
|
3612
|
+
// A gusset has NO erection clearance row: its setback is derived from the real clash with the support,
|
|
3613
|
+
// so `clearance` is never read (steel-joints.ts — "the setback IS the clearance"). Showing it would put an
|
|
3614
|
+
// editable 1/2" default in front of the user that changes nothing.
|
|
3615
|
+
if(pk==='plate'&&(j.kind==='shear-plate'||j.kind==='brace-gusset'))body=sec('Plate')+kv('Width',dim(el&&el.width))+kv('Height',dim(el&&el.depth))+kv('Thickness',dim(el&&el.thickness))+kv('Weld leg',v('weldLeg','mm'))+(j.kind==='brace-gusset'?kv('Set back',dim(el&&el.meta&&el.meta.setbackMm)):kv('Clearance',v('clearance','mm')));
|
|
3613
3616
|
else if(pk==='bolt')body=sec('Bolts')+kv('Grid (cols × rows)',esc(`${pp.boltCols||1} × ${pp.boltRows||3}`))+kv('Diameter',v('boltDia','mm'))+kv('Grade',pp.boltGrade?esc(pp.boltGrade):'A325'+dft)+kv('Row pitch',v('boltPitch','mm'))+((Number(pp.boltCols)||1)>1?kv('Column pitch',pp.boltColPitch!=null?v('boltColPitch','mm'):dim(Number(pp.boltPitch!=null?pp.boltPitch:70))):'')+kv('Length','<span style="color:var(--mut)">auto (from grip)</span>');
|
|
3614
3617
|
else if(pk==='weld')body=sec('Weld')+kv('Leg',v('weldLeg','mm'));
|
|
3615
3618
|
else if(pk==='cope')body=sec('Cope')+kv('Length',dim(el&&el.width))+kv('Depth',dim(el&&el.depth))+kv('Re-entrant radius',v('copeRadius','mm'));
|
|
@@ -3806,27 +3809,35 @@ function panel(){
|
|
|
3806
3809
|
<div class="row f"><button class="ghostw" id=bpTrim data-tip="Pick a point on ${esc(m.id)} — trim or extend the column so its base seats there (snaps to framing levels)">⭶ Trim / Extend column to base…</button><button class="ghostw" id=bpRemove data-tip="Delete this column's base plate" style="color:#fca5a5;border-color:#7f1d1d">Remove base plate</button></div>`:'';
|
|
3807
3810
|
// This BEAM's shear-plate joints — one params block per detailed END (start/end). Mirrors bpSect but
|
|
3808
3811
|
// per-end (a beam can be detailed at both ends), and adds the clearance + web-side + stiffener controls.
|
|
3809
|
-
|
|
3812
|
+
// Both parametric END kinds. A gusset reaching this panel and finding no section for it was a dead end:
|
|
3813
|
+
// the whole-connection inspector renders “✎ Edit parameters on <member> →” for every parametric kind.
|
|
3814
|
+
const spjs=col?[]:[0,1].map(e=>({e,j:(C.joints||[]).find(j=>j&&(j.kind==='shear-plate'||j.kind==='brace-gusset')&&j.main===m.id&&j.at==='end'+e)})).filter(x=>x.j);
|
|
3810
3815
|
const spAllAuto=spjs.length>0&&spjs.every(x=>x.j.source==='auto');
|
|
3811
3816
|
// DOM ids key on the END INDEX (0/1), NEVER the joint id (a free-string schema field) — so a crafted
|
|
3812
3817
|
// joints[].id can't inject into an attribute position; the handlers below close over the real joint.
|
|
3813
3818
|
const spF=(e,j,key,label,ph,unit)=>{const raw=j&&j.params&&j.params[key]!=null?j.params[key]:null;const val=raw==null?'':(unit==='mm'?esc(fmtFtIn(Number(raw)/25.4)):esc(String(raw)));
|
|
3814
3819
|
return `<div class=elab>${label}</div><input id="spf_e${e}_${key}" inputmode=decimal placeholder="${esc(ph)}" value="${val}" autocomplete=off>${unit&&unit!=='mm'?`<span class=edec>${unit}</span>`:''}`;}; // mm params shown/entered in ft-in
|
|
3815
|
-
const spBlock=({e,j})=>{const dot=e===1?dotE:dotS,lbl=e===1?'End':'Start',st=!!(j.params&&j.params.stiffener);
|
|
3816
|
-
return `<div class=divrow><hr><span class=sect style="margin:0">${dot}${lbl} · Shear plate</span><hr></div>
|
|
3817
|
-
${spF(e,j,'plateWidth','Plate width','auto','mm')}${spF(e,j,'plateHeight','Plate height','auto','mm')}${spF(e,j,'plateThickness','Thickness','3/8"','mm')}${spF(e,j,'weldLeg','Weld leg','1/4"','mm')}${spF(e,j,'clearance','Clearance (beam gap)','1/2"','mm')}
|
|
3818
|
-
<div class=elabrow><span class=elab
|
|
3820
|
+
const spBlock=({e,j})=>{const dot=e===1?dotE:dotS,lbl=e===1?'End':'Start',st=!!(j.params&&j.params.stiffener);const gus=j.kind==='brace-gusset';
|
|
3821
|
+
return `<div class=divrow><hr><span class=sect style="margin:0">${dot}${lbl} · ${gus?'Gusset plate':'Shear plate'}</span><hr></div>
|
|
3822
|
+
${spF(e,j,'plateWidth','Plate width','auto','mm')}${spF(e,j,'plateHeight','Plate height','auto','mm')}${spF(e,j,'plateThickness','Thickness','3/8"','mm')}${spF(e,j,'weldLeg','Weld leg','1/4"','mm')}${gus?spF(e,j,'plateCount','Plates (1 or 2)','2',''):spF(e,j,'clearance','Clearance (beam gap)','1/2"','mm')}
|
|
3823
|
+
<div class=elabrow><span class=elab>${gus?'Lapped side':'Web side'}</span></div>
|
|
3819
3824
|
<div class=seg2 style="margin-top:0"><button id="spside_e${e}_n" class="${(j.params&&j.params.webSide<0)?'':'on'}">Near</button><button id="spside_e${e}_f" class="${(j.params&&j.params.webSide<0)?'on':''}">Far</button></div>
|
|
3820
|
-
|
|
3821
|
-
<div class=seg2 style="margin-top:0"><button id="spw_e${e}_n" class="${(j.params&&j.params.weldSide==='near')?'on':''}">Near</button><button id="spw_e${e}_f" class="${(j.params&&j.params.weldSide==='far')?'on':''}">Far</button><button id="spw_e${e}_b" class="${(!j.params||!j.params.weldSide||j.params.weldSide==='both')?'on':''}">Both</button></div
|
|
3825
|
+
${gus?'':`<div class=elabrow><span class=elab>Weld sides</span></div>
|
|
3826
|
+
<div class=seg2 style="margin-top:0"><button id="spw_e${e}_n" class="${(j.params&&j.params.weldSide==='near')?'on':''}">Near</button><button id="spw_e${e}_f" class="${(j.params&&j.params.weldSide==='far')?'on':''}">Far</button><button id="spw_e${e}_b" class="${(!j.params||!j.params.weldSide||j.params.weldSide==='both')?'on':''}">Both</button></div>`}
|
|
3822
3827
|
<div class=elab style="margin-top:7px;opacity:.7">Bolts</div>
|
|
3823
3828
|
${spF(e,j,'boltCols','Bolt columns','1','')}${spF(e,j,'boltRows','Bolt rows','3','')}${spF(e,j,'boltDia','Bolt ⌀','3/4"','mm')}${spF(e,j,'boltPitch','Row spacing','2 3/4"','mm')}${(Number(j.params&&j.params.boltCols)>1)?spF(e,j,'boltColPitch','Column spacing',(j.params&&j.params.boltPitch!=null?fmtFtIn(Number(j.params.boltPitch)/25.4):'2 3/4"'),'mm'):''}
|
|
3824
3829
|
<div class=elabrow><span class=elab>Bolt grade</span></div>
|
|
3825
3830
|
<div class=seg2 style="margin-top:0"><button id="spg_e${e}_325" class="${(j.params&&j.params.boltGrade==='A490')?'':'on'}">A325</button><button id="spg_e${e}_490" class="${(j.params&&j.params.boltGrade==='A490')?'on':''}">A490</button></div>
|
|
3826
3831
|
<div class=hint style="margin:4px 0 0">Bolt length auto-sizes from the grip (AISC) → shown on the bolt callout.</div>
|
|
3827
|
-
|
|
3828
|
-
<div class="row f"><button class="ghostw" id="sprm_e${e}" data-tip="Delete this end's shear plate" style="color:#fca5a5;border-color:#7f1d1d">Remove shear plate</button></div>`;};
|
|
3829
|
-
|
|
3832
|
+
${gus?`<div class=hint style="margin:4px 0 0">The brace is set back to the support face automatically — a gusset has no erection gap to enter.</div>`:`<div class=elabrow><span class=elab>Opposite stiffener</span><label class=defck><input type=checkbox id="spck_e${e}"${st?' checked':''}>add</label></div>`}
|
|
3833
|
+
<div class="row f"><button class="ghostw" id="sprm_e${e}" data-tip="Delete this end's ${gus?'gusset':'shear plate'}" style="color:#fca5a5;border-color:#7f1d1d">Remove ${gus?'gusset':'shear plate'}</button></div>`;};
|
|
3834
|
+
// The intro reads per-KIND: a gusset has no erection clearance to explain and does not lap a web, so the
|
|
3835
|
+
// fin-plate wording above a gusset block was describing controls that are not there.
|
|
3836
|
+
const spAllGus=spjs.length>0&&spjs.every(x=>x.j.kind==='brace-gusset');
|
|
3837
|
+
const spIntro=spAllGus
|
|
3838
|
+
? 'Tune this end's gusset — millimetres; empty = engine default. The brace is set back to the support face automatically; <b>Lapped side</b> picks which face of the angle leg the plates sandwich.'
|
|
3839
|
+
: (spAllAuto?'Auto-added — millimetres; empty = engine default. <b>Clearance</b> = the gap (≈½–¾") so the beam clears the support; <b>Web side</b> picks which face of the web the plate laps. Clear all via <b>Clear shear plates</b> in the toolbar (AI-tuned plates are kept).':'Tune this end's shear plate — millimetres; empty = engine default. <b>Clearance</b> = the gap (≈½–¾") so the beam clears the support; <b>Web side</b> picks which face of the web the plate laps.');
|
|
3840
|
+
const spSect=spjs.length?`<div class=hint style="margin:8px 0 0">${spIntro}</div>${spjs.map(spBlock).join('')}`:'';
|
|
3830
3841
|
const _cps=(!col&&copesByMember[m.id])?copesByMember[m.id]:[]; // auto cope(s) on this beam (from the rendered scene)
|
|
3831
3842
|
const copeSect=_cps.length?`<div class=divrow><hr><span class=sect style="margin:0">Cope (auto)</span><hr></div><div class=hint style="margin:0 0 2px">${_cps.map(esc).join(' · ')} — auto, clash-driven so the beam clears the support.</div>`:'';
|
|
3832
3843
|
const rotN=((((+m.rot||0)%360)+360)%360); // [0,360) → drives the quick-chip highlight
|
|
@@ -4021,7 +4032,7 @@ function panel(){
|
|
|
4021
4032
|
// DECOUPLED (else an absent boltColPitch silently inherits boltPitch and later row-pitch edits move both).
|
|
4022
4033
|
if((Number(jj.params.boltCols)||1)>1&&jj.params.boltColPitch==null)jj.params.boltColPitch=jj.params.boltPitch!=null?jj.params.boltPitch:70;
|
|
4023
4034
|
jj.source='user';});};};
|
|
4024
|
-
['plateWidth','plateHeight','plateThickness','weldLeg','clearance','boltDia','boltPitch','boltColPitch'].forEach(k=>wsp(k,false));['boltCols','boltRows'].forEach(k=>wsp(k,true));
|
|
4035
|
+
['plateWidth','plateHeight','plateThickness','weldLeg','clearance','boltDia','boltPitch','boltColPitch'].forEach(k=>wsp(k,false));['boltCols','boltRows','plateCount'].forEach(k=>wsp(k,true));
|
|
4025
4036
|
{const setSide=(s)=>edit(()=>{const jj=(C.joints||[]).find(x=>x&&x.id===jid);if(!jj)return;if(!jj.params)jj.params={};jj.params.webSide=s;jj.source='user';}); // which face of the web the plate laps
|
|
4026
4037
|
const n=document.getElementById('spside_e'+e+'_n');if(n)n.onclick=()=>setSide(1);
|
|
4027
4038
|
const f=document.getElementById('spside_e'+e+'_f');if(f)f.onclick=()=>setSide(-1);}
|
|
@@ -4443,11 +4454,11 @@ function openPropLabels(x,y){if(!selArr().length)return;propPopConn=null;const e
|
|
|
4443
4454
|
// connection props onto the model is a member-keyed pipeline → deferred; this is a VIEW, not a picker. ----
|
|
4444
4455
|
function connPropRows(cs){
|
|
4445
4456
|
const j=cs.joint,isBP=cs.kind==='base-plate',pp=(j&&j.params)||{}; // tolerate a missing joint (orphaned part) rather than throw
|
|
4446
|
-
const plate=(partsById||{})[cs.conn+':plate']||null;
|
|
4457
|
+
const plate=(partsById||{})[cs.conn+':plate']||(partsById||{})[cs.conn+':plateA']||null; // …same for the gusset pair
|
|
4447
4458
|
const dim=mm=>(mm==null?'—':fmtFtIn(Number(mm)/25.4));
|
|
4448
4459
|
const cols=pp.boltCols||(isBP?2:1),rows=pp.boltRows||(isBP?2:3);
|
|
4449
4460
|
return [
|
|
4450
|
-
{label:'Type', value:
|
|
4461
|
+
{label:'Type', value:connKindLabel(cs.kind)},
|
|
4451
4462
|
{label:'On member', value:cs.main},
|
|
4452
4463
|
{label:'Plate width', value:plate?dim(plate.width):'—'},
|
|
4453
4464
|
{label:'Plate height', value:plate?dim(plate.depth):'—'},
|
|
@@ -4474,7 +4485,7 @@ function renderConnTree(el){
|
|
|
4474
4485
|
el.querySelector('#ppList').innerHTML='<div class=ppempty>No connection selected.</div>';return; }
|
|
4475
4486
|
const q=(el.querySelector('#ppSearch').value||'').trim().toLowerCase();
|
|
4476
4487
|
const single=t.conns.length===1&&!t.members.length;
|
|
4477
|
-
const kindName=k=>k
|
|
4488
|
+
const kindName=k=>connKindLabel(k);
|
|
4478
4489
|
const nSel=t.conns.length+t.members.length, rowMatch=s=>!q||String(s).toLowerCase().includes(q), sw='<span class=tsw></span>';
|
|
4479
4490
|
el.querySelector('#ppTitle').textContent=single?('Properties · '+kindName(t.conns[0].kind)):('Properties · '+nSel+' objects');
|
|
4480
4491
|
el.querySelector('#ppScope').textContent=single?('On '+t.conns[0].main):(t.conns.length+' connection'+(t.conns.length===1?'':'s')+(t.members.length?(' · '+t.members.length+' member'+(t.members.length===1?'':'s')):''));
|
|
@@ -5629,7 +5640,11 @@ reflectOriginGrid();
|
|
|
5629
5640
|
// retroactively deselect an already-selected object (render() paints from selIds as-is). Type lists are dynamic. ---
|
|
5630
5641
|
const selBar=document.getElementById('selBar'),selFly=document.getElementById('selFly');
|
|
5631
5642
|
var selFilterReady=false; // armed by the deferred first reflect below; render() checks it so its per-edit reflect only runs once the Select-bar is initialised. In the current flow the first paint runs after this line (reads false); `var` (not let/const) is defensive — render() is defined earlier, so if it ever ran before this line it would read undefined (falsy), not throw a TDZ error.
|
|
5632
|
-
const CONN_KIND_LABEL={'base-plate':'Base plate','shear-plate':'Shear plate','custom':'Imported'};
|
|
5643
|
+
const CONN_KIND_LABEL={'base-plate':'Base plate','shear-plate':'Shear plate','brace-gusset':'Gusset plate','custom':'Imported'};
|
|
5644
|
+
// Every connection label in this file goes through here. They used to be open-coded ternaries whose ELSE
|
|
5645
|
+
// branch said 'Shear plate', so the moment a third parametric kind existed the inspector announced a
|
|
5646
|
+
// brace gusset as a shear plate — the right geometry under the wrong name, which is worse than no label.
|
|
5647
|
+
function connKindLabel(k){return CONN_KIND_LABEL[String(k||'').trim().toLowerCase()]||'Connection';}
|
|
5633
5648
|
function connKindRecords(){const seen=new Map();for(const j of ((typeof C!=='undefined'&&C&&C.joints)||[])){const k=normConnKind(j&&j.kind);if(k&&!seen.has(k))seen.set(k,CONN_KIND_LABEL[k]||labelFromMemberTypeKey(k));}return [...seen].map(([k,label])=>({k,label}));}
|
|
5634
5649
|
function selGroupDef(grp){return grp==='members'
|
|
5635
5650
|
? {title:'Members',all:'All member types',store:selFilter.mtype,records:memberTypeRecords(),empty:'No member types'}
|
|
@@ -5913,6 +5928,18 @@ const view3dApi={
|
|
|
5913
5928
|
edit(()=>{C.joints=(Array.isArray(C.joints)?C.joints:[]).filter(x=>!(x&&x.kind==='shear-plate'&&x.main===beam.id&&x.at==='end'+endIdx));C.joints.push(joint);selIds=new Set();});
|
|
5914
5929
|
toast((had?'Shear plate on '+beam.id+' '+(endIdx?'end':'start')+' replaced with “'+f.name+'”':'“'+f.name+'” applied to '+beam.id+' '+(endIdx?'end':'start'))+' — click another beam end, or Esc');return;
|
|
5915
5930
|
}
|
|
5931
|
+
if(f.kind==='brace-gusset'){
|
|
5932
|
+
const _pk=pick.anchorId?P.members.find(m=>m&&m.id===pick.anchorId):null;
|
|
5933
|
+
const br=(_pk&&_pk.role==='beam'&&isBrace(_pk))?_pk:null; // the ONE kind whose host is a brace — a plain beam wants a shear plate instead
|
|
5934
|
+
if(!br){toast(_pk?'A gusset goes on a BRACE end — click a brace':'Click a brace end to place this gusset');return;}
|
|
5935
|
+
const id='cx'+Date.now().toString(36)+Math.floor(Math.random()*1e4).toString(36);
|
|
5936
|
+
const g=partsById[br.id],d3=(a,b)=>a&&b?Math.hypot(a[0]-b[0],a[1]-b[1],a[2]-b[2]):Infinity;
|
|
5937
|
+
const endIdx=(g&&g.from&&g.to&&d3(pick.point,g.to)<d3(pick.point,g.from))?1:0;
|
|
5938
|
+
const joint={id,kind:'brace-gusset',main:br.id,at:'end'+endIdx,params:Object.assign({},f.params||{}),source:'user'};
|
|
5939
|
+
pendingConnSel=id;const had=(C.joints||[]).some(x=>x&&x.kind==='brace-gusset'&&x.main===br.id&&x.at==='end'+endIdx);
|
|
5940
|
+
edit(()=>{C.joints=(Array.isArray(C.joints)?C.joints:[]).filter(x=>!(x&&x.kind==='brace-gusset'&&x.main===br.id&&x.at==='end'+endIdx));C.joints.push(joint);selIds=new Set();});
|
|
5941
|
+
toast((had?'Gusset on '+br.id+' '+(endIdx?'end':'start')+' replaced with “'+f.name+'”':'“'+f.name+'” applied to '+br.id+' '+(endIdx?'end':'start'))+' — the engine sets the brace back to the beam face; click another brace end, or Esc');return;
|
|
5942
|
+
}
|
|
5916
5943
|
if(f.kind==='custom'&&Array.isArray(f.geometry)&&f.geometry.length){
|
|
5917
5944
|
const id='cx'+Date.now().toString(36)+Math.floor(Math.random()*1e4).toString(36);
|
|
5918
5945
|
const joint={id,kind:'custom',name:f.name||'Imported connection',place:pick.point,geometry:f.geometry,source:'user'};
|
|
@@ -6511,14 +6538,15 @@ let favQuery=''; // transient Favourites search filter — NOT per
|
|
|
6511
6538
|
let favSearchOpen=false; // is the search input revealed?
|
|
6512
6539
|
let favKindFilter=(()=>{try{const k=localStorage.getItem('floless.favKind');return (k==='portable'||k==='geometry')?k:'all';}catch{return 'all';}})();
|
|
6513
6540
|
let armedFavId=null; // the favourite whose placement crosshair is armed (persistent .armed row) — transient
|
|
6514
|
-
const FAV_KIND_LABEL={'base-plate':'Base plate','shear-plate':'Shear plate','custom':'Custom (imported)'};
|
|
6515
|
-
const FAV_KIND_COLOR={'base-plate':'#6b7a8d','shear-plate':'#7d8ba0','custom':'#8a97a8'}; // mirror steel-joints.ts GROUPS
|
|
6516
|
-
const FAV_CAT_SUGGEST={'base-plate':['Base plates','Columns'],'shear-plate':['Shear plates','Beams'],'custom':['Imported','Details']};
|
|
6517
|
-
function
|
|
6541
|
+
const FAV_KIND_LABEL={'base-plate':'Base plate','shear-plate':'Shear plate','brace-gusset':'Gusset plate','custom':'Custom (imported)'};
|
|
6542
|
+
const FAV_KIND_COLOR={'base-plate':'#6b7a8d','shear-plate':'#7d8ba0','brace-gusset':'#94a2b7','custom':'#8a97a8'}; // mirror steel-joints.ts GROUPS
|
|
6543
|
+
const FAV_CAT_SUGGEST={'base-plate':['Base plates','Columns'],'shear-plate':['Shear plates','Beams'],'brace-gusset':['Gusset plates','Braces'],'custom':['Imported','Details']};
|
|
6544
|
+
function favHostNoun(k){return k==='base-plate'?'column':k==='brace-gusset'?'brace':'beam';}
|
|
6545
|
+
function favIsPortable(f){return !!f&&(f.kind==='base-plate'||f.kind==='shear-plate'||f.kind==='brace-gusset');}
|
|
6518
6546
|
// The saved-recipe payload captured from a selected whole connection: recipe scalars, or an opaque custom mesh.
|
|
6519
6547
|
function favRecipeOf(j){if(!j)return null;
|
|
6520
6548
|
if(j.kind==='custom')return {kind:'custom',geometry:Array.isArray(j.geometry)?j.geometry:[],name:j.name||'Imported connection'};
|
|
6521
|
-
if(j.kind==='base-plate'||j.kind==='shear-plate')return {kind:j.kind,params:Object.assign({},j.params||{})};
|
|
6549
|
+
if(j.kind==='base-plate'||j.kind==='shear-plate'||j.kind==='brace-gusset')return {kind:j.kind,params:Object.assign({},j.params||{})};
|
|
6522
6550
|
return null;}
|
|
6523
6551
|
// A key-order-STABLE JSON of a params object, so the ★ Saved/Save match survives a disk round-trip (a reloaded
|
|
6524
6552
|
// favourite's params can serialize its keys in a different order than the live joint's — which would flip the ★
|
|
@@ -6536,7 +6564,7 @@ let favModalEditId=null; // an existing favourite id (edit mode — rename/reca
|
|
|
6536
6564
|
function favSuggestName(j){if(!j)return '';
|
|
6537
6565
|
if(j.kind==='custom')return j.name||'Imported connection';
|
|
6538
6566
|
const prof=((P.members||[]).find(m=>m&&m.id===j.main)||{}).profile||'';
|
|
6539
|
-
return (j.kind
|
|
6567
|
+
return connKindLabel(j.kind)+(prof?' — '+prof:'');}
|
|
6540
6568
|
function favFillModal({title,kind,name,category,portable,hint}){
|
|
6541
6569
|
document.getElementById('favModalTitle').textContent=title;
|
|
6542
6570
|
const kf=document.getElementById('favKind');kf.className='chip';kf.textContent=FAV_KIND_LABEL[kind]||kind;
|
|
@@ -6553,12 +6581,12 @@ function openFavModalFor(j){if(!j){toast('Select a connection first');return;}
|
|
|
6553
6581
|
const existing=favMatch(j);favModalJoint=j;favModalEditId=existing?existing.id:null;
|
|
6554
6582
|
const portable=j.kind!=='custom';
|
|
6555
6583
|
const hint=j.kind==='custom'?'Imported geometry — drops in place at the clicked point; won’t parametrically re-fit.'
|
|
6556
|
-
:'Parametric — re-fits any
|
|
6584
|
+
:('Parametric — re-fits any '+favHostNoun(j.kind)+' you apply it to.');
|
|
6557
6585
|
favFillModal({title:existing?'Edit favourite':'Save to Favourites',kind:j.kind,name:existing?existing.name:favSuggestName(j),category:existing?existing.category:'',portable,hint});}
|
|
6558
6586
|
// From a Favourites row ⋯ → rename/recategorize an existing favourite (edit mode; no joint needed).
|
|
6559
6587
|
function openFavModalEdit(f){if(!f)return;favModalJoint=null;favModalEditId=f.id;
|
|
6560
6588
|
favFillModal({title:'Edit favourite',kind:f.kind,name:f.name,category:f.category,portable:favIsPortable(f),
|
|
6561
|
-
hint:f.kind==='custom'?'Imported geometry — drops in place; won’t parametrically re-fit.':'Parametric — re-fits any
|
|
6589
|
+
hint:f.kind==='custom'?'Imported geometry — drops in place; won’t parametrically re-fit.':('Parametric — re-fits any '+favHostNoun(f.kind)+'.')});}
|
|
6562
6590
|
function favModalClose(){document.getElementById('favConnModal').style.display='none';favModalJoint=null;favModalEditId=null;}
|
|
6563
6591
|
function favModalIsOpen(){const m=document.getElementById('favConnModal');return !!m&&m.style.display==='flex';}
|
|
6564
6592
|
async function favModalSave(){const name=(document.getElementById('favName').value||'').trim();
|