@floless/app 0.97.1 → 0.99.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 +1362 -1268
- package/dist/schemas/steel.takeoff.v1.schema.json +1 -0
- package/dist/web/steel-editor.html +97 -18
- package/package.json +1 -1
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"palette": { "type": "array", "items": { "type": "string" }, "description": "Default per-index profile colours." },
|
|
14
14
|
"weights": { "type": "object", "additionalProperties": { "type": ["number", "null"] }, "description": "profile -> plf (pounds per linear foot), from the AISC lookup. null for an unresolved profile (e.g. an unsized moment-frame mark) that has no weight yet." },
|
|
15
15
|
"profile_colors": { "type": "object", "additionalProperties": { "type": "string" }, "description": "profile -> #hex user overrides." },
|
|
16
|
+
"member_styles": { "type": "object", "additionalProperties": { "type": "object", "properties": { "weight": { "enum": ["thin", "med", "thick"] }, "dash": { "enum": ["solid", "dashed", "dotted", "dashdot"] } }, "additionalProperties": false }, "description": "Draft-only 2D display state (like prop_labels): member-type -> line {weight,dash}. Model-global. NOT baked into the lock / 3D scene / IFC / BOM." },
|
|
16
17
|
"sheet_previews": { "type": "object", "additionalProperties": { "type": "string" }, "description": "sheet -> base64 JPEG full-sheet preview (title block excluded)." },
|
|
17
18
|
"custom_details": { "type": "object", "additionalProperties": { "type": "string" }, "description": "user-created detail name -> base64 JPEG." },
|
|
18
19
|
"moment_frames": { "type": "array", "description": "Moment-frame schedule from the frame-elevation sheets." },
|
|
@@ -784,6 +784,7 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
|
|
|
784
784
|
<button id=gridToggleB class=dtog role=menuitemcheckbox aria-checked=false data-tip="Show or hide the grid lines in 2D and 3D"><span class=mck aria-hidden=true></span>Grid lines</button>
|
|
785
785
|
<button id=lenToggleB class=dtog role=menuitemcheckbox aria-checked=false data-tip="Show each selected member's length on the canvas"><span class=mck aria-hidden=true></span>Member length</button>
|
|
786
786
|
<button id=plToggleB class=dtog role=menuitemcheckbox aria-checked=true data-tip="Show or hide property labels in the 2D plan (the property selection is shared with 3D — this hides them here only)"><span class=mck aria-hidden=true></span>Property labels</button>
|
|
787
|
+
<button id=refToggleB class=dtog role=menuitemcheckbox aria-checked=true data-tip="Show or hide the traced reference sheet (the PDF/SVG drawing under the model). Hidden, it also stops contributing snap points."><span class=mck aria-hidden=true></span>Reference sheet</button>
|
|
787
788
|
<button id=gridEditB data-tip="Grid lines — a plan reference with structural bay spacings (n*d repeats a bay). Shows in 2D and 3D; drawing and drags snap to its lines and intersections.">Grid lines…</button>
|
|
788
789
|
<button id=dimStyleB data-tip="Dimension style — end marks, label position and label background. Sets the defaults every dimension follows unless you give it its own style.">Dimension style…</button>
|
|
789
790
|
</div>
|
|
@@ -1097,11 +1098,12 @@ async function boot() {
|
|
|
1097
1098
|
}
|
|
1098
1099
|
} catch (_) { /* no target goal shown */ }
|
|
1099
1100
|
PAL = (Array.isArray(C.palette) && C.palette.length) ? C.palette : DEFAULT_PAL; WT = C.weights || {};
|
|
1100
|
-
try { const _sr = await fetch('/api/aisc-shapes'); if (_sr.ok) { const _sj = await _sr.json(); if (Array.isArray(_sj.shapes)) window.__AISC_SHAPES = new Set(_sj.shapes); if (_sj.bf && typeof _sj.bf === 'object') window.__AISC_BF = _sj.bf; } } catch (_) { /* no shape table → _nominalPlf falls back to regex-only; columns fall back to the marker footprint */ }
|
|
1101
|
+
try { const _sr = await fetch('/api/aisc-shapes'); if (_sr.ok) { const _sj = await _sr.json(); if (Array.isArray(_sj.shapes)) window.__AISC_SHAPES = new Set(_sj.shapes); if (_sj.bf && typeof _sj.bf === 'object') window.__AISC_BF = _sj.bf; if (_sj.sections && typeof _sj.sections === 'object') window.__AISC_SECTIONS = _sj.sections; } } catch (_) { /* no shape table → _nominalPlf falls back to regex-only; columns fall back to the marker footprint */ }
|
|
1101
1102
|
// No weight seeding needed: every RFI/weight read resolves through _wt(), which falls back to the
|
|
1102
1103
|
// SHAPES-guarded _nominalPlf for a valid AISC designation absent from the contract's weights map.
|
|
1103
1104
|
C.custom_details = C.custom_details || {};
|
|
1104
1105
|
C.profile_colors = C.profile_colors || {};
|
|
1106
|
+
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)
|
|
1105
1107
|
if(!Array.isArray(C.member_types))C.member_types=[];
|
|
1106
1108
|
if(!Array.isArray(C.dims3d))C.dims3d=[]; // model-global draft-only 3D dimensions
|
|
1107
1109
|
if(!Array.isArray(C.detail_placements))C.detail_placements=[]; // model-global draft-only placed detail images (Slice 4)
|
|
@@ -1188,12 +1190,14 @@ function showAiUpdateBanner(message) {
|
|
|
1188
1190
|
}
|
|
1189
1191
|
|
|
1190
1192
|
function main() {
|
|
1193
|
+
C.member_styles=sanitizeMemberStyles(C.member_styles); // F5: clamp the loaded contract's line styles to valid tokens + normalised keys (a hand-edited contract isn't schema-validated; the localStorage draft is separately sanitised in restoreSaved())
|
|
1191
1194
|
let P, X0,Y0,X1,Y1, FT, RB64, EXTX, EXTY, profs; // per-plan, set by setPlan()
|
|
1192
1195
|
let mode='sel', drag=null, picking=false, pickKind='profile', pickEnd=null, geoMode=null;
|
|
1193
1196
|
let dimMode=false, dimDraft=null, dimAxis='free', selDimIds=new Set(), dimsVisible=true; // Dimension tool: armed flag, in-progress {a,b,axis}, sticky axis, selected dim ids (multi-select), show/hide
|
|
1194
1197
|
let drawDraft=null; // Add-member tool: the first CLICKED start point (or null) — click-to-start / click-to-finish, mirroring the Dimension tool (no more press-drag)
|
|
1195
1198
|
let calloutsVisible=true; // Workstream B: show/hide the clickable callout bubbles (details + section/elevation/detail-ref) on the plan in select mode
|
|
1196
1199
|
let showSelLen=(()=>{try{return localStorage.getItem('steel:selLen:v1')==='1';}catch(_){return false;}})(); // ⋯ Display → Show member length: paint each selected member's length on the canvas (opt-in, default off)
|
|
1200
|
+
let refSheetOn=(()=>{try{return localStorage.getItem('steel:refSheet:v1')!=='0';}catch(_){return true;}})(); // ⋯ Display → Reference sheet (F13): show/hide the traced PDF/SVG overlay under the model (default ON; only an explicit '0' hides it)
|
|
1197
1201
|
let gridMode=false, gridPick=false, gridLinePick=null; // Grid lines: panel-takeover editing mode + armed pick-origin / single-line clicks
|
|
1198
1202
|
let dimStyleMode=false; // Dimension style: panel-takeover pane for the model-global defaults (⋯ → Display → Dimension style…)
|
|
1199
1203
|
let csaxisMode=false, csDraft=null; // Local coordinate system "set axes" tool: armed flag + in-progress origin [x,y] (null until click 1). P.frame={o,u} holds the committed local frame (null = global).
|
|
@@ -1445,7 +1449,7 @@ const autofillTOS=syncDefaults;
|
|
|
1445
1449
|
// select/delete/undo — a reader-side id-uniqueness hardening. dims3d rides its own persistence.
|
|
1446
1450
|
// dim_style (the model-global dimension-style defaults) rides every entry like details/member_types: one
|
|
1447
1451
|
// chronological stack means an undo simply walks the whole model back, so there is no cross-sheet clobber.
|
|
1448
|
-
function snapshot(){return JSON.stringify({planes:C.plans.map(p=>({sheet:p.sheet,members:p.members,dims:p.dims||[],frame:p.frame||null,grid:p.grid||null})),joints:C.joints||[],clips:(window.Steel3DView&&window.Steel3DView.clipState)?window.Steel3DView.clipState():null,details:(C.detail_placements||[]),member_types:C.member_types||[],dim_style:C.dim_style||null});} // members/dims/frame/grid are all PER-SHEET → captured per sheet so a cross-sheet undo restores each sheet's OWN dims/frame/grid, never the active sheet's over another's. clips/work area are view-state riding the undo stack; details/dim_style = model-global, captured whole.
|
|
1452
|
+
function snapshot(){return JSON.stringify({planes:C.plans.map(p=>({sheet:p.sheet,members:p.members,dims:p.dims||[],frame:p.frame||null,grid:p.grid||null})),joints:C.joints||[],clips:(window.Steel3DView&&window.Steel3DView.clipState)?window.Steel3DView.clipState():null,details:(C.detail_placements||[]),member_types:C.member_types||[],dim_style:C.dim_style||null,member_styles:C.member_styles||{}});} // members/dims/frame/grid are all PER-SHEET → captured per sheet so a cross-sheet undo restores each sheet's OWN dims/frame/grid, never the active sheet's over another's. clips/work area are view-state riding the undo stack; details/dim_style = model-global, captured whole.
|
|
1449
1453
|
// Undo/redo is a SINGLE GLOBAL stack (not per-plane): snapshot() above captures EVERY plane's
|
|
1450
1454
|
// members, so one whole-model stack is coherent — undo restores all planes at once, and a cross-
|
|
1451
1455
|
// sheet edit/delete/to-level round-trips fully. (Earlier this was per-plane — `undo=P.undo` swapped
|
|
@@ -1478,6 +1482,7 @@ function apply(json){const d=JSON.parse(json);
|
|
|
1478
1482
|
if(window.Steel3DView&&window.Steel3DView.cmClear3d)window.Steel3DView.cmClear3d(); // and the 3D-side draft/ghosts
|
|
1479
1483
|
if(window.Steel3DView&&window.Steel3DView.setClipState&&'clips' in d)window.Steel3DView.setClipState(d.clips); // restore clips + work area alongside the contract
|
|
1480
1484
|
if('member_types' in d)C.member_types=sanitizeMemberTypes(d.member_types);
|
|
1485
|
+
if('member_styles' in d)C.member_styles=(d.member_styles&&typeof d.member_styles==='object'&&!Array.isArray(d.member_styles))?d.member_styles:{}; // F5: model-global per-type line styles ride the undo stack (like dim_style) so a setMemberLineStyle() edit() is undoable
|
|
1481
1486
|
scheduleSave();render();sync3D();}
|
|
1482
1487
|
function doUndo(){if(!undo.length)return;redo.push(snapshotLike());apply(undo.pop());}
|
|
1483
1488
|
function doRedo(){if(!redo.length)return;undo.push(snapshotLike());apply(redo.pop());}
|
|
@@ -1498,7 +1503,7 @@ function setSaved(state,msg){const el=document.getElementById('saveStat');if(!el
|
|
|
1498
1503
|
// since the engine's setClipState does NOT re-sanitise its input), and caps the list at 10.
|
|
1499
1504
|
function sanitizeViews(arr){if(!Array.isArray(arr))return [];const out=[];for(const v of arr){if(!v||typeof v!=='object')continue;const id=(typeof v.id==='string'&&v.id)?v.id:('v'+Math.random().toString(36).slice(2,9));const name=(typeof v.name==='string'&&v.name.trim())?v.name.slice(0,80):'View';out.push({v:1,id,name,order:typeof v.order==='number'?v.order:out.length,camera:(v.camera&&typeof v.camera==='object')?v.camera:null,projection:v.projection==='ortho'?'ortho':'persp',mode:['solid','wire','xray'].includes(v.mode)?v.mode:'solid',clips:(v.clips&&typeof v.clips==='object')?v.clips:null,objects:(v.objects&&typeof v.objects==='object')?v.objects:null});if(out.length>=10)break;}return out;}
|
|
1500
1505
|
function persist(){try{localStorage.setItem(LSKEY,JSON.stringify({sig:dataSig(),ts:Date.now(),active:C.active,
|
|
1501
|
-
custom_details:C.custom_details, profile_colors:C.profile_colors, member_types:C.member_types, target_confidence:C.target_confidence, dims3d:C.dims3d, dim_overlays:C.dim_overlays, dim_style:C.dim_style, prop_labels:C.prop_labels, joints:C.joints, detail_placements:C.detail_placements, views:C.views,
|
|
1506
|
+
custom_details:C.custom_details, profile_colors:C.profile_colors, member_styles:C.member_styles, member_types:C.member_types, target_confidence:C.target_confidence, dims3d:C.dims3d, dim_overlays:C.dim_overlays, dim_style:C.dim_style, prop_labels:C.prop_labels, joints:C.joints, detail_placements:C.detail_placements, views:C.views,
|
|
1502
1507
|
plans:C.plans.map(p=>({sheet:p.sheet,members:p.members,default_tos:p.default_tos,details:p.details,dims:p.dims,frame:p.frame||null,grid:p.grid||null}))}));setSaved('ok');}catch(e){setSaved('err');console.error('local autosave failed',e);}}
|
|
1503
1508
|
// --- server-side draft save: PUT the FULL contract C — this is the copy Approve bakes.
|
|
1504
1509
|
// localStorage (persist) stays the instant per-browser draft cache; this is the durable one.
|
|
@@ -1527,6 +1532,7 @@ function restoreSaved(){try{const raw=localStorage.getItem(LSKEY);if(!raw)return
|
|
|
1527
1532
|
if(d.sig!==dataSig())return false;const by={};(d.plans||[]).forEach(p=>by[p.sheet]=p);
|
|
1528
1533
|
if(d.custom_details)C.custom_details=d.custom_details;
|
|
1529
1534
|
if(d.profile_colors)C.profile_colors=d.profile_colors;
|
|
1535
|
+
if(d.member_styles)C.member_styles=sanitizeMemberStyles(d.member_styles); // F5: restore per-type line styles from the local draft (sanitised — the localStorage draft is unvalidated, unlike the server contract)
|
|
1530
1536
|
if(Array.isArray(d.member_types))C.member_types=sanitizeMemberTypes(d.member_types);
|
|
1531
1537
|
if(d.target_confidence!=null)C.target_confidence=d.target_confidence;
|
|
1532
1538
|
C.plans.forEach(p=>{const s=by[p.sheet];if(s){if(Array.isArray(s.members))p.members=s.members;if(s.default_tos!=null)p.default_tos=s.default_tos;if(Array.isArray(s.details))p.details=s.details;if(Array.isArray(s.dims))p.dims=s.dims;if('frame' in s)p.frame=s.frame||null;if('grid' in s)p.grid=s.grid||null;p.autofilled=true;}});
|
|
@@ -1545,11 +1551,35 @@ function updUR(){document.getElementById('undoB').disabled=!undo.length;document
|
|
|
1545
1551
|
// index moved off it — a blank/RFI/other-plan profile must not shift a real profile's slot.) Rebuilt at
|
|
1546
1552
|
// render() top so it tracks edits without touching every profs.push site.
|
|
1547
1553
|
let colorRank=[];
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1554
|
+
// Canonical designation (MIRRORS server contract-to-scene canonProfile): upper, x/X/× → X, whitespace
|
|
1555
|
+
// around X / after the prefix removed, mixed-fraction spaces kept. One identity for 2D / 3D / IFC / Tekla.
|
|
1556
|
+
function canonProfile(s){return String(s||'').trim().toUpperCase().replace(/×/g,'X').replace(/\s*X\s*/g,'X').replace(/^([A-Z]+)\s+/,'$1');}
|
|
1557
|
+
function buildColorRank(){colorRank=[...new Set([...(C.plans||[]).flatMap(pl=>(pl.members||[]).map(m=>canonProfile(m.profile))).filter(Boolean), ...Object.keys(WT||{}).map(canonProfile)])].sort();}
|
|
1558
|
+
function colorFor(p){const k=canonProfile(p);
|
|
1559
|
+
const ov=C.profile_colors[p]??(Object.entries(C.profile_colors).find(([kk])=>canonProfile(kk)===k)||[])[1]; // override: exact key, then canonical (case + x/X/× + separator whitespace) — mirrors contract-to-scene pickColor so an override resolves identically in 2D + 3D
|
|
1551
1560
|
if(ov)return ov;
|
|
1552
1561
|
const i=colorRank.indexOf(k);return PAL[((i%PAL.length)+PAL.length)%PAL.length];} // i<0 (blank/CUSTOM/unresolved) wraps to PAL[last], matching pickColor so those members agree in 2D + 3D too
|
|
1562
|
+
// F5: per member-type 2D line style. Tokens → px; dashes chosen to avoid the reserved semantic patterns
|
|
1563
|
+
// (RFI 10 6, brace 30 8 6 8, grid 12 4 2 4). med+solid (or absent) = today's default (line.member stroke-width:6).
|
|
1564
|
+
const MS_W={thin:3,med:6,thick:9},MS_D={solid:'',dashed:'14 8',dotted:'2 8',dashdot:'18 7 3 7'};
|
|
1565
|
+
function memberLineStyle(m){const s=C.member_styles&&C.member_styles[memberTypeOf(m)];if(!s||typeof s!=='object')return null; // no style for this category → render() adds no inline attr (byte-identical to today)
|
|
1566
|
+
const w=MS_W[s.weight],d=(s.dash&&s.dash!=='solid')?MS_D[s.dash]:''; // unknown token → default (undefined width / '' dash)
|
|
1567
|
+
return {w:(w&&w!==6)?w:0, d:(d||'')};} // w=0 / d='' mean "default → omit the inline attr"
|
|
1568
|
+
// Set one property of a member-type's line style; prune back to the empty default so an untouched-looking
|
|
1569
|
+
// category leaves no contract entry. edit() → undo + autosave + re-render.
|
|
1570
|
+
function setMemberLineStyle(tk,prop,val){edit(()=>{const cur=(C.member_styles[tk]&&typeof C.member_styles[tk]==='object')?C.member_styles[tk]:{};
|
|
1571
|
+
const next={weight:cur.weight||'med',dash:cur.dash||'solid'};next[prop]=val;
|
|
1572
|
+
if(next.weight==='med'&&next.dash==='solid')delete C.member_styles[tk];else C.member_styles[tk]=next;});}
|
|
1573
|
+
// F5: clamp a restored member_styles map to valid tokens + normalised type keys. The server schema validates
|
|
1574
|
+
// on save, but the localStorage draft (and any hand-edited contract) is unvalidated — this keeps a bogus
|
|
1575
|
+
// token/key from reaching the next save (which would fail validation) and drops all-default entries.
|
|
1576
|
+
function sanitizeMemberStyles(ms){if(!ms||typeof ms!=='object'||Array.isArray(ms))return {};
|
|
1577
|
+
const WOK={thin:1,med:1,thick:1},DOK={solid:1,dashed:1,dotted:1,dashdot:1},out={};
|
|
1578
|
+
const nk=k=>String(k||'').trim().toLowerCase().replace(/[^a-z0-9]+/g,'-').replace(/^-+|-+$/g,'').slice(0,48); // mirrors normMemberTypeKey (a const defined later → inlined so this stays callable at boot-time init)
|
|
1579
|
+
for(const k in ms){const key=nk(k);if(!key)continue;const s=ms[k];if(!s||typeof s!=='object')continue;
|
|
1580
|
+
const w=WOK[s.weight]?s.weight:'med',d=DOK[s.dash]?s.dash:'solid';
|
|
1581
|
+
if(w!=='med'||d!=='solid')out[key]={weight:w,dash:d};}
|
|
1582
|
+
return out;}
|
|
1553
1583
|
function len(a,b){return Math.hypot(a[0]-b[0],a[1]-b[1]);}
|
|
1554
1584
|
// ── Column profile sections ─────────────────────────────────────────────────────────────────────
|
|
1555
1585
|
// A column is drawn on the plan as its profile-SECTION footprint (I/box/channel/angle/tube), not a
|
|
@@ -1558,14 +1588,20 @@ function len(a,b){return Math.hypot(a[0]-b[0],a[1]-b[1]);}
|
|
|
1558
1588
|
// /api/aisc-shapes. Returns null for an unresolved mark (RFI).
|
|
1559
1589
|
function profileDimsIn(profile){
|
|
1560
1590
|
if(!profile)return null;
|
|
1561
|
-
const p=String(profile).trim().toUpperCase();
|
|
1591
|
+
const p=String(profile).trim().toUpperCase().replace(/×/g,'X'); // separator may be x / X / ×
|
|
1562
1592
|
if(p===''||/(^|[^A-Z])MF($|[^A-Z])/.test(p))return null;
|
|
1563
|
-
const m=p.match(/^([A-Z]+)\s*(
|
|
1564
|
-
|
|
1593
|
+
const m=p.match(/^([A-Z]+)\s*(.+)$/);if(!m)return null;
|
|
1594
|
+
// parseDim (not parseFloat) so a mixed-fraction leg "3 1/2" → 3.5, not 3 — mirrors server contract-to-scene.
|
|
1595
|
+
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;};
|
|
1596
|
+
const prefix=m[1],nums=m[2].split('X').map(_pd).filter(n=>n!=null);
|
|
1565
1597
|
if(!nums.length)return null;
|
|
1566
1598
|
if((prefix==='HSS'||prefix==='TUBE'||prefix==='L')&&nums.length>=3)return{d:nums[0],w:nums[1]};
|
|
1567
1599
|
if(prefix==='HSS'||prefix==='PIPE'){const dia=nums[0];return{d:dia,w:dia};}
|
|
1568
|
-
if(/^(W|S|M|HP|C|MC|WT|ST|MT)$/.test(prefix)){const
|
|
1600
|
+
if(/^(W|S|M|HP|C|MC|WT|ST|MT)$/.test(prefix)){const key=p.replace(/\s+/g,'');
|
|
1601
|
+
// ACTUAL AISC depth+width when tabulated (the leading number is the NOMINAL series depth). Mirrors
|
|
1602
|
+
// server sectionDimsIn → __AISC_SECTIONS {designation:[d,bf]} from /api/aisc-shapes.
|
|
1603
|
+
const sec=(window.__AISC_SECTIONS||{})[key];if(sec)return{d:sec[0],w:sec[1]};
|
|
1604
|
+
const d=nums[0],bf=(window.__AISC_BF||{})[key];
|
|
1569
1605
|
if(bf!==undefined)return{d,w:bf};const ratio=(prefix==='C'||prefix==='MC')?0.28:0.42;return{d,w:d*ratio};}
|
|
1570
1606
|
return null;
|
|
1571
1607
|
}
|
|
@@ -1609,7 +1645,9 @@ const _polyStr=pts=>pts.map(p=>p[0].toFixed(1)+','+p[1].toFixed(1)).join(' ');
|
|
|
1609
1645
|
// the blurry raster JPEG. Vector PDFs expose filterElsForPlan(); a genuinely scanned sheet (no vectors)
|
|
1610
1646
|
// falls back to the RB64 raster. ponytail: all line d's are merged into ONE <path> so the browser parses
|
|
1611
1647
|
// one node, not thousands — fast to re-render on pan/zoom.
|
|
1648
|
+
function hasOverlay(){return !!(filterElsForPlan()||RB64);} // F13: the active plan carries a reference sheet — vector linework or a scanned raster
|
|
1612
1649
|
function overlaySvg(){
|
|
1650
|
+
if(!refSheetOn)return ''; // F13: reference sheet hidden → draw neither the raster/vector linework NOR the white pdfsheet backdrop
|
|
1613
1651
|
const els=filterElsForPlan();
|
|
1614
1652
|
if(!els)return RB64?`<image href="data:image/jpeg;base64,${RB64}" x="${X0}" y="${Y0}" width="${X1-X0}" height="${Y1-Y0}"/>`:'';
|
|
1615
1653
|
let d='',circ='';
|
|
@@ -2208,7 +2246,10 @@ function render(){
|
|
|
2208
2246
|
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)
|
|
2209
2247
|
if(m.role==='column'){const pts=columnSectionPoly(m); // a column draws as its profile-section footprint, not a line
|
|
2210
2248
|
if(pts){s+=`<polygon class="member${m.rfi?' rfi':''}${sel?' sel':''}${fh?' find-hit':''}" data-id="${m.id}" points="${_polyStr(pts)}" fill="${c}" stroke="${c}"${g}/>`;continue;}}
|
|
2211
|
-
|
|
2249
|
+
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.
|
|
2250
|
+
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&&!m.rfi)?`stroke-dasharray:${ls.d};`:''; // RFI keeps its semantic 10 6 dash
|
|
2251
|
+
const _sty=(_fx||_sw||_sd)?` style="${_fx}${_sw}${_sd}"`:'';
|
|
2252
|
+
s+=`<line class="member${m.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}/>`;}
|
|
2212
2253
|
{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
|
|
2213
2254
|
if((mode==='add'||(picking&&pickKind==='profile'))&&P.labels) for(const lb of P.labels){const w=Math.max(40,lb.text.length*11);
|
|
2214
2255
|
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>`;}
|
|
@@ -2241,7 +2282,7 @@ function render(){
|
|
|
2241
2282
|
s+=renderPropLabels(); // right-click property-label chips (2D); 3D labels ride the div-overlay pool
|
|
2242
2283
|
s+=renderSelLenLabels(); // on-select member-length chips (2D), gated by the ⋯ Display "Show member length" toggle
|
|
2243
2284
|
if(P.frame)s+=axisGlyphSvg(P.frame.o,P.frame.u,false); // local-axes glyph at the origin (only when a frame is set; removed on reset)
|
|
2244
|
-
svg.innerHTML=s; document.getElementById('profiles').innerHTML=profs.map(p=>`<option value="${esc(p)}">`).join(''); document.getElementById('details').innerHTML=(P.details||[]).map(d=>`<option value="${esc(d.text)}">`).join(''); stats(); panel(); updUR(); updDup(); updConf(); updCS(); updConnBtn(); updBpBtn(); updSpBtn(); updGridToggle(); updLenToggle(); updDimToggle(); updCalloutToggle(); updPlToggle();
|
|
2285
|
+
svg.innerHTML=s; document.getElementById('profiles').innerHTML=profs.map(p=>`<option value="${esc(p)}">`).join(''); document.getElementById('details').innerHTML=(P.details||[]).map(d=>`<option value="${esc(d.text)}">`).join(''); stats(); panel(); updUR(); updDup(); updConf(); updCS(); updConnBtn(); updBpBtn(); updSpBtn(); updGridToggle(); updLenToggle(); updDimToggle(); updCalloutToggle(); updPlToggle(); updRefToggle();
|
|
2245
2286
|
if(selFilterReady)reflectSelFilter(); // keep the Select-bar Members/Connections buttons in sync with the model — a new/removed connection kind (e.g. the first auto-detailed base plate) flips their on/off without a manual toggle. Gated on selFilterReady so it doesn't run until the deferred first reflect has armed it (that reflect needs BASE_MEMBER_TYPES, initialised later in main()).
|
|
2246
2287
|
if(view3d&&window.Steel3DView){window.Steel3DView.setSelection(selIds);updateIsolateBtn();if(selIds.size&&window.Steel3DView.selectedClips&&window.Steel3DView.selectedClips().length)window.Steel3DView.setSelectedClips([]);refreshLegendSel();} // keep the 3D highlight + legend selection in sync; selecting a member clears any clip selection (exclusive)
|
|
2247
2288
|
try{updateConnCrumb();}catch(_){} // Connection Component breadcrumb follows the selection (3D-only; hidden at root)
|
|
@@ -2646,7 +2687,7 @@ function panel(){
|
|
|
2646
2687
|
'<button class="ghostw f" id=applyTos>Reset all ends to default</button></div>';
|
|
2647
2688
|
document.getElementById('defTos').onchange=e=>{defaultTOS=parseLen(e.target.value);P.default_tos=defaultTOS;syncDefaults();scheduleSave();render();};
|
|
2648
2689
|
document.getElementById('applyTos').onclick=()=>edit(()=>{for(const m of P.members){ensureMeta(m);if(m.role==='column'){m.col.tosDef=true;m.col.tos=defaultTOS;}else for(const en of m.ends){en.tosDef=true;en.tos=defaultTOS;}}});
|
|
2649
|
-
document.querySelectorAll('.swc').forEach(c=>c.onchange=e=>{C.profile_colors[c.dataset.prof]=e.target.value;scheduleSave();render();}); // recolour a profile (applies everywhere it's drawn)
|
|
2690
|
+
document.querySelectorAll('.swc').forEach(c=>c.onchange=e=>{C.profile_colors[c.dataset.prof]=e.target.value;scheduleSave();render();sync3D();}); // recolour a profile (applies everywhere it's drawn; sync3D repaints a live 3D scene, no-op in 2D)
|
|
2650
2691
|
const _rc=document.getElementById('resetCols');if(_rc)_rc.onclick=()=>{C.profile_colors={};scheduleSave();render();};
|
|
2651
2692
|
return;}
|
|
2652
2693
|
if(arr.length>1){
|
|
@@ -2846,10 +2887,23 @@ function panel(){
|
|
|
2846
2887
|
+(col
|
|
2847
2888
|
? `<div class=hint style="margin:0 0 4px">A column is plumb — Bottom & Top share the plan X/Y (edit either); Z is the base / top-of-steel elevation.</div>`+_dpBlock(0,`<div class=sect>${dotS}Bottom</div>`)+`<div class=divrow><hr></div>`+_dpBlock(1,`<div class=sect>${dotE}Top</div>`)
|
|
2848
2889
|
: _dpBlock(0,`<div class=sect>${dotS}Start</div>`)+`<div class=divrow><hr></div>`+_dpBlock(1,`<div class=sect>${dotE}End</div>`));
|
|
2890
|
+
// F1 + F5: member appearance — colour (per profile, 2D+3D) + line weight/dash (per member type, 2D-only, line-drawn members only).
|
|
2891
|
+
const _hasProf=!!(m.profile&&String(m.profile).trim());
|
|
2892
|
+
const _tk=memberTypeOf(m),_tlab=memberTypeLabel(_tk),_msc=(C.member_styles&&C.member_styles[_tk])||{};
|
|
2893
|
+
const _wOn=w=>((_msc.weight||'med')===w?' on':''),_dOn=d=>((_msc.dash||'solid')===d?' on':'');
|
|
2894
|
+
const _DGV={solid:'',dashed:'7 4',dotted:'1.5 3',dashdot:'7 3 1.5 3'}; // PREVIEW-only dasharrays — short so the glyph reads distinctly in a 24px line (the actual member patterns are MS_D, too long to preview)
|
|
2895
|
+
const _dGlyph=d=>`<svg width=26 height=8 viewBox="0 0 26 8" aria-hidden=true><line x1=1 y1=4 x2=25 y2=4 stroke=currentColor stroke-width=2 stroke-linecap=round${_DGV[d]?` stroke-dasharray="${_DGV[d]}"`:''}/></svg>`;
|
|
2896
|
+
const _lineCtl=(!col&&!br)?`<div class=elab style="margin:8px 0 0">Line — all ${esc(_tlab)}<span style="opacity:.5;font-weight:400"> · 2D</span></div>
|
|
2897
|
+
<div class=seg2 style="margin-top:4px"><button class="msW${_wOn('thin')}" data-w=thin data-tip="Thin line">Thin</button><button class="msW${_wOn('med')}" data-w=med data-tip="Default weight">Med</button><button class="msW${_wOn('thick')}" data-w=thick data-tip="Thick line">Thick</button></div>
|
|
2898
|
+
<div class="seg2 segico" style="margin-top:6px"><button class="msD${_dOn('solid')}" data-d=solid data-tip="Solid">${_dGlyph('solid')}</button><button class="msD${_dOn('dashed')}" data-d=dashed data-tip="Dashed">${_dGlyph('dashed')}</button><button class="msD${_dOn('dotted')}" data-d=dotted data-tip="Dotted">${_dGlyph('dotted')}</button><button class="msD${_dOn('dashdot')}" data-d=dashdot data-tip="Dash-dot">${_dGlyph('dashdot')}</button></div>`:'';
|
|
2899
|
+
const appearanceSect=(_hasProf||_lineCtl)?`<div class=divrow><hr><span class=sect style="margin:0" data-tip="Colour is per profile — recolours everywhere that profile is drawn, 2D and 3D. Line weight and dash are per member type, 2D only.">Appearance</span><hr></div>`
|
|
2900
|
+
+(_hasProf?`<div style="display:flex;align-items:center;gap:8px;margin-top:2px"><span class=elab style="margin:0;flex:none">Colour</span><input type=color id=msColor class=swc value="${colorFor(m.profile)}" data-tip="Colour for ${esc(m.profile)} — recolours every ${esc(m.profile)} (2D + 3D)"><span class=hint style="margin:0;opacity:.6">${esc(m.profile)} · everywhere</span></div>`:'')
|
|
2901
|
+
+_lineCtl:'';
|
|
2849
2902
|
p.innerHTML=`<h3>Member ${esc(m.id)}</h3>
|
|
2850
2903
|
${typeFilterHTML()}
|
|
2851
2904
|
${memberTypeField('mTypeS',[m])}
|
|
2852
2905
|
<div class="f"><div class=elab>Profile</div><div style="display:flex;gap:6px"><input id=pf class=combo data-src=profiles value="${esc(m.profile)}" style="flex:1" autocomplete=off><button id=pickProf class="ghost${(picking&&pickKind==='profile')?' on':''}" data-tip="Pick profile by clicking a label in the drawing">⌖ pick</button></div>${(picking&&pickKind==='profile')?'<div class="hint" style="margin-top:4px;font-style:italic;color:var(--brand)">Click a profile label in the drawing…</div>':(picking&&pickKind==='detail')?'<div class="hint" style="margin-top:4px;font-style:italic;color:#a855f7">Click a detail callout in the drawing…</div>':''}</div>
|
|
2906
|
+
${appearanceSect}
|
|
2853
2907
|
${braceSect}
|
|
2854
2908
|
<div class="row hint">Length <b>${L} ft</b> · ${wpf==null?'<span id=rfiPill class="pill pill-clickable" role=button tabindex=0 data-tip="Open the RFI list, focused on this member" style="background:#7f1d1d">RFI — size unresolved</span>':'Weight <b>'+(_lenFt(m)*wpf).toFixed(0)+' lb</b> · '+wpf+' lb/ft'}</div>
|
|
2855
2909
|
<div class=row><button class=ghostw id=verifyBtn${m.verified?' style="border-color:#166534;color:#86efac"':''} data-tip="Mark this member human-confirmed → 100% in the confidence report">${m.verified?'✓ Verified — human-confirmed':'Mark verified'}</button></div>
|
|
@@ -2872,6 +2926,9 @@ function panel(){
|
|
|
2872
2926
|
{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)
|
|
2873
2927
|
document.getElementById('pickProf').onclick=()=>{if(picking&&pickKind==='profile'){picking=false;}else{picking=true;pickKind='profile';pickEnd=null;}render();};
|
|
2874
2928
|
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
|
|
2929
|
+
{const _cc=document.getElementById('msColor');if(_cc)_cc.onchange=e=>{C.profile_colors[m.profile]=e.target.value;scheduleSave();render();sync3D();};} // F1: recolour this member's profile (same write as the legend swatch) — sync3D() repaints a live 3D scene (no-op in 2D) so colour is truly 2D+3D
|
|
2930
|
+
document.querySelectorAll('.msW').forEach(b=>b.onclick=()=>setMemberLineStyle(memberTypeOf(m),'weight',b.dataset.w)); // F5: per member-type line weight
|
|
2931
|
+
document.querySelectorAll('.msD').forEach(b=>b.onclick=()=>setMemberLineStyle(memberTypeOf(m),'dash',b.dataset.d)); // F5: per member-type line dash
|
|
2875
2932
|
document.querySelectorAll('.mfsug').forEach(b=>b.onclick=()=>edit(()=>{m.profile=b.dataset.s;m.mf=true;m.rfi=(_wt(m.profile)==null);if(!profs.includes(m.profile)){profs.push(m.profile);profs.sort();}})); // record the moment-frame provenance (drives the confidence "schedule-resolved" factor)
|
|
2876
2933
|
const _gel=document.getElementById('geoEL'),_gsp=document.getElementById('geoSplit');
|
|
2877
2934
|
if(_gel)_gel.onclick=()=>{geoMode=(geoMode==='el'?null:'el');setGeo();render();};
|
|
@@ -3044,6 +3101,7 @@ function _segX(a,b,c,d){const rx=b[0]-a[0],ry=b[1]-a[1],sx=d[0]-c[0],sy=d[1]-c[1
|
|
|
3044
3101
|
// drawing×drawing intersection snap (that O(n²) over ~6k segments is untenable per-move); spatial index if needed.
|
|
3045
3102
|
let _ovSnap=null,_ovSnapEls=null;
|
|
3046
3103
|
function overlaySnapGeom(){
|
|
3104
|
+
if(!refSheetOn){_ovSnap=null;_ovSnapEls=null;return null;} // F13: hidden reference sheet contributes no snap candidates (don't snap to invisible linework — buildSnap :3062 + snapPerpTargets :3085)
|
|
3047
3105
|
const els=filterElsForPlan();
|
|
3048
3106
|
if(!els){_ovSnap=null;_ovSnapEls=null;return null;} // scanned raster / empty → nothing traced to snap to
|
|
3049
3107
|
if(els===_ovSnapEls&&_ovSnap)return _ovSnap; // same sheet's vectors → reuse the parse
|
|
@@ -4154,6 +4212,8 @@ function updCalloutToggle(){const b=document.getElementById('calloutToggleB');if
|
|
|
4154
4212
|
document.getElementById('calloutToggleB').onclick=e=>{e.stopPropagation();calloutsVisible=!calloutsVisible;updCalloutToggle();render();};
|
|
4155
4213
|
function updPlToggle(){const b=document.getElementById('plToggleB');if(b){const on=!!(C.prop_labels&&C.prop_labels.vis2d);b.classList.toggle('on',on);b.setAttribute('aria-checked',String(on));}} // B1: 2D property-label visibility (independent of 3D)
|
|
4156
4214
|
document.getElementById('plToggleB').onclick=e=>{e.stopPropagation();C.prop_labels.vis2d=!C.prop_labels.vis2d;updPlToggle();refreshPropLabels();}; // refreshPropLabels → scheduleSave()+render(): repaints the 2D chips (gated by vis2d) and persists the choice
|
|
4215
|
+
function updRefToggle(){const b=document.getElementById('refToggleB');if(!b)return;b.disabled=!hasOverlay();b.classList.toggle('on',refSheetOn);b.setAttribute('aria-checked',String(refSheetOn));} // F13: grey the row out on a plan with no reference sheet (mirrors updGridToggle's no-grid disable)
|
|
4216
|
+
document.getElementById('refToggleB').onclick=e=>{e.stopPropagation();refSheetOn=!refSheetOn;try{localStorage.setItem('steel:refSheet:v1',refSheetOn?'1':'0');}catch(_){}updRefToggle();render();}; // render() rebuilds the SVG (overlaySvg gone/back) and buildSnap re-reads overlaySnapGeom (snap candidates gone/back)
|
|
4157
4217
|
document.getElementById('gridEditB').onclick=()=>{setGridMode(!gridMode);render();};
|
|
4158
4218
|
document.getElementById('dimStyleB').onclick=()=>{setDimStyleMode(!dimStyleMode);render();};
|
|
4159
4219
|
document.getElementById('gridToggleB').onclick=e=>{e.stopPropagation();gridSetVisible(!gridOn());};
|
|
@@ -4821,7 +4881,7 @@ function wireTypeFilter(p){
|
|
|
4821
4881
|
b.onkeydown=e=>{if(e.key==='Enter'||e.key===' '){e.preventDefault();e.stopPropagation();act(e.altKey);}}; // native <button> Enter/Space bubbles to the global idle-repeat-last handler (:3838, !inForm) which preventDefaults activation — activate here + stopPropagation, mirroring the F12 RFI pill (:2632). Alt+Enter/Space isolates (keyboard parity).
|
|
4822
4882
|
});
|
|
4823
4883
|
}
|
|
4824
|
-
function profileKeyOf(m){return (m&&m.profile
|
|
4884
|
+
function profileKeyOf(m){return canonProfile(m&&m.profile);} // matches the scene group key (contract-to-scene canonProfile)
|
|
4825
4885
|
function categoryOfProfile(profKey){for(const m of (P.members||[]))if(profileKeyOf(m)===profKey)return memberTypeOf(m);return 'beam';} // a profile-group's category = the type of its member(s)
|
|
4826
4886
|
let legendMode=(localStorage.getItem('floless.legendMode')==='type')?'type':'profile';
|
|
4827
4887
|
let collapsedCats=new Set((()=>{try{return JSON.parse(localStorage.getItem('floless.legendCollapsed')||'[]');}catch{return [];}})());
|
|
@@ -6071,11 +6131,11 @@ const BANDPILL={verified:'background:#166534;color:#86efac',high:'background:#14
|
|
|
6071
6131
|
// "×" IS the AISC lb/ft (W10X33 = 33). Resolves a valid size even with no weights map — but ONLY a size that
|
|
6072
6132
|
// actually exists in the AISC catalogue (SHAPES), so a regex-matching but non-standard string (e.g. W99X999)
|
|
6073
6133
|
// stays unresolved (RFI) instead of being trusted for a bogus name-encoded weight.
|
|
6074
|
-
function _nominalPlf(p){const k=String(p||'').toUpperCase().replace(/\s/g,'');const m=k.match(/^(W|M|S|HP|C|MC|WT|MT|ST)\d+(?:\.\d+)?X([\d.]+)$/);if(!m)return null;const _S=window.__AISC_SHAPES;if(_S&&!_S.has(k))return null;return parseFloat(m[2]);}
|
|
6134
|
+
function _nominalPlf(p){const k=String(p||'').toUpperCase().replace(/\s/g,'').replace(/×/g,'X');const m=k.match(/^(W|M|S|HP|C|MC|WT|MT|ST)\d+(?:\.\d+)?X([\d.]+)$/);if(!m)return null;const _S=window.__AISC_SHAPES;if(_S&&!_S.has(k))return null;return parseFloat(m[2]);}
|
|
6075
6135
|
function _ensureWt(p){if(p&&WT&&WT[p]==null){const v=_nominalPlf(p);if(v!=null)WT[p]=v;}}
|
|
6076
6136
|
function _wt(profile){if(!profile)return null;
|
|
6077
6137
|
if(WT&&profile in WT&&WT[profile]!=null)return WT[profile];
|
|
6078
|
-
if(WT){const h=Object.entries(WT).find(([k])=>k
|
|
6138
|
+
if(WT){const t=canonProfile(profile);const h=Object.entries(WT).find(([k])=>canonProfile(k)===t);if(h&&h[1]!=null)return h[1];} // shared canonProfile identity so a ×/spaced designation matches its weight-map key
|
|
6079
6139
|
return _nominalPlf(profile);} // fall back to the lb/ft encoded in a standard designation
|
|
6080
6140
|
const _isMf=p=>!!p&&/(^|[^A-Z])MF($|[^A-Z])/i.test(p);
|
|
6081
6141
|
// Elevation-aware coincident dedupe for the browser confidence panel — same footprint+wildcard-elevation logic as
|
|
@@ -6583,6 +6643,7 @@ if(new URLSearchParams(location.search).get('selftest')==='1'){(function(){
|
|
|
6583
6643
|
if(typeof C!=='undefined'&&C)C.filter=sflt;_ovSnapEls=null;Object.assign(snapEnabled,se);snapOnly=so;P.members=sm;P.segments=ss;P.dims=sd;dimsVisible=sdv;zoom=sz;}
|
|
6584
6644
|
// 10c) Overlay (traced PDF filter) linework as a ⟂ target (reusing B3 overlaySnapGeom) + els-identity cache rebuild
|
|
6585
6645
|
{if(typeof C!=='undefined'&&C){const sm=P.members,ss=P.segments,sd=P.dims,sdv=dimsVisible,ssh=P.sheet,sz=zoom,se=Object.assign({},snapEnabled),so=snapOnly,sflt=C.filter;
|
|
6646
|
+
const _srs=refSheetOn;refSheetOn=true; // F13: overlay snapping requires the reference sheet shown — force it on for these overlay-snap assertions (a persisted OFF in localStorage would otherwise fail them)
|
|
6586
6647
|
zoom=1;snapOnly=null;P.members=[];P.segments=[];P.dims=[];dimsVisible=false;P.sheet='__perptest'; // isolate: no member/segment/dim geometry → only the overlay is a candidate
|
|
6587
6648
|
snapEnabled.end=false;snapEnabled.int=false;snapEnabled.mid=false;snapEnabled.line=false;snapEnabled.ext=false;snapEnabled.perp=true;snapEnabled.par=false;
|
|
6588
6649
|
C.filter={elements:[{kind:'line',x1:0,y1:100,x2:200,y2:100}]};_ovSnapEls=null;buildSnap(null,{noGrid:true}); // explicit x1 overlay line; NO member/grid → only the overlay can be hit
|
|
@@ -6591,7 +6652,7 @@ if(new URLSearchParams(location.search).get('selftest')==='1'){(function(){
|
|
|
6591
6652
|
const o2=snap(60,97,[60,140]);ok(o2.hit&&o2.kind==='perp'&&pnear([o2.x,o2.y],[60,100]),'⟂ targets OVERLAY d-path linework AND the els-identity cache rebuilt on the swapped array');
|
|
6592
6653
|
snapEnabled.perp=false;snapEnabled.par=true;
|
|
6593
6654
|
const opar=snap(70,102,[10,100]);ok(opar.kind!=='par','∥ does NOT target the overlay — a drag parallel to a traced line does not lock (overlay too dense to direction-match; parallel uses model geometry only)');
|
|
6594
|
-
C.filter=sflt;P.sheet=ssh;P.dims=sd;dimsVisible=sdv;_ovSnapEls=null;Object.assign(snapEnabled,se);snapOnly=so;P.members=sm;P.segments=ss;zoom=sz;}}
|
|
6655
|
+
refSheetOn=_srs;C.filter=sflt;P.sheet=ssh;P.dims=sd;dimsVisible=sdv;_ovSnapEls=null;Object.assign(snapEnabled,se);snapOnly=so;P.members=sm;P.segments=ss;zoom=sz;}}
|
|
6595
6656
|
// 10d) ⟂/∥ can target a DIMENSION line (square/parallel to a placed dimension)
|
|
6596
6657
|
{const sm=P.members,ss=P.segments,sd=P.dims,sdv=dimsVisible,sz=zoom,se=Object.assign({},snapEnabled),so=snapOnly,sflt=(typeof C!=='undefined'&&C)?C.filter:undefined;
|
|
6597
6658
|
if(typeof C!=='undefined'&&C)C.filter=null;_ovSnapEls=null;
|
|
@@ -6603,6 +6664,7 @@ if(new URLSearchParams(location.search).get('selftest')==='1'){(function(){
|
|
|
6603
6664
|
if(typeof C!=='undefined'&&C)C.filter=sflt;_ovSnapEls=null;Object.assign(snapEnabled,se);snapOnly=so;P.members=sm;P.segments=ss;P.dims=sd;dimsVisible=sdv;zoom=sz;}
|
|
6604
6665
|
// 11b) B3 — snapping to the traced PDF overlay (filter vectors → endpoint/nearest/midpoint) + the path parser
|
|
6605
6666
|
{const sm=P.members,ss=P.segments,sd=P.dims,sf=C.filter,ssh=P.sheet,sdv=dimsVisible,sz=zoom;
|
|
6667
|
+
const _srs2=refSheetOn;refSheetOn=true; // F13: force the reference sheet shown for the overlay-snap assertions
|
|
6606
6668
|
zoom=1;P.members=[];P.segments=[];P.dims=[];dimsVisible=false;P.sheet='__ovtest';
|
|
6607
6669
|
C.filter={elements:[{kind:'line',d:'M 0 0 L 100 0 L 100 40'}]}; // an L-polyline (0,0)→(100,0)→(100,40)
|
|
6608
6670
|
_ovSnapEls=null;buildSnap(null,{noGrid:true}); // reset the cache (keys on els identity), then rebuild
|
|
@@ -6610,6 +6672,7 @@ if(new URLSearchParams(location.search).get('selftest')==='1'){(function(){
|
|
|
6610
6672
|
const om=snap(50,2);ok(om.hit&&om.kind==='mid'&&pnear([om.x,om.y],[50,0]),'overlay → snaps to a traced segment midpoint (△)');
|
|
6611
6673
|
const ol=snap(30,3);ok(ol.hit&&pnear([ol.x,ol.y],[30,0]),'overlay → snaps onto a traced line (nearest)');
|
|
6612
6674
|
_ovSnapEls=null;buildSnap(null,{noGrid:true,noOverlay:true});const on=snap(2,2);ok(!on.hit,'opts.noOverlay excludes the overlay from the snap set');
|
|
6675
|
+
refSheetOn=false;_ovSnapEls=null;buildSnap(null,{noGrid:true});ok(!snap(2,2).hit,'F13: a hidden reference sheet (refSheetOn=false) excludes the traced overlay from the snap set');refSheetOn=true;_ovSnapEls=null;buildSnap(null,{noGrid:true});
|
|
6613
6676
|
// parser handles the full line-ish grammar so snapping stays in step with what overlaySvg() draws
|
|
6614
6677
|
{const g=[];parsePathSegs('M 0 0 L 10 0 C 12 5 14 5 16 0',(a,b)=>g.push([a,b]));
|
|
6615
6678
|
ok(g.length===2&&pnear(g[0][0],[0,0])&&pnear(g[0][1],[10,0])&&pnear(g[1][1],[16,0]),'parsePathSegs: M/L segment + C chord to endpoint');}
|
|
@@ -6620,7 +6683,7 @@ if(new URLSearchParams(location.search).get('selftest')==='1'){(function(){
|
|
|
6620
6683
|
P.members=[{id:'col',wp:[[200,0],[200,50]]}];C.filter={elements:[{kind:'line',d:'M 5 30 L 5 60'}]}; // authored column far away; overlay vertices sit at x=5
|
|
6621
6684
|
_ovSnapEls=null;buildSnap(null,{noGrid:true});
|
|
6622
6685
|
const aa=snap(7,500);ok(!aa.hit&&aa.x===7,'axis-align ignores overlay vertices — a free point is NOT silently pulled to a drawing column');
|
|
6623
|
-
C.filter=sf;P.sheet=ssh;_ovSnapEls=null;P.members=sm;P.segments=ss;P.dims=sd;dimsVisible=sdv;zoom=sz;}
|
|
6686
|
+
refSheetOn=_srs2;C.filter=sf;P.sheet=ssh;_ovSnapEls=null;P.members=sm;P.segments=ss;P.dims=sd;dimsVisible=sdv;zoom=sz;}
|
|
6624
6687
|
// 11) member length — true 3D distance between the two end nodes: level beam = plan run, plumb column = TOS−BOS
|
|
6625
6688
|
// height (its plan points coincide → 0 plan distance), and a SLOPED member picks up its elevation rise.
|
|
6626
6689
|
{const sf=FT,st=defaultTOS;FT=12;defaultTOS=198;
|
|
@@ -6692,6 +6755,22 @@ if(new URLSearchParams(location.search).get('selftest')==='1'){(function(){
|
|
|
6692
6755
|
ok(pts.every(p=>p[0]>=-0.01&&p[0]<=100.01),'brace arrowheads never overhang the work points');
|
|
6693
6756
|
ok(braceHeadPoints(m).length===3,'brace draws 3 heads (single higher + double lower)');}
|
|
6694
6757
|
|
|
6758
|
+
// F5: per member-type line-style resolution (tokens → px; default/absent renders as today; RFI keeps its own dash via render()'s !m.rfi gate).
|
|
6759
|
+
{const _sv=C.member_styles,bm={id:'msB',role:'beam',profile:'W16X26',memberType:'beam',wp:[[0,0],[100,0]],ends:[{},{}]};
|
|
6760
|
+
C.member_styles={};ok(memberLineStyle(bm)===null,'memberLineStyle: unstyled category → null (renders byte-identical to today)');
|
|
6761
|
+
C.member_styles={beam:{weight:'thick',dash:'dashed'}};const _r=memberLineStyle(bm);
|
|
6762
|
+
ok(_r&&_r.w===9&&_r.d==='14 8','memberLineStyle maps thick→9px + dashed→"14 8"');
|
|
6763
|
+
C.member_styles={beam:{weight:'med',dash:'solid'}};const _r2=memberLineStyle(bm);
|
|
6764
|
+
ok(_r2&&_r2.w===0&&_r2.d==='','med+solid → default (w=0,d="" so render() omits both inline attrs)');
|
|
6765
|
+
C.member_styles={beam:{weight:'thin',dash:'bogus'}};const _r3=memberLineStyle(bm);
|
|
6766
|
+
ok(_r3&&_r3.w===3&&_r3.d==='','an unknown dash token falls back to solid (no dasharray)');
|
|
6767
|
+
C.member_styles={beam:{weight:'thick',dash:'dashed'}};const _ss=JSON.parse(snapshot());
|
|
6768
|
+
ok(_ss.member_styles&&_ss.member_styles.beam&&_ss.member_styles.beam.weight==='thick','snapshot() captures member_styles → a setMemberLineStyle() edit() is undoable');
|
|
6769
|
+
ok(sanitizeMemberStyles({beam:{weight:'bogus',dash:'dashed'}}).beam.weight==='med','sanitizeMemberStyles clamps a bogus weight token to med (a corrupt draft can never reach the next save)');
|
|
6770
|
+
ok(!('x' in sanitizeMemberStyles({x:{weight:'med',dash:'solid'}})),'sanitizeMemberStyles drops an all-default entry');
|
|
6771
|
+
ok('beam' in sanitizeMemberStyles({Beam:{weight:'thick',dash:'solid'}}),'sanitizeMemberStyles normalises the type key (Beam→beam) so it matches memberTypeOf lookups');
|
|
6772
|
+
C.member_styles=_sv;}
|
|
6773
|
+
|
|
6695
6774
|
// ── the CLIENT MIRRORS of the server guards. These are the paths that actually bite the user while
|
|
6696
6775
|
// editing (silent geometry corruption), and the server tests do not protect them. (pr-test-analyzer)
|
|
6697
6776
|
ok(!_mElig(normBrace(mk({}))),'_mElig rejects a brace (never merges into a beam)');
|