@floless/app 0.125.0 → 0.126.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/dist/floless-server.cjs +147 -69
- package/dist/schemas/steel.model.v2.schema.json +3 -1
- package/dist/skills/floless-app-steel-takeoff/SKILL.md +56 -7
- package/dist/web/app.css +38 -0
- package/dist/web/aware.js +182 -13
- package/dist/web/steel-3d-core.js +29 -0
- package/dist/web/steel-3d-view.js +36 -8
- package/dist/web/steel-editor.html +298 -105
- package/dist/web/workspaces.js +82 -13
- package/package.json +2 -1
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
#detOpacity{flex:1;min-width:0} /* SIZING only — the theming is the global input[type=range] rule below */
|
|
53
53
|
#zoombar #zPct{min-width:40px;text-align:right;color:var(--mut);font-variant-numeric:tabular-nums}
|
|
54
54
|
/* Connection Component breadcrumb (Slice A) — a floating chip over the 3D canvas, same recipe as #zoombar. */
|
|
55
|
-
#connCrumb{position:absolute;left:50%;top:48px;transform:translateX(-50%);display:none;align-items:center;gap:1px;max-width:min(72%,560px);background:var(--panel);border:1px solid var(--line);border-radius:8px;padding:4px 10px;box-shadow:0 4px 14px rgba(0,0,0,.45);z-index:58;font-size:12px;white-space:nowrap;overflow:hidden} /* below #m3dBar (top:12,h~29,z:59); z:58 keeps it clickable above the
|
|
55
|
+
#connCrumb{position:absolute;left:50%;top:48px;transform:translateX(-50%);display:none;align-items:center;gap:1px;max-width:min(72%,560px);background:var(--panel);border:1px solid var(--line);border-radius:8px;padding:4px 10px;box-shadow:0 4px 14px rgba(0,0,0,.45);z-index:58;font-size:12px;white-space:nowrap;overflow:hidden} /* below #m3dBar (top:12,h~29,z:59); z:58 keeps it clickable above the model-glued label chips, which sit under the 3D chrome at z:3-4 (#614) */
|
|
56
56
|
#connCrumb .seg{color:var(--mut);cursor:pointer;padding:1px 4px;border-radius:4px;background:none;border:0;font:inherit;max-width:260px;overflow:hidden;text-overflow:ellipsis}
|
|
57
57
|
#connCrumb .seg:hover{color:var(--text);text-decoration:underline}
|
|
58
58
|
#connCrumb .seg.cur{color:var(--brand);font-weight:600;cursor:default;text-decoration:none}
|
|
@@ -804,7 +804,7 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
|
|
|
804
804
|
circle.handle.ep-end{fill:#f472b6;stroke:#0b1220;stroke-width:2}
|
|
805
805
|
.epdot{display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:5px;vertical-align:middle}
|
|
806
806
|
/* 3D-only floating chrome (parity with AWARE viewer-3d): toolbar TL, legend BL, ViewCube BR */
|
|
807
|
-
#m3dBar{position:absolute;top:12px;left:12px;right:12px;display:none;flex-wrap:wrap;gap:6px;align-items:center;z-index:59} /* bounded to the stage so narrow windows wrap this local toolbar instead of widening the whole document; above
|
|
807
|
+
#m3dBar{position:absolute;top:12px;left:12px;right:12px;display:none;flex-wrap:wrap;gap:6px;align-items:center;z-index:59} /* bounded to the stage so narrow windows wrap this local toolbar instead of widening the whole document; above the model-glued label chips (z:3-4, under the 3D chrome — #614), below toasts (60) */
|
|
808
808
|
#m3dBar .seg-group,#m3dBar>button{box-shadow:0 4px 14px rgba(0,0,0,.45)}
|
|
809
809
|
#m3dBar>button{font-size:12px;padding:5px 9px}
|
|
810
810
|
#m3dBar .m3dwrap{position:relative;display:inline-flex}
|
|
@@ -2240,9 +2240,24 @@ async function boot() {
|
|
|
2240
2240
|
} catch (_) { /* no target goal shown */ }
|
|
2241
2241
|
}
|
|
2242
2242
|
PAL = (Array.isArray(C.palette) && C.palette.length) ? C.palette : DEFAULT_PAL; WT = C.weights || {};
|
|
2243
|
-
|
|
2243
|
+
// Without this table almost nothing resolves: every HSS/L/2L/PIPE loses its weight, every column
|
|
2244
|
+
// loses its real footprint, and a PIPE's nominal size gets believed as its diameter. That state used
|
|
2245
|
+
// to be reached by an empty `catch` and was indistinguishable from a healthy load — the header stat
|
|
2246
|
+
// simply read a smaller tonnage. It is now recorded, so the RFI list can say "the table did not
|
|
2247
|
+
// load" instead of "check the designation". (silent-failure review)
|
|
2248
|
+
try {
|
|
2249
|
+
const _sr = await fetch('/api/aisc-shapes');
|
|
2250
|
+
if (!_sr.ok) throw new Error('HTTP ' + _sr.status);
|
|
2251
|
+
const _sj = await _sr.json();
|
|
2252
|
+
if (!_sj.weights || typeof _sj.weights !== 'object' || !_sj.sections || typeof _sj.sections !== 'object') throw new Error('payload missing weights/sections');
|
|
2253
|
+
window.__AISC_WEIGHTS = _sj.weights;
|
|
2254
|
+
window.__AISC_SECTIONS = _sj.sections;
|
|
2255
|
+
} catch (e) {
|
|
2256
|
+
window.__AISC_LOAD_FAILED = true;
|
|
2257
|
+
console.warn('AISC shape table failed to load — sizes and weights are unavailable:', e && e.message ? e.message : e);
|
|
2258
|
+
}
|
|
2244
2259
|
// No weight seeding needed: every RFI/weight read resolves through _wt(), which falls back to the
|
|
2245
|
-
//
|
|
2260
|
+
// AISC catalogue weight for any tabulated designation the contract's weights map does not carry.
|
|
2246
2261
|
C.custom_details = C.custom_details || {};
|
|
2247
2262
|
C.profile_colors = C.profile_colors || {};
|
|
2248
2263
|
if(!C.member_styles||typeof C.member_styles!=='object'||Array.isArray(C.member_styles))C.member_styles={}; // F5: per member-type 2D line style {weight,dash} — model-global, draft-only (stripped at bake like prop_labels). boot() only object-guards; main() sanitizes the tokens/keys (sanitizeMemberStyles lives in main()'s scope)
|
|
@@ -2535,8 +2550,7 @@ function main() {
|
|
|
2535
2550
|
*
|
|
2536
2551
|
* v2's schema CLOSED both of those. Running v1's repair pass over a v2 document therefore does exactly the
|
|
2537
2552
|
* wrong thing in both directions, and it is not theoretical — it is what the schema check measured:
|
|
2538
|
-
* - it ADDS keys v2 forbids: `
|
|
2539
|
-
* `views[].projection` (v2 keeps the projection inside `camera.proj`);
|
|
2553
|
+
* - it ADDS keys v2 forbids: `views[].projection` (v2 keeps the projection inside `camera.proj`);
|
|
2540
2554
|
* - it DROPS a key v2 requires: `views[].generated.axisId`, because v1's generated-view provenance is
|
|
2541
2555
|
* keyed by label and elevation, and a canonical grid is referenced by stable axis id instead.
|
|
2542
2556
|
* The second is data loss, and both land before the user has done anything — so the first save is refused
|
|
@@ -2544,6 +2558,12 @@ function main() {
|
|
|
2544
2558
|
*
|
|
2545
2559
|
* A v2 document does not need the pass: it arrives SERVER-VALIDATED (P7b validates schema plus referential
|
|
2546
2560
|
* integrity on every PUT), which is a stronger guarantee than any of these clamps.
|
|
2561
|
+
*
|
|
2562
|
+
* EXCEPT `sanitizePropLabels`, WHICH NOW RUNS ON BOTH (#614). It was on this list for one key —
|
|
2563
|
+
* `prop_labels.vis2d`/`vis3d`, v1's per-view label visibility, which v2's closed `propLabels` refused.
|
|
2564
|
+
* The schema carries both now, so nothing it writes is forbidden, and skipping it is what left
|
|
2565
|
+
* `C.prop_labels` possibly absent on a v2 document while the label readers dereference `pl.props`. See
|
|
2566
|
+
* its call site for the full argument.
|
|
2547
2567
|
*/
|
|
2548
2568
|
if(!MODEL_V2)C.member_styles=sanitizeMemberStyles(C.member_styles); // v2 arrives closed + validated; v1 needs repair
|
|
2549
2569
|
let P, X0,Y0,X1,Y1, FT, RB64, EXTX, EXTY, profs, NO_PLAN_VIEW=false; // per-plan, set by setPlan()
|
|
@@ -3390,6 +3410,14 @@ function applyDraftFields(d){
|
|
|
3390
3410
|
const candidate=structuredClone(C);
|
|
3391
3411
|
const rootKeys=['members','grid','custom_details','profile_colors','member_styles','member_types','target_confidence','dims3d','dim_overlays','dim_style','prop_labels','joints','connections','detail_placements','views'];
|
|
3392
3412
|
for(const key of rootKeys)if(key in d)candidate[key]=structuredClone(d[key]);
|
|
3413
|
+
// …EXCEPT `prop_labels`, WHICH IS SANITISED LIKE THE v1 ARM DOES (#614). A draft is unvalidated
|
|
3414
|
+
// localStorage, and this restore runs AFTER the boot-time sanitise — so a raw copy re-introduces
|
|
3415
|
+
// exactly the shape that sanitise exists to prevent: `prop_labels` with no `props`, which
|
|
3416
|
+
// `renderPropLabels` dereferences on the next repaint. Reachable today, not hypothetically: a
|
|
3417
|
+
// migrated document legitimately has no `props` (remapPropLabels emits it only when the v1 side had
|
|
3418
|
+
// an array), and any draft written by a build that did not sanitise on v2 carries that shape
|
|
3419
|
+
// forward. The v1 arm below has always done this; the asymmetry was the bug. (Found by review.)
|
|
3420
|
+
if('prop_labels' in d)candidate.prop_labels=sanitizePropLabels(d.prop_labels);
|
|
3393
3421
|
// REFERENCES ARE RECONCILED, NEVER REPLACED — and this is not tidiness, it is a reference that
|
|
3394
3422
|
// vanished in front of me. Which references EXIST is the server's answer: insert and remove are
|
|
3395
3423
|
// routes that write the contract themselves, and `adoptReferenceWrite` then re-points this draft at
|
|
@@ -3864,25 +3892,47 @@ function len(a,b){return Math.hypot(a[0]-b[0],a[1]-b[1]);}
|
|
|
3864
3892
|
// ── Column profile sections ─────────────────────────────────────────────────────────────────────
|
|
3865
3893
|
// A column is drawn on the plan as its profile-SECTION footprint (I/box/channel/angle/tube), not a
|
|
3866
3894
|
// point. `profileDimsIn` MIRRORS server/contract-to-scene.ts `profileDimsIn` (KEEP IN LOCK-STEP —
|
|
3867
|
-
// same parse rules) → {w,d} in INCHES; window.
|
|
3895
|
+
// same parse rules) → {w,d} in INCHES; window.__AISC_SECTIONS is the {designation→[d,w]} map from
|
|
3868
3896
|
// /api/aisc-shapes. Returns null for an unresolved mark (RFI).
|
|
3897
|
+
// The AISC table's key form. MIRRORS server/aisc-sections.ts `canonicalDesignation` — the table is
|
|
3898
|
+
// keyed by it, so anything short of the same fold turns a known section into an unknown one, silently:
|
|
3899
|
+
// a designation typed with an en-dash or a prime still READS correctly on screen while its member
|
|
3900
|
+
// loses its weight and its real dims.
|
|
3901
|
+
// Also the normaliser every profile INPUT commits through. Those used to do their own
|
|
3902
|
+
// `.toUpperCase().replace(/ /g,'')`, which strips the space out of a mixed fraction before anything
|
|
3903
|
+
// can read it: typing "HSS3 1/2X3 1/2X1/4" stored the string "HSS31/2X31/2X1/4" — not a designation
|
|
3904
|
+
// any table has, and not one the fold below can repair, because the whitespace it needs is already
|
|
3905
|
+
// gone. The member then read as an unknown size forever, in a contract that had silently recorded a
|
|
3906
|
+
// mangled profile. Found by the independent QA pass; the author's own E2E seeded contracts directly
|
|
3907
|
+
// and never went through the box. (QA E2E §5b)
|
|
3908
|
+
function _canonDes(s){return String(s==null?'':s).trim().toUpperCase()
|
|
3909
|
+
.replace(/[×✕✖]/g,'X').replace(/[‐-―−]/g,'-').replace(/[‘’ʹ′]/g,"'").replace(/[“”ʺ″]/g,'"')
|
|
3910
|
+
.replace(/ /g,' ').replace(/(\d)\s+(\d+\/\d+)/g,'$1-$2').replace(/\s+/g,'');}
|
|
3911
|
+
function _aiscSec(key){return (window.__AISC_SECTIONS||{})[key];}
|
|
3869
3912
|
function profileDimsIn(profile){
|
|
3870
3913
|
if(!profile)return null;
|
|
3871
3914
|
const p=String(profile).trim().toUpperCase().replace(/[×✕✖]/g,'X'); // separator may be x / X / × / ✕ / ✖ — the SAME fold as server contract-to-scene profileDimsIn, or the two disagree about which designations resolve
|
|
3872
3915
|
if(p===''||/(^|[^A-Z])MF($|[^A-Z])/.test(p))return null;
|
|
3873
3916
|
const m=p.match(/^([A-Z]+)\s*(.+)$/);if(!m)return null;
|
|
3874
|
-
// parseDim (not parseFloat) so a mixed-fraction leg "3 1/2" → 3.5, not 3 —
|
|
3875
|
-
|
|
3876
|
-
const
|
|
3917
|
+
// parseDim (not parseFloat) so a mixed-fraction leg "3 1/2" or the Manual's "3-1/2" → 3.5, not 3 —
|
|
3918
|
+
// mirrors server aisc-sections parseDim.
|
|
3919
|
+
const _pd=t=>{const s=String(t).trim();let mm=s.match(/^(\d+)(?:\s+|-)(\d+)\/(\d+)$/);if(mm)return +mm[1]+ +mm[2]/+mm[3];mm=s.match(/^(\d+)\/(\d+)$/);if(mm)return +mm[1]/+mm[2];const d=parseFloat(s);return isFinite(d)?d:null;};
|
|
3920
|
+
const prefix=m[1],key=_canonDes(profile),nums=m[2].split('X').map(_pd).filter(n=>n!=null);
|
|
3877
3921
|
if(!nums.length)return null;
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3922
|
+
// The TABLE answers first — the name is only as good as the glyphs it was typed with. `p` folds the
|
|
3923
|
+
// multiplication sign but not the dash class, so an en-dashed "L5X3–1/2X1/4" (what OCR and vision
|
|
3924
|
+
// reads emit) parsed its short leg as a flat 3 and drew half an inch narrow with nothing to say so.
|
|
3925
|
+
if((prefix==='HSS'||prefix==='TUBE'||prefix==='L')&&nums.length>=3){const sec=_aiscSec(key);return sec?{d:sec[0],w:sec[1]}:{d:nums[0],w:nums[1]};}
|
|
3926
|
+
// A PIPE names its NOMINAL PIPE SIZE, not its outside diameter — a Pipe4STD measures 4.5" across —
|
|
3927
|
+
// so the table is the only honest source. A round HSS is the opposite: its name states the OD
|
|
3928
|
+
// exactly (6.625") where the table rounds to three figures, so the name wins there.
|
|
3929
|
+
if(prefix==='PIPE'){const sec=_aiscSec(key);return sec?{d:sec[0],w:sec[1]}:{d:nums[0],w:nums[0]};}
|
|
3930
|
+
if(prefix==='HSS'){const dia=nums[0];return{d:dia,w:dia};}
|
|
3931
|
+
if(/^(W|S|M|HP|C|MC|WT|ST|MT)$/.test(prefix)){
|
|
3881
3932
|
// ACTUAL AISC depth+width when tabulated (the leading number is the NOMINAL series depth). Mirrors
|
|
3882
|
-
// server sectionDimsIn → __AISC_SECTIONS {designation:[d,
|
|
3883
|
-
const sec=(
|
|
3884
|
-
const d=nums[0],
|
|
3885
|
-
if(bf!==undefined)return{d,w:bf};const ratio=(prefix==='C'||prefix==='MC')?0.28:0.42;return{d,w:d*ratio};}
|
|
3933
|
+
// server sectionDimsIn → __AISC_SECTIONS {designation:[d,w]} from /api/aisc-shapes.
|
|
3934
|
+
const sec=_aiscSec(key);if(sec)return{d:sec[0],w:sec[1]};
|
|
3935
|
+
const d=nums[0],ratio=(prefix==='C'||prefix==='MC')?0.28:0.42;return{d,w:d*ratio};}
|
|
3886
3936
|
return null;
|
|
3887
3937
|
}
|
|
3888
3938
|
// True when profileDimsIn had to GUESS this profile's width from a per-series ratio (0.42d for W, 0.28d
|
|
@@ -3909,9 +3959,15 @@ function sectionKindOf(profile){const p=String(profile||'').toUpperCase().trim()
|
|
|
3909
3959
|
function sectionShapePts(profile,w,d){const hw=w/2,hd=d/2,kind=sectionKindOf(profile);
|
|
3910
3960
|
if(kind==='I'){const tf=Math.min(d*0.5,Math.max(d*0.10,6)),tw=Math.min(w*0.5,Math.max(w*0.10,5));
|
|
3911
3961
|
return [[-hw,-hd],[hw,-hd],[hw,-hd+tf],[tw/2,-hd+tf],[tw/2,hd-tf],[hw,hd-tf],[hw,hd],[-hw,hd],[-hw,hd-tf],[-tw/2,hd-tf],[-tw/2,-hd+tf],[-hw,-hd+tf]];}
|
|
3912
|
-
|
|
3962
|
+
// The `Math.min(…*0.5, …)` clamps are not decoration — the floors below (5, 6) are FLAT px minimums
|
|
3963
|
+
// so a section still reads at small zoom, and on a small section at a coarse scale the floor exceeds
|
|
3964
|
+
// the section itself. An unclamped thickness pushes the inner corner past the outline, so the drawn
|
|
3965
|
+
// footprint comes out BIGGER than the member: an L4X4X3/8 at pt_per_ft 12 measured 5"x5" instead of
|
|
3966
|
+
// 4"x4". The I branch has always clamped; these two never did, and it stayed invisible while an angle
|
|
3967
|
+
// or channel column had no resolvable footprint to draw at all — which #627 changed. (QA E2E §2)
|
|
3968
|
+
if(kind==='C'){const tf=Math.min(d*0.5,Math.max(d*0.10,5)),tw=Math.min(w*0.5,Math.max(w*0.12,5));
|
|
3913
3969
|
return [[-hw,-hd],[hw,-hd],[hw,-hd+tf],[-hw+tw,-hd+tf],[-hw+tw,hd-tf],[hw,hd-tf],[hw,hd],[-hw,hd]];}
|
|
3914
|
-
if(kind==='L'){const
|
|
3970
|
+
if(kind==='L'){const mn=Math.min(w,d),t=Math.min(mn*0.5,Math.max(mn*0.18,5));
|
|
3915
3971
|
return [[-hw,-hd],[hw,-hd],[hw,-hd+t],[-hw+t,-hd+t],[-hw+t,hd],[-hw,hd]];}
|
|
3916
3972
|
return [[-hw,-hd],[hw,-hd],[hw,hd],[-hw,hd]];} // TUBE/BOX → rectangle
|
|
3917
3973
|
// Column plan polygon (absolute px). Primary: derive from profile + pt_per_ft + rot. Fallback: a small
|
|
@@ -3945,7 +4001,12 @@ function columnSectionPoly(m){
|
|
|
3945
4001
|
return pts.map(([x,y])=>[cx+x*cs-y*sn,cy+x*sn+y*cs]);
|
|
3946
4002
|
}
|
|
3947
4003
|
const r=ppf?Math.max(6,(6/12)*ppf):8; // ~6" or a floor, so it stays visible even unscaled
|
|
3948
|
-
|
|
4004
|
+
// Tagged, because this square claims no size and the caller cannot tell that by looking at it. It used
|
|
4005
|
+
// to be reachable only for a member that was ALSO an RFI, which is drawn dashed and listed for the user
|
|
4006
|
+
// — the marker never had to speak for itself. A double angle broke that pairing (#627): its weight
|
|
4007
|
+
// resolves exactly while AISC tabulates no back-to-back spacing for the pair, so it draws a plain,
|
|
4008
|
+
// fully-resolved-looking marker at a size nobody chose. The caller says so in a tooltip.
|
|
4009
|
+
return Object.assign([[cx-r,cy-r],[cx+r,cy-r],[cx+r,cy+r],[cx-r,cy+r]],{placeholder:true});
|
|
3949
4010
|
}
|
|
3950
4011
|
const _polyStr=pts=>pts.map(p=>p[0].toFixed(1)+','+p[1].toFixed(1)).join(' ');
|
|
3951
4012
|
// Vector overlay: render THIS sheet's filter linework crisply (sharp, snappable, measurable) instead of
|
|
@@ -4897,13 +4958,23 @@ function render(){
|
|
|
4897
4958
|
s+=gridSvg(); // structural grid under the linework (members/dims stay on top)
|
|
4898
4959
|
for(const sg of P.segments) s+=`<line class=seg data-seg="${sg.id}" x1="${sg.a[0]}" y1="${sg.a[1]}" x2="${sg.b[0]}" y2="${sg.b[1]}"/>`;
|
|
4899
4960
|
for(const m of P.members){const c=colorFor(m.profile);const sel=selIds.has(m.id);const fh=findHits.has(m.id);const on=sel||fh;const g=on?` style="filter:drop-shadow(0 0 3px ${c}) drop-shadow(0 0 8px ${c})"`:'';
|
|
4961
|
+
// RFI is DERIVED here, not read off the member. `m.rfi` is a persisted contract field, written at
|
|
4962
|
+
// edit time and never recomputed on load — so every HSS/L/2L/PIPE profiled before the catalogue was
|
|
4963
|
+
// completed still carries rfi:true (#627). The RFI pill, the RFI list and the confidence panel all
|
|
4964
|
+
// recompute through _wt, so reading the stored flag here drew those members dashed-and-unresolved
|
|
4965
|
+
// on a canvas whose own counter said there were none, with no row anywhere to clear it. One source
|
|
4966
|
+
// of truth for "is this an RFI", and it is the same one everything else already uses. (code review)
|
|
4967
|
+
const rfi=_wt(m.profile)==null;
|
|
4900
4968
|
if(isBrace(m)){s+=braceSymbol(m,c,g);continue;} // a brace draws as its distinct symbol (dashed=below-floor + hi/lo arrows), not a plain line (B4)
|
|
4901
4969
|
if(m.role==='column'){const pts=columnSectionPoly(m); // a column draws as its profile-section footprint, not a line
|
|
4902
|
-
|
|
4970
|
+
// A placeholder footprint on a member that is NOT an RFI reads as a real, small section — the size is
|
|
4971
|
+
// the one thing on this canvas it cannot be trusted for, so it says so rather than looking resolved.
|
|
4972
|
+
const _ph=(pts&&pts.placeholder&&!rfi)?` data-tip="Footprint shown as a placeholder — the AISC table gives no footprint for this shape. Its weight and length are still exact."`:'';
|
|
4973
|
+
if(pts){s+=`<polygon class="member${rfi?' rfi':''}${sel?' sel':''}${fh?' find-hit':''}" data-id="${m.id}" points="${_polyStr(pts)}" fill="${c}" stroke="${c}"${g}${_ph}/>`;continue;}}
|
|
4903
4974
|
const ls=memberLineStyle(m); // F5: category line weight/dash. Inline style (NOT a presentation attr) so it beats line.member/.sel CSS width; the glow still cues selection.
|
|
4904
|
-
const _fx=on?`filter:drop-shadow(0 0 3px ${c}) drop-shadow(0 0 8px ${c});`:'', _sw=(ls&&ls.w)?`stroke-width:${ls.w}px;`:'', _sd=(ls&&ls.d&&!
|
|
4975
|
+
const _fx=on?`filter:drop-shadow(0 0 3px ${c}) drop-shadow(0 0 8px ${c});`:'', _sw=(ls&&ls.w)?`stroke-width:${ls.w}px;`:'', _sd=(ls&&ls.d&&!rfi)?`stroke-dasharray:${ls.d};`:''; // RFI keeps its semantic 10 6 dash
|
|
4905
4976
|
const _sty=(_fx||_sw||_sd)?` style="${_fx}${_sw}${_sd}"`:'';
|
|
4906
|
-
s+=`<line class="member${
|
|
4977
|
+
s+=`<line class="member${rfi?' rfi':''}${sel?' sel':''}${fh?' find-hit':''}" data-id="${m.id}" x1="${m.wp[0][0]}" y1="${m.wp[0][1]}" x2="${m.wp[1][0]}" y2="${m.wp[1][1]}" stroke="${c}"${_sty}/>`;}
|
|
4907
4978
|
{const hsel=sel2d();if(hsel.length>=1){const HR=epR();for(const sm of hsel)for(let i=0;i<2;i++) s+=`<circle class="handle ${i===0?'ep-start':'ep-end'}" data-mid="${sm.id}" data-h="${i}" cx="${sm.wp[i][0]}" cy="${sm.wp[i][1]}" r="${HR}"/>`;}} // end 1 (start) yellow, end 2 (end) magenta · shown for every selected member · radius grows with zoom (epR) so it stays visible against the thick line
|
|
4908
4979
|
if((mode==='add'||(picking&&pickKind==='profile'))&&P.labels) for(const lb of P.labels){const w=Math.max(40,lb.text.length*11);
|
|
4909
4980
|
s+=`<rect class=lblhot data-prof="${esc(lb.text)}" x="${lb.disp[0]-w/2}" y="${lb.disp[1]-10}" width="${w}" height="20" rx="3"><title>${esc(lb.text)}</title></rect>`;}
|
|
@@ -4972,13 +5043,13 @@ function updateBadges(){const R=12/zoom,F=13/zoom,ox=el=>(+el.dataset.fi-(+el.da
|
|
|
4972
5043
|
// threshold live (data-mlen × zoom), so zooming reveals/hides labels as members cross ~24px on screen.
|
|
4973
5044
|
{const plG=svg.querySelector('g.pllabels');if(plG){let hid=0;
|
|
4974
5045
|
plG.querySelectorAll('rect.plchip').forEach(r=>{const w=(+r.dataset.tw*6.4+12)/zoom,h=15/zoom,cy=(+r.dataset.ay)+(+r.dataset.off)/zoom;
|
|
4975
|
-
const show=(+r.dataset.mlen)
|
|
5046
|
+
const show=plabelVisible(+r.dataset.mlen);r.style.display=show?'':'none';if(!show)hid++;
|
|
4976
5047
|
r.setAttribute('width',w);r.setAttribute('height',h);r.setAttribute('x',(+r.dataset.ax)-w/2);r.setAttribute('y',cy-h/2);});
|
|
4977
|
-
plG.querySelectorAll('text.pltx').forEach(t=>{const show=(+t.dataset.mlen)
|
|
5048
|
+
plG.querySelectorAll('text.pltx').forEach(t=>{const show=plabelVisible(+t.dataset.mlen);t.style.display=show?'':'none';t.setAttribute('y',(+t.dataset.ay)+(+t.dataset.off)/zoom);t.style.fontSize=(11/zoom)+'px';});
|
|
4978
5049
|
propLabelsHidden=hid;updatePropHint();}} // hid counts hidden chip ROWS (>0 ⇒ note shows) — the note only needs the boolean
|
|
4979
5050
|
{const mlG=svg.querySelector('g.mlenlabels');if(mlG){ // on-select length chips: same zoom-rescale + threshold as the property chips
|
|
4980
|
-
mlG.querySelectorAll('rect.mlenchip').forEach(r=>{const w=(+r.dataset.tw*6.4+12)/zoom,h=15/zoom,cx=(+r.dataset.mx)+(+r.dataset.nx)*(+r.dataset.base)/zoom,cy=(+r.dataset.my)+(+r.dataset.ny)*(+r.dataset.base)/zoom,show=(+r.dataset.mlen)
|
|
4981
|
-
mlG.querySelectorAll('text.mlentx').forEach(t=>{const show=(+t.dataset.mlen)
|
|
5051
|
+
mlG.querySelectorAll('rect.mlenchip').forEach(r=>{const w=(+r.dataset.tw*6.4+12)/zoom,h=15/zoom,cx=(+r.dataset.mx)+(+r.dataset.nx)*(+r.dataset.base)/zoom,cy=(+r.dataset.my)+(+r.dataset.ny)*(+r.dataset.base)/zoom,show=plabelVisible(+r.dataset.mlen);r.style.display=show?'':'none';r.setAttribute('width',w);r.setAttribute('height',h);r.setAttribute('x',cx-w/2);r.setAttribute('y',cy-h/2);});
|
|
5052
|
+
mlG.querySelectorAll('text.mlentx').forEach(t=>{const show=plabelVisible(+t.dataset.mlen);t.style.display=show?'':'none';t.setAttribute('x',(+t.dataset.mx)+(+t.dataset.nx)*(+t.dataset.base)/zoom);t.setAttribute('y',(+t.dataset.my)+(+t.dataset.ny)*(+t.dataset.base)/zoom);t.style.fontSize=(11/zoom)+'px';});}}
|
|
4982
5053
|
const cg=svg.querySelector('g.csglyph');if(cg&&P.frame)cg.outerHTML=axisGlyphSvg(P.frame.o,P.frame.u,false);} // glyph is sized in 1/zoom → regenerate on zoom (like the dim chips)
|
|
4983
5054
|
function updateHandles(m){svg.querySelectorAll(`circle.handle[data-mid="${m.id}"]`).forEach(h=>{const i=+h.dataset.h;h.setAttribute('cx',m.wp[i][0]);h.setAttribute('cy',m.wp[i][1]);});}
|
|
4984
5055
|
function updateLine(m){
|
|
@@ -5339,7 +5410,7 @@ function panel(){
|
|
|
5339
5410
|
<div class=sect>Draw a member</div>
|
|
5340
5411
|
<div class=hint id=drawHint>${view3d?'✏️ Click the start then the end — both land on the <b>working plane</b>. A near-vertical pick pair becomes a column. <b>Shift</b> = straight, <b>Esc</b> = exit.':drawHintText()}</div>`;
|
|
5341
5412
|
const ap=document.getElementById('addProf');
|
|
5342
|
-
ap.oninput=ap.onchange=e=>{addProfile=e.target.value
|
|
5413
|
+
ap.oninput=ap.onchange=e=>{addProfile=_canonDes(e.target.value);};
|
|
5343
5414
|
document.getElementById('addPick').onclick=()=>{picking=!pk;pickKind='profile';pickEnd=null;render();}; // labels are already hot in Add mode — this arms the same highlighted "pick a label" state as the member inspector
|
|
5344
5415
|
document.getElementById('mTypeA').onchange=e=>{const v=e.target.value;
|
|
5345
5416
|
if(!normMemberTypeKey(v)){e.target.value=memberTypeLabel(addType);return;} // blank or punctuation-only ("!!!") normalises to no key → mints nothing, so don't burn an undo step on it
|
|
@@ -5594,7 +5665,7 @@ function panel(){
|
|
|
5594
5665
|
<div class="row f"><button class=danger id=del>Delete selected (${arr.length})</button></div>`;
|
|
5595
5666
|
wireTypeFilter(p);
|
|
5596
5667
|
// wiring — every commit applies to the whole selection; a blank field is a no-op (leaves each member's own value).
|
|
5597
|
-
document.getElementById('pf').onchange=e=>{const v=e.target.value
|
|
5668
|
+
document.getElementById('pf').onchange=e=>{const v=_canonDes(e.target.value);if(!v)return;edit(()=>{for(const m of selArr())ModelCmd.patchMember(m,{profile:v,rfi:_wt(v)==null});if(!profs.includes(v)){profs.push(v);profs.sort();}});};
|
|
5598
5669
|
document.getElementById('mTypeM').onchange=e=>{const v=e.target.value;if(!normMemberTypeKey(v)){e.target.value=memberTypeValueFor(selArr());return;}edit(()=>{const k=memberTypeFromInput(v);if(!k)return;applyMemberType(selArr(),k);});}; // type owns Column-vs-beam-style role and legend category
|
|
5599
5670
|
document.getElementById('verifyBtn').onclick=()=>edit(()=>{const v=!allVerified;for(const m of selArr())ModelCmd.patchMember(m,{verified:v});});
|
|
5600
5671
|
{const _gel=document.getElementById('geoEL');if(_gel)_gel.onclick=()=>{geoMode=(geoMode==='el'?null:'el');setGeo();render();};}
|
|
@@ -5858,7 +5929,7 @@ function panel(){
|
|
|
5858
5929
|
<div class=row><button class=ghostw id=swapEnds data-tip="Reverse the member: swap the start (${col?'bottom':'yellow'}) and end (${col?'top':'magenta'}) handles · Shortcut: P">⇄ Swap start ↔ end <span style="opacity:.55">(P)</span></button></div>`}
|
|
5859
5930
|
<div class="row f"><button class=danger id=del>Delete member</button></div>`;
|
|
5860
5931
|
wireTypeFilter(p);
|
|
5861
|
-
document.getElementById('pf').onchange=e=>edit(()=>{const v=e.target.value
|
|
5932
|
+
document.getElementById('pf').onchange=e=>edit(()=>{const v=_canonDes(e.target.value);ModelCmd.patchMember(m,{profile:v,rfi:_wt(v)==null});if(v&&!profs.includes(v)){profs.push(v);profs.sort();}});
|
|
5862
5933
|
{const rp=document.getElementById('rfiPill');if(rp){const go=()=>openRFI(m.id);rp.onclick=go;rp.onkeydown=e=>{if(e.key==='Enter'||e.key===' '){e.preventDefault();e.stopPropagation();go();}};}} // F12: the RFI pill opens the list focused on THIS member (role=button span → keydown for Enter/Space). stopPropagation so idle Space/Enter doesn't ALSO hit the global repeat-last handler (:3804) — matches the editor's local-keydown convention (:1738,:4212)
|
|
5863
5934
|
document.getElementById('pickProf').onclick=()=>{if(picking&&pickKind==='profile'){picking=false;}else{picking=true;pickKind='profile';pickEnd=null;}render();};
|
|
5864
5935
|
document.getElementById('mTypeS').onchange=e=>{const v=e.target.value;if(!normMemberTypeKey(v)){e.target.value=memberTypeLabel(memberTypeOf(m));return;}edit(()=>{const k=memberTypeFromInput(v);if(k&&memberTypeOf(m)!==k)applyMemberType([m],k);});}; // retype → role + legend recategorize (edit() → sync3D → build3DLegend); undoable
|
|
@@ -6254,13 +6325,39 @@ function v2CanonicalMember(id){
|
|
|
6254
6325
|
function _lenFt(m){
|
|
6255
6326
|
if(MODEL_V2&&m){const canon=v2CanonicalMember(m.id);if(canon)return modelReadsV2().lengthFt(canon);}
|
|
6256
6327
|
return _len3dFt(m,FT,defaultTOS);}
|
|
6328
|
+
/*
|
|
6329
|
+
* THE LABEL'S LENGTH, WHICH IS `undefined` WHERE THERE ISN'T ONE.
|
|
6330
|
+
*
|
|
6331
|
+
* `_lenFt` answers 0 for a member whose geometry cannot be resolved — a v2 member with an
|
|
6332
|
+
* `{unknown:true}` elevation has no third dimension to measure. That is a defensible number for a total
|
|
6333
|
+
* (the header adds it), and a lie in a chip: measured by the independent QA, a beam with a 25 ft plan run
|
|
6334
|
+
* and unresolved elevations printed `Length: 0.0 ft` and `Weight: 0 lb` beside it, as fact. The TOS rows
|
|
6335
|
+
* already refuse this by returning `undefined` for an unknown elevation, and the schema's own `elevation`
|
|
6336
|
+
* note says an unknown must never be substituted with a default — this is the same rule, one property
|
|
6337
|
+
* over.
|
|
6338
|
+
*
|
|
6339
|
+
* SCOPED TO THE LABELS deliberately: the header total, the Inspect readout and the BOM all read `_lenFt`
|
|
6340
|
+
* and all report the same 0 today. That is a wider question about what a total should say when part of
|
|
6341
|
+
* it is unknown, and it is not this change's to answer — a chip stating a length that was never read is.
|
|
6342
|
+
*
|
|
6343
|
+
* WHICH IS WHY IT IS A `labelGet`, NOT THE ROW'S `get`. `PROP_DEFS[].get` has a second consumer:
|
|
6344
|
+
* `propAggRow` aggregates it across the selection, and `renderPropPop` DISABLES the row when every
|
|
6345
|
+
* member answers undefined. Wiring this into `get` therefore greyed out Length and Weight whenever the
|
|
6346
|
+
* selection was exactly the member that could not be measured — which is the natural member to
|
|
6347
|
+
* right-click, and the checkbox it blocks is plan-wide. Found by review, one round after the QA run that
|
|
6348
|
+
* produced this helper. The popup keeps aggregating the measurable answer; only the chip refuses.
|
|
6349
|
+
*/
|
|
6350
|
+
function _lenFtLabel(m){
|
|
6351
|
+
if(MODEL_V2&&m){const canon=v2CanonicalMember(m.id);if(canon&&!SteelCore.memberGeometryV2(canon))return undefined;}
|
|
6352
|
+
const v=_lenFt(m);
|
|
6353
|
+
return (Number.isFinite(v)&&v>0)?v:undefined;}
|
|
6257
6354
|
const PROP_DEFS=[
|
|
6258
6355
|
{key:'id', label:'Mark', get:m=>m.id, fmt:v=>v==null?'':String(v)},
|
|
6259
6356
|
{key:'profile', label:'Profile', get:m=>m.profile, fmt:v=>v==null?'':String(v)},
|
|
6260
6357
|
{key:'type', label:'Type', get:m=>memberTypeLabel(memberTypeOf(m)), fmt:v=>v==null?'':String(v)},
|
|
6261
6358
|
{key:'role', label:'Role', get:m=>m.role==='column'?'Column':'Beam', fmt:v=>v||''},
|
|
6262
|
-
{key:'length', label:'Length', get:m=>_lenFt(m),
|
|
6263
|
-
{key:'weight', label:'Weight', get:m=>{const w=_wt(m.profile);return w==null?undefined:_lenFt(m)*w;}, fmt:v=>v==null?'':Math.round(v).toLocaleString()+' lb'},
|
|
6359
|
+
{key:'length', label:'Length', get:m=>_lenFt(m), labelGet:m=>_lenFtLabel(m), fmt:v=>v==null?'':v.toFixed(1)+' ft'},
|
|
6360
|
+
{key:'weight', label:'Weight', get:m=>{const w=_wt(m.profile);return w==null?undefined:_lenFt(m)*w;}, labelGet:m=>{const w=_wt(m.profile),l=_lenFtLabel(m);return (w==null||l==null)?undefined:l*w;}, fmt:v=>v==null?'':Math.round(v).toLocaleString()+' lb'},
|
|
6264
6361
|
{key:'position', label:'Position', get:m=>m.role==='column'?undefined:posDefault(m), fmt:v=>v?v[0].toUpperCase()+v.slice(1):''},
|
|
6265
6362
|
// undefined wherever the concept itself is undefined (a column, a plumb member, an unresolved profile) —
|
|
6266
6363
|
// the label must never print a justification the bake ignores.
|
|
@@ -6288,23 +6385,37 @@ function sanitizePropLabels(x){const o=(x&&typeof x==='object'&&!Array.isArray(x
|
|
|
6288
6385
|
selected_only:o.selected_only===true,
|
|
6289
6386
|
vis2d:o.vis2d!==false,vis3d:o.vis3d!==false, // per-view label VISIBILITY (B1): default ON; the property SELECTION (props) stays shared across 2D+3D — only show/hide is independent
|
|
6290
6387
|
ids:Array.isArray(o.ids)?o.ids.filter(v=>typeof v==='string'):[]};}
|
|
6291
|
-
//
|
|
6292
|
-
//
|
|
6293
|
-
//
|
|
6294
|
-
|
|
6388
|
+
// PROP_LABELS IS SANITISED ON BOTH FORMATS (#614), and it is the ONE member of the repair-pass family
|
|
6389
|
+
// that is — see the note at the top of main() for why the others stay v1-only. It was excluded for one
|
|
6390
|
+
// reason: it materialises `vis2d`/`vis3d`, which v2's closed `prop_labels` refused, so running it added
|
|
6391
|
+
// keys that made the user's first save fail for an edit they never made. Now that the schema carries both
|
|
6392
|
+
// flags, every key it writes is legal on v2, and NOT running it is the defect — `propLabelLinesFor` and
|
|
6393
|
+
// `renderPropLabels` read `pl.props.length` on a document that may carry no `prop_labels` at all, which
|
|
6394
|
+
// is the TypeError the original v2 attempt hit and mis-attributed to the label derivation.
|
|
6395
|
+
//
|
|
6396
|
+
// Its siblings are still refused, and the reason is unchanged: `sanitizeViews` DROPS `views[].generated
|
|
6397
|
+
// .axisId` (v2 requires it — data loss) and adds `views[].projection` (v2 keeps that in `camera.proj`).
|
|
6295
6398
|
C.prop_labels=sanitizePropLabels(C.prop_labels); // normalise the contract's incoming value now (PROP_KEYS is initialised above; runs before main's bootstrap render + restoreSaved override)
|
|
6399
|
+
if(!MODEL_V2){
|
|
6296
6400
|
C.views=sanitizeViews(C.views); // normalise the incoming saved views now — inside main() where sanitizeViews is in scope (boot() only guaranteed an array); runs before the bootstrap render + restoreSaved override, same pattern as prop_labels above
|
|
6297
6401
|
if(SteelCore)C.dims3d=SteelCore.sanitizeDims3d(C.dims3d); // UCS Stage 5: canonicalise each 3D dim's axisDir (drop junk / normalise non-unit) so a bad value can't wedge the schema-validated save — the SERVER contract copy; restoreSaved re-sanitises the localStorage draft below
|
|
6298
6402
|
}
|
|
6299
6403
|
// the "Label: value" lines a member contributes for the currently-checked props (registry order; skips N/A + empty)
|
|
6300
6404
|
function propLabelLinesFor(m){const pl=C.prop_labels;if(!pl||!pl.props.length)return [];ensureMeta(m);
|
|
6301
|
-
const out=[];for(const def of PROP_DEFS){if(!pl.props.includes(def.key))continue;const raw=def.get(m);if(raw===undefined)continue;const t=def.fmt(raw);if(t==='')continue;out.push(def.label+': '+t);}return out;}
|
|
6405
|
+
const out=[];for(const def of PROP_DEFS){if(!pl.props.includes(def.key))continue;const raw=(def.labelGet||def.get)(m);if(raw===undefined)continue;const t=def.fmt(raw);if(t==='')continue;out.push(def.label+': '+t);}return out;}
|
|
6302
6406
|
// members that actually get a label, honouring the plan-wide-vs-selected-only scope
|
|
6303
6407
|
function propLabelMembers(){const pl=C.prop_labels;if(!pl||!pl.props.length)return [];
|
|
6304
|
-
// PER-SHEET
|
|
6305
|
-
// plan-local PIXEL coordinates into the ACTIVE sheet's SVG, so an off-sheet member would be
|
|
6306
|
-
// the wrong place on any multi-sheet project. A repair briefly widened this to allMembers()
|
|
6307
|
-
// v2 TypeError and introduced exactly that regression
|
|
6408
|
+
// PER-SHEET ON BOTH FORMATS, and that is not incidental: renderPropLabels draws each chip at the
|
|
6409
|
+
// member's plan-local PIXEL coordinates into the ACTIVE sheet's SVG, so an off-sheet member would be
|
|
6410
|
+
// painted in the wrong place on any multi-sheet project. A repair briefly widened this to allMembers()
|
|
6411
|
+
// to stop a v2 TypeError and introduced exactly that regression.
|
|
6412
|
+
//
|
|
6413
|
+
// ON v2 `P` IS THE PROJECTION, so `P.members` is the active sheet's projected members — the same scope,
|
|
6414
|
+
// reached a different way. That has a consequence worth naming rather than leaving to be discovered:
|
|
6415
|
+
// the 3D view's own member list IS model-wide, so on a multi-sheet v2 model the 3D chips cover only the
|
|
6416
|
+
// active sheet's members. v1 behaves identically (`getMembers` returns `P.members` there too), so it is
|
|
6417
|
+
// parity, not a v2 regression — but it is a limit, and an earlier version of this comment implied the
|
|
6418
|
+
// v2 arm had been given a model-wide list, which it has not. (Found by review.)
|
|
6308
6419
|
let base=P.members;
|
|
6309
6420
|
if(pl.selected_only){const ids=new Set(pl.ids||[]);base=base.filter(m=>ids.has(m.id));}
|
|
6310
6421
|
return base.filter(m=>propLabelLinesFor(m).length>0);}
|
|
@@ -6321,6 +6432,32 @@ let propLabelsHidden=0;
|
|
|
6321
6432
|
// A member's labels hide when its on-screen length < this (px) — the density guard (§5.5). Kept as one
|
|
6322
6433
|
// constant so renderPropLabels (initial paint) and updateBadges (live on zoom) agree.
|
|
6323
6434
|
const PLABEL_MIN_PX=24;
|
|
6435
|
+
/*
|
|
6436
|
+
* …AND A MEMBER WITH NO PLAN RUN IS EXEMPT FROM IT. The ORDINARY column — authored as a coincident point
|
|
6437
|
+
* symbol, which is what the reader emits and what the plan draws — has a drawn line of length 0, so
|
|
6438
|
+
* `mlen * zoom` is 0 at every zoom and it could never carry a 2D chip. It also fed the "Labels hidden —
|
|
6439
|
+
* zoom in" pill, which therefore stayed up permanently while zooming did nothing about it. Measured by
|
|
6440
|
+
* the independent QA at 119 / 156 / 291 / 400% (the maximum): still hidden.
|
|
6441
|
+
*
|
|
6442
|
+
* "ordinary", not "every" — the same absolute review caught two commits ago on this branch. A raking or
|
|
6443
|
+
* battered column has two distinct plan points and a real run, and takes the ordinary arm.
|
|
6444
|
+
*
|
|
6445
|
+
* The threshold exists to hide a label on a member too SHORT TO READ ALONG. A point is not short; it has
|
|
6446
|
+
* no length to be short. So the rule is "if it has a run, the run must be legible", and a member without
|
|
6447
|
+
* one is drawn.
|
|
6448
|
+
*
|
|
6449
|
+
* ONE PREDICATE FOR ALL FIVE CALL SITES — the property chips (initial paint + both halves of
|
|
6450
|
+
* updateBadges' live re-apply) and the on-select member-length chips (the same three, minus one that
|
|
6451
|
+
* gates on 3D length instead). They were five copies of one inequality; converting three would have left
|
|
6452
|
+
* a column labelled by ⋯ Display → Property labels and unlabelled by ⋯ Display → Show member length, in
|
|
6453
|
+
* the same view, having already shown its length in 3D (refreshSelLen3d gates on the 3D length, which is
|
|
6454
|
+
* why the inconsistency was visible rather than merely latent).
|
|
6455
|
+
*
|
|
6456
|
+
* WHAT THIS DOES NOT FIX, stated because the pill's copy promises it: a member with a real but tiny run
|
|
6457
|
+
* still hides below `PLABEL_MIN_PX / ZMAX` = 6 plan px, and "zoom in" cannot rescue it. The class is now
|
|
6458
|
+
* "a stub under ~6 px" instead of "every column".
|
|
6459
|
+
*/
|
|
6460
|
+
const plabelVisible=mlen=>!(mlen>0)||mlen*zoom>=PLABEL_MIN_PX;
|
|
6324
6461
|
// On-select member-length chips (2D): when the ⋯ Display "Show member length" toggle is on, paint each selected
|
|
6325
6462
|
// member's true 3D length at its midpoint, nudged perpendicular off the line (fixed relative to member direction).
|
|
6326
6463
|
// Cyan dimension chips; the member being end-dragged is skipped (its live overlay covers it); coincident midpoints
|
|
@@ -6334,7 +6471,7 @@ function renderSelLenLabels(){if(!showSelLen)return '';const selM=sel2d();if(!se
|
|
|
6334
6471
|
const lenFt=_lenFt(m);if(!(lenFt>0)||!isFinite(lenFt))return; // skip degenerate/NaN geometry — never paint an empty "len " chip
|
|
6335
6472
|
const dx=b[0]-a[0],dy=b[1]-a[1],dl=Math.hypot(dx,dy)||1,nx=-dy/dl,ny=dx/dl,base=18+(j-(n-1)/2)*16,mlen=len(a,b);
|
|
6336
6473
|
const txt='len '+fmtFtIn(lenFt*12),tw=txt.length,w=(tw*6.4+12)/zoom,hh=15/zoom,cx=mid[0]+nx*base/zoom,cy=mid[1]+ny*base/zoom;
|
|
6337
|
-
const show=mlen
|
|
6474
|
+
const show=plabelVisible(mlen),hide=show?'':';display:none',dd=`data-mx="${mid[0]}" data-my="${mid[1]}" data-nx="${nx}" data-ny="${ny}" data-base="${base}" data-mlen="${mlen}"`;
|
|
6338
6475
|
s+=`<rect class=mlenchip ${dd} data-tw="${tw}" x="${cx-w/2}" y="${cy-hh/2}" width="${w}" height="${hh}" rx="${3/zoom}" style="${hide}"/>`
|
|
6339
6476
|
+`<text class=mlentx ${dd} x="${cx}" y="${cy}" style="font-size:${11/zoom}px${hide}">${esc(txt)}</text>`;});}
|
|
6340
6477
|
return s?`<g class="mlenlabels">${s}</g>`:'';}
|
|
@@ -6345,7 +6482,7 @@ function renderPropLabels(){const pl=C.prop_labels;propLabelsHidden=0;if(!pl||!p
|
|
|
6345
6482
|
// only sets each chip's initial visibility. updateBadges re-applies it live as the user zooms — so
|
|
6346
6483
|
// zooming in reveals a hidden label and zooming out hides it (they're in the DOM either way).
|
|
6347
6484
|
for(const m of ms){const lines=propLabelLinesFor(m);if(!lines.length)continue;
|
|
6348
|
-
const vl=memberViewLine(m),a=vl[0],b=vl[1],mlen=len(a,b);const show=mlen
|
|
6485
|
+
const vl=memberViewLine(m),a=vl[0],b=vl[1],mlen=len(a,b);const show=plabelVisible(mlen);if(!show)hidden++; // chips ride the DRAWN line (offset brace included)
|
|
6349
6486
|
const anc=pl.placement==='start'?a:pl.placement==='end'?b:[(a[0]+b[0])/2,(a[1]+b[1])/2];
|
|
6350
6487
|
const n=lines.length,hide=show?'':';display:none';
|
|
6351
6488
|
lines.forEach((txt,i)=>{const off=(i-(n-1)/2)*15,tw=txt.length,w=(tw*6.4+12)/zoom,h=15/zoom,cy=anc[1]+off/zoom;
|
|
@@ -6354,6 +6491,15 @@ function renderPropLabels(){const pl=C.prop_labels;propLabelsHidden=0;if(!pl||!p
|
|
|
6354
6491
|
propLabelsHidden=hidden;
|
|
6355
6492
|
return `<g class="pllabels">${s}</g>`;}
|
|
6356
6493
|
// fixed-screen corner note when the zoom threshold is hiding labels (an HTML pill, outside the zoomed SVG)
|
|
6494
|
+
//
|
|
6495
|
+
// A SECOND MESSAGE WAS ADDED HERE AND REMOVED, and the reason is worth keeping. The UX review noted that
|
|
6496
|
+
// "visibility on, no properties ticked" leaves a toggle reading on over a canvas with no chips — true, and
|
|
6497
|
+
// "Clear all" reaches it in one click. But `props: []` with visibility on is not an anomaly, it is the
|
|
6498
|
+
// RESTING STATE OF EVERY DOCUMENT: `sanitizePropLabels` writes `props: []` and defaults both flags on, and
|
|
6499
|
+
// the reader emits the same empty skeleton. So the predicate that was supposed to explain a rare state
|
|
6500
|
+
// matched every project that had never used the feature, and parked a permanent pill telling the user to
|
|
6501
|
+
// right-click a member. Measured by review, not reasoned about. The honest place for that explanation is
|
|
6502
|
+
// the popup where "Clear all" lives, not the canvas.
|
|
6357
6503
|
function updatePropHint(){let el=document.getElementById('plHint');
|
|
6358
6504
|
const show=!view3d&&propLabelsHidden>0;
|
|
6359
6505
|
if(!show){if(el)el.style.display='none';return;}
|
|
@@ -7472,9 +7618,11 @@ document.getElementById('calloutToggleB').onclick=e=>{e.stopPropagation();if(MOD
|
|
|
7472
7618
|
// first repaint after boot — the row would silently go live and lose its screen-reader reason. A
|
|
7473
7619
|
// mutation run proved the shape passes the suite unless it is asserted after an op, which is why
|
|
7474
7620
|
// steel-editor-v2.test.ts re-asserts this row's whole state following a render.
|
|
7475
|
-
//
|
|
7476
|
-
//
|
|
7477
|
-
//
|
|
7621
|
+
// The `C.prop_labels &&` term is not belt-and-braces: sanitizePropLabels materialises the object on
|
|
7622
|
+
// every document now (#614), but this runs on EVERY render and a future path that replaces the contract
|
|
7623
|
+
// wholesale would reach it first. (It used to be load-bearing for a different reason — the sanitiser was
|
|
7624
|
+
// v1-only, so a v2 document arrived with no `prop_labels` at all. That is no longer the case, and the
|
|
7625
|
+
// paragraph claiming plVis short-circuits to false on v2 went with it: plVis now reads the flag.)
|
|
7478
7626
|
function updPlToggle(){const b=document.getElementById('plToggleB');if(b){const on=!!(C.prop_labels&&plVis(false));b.classList.toggle('on',on);b.setAttribute('aria-checked',String(on));}} // B1: 2D property-label visibility (independent of 3D)
|
|
7479
7627
|
document.getElementById('plToggleB').onclick=e=>{e.stopPropagation();if(!canWritePropLabelVis())return;C.prop_labels.vis2d=!C.prop_labels.vis2d;updPlToggle();refreshPropLabels();}; // refreshPropLabels → scheduleSave()+render(): repaints the 2D chips (gated by vis2d) and persists the choice
|
|
7480
7628
|
// MODEL_RO is a term here in its own right, NOT covered by !hasOverlay(): `filter` is a legal v2 root key
|
|
@@ -7566,26 +7714,30 @@ function roLock(el){
|
|
|
7566
7714
|
el.style.opacity='.4';el.style.pointerEvents='none';el.style.cursor='default';
|
|
7567
7715
|
return el;}
|
|
7568
7716
|
/**
|
|
7569
|
-
* The two controls that set the per-view label flag
|
|
7717
|
+
* The two controls that set the per-view label flag: make each REPORT the flag, and disable it only when
|
|
7718
|
+
* the document cannot take the write.
|
|
7570
7719
|
*
|
|
7571
7720
|
* Separate from applyReadOnlyChrome's anchor list because `m3dPropLabels` lives in the 3D legend, which is
|
|
7572
7721
|
* built lazily by build3DLegend() long after boot; disabling it once at boot would miss it.
|
|
7573
7722
|
*/
|
|
7574
7723
|
function roDisablePropLabelToggles(){
|
|
7575
|
-
// MODEL_V2, not MODEL_RO: the flag has no home in v2's closed `prop_labels` whether or not the document
|
|
7576
|
-
// is writable, so a live v2 model must disable these two exactly as a read-only one did. Leaving them
|
|
7577
|
-
// enabled over a refused write is the silent no-op this whole mode exists to avoid.
|
|
7578
|
-
if(!MODEL_V2)return;
|
|
7579
7724
|
for(const id of ['plToggleB','m3dPropLabels']){
|
|
7580
7725
|
const el=document.getElementById(id);
|
|
7581
7726
|
if(!el)continue;
|
|
7582
|
-
|
|
7583
|
-
//
|
|
7584
|
-
//
|
|
7585
|
-
//
|
|
7586
|
-
//
|
|
7587
|
-
//
|
|
7727
|
+
// THE STATE SYNC IS UNCONDITIONAL, and an early `if(canWritePropLabelVis())return;` was the first cut
|
|
7728
|
+
// of this repair — which quietly DELETED the one thing keeping `m3dPropLabels` honest at boot (#614).
|
|
7729
|
+
// It is static markup carrying `checked`, and nothing else syncs it until the user opens the View
|
|
7730
|
+
// menu, so a document holding `vis3d:false` would render its first frame — and answer a screen reader —
|
|
7731
|
+
// "checked" for a flag plVis reads false. That lie used to be impossible only because every v2
|
|
7732
|
+
// document reached the disabled branch; making them writable is exactly what exposed it. The 2D row
|
|
7733
|
+
// needs no help here (updPlToggle derives `on` and aria-checked from plVis on every render), but it
|
|
7734
|
+
// costs nothing and keeps the two controls under one rule. (Found by the UX review of this change.)
|
|
7588
7735
|
if(el.type==='checkbox')el.checked=plVis(id==='m3dPropLabels');
|
|
7736
|
+
// WRITABILITY, not format. This read `MODEL_V2` while v2's closed `prop_labels` had no home for the
|
|
7737
|
+
// flag — a live v2 model had to disable these two exactly as a read-only one did, because leaving them
|
|
7738
|
+
// enabled over a refused write is the silent no-op that mode exists to avoid. v2 has the home now, so
|
|
7739
|
+
// the only remaining reason to grey them is a document that refuses every write.
|
|
7740
|
+
el.disabled=!canWritePropLabelVis();
|
|
7589
7741
|
// The ribbon only renders under `body.model-ro`, so pointing a LIVE v2 control at it would name an
|
|
7590
7742
|
// element that is not on the page — and its text says the whole model is read-only, which is no longer
|
|
7591
7743
|
// true here. Describe it only where the ribbon actually exists.
|
|
@@ -7956,13 +8108,18 @@ function applyConnectionBakeTruth(j,announce=true){
|
|
|
7956
8108
|
const fresh=updateConnectionDiagnostics(j&&j.diagnostics,false),sk=Array.isArray(j&&j.skipped)?j.skipped:[];
|
|
7957
8109
|
const diagnosed=new Set(connectionDiagnostics.map(d=>d.jointId));
|
|
7958
8110
|
const legacy=sk.filter(s=>String(s).startsWith('joint:')&&!diagnosed.has(String(s).slice(6))).length;
|
|
8111
|
+
// A member the catalogue can WEIGH but not draw (a double angle — AISC tabulates no back-to-back
|
|
8112
|
+
// spacing) is priced in the BOM and missing from 3D and the IFC. That is not the "expected RFI drop"
|
|
8113
|
+
// the silence below was justified by, so it gets said (#627).
|
|
8114
|
+
const noFit=sk.filter(s=>String(s).startsWith('nofootprint:')).length;
|
|
7959
8115
|
if(sk.length)console.warn('3D bake skipped '+sk.length+' item(s):',sk);
|
|
7960
|
-
if(announce&&(fresh.count||legacy)){
|
|
8116
|
+
if(announce&&(fresh.count||legacy||noFit)){
|
|
7961
8117
|
const bits=[];
|
|
7962
8118
|
if(fresh.refused)bits.push(fresh.refused+' connection'+(fresh.refused>1?'s':'')+' not built');
|
|
7963
8119
|
if(fresh.adjusted)bits.push(fresh.adjusted+' built with an adjusted bolt gauge');
|
|
7964
8120
|
if(legacy)bits.push(legacy+' connection'+(legacy>1?'s':'')+' not shown in 3D');
|
|
7965
|
-
|
|
8121
|
+
if(noFit)bits.push(noFit+' member'+(noFit>1?'s':'')+' priced but not drawn — no tabulated footprint');
|
|
8122
|
+
toast(bits.join(' · ')+' — '+((legacy||noFit)?'see the member inspector and console.':'see the member inspector.'));
|
|
7966
8123
|
}
|
|
7967
8124
|
}
|
|
7968
8125
|
async function fetchScenePayload(contract=C){
|
|
@@ -8129,37 +8286,43 @@ async function sendSelectionToHost(host,ids,hostPid){
|
|
|
8129
8286
|
* and it is worse here, because a wrong position looks right.
|
|
8130
8287
|
*/
|
|
8131
8288
|
/**
|
|
8132
|
-
* PROPERTY-LABEL VISIBILITY
|
|
8133
|
-
*
|
|
8134
|
-
*
|
|
8135
|
-
*
|
|
8136
|
-
*
|
|
8137
|
-
*
|
|
8138
|
-
*
|
|
8139
|
-
*
|
|
8140
|
-
*
|
|
8141
|
-
*
|
|
8142
|
-
*
|
|
8143
|
-
*
|
|
8144
|
-
*
|
|
8145
|
-
*
|
|
8146
|
-
*
|
|
8147
|
-
*
|
|
8148
|
-
*
|
|
8149
|
-
*
|
|
8150
|
-
*
|
|
8151
|
-
*
|
|
8152
|
-
*
|
|
8153
|
-
*
|
|
8154
|
-
*
|
|
8155
|
-
*
|
|
8156
|
-
*
|
|
8157
|
-
*
|
|
8158
|
-
*
|
|
8159
|
-
*
|
|
8289
|
+
* PROPERTY-LABEL VISIBILITY — one flag, both formats (#614).
|
|
8290
|
+
*
|
|
8291
|
+
* HISTORY, because the shape of the repair follows from it. v1's `prop_labels` is
|
|
8292
|
+
* `additionalProperties: true` and the editor stores a per-view `vis2d`/`vis3d` there. v2 CLOSED that
|
|
8293
|
+
* object to `props`/`placement`/`selected_only`/`ids`, so unit 5 (P7d) refused the write and disabled the
|
|
8294
|
+
* two controls: leaving a live-looking toggle over a refused write is the silent no-op that mode existed
|
|
8295
|
+
* to remove, and writing the key anyway would corrupt the document so the NEXT save is refused for a
|
|
8296
|
+
* toggle the user flicked.
|
|
8297
|
+
*
|
|
8298
|
+
* That was right about the schema and wrong about the feature. Two causes were tangled in one flag and
|
|
8299
|
+
* only one was real:
|
|
8300
|
+
*
|
|
8301
|
+
* 1. REAL — v2 had nowhere to keep the flag. Fixed where it belonged, in the schema: `propLabels` now
|
|
8302
|
+
* carries `vis2d`/`vis3d`. It is closed to keep `ids` accountable to identity migration, not to
|
|
8303
|
+
* withhold display state, and `props`/`placement`/`selected_only`/`ids` were always accepted.
|
|
8304
|
+
* A browser-local store was the cheaper alternative and was rejected: the property SELECTION already
|
|
8305
|
+
* travels in the document, so keeping only show/hide per machine would open the same project on
|
|
8306
|
+
* another machine with the props ticked and the chips missing.
|
|
8307
|
+
* 2. NOT REAL — "nothing behind the flag can produce a correct label for a v2 member". The label
|
|
8308
|
+
* derivation reads `m.profile`, `m.role`, `m.ends[].tos`, `m.col`, and the ACTIVE PLAN's member
|
|
8309
|
+
* list; on v2 the active plan IS `V2_PROJECTION.plan`, and `projectMember()` emits exactly that v1
|
|
8310
|
+
* vocabulary (`web/steel-model-v2-projection.js`). The TypeError that killed the first attempt came
|
|
8311
|
+
* from answering ON while `sanitizePropLabels` was skipped, so `pl.props` was undefined — a missing
|
|
8312
|
+
* normalisation, not a missing derivation. That sanitiser now runs on both formats.
|
|
8313
|
+
*
|
|
8314
|
+
* ABSENT MEANS ON, and the `!== false` below is what says so. Both formats normalise at boot, so the
|
|
8315
|
+
* default is not what an ordinary open depends on — it is defence for the values that reach `plVis`
|
|
8316
|
+
* around that: the v2 draft restore (whose own sanitise this change also added), and a MIGRATED
|
|
8317
|
+
* document, since v1 only persists these flags once its editor has saved and migration cannot carry
|
|
8318
|
+
* what was never written. Reading either as "off" hides chips for properties the user has ticked.
|
|
8319
|
+
*
|
|
8320
|
+
* THE GATE ASKS WRITABILITY, WHICH IS NOW THE ONLY QUESTION LEFT. It shipped as `canWriteModel()`, was
|
|
8321
|
+
* narrowed to `&& !MODEL_V2` when v2 had no home for the flag, and goes back now that it does — the
|
|
8322
|
+
* format no longer decides anything here.
|
|
8160
8323
|
*/
|
|
8161
|
-
function canWritePropLabelVis(){return canWriteModel()
|
|
8162
|
-
function plVis(is3d){
|
|
8324
|
+
function canWritePropLabelVis(){return canWriteModel();}
|
|
8325
|
+
function plVis(is3d){const pl=C&&C.prop_labels;if(!pl)return false;return (is3d?pl.vis3d:pl.vis2d)!==false;}
|
|
8163
8326
|
/** v2's ONE root member array. Not a plan property — see §8.3 on why reading `C.plans[].members` is worse than useless here. */
|
|
8164
8327
|
function modelMembersV2(){return (C&&Array.isArray(C.members))?C.members:[];}
|
|
8165
8328
|
/** Refuse a read the v2 arm cannot answer truthfully. THROWS — never a default, never a silent empty. */
|
|
@@ -8205,7 +8368,7 @@ function modelReadsV2(){
|
|
|
8205
8368
|
invalidate(){}, // nothing is cached: a v2 member carries its own world-mm coordinates, so there is no per-plan scale to index
|
|
8206
8369
|
geometryOf,
|
|
8207
8370
|
lengthFt(m){const g=geometryOf(m),a=g&&g.line&&g.line[0],b=g&&g.line&&g.line[1];
|
|
8208
|
-
return (a&&b)?Math.hypot(b[0]-a[0],b[1]-a[1],b[2]-a[2])/V2_PT_PER_FT:0;}, // stored world mm → true 3D feet
|
|
8371
|
+
return (a&&b)?Math.hypot(b[0]-a[0],b[1]-a[1],b[2]-a[2])/V2_PT_PER_FT:0;}, // stored world mm → true 3D feet. Unknown/malformed elevations answer 0 here, which the header sums; it is `_lenFtLabel` that turns that into an ABSENT chip rather than a fabricated one (this comment claimed the absence and did not deliver it — #614)
|
|
8209
8372
|
// A v2 member has no owning plan and no scale. This is only ever asked by a WRITE path (the member
|
|
8210
8373
|
// drag, the endpoint drag, split), every one of which is refused — so reaching it is a bug, and a
|
|
8211
8374
|
// throw says so instead of inverting a commit through a fabricated scale.
|
|
@@ -8272,8 +8435,14 @@ const view3dApi={
|
|
|
8272
8435
|
onSelectBatch:({memberIds=[],gridIds=[]},additive)=>{const mids=memberIds.filter(selIdOK),gridAllowed=selGridOK(),gids=gridAllowed?gridIds:[];if(!additive&&(memberIds.length||gridIds.length)&&!mids.length&&!gids.length)return;selDimIds.clear();sel3dDimIds.clear();if(additive){for(const id of mids)selIds.has(id)?selIds.delete(id):selIds.add(id);for(const id of gids)selGridIds.has(id)?selGridIds.delete(id):selGridIds.add(id);}else{selIds=new Set(mids);selGridIds=new Set(gids);if(window.Steel3DView&&window.Steel3DView.setSelectedClips)window.Steel3DView.setSelectedClips([]);}render();if(window.Steel3DView&&window.Steel3DView.refreshDims)window.Steel3DView.refreshDims();}, // Atomic 3D area/direct pick for members + logical grids: filter each class, toggle additively, otherwise replace both selections together.
|
|
8273
8436
|
// THE MEMBER LIST. v1 keeps one per sheet; v2 keeps ONE at the document root, which IS the whole model —
|
|
8274
8437
|
// so for v2 both of these answer the same list, truthfully, rather than the silent [] that reading
|
|
8275
|
-
// `C.plans[].members` would give (§8.3). The view
|
|
8276
|
-
// `model().geometryOf`,
|
|
8438
|
+
// `C.plans[].members` would give (§8.3). The view takes ids and hands the records back to
|
|
8439
|
+
// `model().geometryOf`, which is what makes a v2 record safe to pass through here.
|
|
8440
|
+
//
|
|
8441
|
+
// "read by nothing that assumes `wp`" is what this said, and it was FALSE for two call sites: both 3D
|
|
8442
|
+
// label pools (`syncMemberLabels`, `syncPropLabels`) gated on `Array.isArray(m.wp)` and so skipped
|
|
8443
|
+
// every canonical member — the mark/id labels AND the property labels drew nothing on a v2 model, each
|
|
8444
|
+
// silently. Fixed at those sites (#614) by asking for the work line, the same repair P7d applied to the
|
|
8445
|
+
// reference lines. Stated rather than quietly corrected: the claim was the reason nobody looked.
|
|
8277
8446
|
getMembers:()=>MODEL_V2?modelMembersV2():P.members, // v1: active-sheet members (wp); v2 3D reads canonical world members.
|
|
8278
8447
|
allMembers, // EVERY member in the model — already format-aware (see its definition); the 3D box-select tests all visible meshes, not just the active sheet's
|
|
8279
8448
|
// ── The three reads §8.3 names as plausible-but-FALSE for v2. Each is a v1 PLAN concept, and each has a
|
|
@@ -12373,9 +12542,22 @@ document.getElementById('framesClose').onclick=closeFrames;
|
|
|
12373
12542
|
document.getElementById('framesBackdrop').onclick=closeFrames;
|
|
12374
12543
|
// --- RFI list: every unresolved member (no AISC size) with the reason, editable + locatable ---
|
|
12375
12544
|
function rfiList(){return P.members.filter(m=>_wt(m.profile)==null);}
|
|
12545
|
+
// A European/British designation, correctly spelled and simply not in a US catalogue. Telling its
|
|
12546
|
+
// author to "check the designation" sends them hunting a typo that is not there — which became the
|
|
12547
|
+
// likeliest way to read that message once the US catalogue was completed (#627) and the sizes that
|
|
12548
|
+
// still fail are mostly these. Prefixes match sectionKindOf's, which already knows them by sight.
|
|
12549
|
+
const _isEuroSection=p=>/^(IPE|HE[ABM]?|UB|UC|UKB|UKC|UKA|PFC|UPN|UPE)\s*\d/i.test(String(p||'').trim());
|
|
12376
12550
|
function rfiReason(m){if(!m.profile)return 'No profile assigned';
|
|
12377
12551
|
if(/^MF/i.test(m.profile))return 'Moment-frame mark — pick a girder (see Frames)';
|
|
12378
12552
|
if(/^BF/i.test(m.profile))return 'Brace-frame mark — pick a section';
|
|
12553
|
+
// When the table never loaded, EVERY size is unresolved and none of the reasons below is the truth.
|
|
12554
|
+
if(window.__AISC_LOAD_FAILED)return 'The AISC size table could not be loaded — sizes and weights are unavailable. Reload the page.';
|
|
12555
|
+
// The catalogue knows this size; the MODEL is what withheld a weight for it (a weights entry set to
|
|
12556
|
+
// null — how a built-up or castellated section is marked as "not the catalogue shape it is named
|
|
12557
|
+
// after"). Sending its author to check a designation that is perfectly correct is the same
|
|
12558
|
+
// misdirection the European case above exists to stop.
|
|
12559
|
+
if(_aiscPlf(m.profile)!=null)return 'This model records no weight for that size — the designation itself is a standard AISC shape';
|
|
12560
|
+
if(_isEuroSection(m.profile))return 'European/British section — this catalogue holds AISC (US) shapes only, so it can’t resolve here';
|
|
12379
12561
|
return 'Size not in the AISC table — check the designation';}
|
|
12380
12562
|
// #628. One string for both markers on a verified row (the green number chip and the ✓ Verified pill) so
|
|
12381
12563
|
// they can never drift apart. The apostrophe is typographic because this is a SINGLE-quoted JS literal,
|
|
@@ -12430,7 +12612,7 @@ function openRFI(focusId){focusId=(typeof focusId==='string')?focusId:null; //
|
|
|
12430
12612
|
<td><button class=ghost data-loc="${esc(m.id)}">Locate</button></td></tr>`;}).join('')+'</tbody></table>')
|
|
12431
12613
|
:'<div class=hint>No unresolved members — every member has a resolved AISC size. ✓</div>';
|
|
12432
12614
|
g.querySelectorAll('input.combo[data-mid]').forEach(inp=>inp.onchange=e=>{const m=byId(inp.dataset.mid);if(!m)return;
|
|
12433
|
-
const v=e.target.value
|
|
12615
|
+
const v=_canonDes(e.target.value);edit(()=>{ModelCmd.patchMember(m,{profile:v,rfi:_wt(v)==null});if(v&&!profs.includes(v)){profs.push(v);profs.sort();}});openRFI();});
|
|
12434
12616
|
g.querySelectorAll('button[data-loc]').forEach(b=>b.onclick=()=>{const m=byId(b.dataset.loc);if(!m)return;selDimIds.clear();selIds=new Set([m.id]);geoMode=null;setGeo();closeRFI();render();zoomToMember(m);});
|
|
12435
12617
|
document.getElementById('rfiModal').style.display='flex';
|
|
12436
12618
|
if(focusId){const inp=[...g.querySelectorAll('input.combo[data-mid]')].find(i=>i.dataset.mid===focusId);const row=inp&&inp.closest('tr'); // find via the row's profile input — avoids CSS-escaping the id
|
|
@@ -12446,24 +12628,35 @@ const BANDW={verified:1,high:.9,med:.65,low:.35,rfi:0};
|
|
|
12446
12628
|
const BANDLAB={verified:'Verified',high:'High',med:'Medium',low:'Low',rfi:'RFI'};
|
|
12447
12629
|
const BANDC={verified:'#86efac',high:'#4ade80',med:'#fbbf24',low:'#fca5a5',rfi:'#fca5a5'};
|
|
12448
12630
|
const BANDPILL={verified:'background:#166534;color:#86efac',high:'background:#14532d;color:#4ade80',med:'background:#713f12;color:#fbbf24',low:'background:#7f1d1d;color:#fca5a5',rfi:'background:#7f1d1d;color:#fca5a5'};
|
|
12449
|
-
// The
|
|
12450
|
-
//
|
|
12451
|
-
//
|
|
12452
|
-
//
|
|
12453
|
-
//
|
|
12454
|
-
//
|
|
12455
|
-
|
|
12631
|
+
// The AISC catalogue weight — the only way most of the catalogue can be weighed at all. Nothing in
|
|
12632
|
+
// "HSS4X4X3/8" encodes 17.27 lb/ft, so before the table carried weights every hollow section, angle
|
|
12633
|
+
// and double angle read as "not in the AISC table", was flagged RFI, and contributed 0 lb to the
|
|
12634
|
+
// takeoff (#627). MIRRORS server aisc-sections.ts aiscWeightPlf.
|
|
12635
|
+
//
|
|
12636
|
+
// A second helper used to sit beside this one, reading the lb/ft ENCODED in a W/M/S/HP/C/MC/WT/MT/ST
|
|
12637
|
+
// designation and gating it on a served designation SET so a regex-matching invention (W99X999) was
|
|
12638
|
+
// not believed. The served weights make it unreachable: for every string that regex accepts, the
|
|
12639
|
+
// catalogue either has the designation — and then it has its weight, which this returns — or it does
|
|
12640
|
+
// not, and the set would have refused it too. Keeping it meant a dead branch annotated as a live
|
|
12641
|
+
// fallback, inside the one function three files are kept in lock-step with. (re-review)
|
|
12642
|
+
function _aiscPlf(p){const w=(window.__AISC_WEIGHTS||{})[_canonDes(p)];return w==null?null:w;}
|
|
12456
12643
|
function _wt(profile){if(!profile)return null;
|
|
12457
|
-
|
|
12458
|
-
|
|
12459
|
-
|
|
12644
|
+
// An explicit null in the contract is a PRESENT answer and stays null — the only way to say "marked
|
|
12645
|
+
// W16X26, not a catalogue W16X26" (a built-up girder, a castellated section). MIRRORS the server's
|
|
12646
|
+
// foldedWeight/weightOf resolution order exactly.
|
|
12647
|
+
if(WT&&profile in WT)return WT[profile]==null?null:WT[profile];
|
|
12648
|
+
if(WT){const t=canonProfile(profile);const h=Object.entries(WT).find(([k])=>canonProfile(k)===t);if(h)return h[1]==null?null:h[1];} // shared canonProfile identity so a ×/spaced designation matches its weight-map key
|
|
12649
|
+
return _aiscPlf(profile);} // the contract's own weight always wins; the catalogue answers only where it said nothing
|
|
12460
12650
|
const _isMf=p=>!!p&&/(^|[^A-Z])MF($|[^A-Z])/i.test(p);
|
|
12461
12651
|
// Elevation-aware coincident dedupe for the browser confidence panel — same footprint+wildcard-elevation logic as
|
|
12462
12652
|
// redundantDups / the server, so the in-browser confidence report and the server score agree on stacked members.
|
|
12463
12653
|
function _confDupIds(members){return new Set(dedupeFootprintIds(members,m=>{let s=0;if(m.profile&&!_isMf(m.profile))s++;if(m.profile&&m.profile.trim()!=='')s++;return s;}));}
|
|
12464
12654
|
function _elevAssumed(m){if(m.role==='column')return !(m.col&&m.col.tosDef===false);const en=m.ends||[];if(!en.length)return true;return en.some(e=>e.tosDef!==false);}
|
|
12465
12655
|
function _scoreMember(m,dup){const plf=_wt(m.profile);const F=[];
|
|
12466
|
-
|
|
12656
|
+
// Same three reasons the RFI list gives, through the SAME euro-section predicate — this detail string
|
|
12657
|
+
// is a second copy of that message, and the pair it already sits beside (/^MF/i here vs _isMf there)
|
|
12658
|
+
// is the standing demonstration of what happens when two copies are left to be kept in step by hand.
|
|
12659
|
+
if(plf==null){F.push({key:'profile',label:'Profile',state:'fail',detail:(!m.profile||!m.profile.trim())?'no profile assigned':_isMf(m.profile)?('unresolved mark "'+m.profile+'" — not an AISC size'):_aiscPlf(m.profile)!=null?('this model records no weight for "'+m.profile+'" — the designation is a standard AISC shape'):_isEuroSection(m.profile)?('"'+m.profile+'" is a European/British section — this catalogue holds AISC (US) shapes only'):('"'+m.profile+'" not in the AISC weight table')});return {band:'rfi',factors:F};}
|
|
12467
12660
|
const sched=m.mf===true;F.push({key:'profile',label:'Profile',state:sched?'assumed':'ok',detail:sched?(m.profile+' — resolved from the frame schedule ('+plf+' plf)'):(m.profile+' ('+plf+' plf, AISC)')});
|
|
12468
12661
|
const asm=_elevAssumed(m);F.push({key:'elevation',label:'Elevation',state:asm?'assumed':'ok',detail:asm?'plan default (UNO) — no local callout':'from a drawing callout'});
|
|
12469
12662
|
const isd=dup.has(m.id);if(isd)F.push({key:'dup',label:'Duplicate',state:'fail',detail:'coincident with a kept member — deleting dedupes the BOM'});
|
|
@@ -12687,7 +12880,7 @@ function dupDetailKeys(){const seen={},out=[];for(const r of (C.connections||[])
|
|
|
12687
12880
|
// Specificity rank, most specific first. A row carrying several matchers ranks by its MOST specific one —
|
|
12688
12881
|
// without that the rank is undefined and the winner depends on evaluation accident.
|
|
12689
12882
|
function schedRank(mt){const m=mt||{};return m.profile?1:m.profilePrefix?2:m.depth?3:m.role?4:5;}
|
|
12690
|
-
function _secDepthIn(profile){const row=(
|
|
12883
|
+
function _secDepthIn(profile){const row=_aiscSec(_canonDes(profile));return (row&&isFinite(row[0]))?row[0]:null;}
|
|
12691
12884
|
function schedMatches(mt,m){const q=mt||{};
|
|
12692
12885
|
if(q.profile&&canonProfile(m&&m.profile)!==canonProfile(q.profile))return false;
|
|
12693
12886
|
if(q.profilePrefix&&canonProfile(m&&m.profile).indexOf(canonProfile(q.profilePrefix))!==0)return false;
|