@floless/app 0.91.0 → 0.91.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/floless-server.cjs
CHANGED
|
@@ -53106,7 +53106,7 @@ function appVersion() {
|
|
|
53106
53106
|
return resolveVersion({
|
|
53107
53107
|
isSea: isSea2(),
|
|
53108
53108
|
sqVersionXml: readSqVersionXml(),
|
|
53109
|
-
define: true ? "0.91.
|
|
53109
|
+
define: true ? "0.91.1" : void 0,
|
|
53110
53110
|
pkgVersion: readPkgVersion()
|
|
53111
53111
|
});
|
|
53112
53112
|
}
|
|
@@ -53116,7 +53116,7 @@ function resolveChannel(s) {
|
|
|
53116
53116
|
return "dev";
|
|
53117
53117
|
}
|
|
53118
53118
|
function appChannel() {
|
|
53119
|
-
return resolveChannel({ isSea: isSea2(), define: true ? "0.91.
|
|
53119
|
+
return resolveChannel({ isSea: isSea2(), define: true ? "0.91.1" : void 0 });
|
|
53120
53120
|
}
|
|
53121
53121
|
|
|
53122
53122
|
// workflow-update.ts
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
import * as THREE from 'three';
|
|
18
18
|
import { OrbitControls } from 'three/addons/OrbitControls.js';
|
|
19
19
|
import { Brush, Evaluator, SUBTRACTION } from 'three-bvh-csg';
|
|
20
|
-
import { snapCandidates, snapPoint, planPointToWp, memberGeometry, elevationLevels, snapElevation, dim3dGeom, planeBasis, planeFrom3Points, vecToPlane, frameFrom3Points, frameFromAngle } from './steel-3d-core.js';
|
|
20
|
+
import { snapCandidates, snapPoint, planPointToWp, memberGeometry, elevationLevels, snapElevation, dim3dGeom, planeBasis, planeFrom3Points, vecToPlane, frameFrom3Points, frameFromAngle, worldToLocal, identityFrame } from './steel-3d-core.js';
|
|
21
21
|
import { gridGeometry, gridCandidates3d, mmPerPx } from './grid-core.js';
|
|
22
22
|
|
|
23
23
|
let renderer, scene, perspCam, orthoCam, camera, controls, root, api, canvasEl, ro, rafId, grid, raycaster, downXY, lastPick = '(none)';
|
|
@@ -155,7 +155,12 @@ function init(canvas, theApi) {
|
|
|
155
155
|
readout.style.cssText = 'position:fixed;display:none;pointer-events:none;z-index:60;background:var(--panel,#0f172a);color:var(--text,#f8fafc);border:1px solid var(--line,#1e293b);border-radius:4px;padding:3px 7px;font:12px system-ui;white-space:nowrap;box-shadow:0 2px 8px rgba(0,0,0,.5)';
|
|
156
156
|
readout._dist = document.createElement('span');
|
|
157
157
|
readout._type = document.createElement('span'); readout._type.style.color = 'var(--mut,#94a3b8)';
|
|
158
|
-
|
|
158
|
+
// UCS Stage 2 — live local-coordinate row (X′/Y′/Z′): a block row that wraps below the length line;
|
|
159
|
+
// persistent label+value nodes updated per hover frame (textContent, never innerHTML). Hidden until fed.
|
|
160
|
+
readout._coord = document.createElement('div'); readout._coord.className = 'ro-coord'; readout._coord.style.display = 'none';
|
|
161
|
+
readout._coordL = []; readout._coordV = [];
|
|
162
|
+
for (let i = 0; i < 3; i++) { const lbl = document.createElement('span'); lbl.className = 'ro-lbl'; const val = document.createElement('b'); readout._coord.append(lbl, val); readout._coordL.push(lbl); readout._coordV.push(val); }
|
|
163
|
+
readout.append(readout._dist, readout._type, readout._coord);
|
|
159
164
|
document.body.appendChild(readout);
|
|
160
165
|
// 3D dimension tool: a group of placed-dim lines (over the steel) + a live preview line + an HTML
|
|
161
166
|
// overlay host for the midpoint labels (positioned each frame so they face the camera as screen text).
|
|
@@ -2451,6 +2456,8 @@ function renderFramePickPreview(e) {
|
|
|
2451
2456
|
if (!overlayScene || !framePickPts) return;
|
|
2452
2457
|
const r = dimPointAt(e), cur = r ? r.p : null;
|
|
2453
2458
|
if (r) showMarker(r.p, r.type); else if (marker) marker.visible = false; // snap reticle on EVERY step, including the origin pick
|
|
2459
|
+
if (cur) roShowCoordOnly(cur, e.clientX, e.clientY); // live coords of the cursor at every frame-set click (origin/X/Y)
|
|
2460
|
+
else if (readout) readout.style.display = 'none'; // cursor resolved to nothing (edge-on/miss) → don't freeze the last coord
|
|
2454
2461
|
if (!cur || !framePickPts.length) return; // origin step: just the reticle, no rubber-band yet
|
|
2455
2462
|
const g = new THREE.Group();
|
|
2456
2463
|
const line = (a, b, col, op) => { const l = new THREE.Line(new THREE.BufferGeometry().setFromPoints([new THREE.Vector3(...a), new THREE.Vector3(...b)]), new THREE.LineBasicMaterial({ color: col, transparent: true, opacity: op == null ? 0.95 : op })); l.material.depthTest = false; l.renderOrder = 998; return l; };
|
|
@@ -2610,7 +2617,7 @@ function tfGhostBuild(offs) {
|
|
|
2610
2617
|
}
|
|
2611
2618
|
function tfPreview(e) {
|
|
2612
2619
|
const st = cmActive(); if (!st || !tfDraft) return;
|
|
2613
|
-
const r = wpPointAt(e); if (!r) return;
|
|
2620
|
+
const r = wpPointAt(e); if (!r) { if (readout) readout.style.display = 'none'; return; } // cursor off the plane (edge-on) → clear the chip, don't freeze the last readout
|
|
2614
2621
|
const p = tfConstrain(r.p, e);
|
|
2615
2622
|
tfLast = p; tfLastClient = [e.clientX, e.clientY];
|
|
2616
2623
|
if (r.snap && tfAxis === 'free' && !e.shiftKey) showMarker(p, r.type); else marker.visible = false;
|
|
@@ -2628,6 +2635,7 @@ function tfPreview(e) {
|
|
|
2628
2635
|
readout._dist.textContent = api.fmtLen ? api.fmtLen(L) : (L / FT_MM).toFixed(2) + ' ft';
|
|
2629
2636
|
readout._type.textContent = r.snap ? ' · ' + (r.type || 'snap') : (st.tool === 'copy' && !st.array && st.count > 1 ? ' ×' + st.count : '');
|
|
2630
2637
|
readout.style.left = (e.clientX + 14) + 'px'; readout.style.top = (e.clientY + 14) + 'px'; readout.style.display = 'block';
|
|
2638
|
+
roCoords(p); // local coords of the destination point
|
|
2631
2639
|
}
|
|
2632
2640
|
function tfClick(e) {
|
|
2633
2641
|
const st = cmActive(); if (!st) return false;
|
|
@@ -2690,15 +2698,16 @@ function drClick(e) {
|
|
|
2690
2698
|
if (drRubber) drRubber.visible = false; readout.style.display = 'none'; // stays armed for the next member
|
|
2691
2699
|
}
|
|
2692
2700
|
function drPreview(e) {
|
|
2693
|
-
const r = wpPointAt(e); if (!r) return;
|
|
2701
|
+
const r = wpPointAt(e); if (!r) { if (readout) readout.style.display = 'none'; return; } // cursor off the plane (edge-on) → clear the chip, don't freeze the last readout
|
|
2694
2702
|
if (r.snap) showMarker(r.p, r.type); else marker.visible = false;
|
|
2695
|
-
if (!drDraft) {
|
|
2703
|
+
if (!drDraft) { roShowCoordOnly(r.p, e.clientX, e.clientY); return; } // before the start pick: show the start point's local coords
|
|
2696
2704
|
const p = drShiftLock(r.p, e);
|
|
2697
2705
|
if (!drRubber) { drRubber = new THREE.Line(new THREE.BufferGeometry().setFromPoints([new THREE.Vector3(), new THREE.Vector3()]), new THREE.LineBasicMaterial({ color: 0x22d3ee })); drRubber.material.depthTest = false; drRubber.renderOrder = 997; scene.add(drRubber); }
|
|
2698
2706
|
drRubber.geometry.setFromPoints([new THREE.Vector3(...drDraft), new THREE.Vector3(...p)]); drRubber.visible = true;
|
|
2699
2707
|
const L = Math.hypot(p[0] - drDraft[0], p[1] - drDraft[1], p[2] - drDraft[2]);
|
|
2700
2708
|
readout._dist.textContent = api.fmtLen ? api.fmtLen(L) : (L / FT_MM).toFixed(2) + ' ft'; readout._type.textContent = r.snap ? ' · ' + (r.type || 'snap') : '';
|
|
2701
2709
|
readout.style.left = (e.clientX + 14) + 'px'; readout.style.top = (e.clientY + 14) + 'px'; readout.style.display = 'block';
|
|
2710
|
+
roCoords(p); // local coords of the member end point
|
|
2702
2711
|
}
|
|
2703
2712
|
// world units per screen pixel at the target plane — drives screen-CONSTANT marker/dot sizes, for
|
|
2704
2713
|
// BOTH perspective (distance) and ortho (frustum height / zoom), so dots stay small when zoomed in.
|
|
@@ -2792,6 +2801,7 @@ function gridPlaneZ() {
|
|
|
2792
2801
|
function dimEffectiveAxis(alt) { return alt && dimDraft3d ? 'z' : dimAxis3d; }
|
|
2793
2802
|
|
|
2794
2803
|
function onDown(e) {
|
|
2804
|
+
if (readout) { readout.style.display = 'none'; if (readout._coord) readout._coord.style.display = 'none'; } // UCS Stage 2: hide the whole readout chip so a drag never shows a lingering coordinate (or an empty coord-only shell); the drag/next hover re-shows it
|
|
2795
2805
|
if (e.button === 2) { rightDownXY = [e.clientX, e.clientY]; rightMoved = false; } // arm the click-vs-drag test for the snap menu
|
|
2796
2806
|
if (e.button !== 0) return; // RIGHT/MIDDLE → OrbitControls (orbit/pan)
|
|
2797
2807
|
if (wpMode === 'face') { e.stopPropagation(); const r = wpFacePick(e.clientX, e.clientY); if (r) { workPlane = r; wpMode = null; canvasEl.style.cursor = 'default'; renderWorkPlane(); reflectWpBar(); if (api && api.toast) api.toast('Working plane set on the face'); } return; } // armed: one face click sets the plane
|
|
@@ -3126,6 +3136,30 @@ function closestOnSeg3(p, a, b) {
|
|
|
3126
3136
|
}
|
|
3127
3137
|
|
|
3128
3138
|
// ---- hover: cursor + readout chip (no drag in progress) ----
|
|
3139
|
+
// UCS Stage 2 — live local-coordinate readout. Show a resolved world point in the ACTIVE local frame
|
|
3140
|
+
// as X′/Y′/Z′ (measured from the local origin along its axes), or as plain global X/Y/Z at identity
|
|
3141
|
+
// (worldToLocal on identityFrame is a no-op), as a second row of the cursor readout chip. Fed once per
|
|
3142
|
+
// resolver step from the hover RAF (never double-subscribed); the row is cleared on pointerdown so a
|
|
3143
|
+
// drag never shows a lingering coordinate.
|
|
3144
|
+
const RO_IDENT = identityFrame(); // reused every global-mode hover so we don't alloc a frame per RAF
|
|
3145
|
+
const RO_AX = ['X', 'Y', 'Z'];
|
|
3146
|
+
function roFmt(mm) { if (Math.abs(mm) < 0.5) mm = 0; return api && api.fmtLen ? api.fmtLen(mm) : (mm / FT_MM).toFixed(2) + ' ft'; } // snap sub-1/16" float noise to 0 so a plane point never reads "-0""
|
|
3147
|
+
function roCoords(worldPt) {
|
|
3148
|
+
if (!readout || !readout._coord || !worldPt) return;
|
|
3149
|
+
const local = worldToLocal(worldPt, frame3d || RO_IDENT); // identity → the point's global coords
|
|
3150
|
+
const prime = frame3d ? '′' : ''; // U+2032 prime marks a local axis; plain X/Y/Z at global
|
|
3151
|
+
for (let i = 0; i < 3; i++) { readout._coordL[i].textContent = RO_AX[i] + prime + ' '; readout._coordV[i].textContent = roFmt(local[i]); }
|
|
3152
|
+
readout._coord.classList.toggle('ro-local', !!frame3d); // cyan the row only when a local frame is set (reuses #csStat.local's accent)
|
|
3153
|
+
readout._coord.style.display = '';
|
|
3154
|
+
}
|
|
3155
|
+
// A single-point pick with no length yet (base point, first Add/Move/Copy/Dim click, frame 3-click set):
|
|
3156
|
+
// show the chip with the coord row as its only content (clear the length line first).
|
|
3157
|
+
function roShowCoordOnly(worldPt, x, y) {
|
|
3158
|
+
if (!readout) return;
|
|
3159
|
+
readout._dist.textContent = ''; readout._type.textContent = '';
|
|
3160
|
+
roCoords(worldPt);
|
|
3161
|
+
readout.style.left = (x + 14) + 'px'; readout.style.top = (y + 14) + 'px'; readout.style.display = 'block';
|
|
3162
|
+
}
|
|
3129
3163
|
function onHoverMove(e) {
|
|
3130
3164
|
lastHoverXY = [e.clientX, e.clientY];
|
|
3131
3165
|
dimLastAlt = e.altKey; // remembered so the rAF body can rebuild a synthetic event
|
|
@@ -3142,6 +3176,7 @@ function onHoverMove(e) {
|
|
|
3142
3176
|
readout._dist.textContent = api.fmtLen ? api.fmtLen(p.z) : (p.z / 304.8).toFixed(2) + ' ft';
|
|
3143
3177
|
readout._type.textContent = p.snapped ? ' · ' + (p.label || 'level') : ' ↕';
|
|
3144
3178
|
readout.style.left = (lastHoverXY[0] + 14) + 'px'; readout.style.top = (lastHoverXY[1] + 14) + 'px'; readout.style.display = 'block';
|
|
3179
|
+
roCoords([p.x, p.y, p.z]);
|
|
3145
3180
|
} else { marker.visible = false; readout.style.display = 'none'; canvasEl.style.cursor = 'crosshair'; }
|
|
3146
3181
|
return;
|
|
3147
3182
|
}
|
|
@@ -3158,7 +3193,8 @@ function onHoverMove(e) {
|
|
|
3158
3193
|
canvasEl.style.cursor = 'crosshair';
|
|
3159
3194
|
if (tfDraft) tfPreview({ clientX: lastHoverXY[0], clientY: lastHoverXY[1], altKey: dimLastAlt, shiftKey: tfLastShift });
|
|
3160
3195
|
else { const r = wpPointAt({ clientX: lastHoverXY[0], clientY: lastHoverXY[1], altKey: dimLastAlt });
|
|
3161
|
-
if (r && r.snap) showMarker(r.p, r.type); else marker.visible = false;
|
|
3196
|
+
if (r && r.snap) showMarker(r.p, r.type); else marker.visible = false;
|
|
3197
|
+
if (r) roShowCoordOnly(r.p, lastHoverXY[0], lastHoverXY[1]); else if (readout) readout.style.display = 'none'; } // local coords of the base point before it's picked
|
|
3162
3198
|
updateStatusChip(); return; }
|
|
3163
3199
|
if (clipMode) { canvasEl.style.cursor = 'crosshair'; if (clipMode === 'box') clipBoxPreviewAt(lastHoverXY[0], lastHoverXY[1]); return; } // armed clip pick: crosshair (+ live box preview while drawing)
|
|
3164
3200
|
if (dimMode3d) { // dim tool: snap marker + live preview line + readout (no member hover)
|
|
@@ -3173,7 +3209,10 @@ function onHoverMove(e) {
|
|
|
3173
3209
|
readout._dist.textContent = api.fmtLen ? api.fmtLen(g.valueMm) : (g.valueMm / 304.8).toFixed(2) + ' ft';
|
|
3174
3210
|
readout._type.textContent = r.type ? ' · ' + r.type : (dimLastAlt ? ' ↕' : '');
|
|
3175
3211
|
readout.style.left = (lastHoverXY[0] + 14) + 'px'; readout.style.top = (lastHoverXY[1] + 14) + 'px'; readout.style.display = 'block';
|
|
3176
|
-
|
|
3212
|
+
roCoords(r.p); // local coords of the second dim point
|
|
3213
|
+
} else { dimPreviewLine.visible = false;
|
|
3214
|
+
if (r && !dimDraft3d) roShowCoordOnly(r.p, lastHoverXY[0], lastHoverXY[1]); // first dim point: coords-only chip
|
|
3215
|
+
else if (readout) readout.style.display = 'none'; } // no point (or a draft with the cursor off-plane) → clear the chip, don't freeze the last readout
|
|
3177
3216
|
return;
|
|
3178
3217
|
}
|
|
3179
3218
|
if (framePicking()) { // 3-click UCS set in progress: live rubber-band X/Y + Z-flip arrow, snap marker at the cursor
|
|
@@ -3363,6 +3402,7 @@ window.Steel3DView = {
|
|
|
3363
3402
|
workAreaSetAll, workAreaFromSelection, workAreaToggle, workAreaSetWhole, clearWorkArea, workAreaState,
|
|
3364
3403
|
armWorkPlanePick, setWorkPlanePrincipal, clearWorkPlane, toggleWorkPlaneVisible, workPlaneInfo,
|
|
3365
3404
|
armFrame3d, disarmFrame3d, repickFrame3d, setFrame3d, setFrameBasis, setFrameAngle, setFrameOrigin, clearFrame3d, frameInfo, frameArmed: () => frameMode, framePicking, framePickStep, frameHandlesScreen, // 3D local drawing frame (UCS stage 1)
|
|
3405
|
+
coordReadout: () => { if (!readout || !readout._coord || readout.style.display === 'none' || readout._coord.style.display === 'none') return null; return { local: readout._coord.classList.contains('ro-local'), values: readout._coordV.map((v) => v.textContent), labels: readout._coordL.map((l) => l.textContent.trim()), text: readout._coord.textContent }; }, // UCS stage 2 test probe: the live local-coordinate row (null when hidden)
|
|
3366
3406
|
cmEscape, cmHasBase, cmClear3d, setCmAxis, cmLastClient, cmHudApply,
|
|
3367
3407
|
drClear3d, drEscape: () => { if (drDraft) { drDraft = null; drClear3d(); return true; } return false; },
|
|
3368
3408
|
toggleDimTool, setDimAxis, dimAxis, setDims3dVisible, dims3dVisible, refreshDims,
|
|
@@ -148,6 +148,11 @@
|
|
|
148
148
|
#csStat.local{border:1px solid #22d3ee;background:rgba(34,211,238,.10);border-radius:4px;padding:1px 6px;cursor:pointer} /* lift the chip out of the muted row when a local frame/plane is active (reuses the dim/accent cyan — no new colour); clickable → reset to global */
|
|
149
149
|
#snapStat{cursor:pointer;border:1px solid #22d3ee;background:rgba(34,211,238,.10);border-radius:4px;padding:1px 6px} /* snap-override chip — same cyan treatment as #csStat.local; the cyan IS the snap-marker colour it restricts */
|
|
150
150
|
#snapStat:hover b{color:#fff}
|
|
151
|
+
/* UCS stage 2 — live local-coordinate row inside the 3D cursor readout chip (steel-3d-view.js builds the element). */
|
|
152
|
+
.ro-coord{font-variant-numeric:tabular-nums;color:var(--mut,#94a3b8);white-space:nowrap;font-size:12px}
|
|
153
|
+
.ro-coord .ro-lbl{margin-left:9px} .ro-coord .ro-lbl:first-child{margin-left:0}
|
|
154
|
+
.ro-coord b{color:var(--text,#f8fafc);font-weight:400}
|
|
155
|
+
.ro-coord.ro-local,.ro-coord.ro-local b{color:#22d3ee} /* whole row goes cyan when a local frame is set — reuses #csStat.local's accent, no new colour */
|
|
151
156
|
#snapMenu{position:fixed;left:0;top:0;z-index:45;min-width:186px} /* right-click snap menu — reuses the .m3dmenu skin, opened at the cursor */
|
|
152
157
|
#snapMenu .sg{display:inline-block;width:17px;color:#22d3ee} /* leading glyph = the marker the cursor will show */
|
|
153
158
|
#snapMenu button.dim{opacity:.55} /* a running-snap turned off in the ⋯ menu — still forceable here (AutoCAD-style) */
|