@floless/app 0.137.3 → 0.137.4
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 +234 -187
- package/dist/web/grid-core.js +4 -2
- package/dist/web/steel-3d-core.js +117 -15
- package/dist/web/steel-3d-view.js +15 -14
- package/dist/web/steel-editor.html +30 -15
- package/dist/web/steel-model-commands.js +1 -2
- package/dist/web/steel-model-v2-commands.js +1 -1
- package/dist/web/steel-model-v2-projection.js +1 -1
- package/dist/web/steel-plan-transform.js +43 -0
- package/dist/web/steel-units.js +25 -0
- package/package.json +2 -1
package/dist/web/grid-core.js
CHANGED
|
@@ -17,8 +17,10 @@
|
|
|
17
17
|
* `lines` holds individual free-angle grid/reference lines, used for skewed grids or partial one-offs.
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
// The same two constants `steel-3d-core` publishes, under this module's historic names (#951). One
|
|
21
|
+
// definition, in `steel-units`; the aliases are what every caller here already reads.
|
|
22
|
+
import { FT_TO_MM as FT_MM, IN_TO_MM as IN_MM } from './steel-units.js';
|
|
23
|
+
export { FT_MM, IN_MM };
|
|
22
24
|
|
|
23
25
|
const gcd = (a, b) => { while (b) { const t = a % b; a = b; b = t; } return a; };
|
|
24
26
|
export const truncateText = (value, maxLength = 40) => Array.from(String(value == null ? '' : value)).slice(0, maxLength).join('');
|
|
@@ -12,8 +12,14 @@
|
|
|
12
12
|
|
|
13
13
|
import { mmPerPx } from './grid-core.js';
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
// Defined once in the leaf `steel-units` module and re-exported here, because this file is the seam a
|
|
16
|
+
// dozen consumers already import them from and `grid-core` (which this file imports) needs them too.
|
|
17
|
+
// IMPORTED and then exported, NOT `export … from`: a pure re-export publishes the names without
|
|
18
|
+
// creating local bindings, and this module USES both of them (memberGeometry, POSITION_OFFSET_SNAP_MM).
|
|
19
|
+
// The first cut wrote the re-export form and every consumer still resolved them perfectly — while
|
|
20
|
+
// memberGeometry threw `IN_TO_MM is not defined` at run time. The full suite found it; nothing smaller did.
|
|
21
|
+
import { FT_TO_MM, IN_TO_MM } from './steel-units.js';
|
|
22
|
+
export { FT_TO_MM, IN_TO_MM };
|
|
17
23
|
|
|
18
24
|
/** Atomic capability marker: storage, readers, authoring and shipped guidance advance together. */
|
|
19
25
|
export const POSITION_BASIS_CAPABILITY_VERSION = 1;
|
|
@@ -250,12 +256,112 @@ export function clipSegmentToPlanes(a, b, planes = []) {
|
|
|
250
256
|
return [mix(lo), mix(hi)];
|
|
251
257
|
}
|
|
252
258
|
|
|
253
|
-
/**
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
+
/**
|
|
260
|
+
* THE clamped projection of a point onto a segment — the single implementation, for every caller.
|
|
261
|
+
*
|
|
262
|
+
* Seven hand-kept copies of this used to exist across the editor, the 3D view and the server (#951),
|
|
263
|
+
* in two dimensionalities, with three return shapes and four different rules for what counts as a
|
|
264
|
+
* degenerate segment. Nothing kept them in agreement, and this repo's own history is the list of what
|
|
265
|
+
* that costs (#647, #770). There is one now.
|
|
266
|
+
*
|
|
267
|
+
* `p`, `a` and `b` are plain number arrays in ONE coordinate space — the CALLER's. This math is
|
|
268
|
+
* space-agnostic: world millimetres, screen pixels and sheet display points all project the same way.
|
|
269
|
+
* Returns `{ distance, t, closest }`: `t` is the parameter along a→b clamped into [0,1], `closest` the
|
|
270
|
+
* point that parameter names, `distance` the straight-line distance from `p` to it.
|
|
271
|
+
*
|
|
272
|
+
* `rule` is the caller's OWN degeneracy rule, built with `SEG_DEGENERACY` below. It is a required
|
|
273
|
+
* argument, deliberately: the right rule IS caller-specific — 1e-9 mm² is a meaningless threshold in
|
|
274
|
+
* screen pixels — so quietly picking one for all seven would be a silent geometry change, which is
|
|
275
|
+
* exactly the failure class this unification exists to end. Converging them is separate work, per call
|
|
276
|
+
* site, each with its own evidence.
|
|
277
|
+
*
|
|
278
|
+
* The rule is a RULE, not just a number, because the seven originals did not merely use different
|
|
279
|
+
* thresholds — they used different COMPARISONS, and the difference is observable. Two reviewers found
|
|
280
|
+
* this independently after the first cut collapsed all four into `len2 > tol`:
|
|
281
|
+
* · `spDistToSeg`'s `L2 < 1e-9` and `distPointSeg`'s `len2 > 1e-9` disagree at exactly `len2 === 1e-9`,
|
|
282
|
+
* a constructible double: measured 0.9999683772233983 against 1.
|
|
283
|
+
* · `|| 1` substitutes a DENOMINATOR rather than short-circuiting, so a segment with one non-finite
|
|
284
|
+
* component answers all-NaN where `len2 > tol` answers `t = 0` and a partly finite point: measured
|
|
285
|
+
* `[NaN, NaN]` against `[0, NaN]`.
|
|
286
|
+
* Neither is reachable from sane geometry. Both are exactly the "dimensionally plausible, physically
|
|
287
|
+
* wrong, invisible in a screenshot" class #951 was written about, so both are modelled rather than
|
|
288
|
+
* argued away. `server/geometry-primitive-parity.test.ts` runs all seven originals verbatim against
|
|
289
|
+
* this one, including both of those cases.
|
|
290
|
+
*/
|
|
291
|
+
function projectOnSegment(p, a, b, rule, dims) {
|
|
292
|
+
// The CONSUMER validates, not only the factories. Review wrote the object literal by hand instead of
|
|
293
|
+
// calling `atMost()`, and a bare `{mode:'atMost'}` (no `len2`) then compared `len2 > undefined`,
|
|
294
|
+
// which is false for every segment — silently degenerate, always. `{mode:'below'}` is the mirror
|
|
295
|
+
// image: never degenerate. A wrong rule that answers confidently is the exact failure this redesign
|
|
296
|
+
// exists to end, so an unusable rule cannot reach the arithmetic.
|
|
297
|
+
if (!rule || !DEGENERACY_MODES.has(rule.mode)
|
|
298
|
+
|| (rule.mode !== 'unitDenominator' && !(typeof rule.len2 === 'number' && rule.len2 >= 0))) {
|
|
299
|
+
throw new TypeError('projectPointOnSegment: pass a rule built with SEG_DEGENERACY');
|
|
300
|
+
}
|
|
301
|
+
let len2 = 0, dot = 0;
|
|
302
|
+
for (let i = 0; i < dims; i++) { const d = b[i] - a[i]; len2 += d * d; dot += (p[i] - a[i]) * d; }
|
|
303
|
+
const clamp = (v) => Math.max(0, Math.min(1, v));
|
|
304
|
+
let t;
|
|
305
|
+
if (rule.mode === 'unitDenominator') t = clamp(dot / (len2 || 1));
|
|
306
|
+
else if (rule.mode === 'below') t = len2 < rule.len2 ? 0 : clamp(dot / len2);
|
|
307
|
+
else t = len2 > rule.len2 ? clamp(dot / len2) : 0;
|
|
308
|
+
const closest = dims === 2
|
|
309
|
+
? [a[0] + (b[0] - a[0]) * t, a[1] + (b[1] - a[1]) * t]
|
|
310
|
+
: [a[0] + (b[0] - a[0]) * t, a[1] + (b[1] - a[1]) * t, a[2] + (b[2] - a[2]) * t];
|
|
311
|
+
const distance = dims === 2
|
|
312
|
+
? Math.hypot(p[0] - closest[0], p[1] - closest[1])
|
|
313
|
+
: Math.hypot(p[0] - closest[0], p[1] - closest[1], p[2] - closest[2]);
|
|
314
|
+
return { distance, t, closest };
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
const DEGENERACY_MODES = new Set(['atMost', 'below', 'unitDenominator']);
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* The degeneracy rules the seven originals actually used — named, so a call site states its own and a
|
|
321
|
+
* reader can see at a glance which sites differ and where.
|
|
322
|
+
*
|
|
323
|
+
* There is deliberately NO default and no "recommended" one. Picking a favourite here is the converged
|
|
324
|
+
* tolerance #951 forbids; making the four visible side by side is what lets someone later converge them
|
|
325
|
+
* with evidence, per call site, which is the follow-up work the issue asks for.
|
|
326
|
+
*/
|
|
327
|
+
export const SEG_DEGENERACY = {
|
|
328
|
+
/**
|
|
329
|
+
* Project only when the squared length is GREATER than `len2`; otherwise t = 0. A non-finite squared
|
|
330
|
+
* length fails that test and so lands on t = 0. Three originals: `distPointSeg` (`> 1e-9` mm²),
|
|
331
|
+
* `distToSeg` (`> 0` screen px²) and `pointSegmentDistance2d` (`d2 ? … : 0`, which is `> 0` exactly,
|
|
332
|
+
* NaN included, because NaN is falsy).
|
|
333
|
+
*/
|
|
334
|
+
atMost: (len2) => {
|
|
335
|
+
if (!(typeof len2 === 'number' && len2 >= 0)) throw new TypeError('SEG_DEGENERACY.atMost: needs a non-negative number');
|
|
336
|
+
return Object.freeze({ mode: 'atMost', len2 });
|
|
337
|
+
},
|
|
338
|
+
/**
|
|
339
|
+
* t = 0 only when the squared length is STRICTLY BELOW `len2`; everything else projects, a non-finite
|
|
340
|
+
* squared length included (`NaN < tol` is false, so it divides and propagates). One original:
|
|
341
|
+
* `spDistToSeg`'s `if (L2 < 1e-9) return spDist(p, a)`, in display points².
|
|
342
|
+
*/
|
|
343
|
+
below: (len2) => {
|
|
344
|
+
if (!(typeof len2 === 'number' && len2 >= 0)) throw new TypeError('SEG_DEGENERACY.below: needs a non-negative number');
|
|
345
|
+
return Object.freeze({ mode: 'below', len2 });
|
|
346
|
+
},
|
|
347
|
+
/**
|
|
348
|
+
* Substitute a DENOMINATOR of 1 for a falsy squared length rather than short-circuiting — the `len2
|
|
349
|
+
* || 1` idiom. For an exactly zero-length segment this gives the same answer as `atMost(0)` (the
|
|
350
|
+
* numerator is zero too), and for a non-finite one it does not: the whole point comes back NaN
|
|
351
|
+
* instead of only the components that were. Three originals: `closestOnSeg`, `closestOnSeg3`, `projPt`.
|
|
352
|
+
*/
|
|
353
|
+
unitDenominator: Object.freeze({ mode: 'unitDenominator' }),
|
|
354
|
+
};
|
|
355
|
+
Object.freeze(SEG_DEGENERACY);
|
|
356
|
+
|
|
357
|
+
/** Clamped projection of a 2D point onto segment a-b. See `projectOnSegment` and `SEG_DEGENERACY`. */
|
|
358
|
+
export function projectPointOnSegment2d(p, a, b, rule) {
|
|
359
|
+
return projectOnSegment(p, a, b, rule, 2);
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
/** Clamped projection of a 3D point onto segment a-b. See `projectOnSegment` and `SEG_DEGENERACY`. */
|
|
363
|
+
export function projectPointOnSegment3d(p, a, b, rule) {
|
|
364
|
+
return projectOnSegment(p, a, b, rule, 3);
|
|
259
365
|
}
|
|
260
366
|
|
|
261
367
|
/**
|
|
@@ -647,13 +753,9 @@ export function snapElevation(z, levels, tol) {
|
|
|
647
753
|
// intersections (columns land on them); grid lines below member centerlines.
|
|
648
754
|
const PRECEDENCE = { origin: 0, vertex: 0, intersection: 1, 'grid-int': 1, midpoint: 2, centerline: 3, 'vertical-axis': 4, 'grid-line': 5, level: 1 }; // origin = the local UCS origin, ties with a vertex (a deliberate reference point)
|
|
649
755
|
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
let t = ((p[0] - a[0]) * ab[0] + (p[1] - a[1]) * ab[1] + (p[2] - a[2]) * ab[2]) / len2;
|
|
654
|
-
t = Math.max(0, Math.min(1, t));
|
|
655
|
-
return [a[0] + ab[0] * t, a[1] + ab[1] * t, a[2] + ab[2] * t];
|
|
656
|
-
}
|
|
756
|
+
// Snap candidates are world mm, and this caller's historic rule is `len2 || 1` — NOT the millimetre
|
|
757
|
+
// threshold `distPointSeg` uses: a near-degenerate stub member should still snap to its own point here.
|
|
758
|
+
function closestOnSeg(p, a, b) { return projectPointOnSegment3d(p, a, b, SEG_DEGENERACY.unitDenominator).closest; }
|
|
657
759
|
|
|
658
760
|
// Once per candidate TYPE, not once per session: a single global latch meant the first malformed kind
|
|
659
761
|
// silenced every later one, so a second, unrelated breakage would arrive with no trace at all. Keyed by
|
|
@@ -20,7 +20,8 @@ import { RoomEnvironment } from 'three/addons/RoomEnvironment.js';
|
|
|
20
20
|
import { surfaceTextures, applyTriplanar, TILE_MM, DIRECTIONAL } from './steel-materials.js';
|
|
21
21
|
import { canvasToolGuidanceState } from './steel-canvas-guidance.js';
|
|
22
22
|
import { Brush, Evaluator, SUBTRACTION } from 'three-bvh-csg';
|
|
23
|
-
import {
|
|
23
|
+
import { FT_TO_MM as FT_MM } from './steel-units.js';
|
|
24
|
+
import { snapPoint, planPointToWp, memberGeometry, snapElevation, dim3dGeom, dominantAxis3d, planeBasis, planeFrom3Points, frameFrom3Points, frameFromAngle, worldToLocal, identityFrame, resolvePointEntry, offsetsFor, candidateOnPlane, snapGridPoint, clipSegmentToPlanes, projectPointOnSegment2d, SEG_DEGENERACY, perspectiveSegmentParameter, gridDepthWins, segmentHitsRect2d, projectedFootprintHitsRect2d, pickGridLevel, selectedLengthLabelAnchors, sectionKindOf, sectionTopology, memberMeshAxes, positionSwingDelta, snapToStep, rollCommitNorm, unwrapAngleStep, translateEndpoints, livePositionState, swingBasis, swingEndpoint, swingBarriers, clampSwingTheta, POSITION_SWING_MARGIN_RAD, POSITION_OFFSET_SNAP_MM, POSITION_ROT_SNAP_DEG, POSITION_BASIS_CAPABILITY_VERSION } from './steel-3d-core.js';
|
|
24
25
|
// `gridGeometry`, `gridCandidates3d` and `mmPerPx` live behind the host's model read boundary because
|
|
25
26
|
// their display-scale argument is meaningless on a world-mm model grid.
|
|
26
27
|
import { visibleGridLevels, gridTransientScopeSignature, reconcileGridTransientState, objectSelectionStatus } from './grid-core.js';
|
|
@@ -82,7 +83,7 @@ let cube = null; // ViewCube { renderer, scene, cam,
|
|
|
82
83
|
let triad = null; // world-axis triad { renderer, scene, cam, group } — passive X/Y/Z readout
|
|
83
84
|
const DRAG_TOL_PX = 4; // movement past this = a drag (not a click)
|
|
84
85
|
const SNAP_TOL_PX = 10; // snap an endpoint to a target within this screen distance
|
|
85
|
-
|
|
86
|
+
// mm per foot (the dimension readout shows feet, matching the editor) — the shared constant (#951).
|
|
86
87
|
let built = false, fitPending = false;
|
|
87
88
|
const meshById = new Map(); // member id -> THREE.Mesh
|
|
88
89
|
const groupColor = new Map(); // group key -> THREE.Color
|
|
@@ -3412,11 +3413,10 @@ function sizeGridLabels() {
|
|
|
3412
3413
|
}
|
|
3413
3414
|
if (segs.length) lineSegs.set(id, segs);
|
|
3414
3415
|
}
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
};
|
|
3416
|
+
// Screen pixels, and this caller's historic rule is `len2 > 0` (#951 — the shared primitive lives in
|
|
3417
|
+
// steel-3d-core; the rule stays this caller's own).
|
|
3418
|
+
const distToSeg = (px, py, x1, y1, x2, y2) =>
|
|
3419
|
+
projectPointOnSegment2d([px, py], [x1, y1], [x2, y2], SEG_DEGENERACY.atMost(0)).distance;
|
|
3420
3420
|
const survivors = [];
|
|
3421
3421
|
for (const s of placed) {
|
|
3422
3422
|
const p = _spA.copy(s.position).project(camera);
|
|
@@ -5387,7 +5387,7 @@ function pickGridAt(cx,cy){
|
|
|
5387
5387
|
const frustum=gridCameraFrustum();
|
|
5388
5388
|
const screen=p=>{const v=new THREE.Vector3(...p).project(camera);return Number.isFinite(v.x)&&Number.isFinite(v.y)?[rect.left+(v.x*.5+.5)*rect.width,rect.top+(-v.y*.5+.5)*rect.height]:null;};
|
|
5389
5389
|
let best=null;
|
|
5390
|
-
for(const [id,line] of structGridLines){if(!line.visible)continue;const pts=line.userData.segments||[];for(let i=0;i+1<pts.length;i+=2){const sectionVisible=visibleGridSegment(pts[i],pts[i+1]),vis=sectionVisible&&cameraVisibleGridSegment(sectionVisible,frustum);if(!vis)continue;const a=screen(vis[0]),b=screen(vis[1]);if(!a||!b)continue;const hit=
|
|
5390
|
+
for(const [id,line] of structGridLines){if(!line.visible)continue;const pts=line.userData.segments||[];for(let i=0;i+1<pts.length;i+=2){const sectionVisible=visibleGridSegment(pts[i],pts[i+1]),vis=sectionVisible&&cameraVisibleGridSegment(sectionVisible,frustum);if(!vis)continue;const a=screen(vis[0]),b=screen(vis[1]);if(!a||!b)continue;const hit=projectPointOnSegment2d([cx,cy],a,b,SEG_DEGENERACY.atMost(0)),pixelDistance=hit.distance;if(pixelDistance>8)continue;const clip0=new THREE.Vector4(...vis[0],1).applyMatrix4(camera.matrixWorldInverse).applyMatrix4(camera.projectionMatrix),clip1=new THREE.Vector4(...vis[1],1).applyMatrix4(camera.matrixWorldInverse).applyMatrix4(camera.projectionMatrix),t=perspectiveSegmentParameter(hit.t,clip0.w,clip1.w),world=[vis[0][0]+(vis[1][0]-vis[0][0])*t,vis[0][1]+(vis[1][1]-vis[0][1])*t,vis[0][2]+(vis[1][2]-vis[0][2])*t],worldPoint=new THREE.Vector3(...world),distance=camera.position.distanceTo(worldPoint),depth=worldPoint.clone().project(camera).z;if(!best||pixelDistance<best.pixelDistance-0.01||(Math.abs(pixelDistance-best.pixelDistance)<=0.01&&distance<best.distance))best={id,bubble:false,distance,depth,pixelDistance};}}
|
|
5391
5391
|
return best;
|
|
5392
5392
|
}
|
|
5393
5393
|
|
|
@@ -7917,7 +7917,7 @@ function onUp(e) {
|
|
|
7917
7917
|
const planeZ = (g.line[0][2] + g.line[1][2]) / 2;
|
|
7918
7918
|
const hit = rayToPlane(e.clientX, e.clientY, planeZ); if (!hit) return;
|
|
7919
7919
|
if (p.targetId !== p.selId) return; // the cut click must land on the selected member's body
|
|
7920
|
-
const { pt: cut, t } =
|
|
7920
|
+
const { pt: cut, t } = closestOnSegXY([hit[0], hit[1]], g.line[0], g.line[1]); // nearest point ON the member (plan)
|
|
7921
7921
|
if (t <= 0.03 || t >= 0.97) return; // too near an end → no degenerate split
|
|
7922
7922
|
if (api && api.onSplit) api.onSplit(p.selId, planPointToWp(cut, ppf));
|
|
7923
7923
|
return;
|
|
@@ -7944,11 +7944,12 @@ function onUp(e) {
|
|
|
7944
7944
|
if (api && api.onSelect) api.onSelect(p.id, false); // keep the moved member selected
|
|
7945
7945
|
if (api && api.onMoveMember) api.onMoveMember(p.id, newWp); // editor writes wp via edit()
|
|
7946
7946
|
}
|
|
7947
|
-
//
|
|
7948
|
-
|
|
7949
|
-
|
|
7950
|
-
|
|
7951
|
-
|
|
7947
|
+
// Nearest point on segment a-b to plan point p — XY only, world mm, → { pt:[x,y], t }. The projection
|
|
7948
|
+
// is steel-3d-core's one implementation (#951); the tolerance stays this caller's historic rule, where
|
|
7949
|
+
// only a `len2 || 1` substitution stands in for a zero span. (The old name said 3; it was always planar.)
|
|
7950
|
+
function closestOnSegXY(p, a, b) {
|
|
7951
|
+
const { closest, t } = projectPointOnSegment2d(p, a, b, SEG_DEGENERACY.unitDenominator);
|
|
7952
|
+
return { pt: closest, t };
|
|
7952
7953
|
}
|
|
7953
7954
|
|
|
7954
7955
|
// ---- hover: cursor + readout chip (no drag in progress) ----
|
|
@@ -2587,6 +2587,15 @@ function claimMutation(id) { ownWrites.push(id); while (ownWrites.length > OWN_W
|
|
|
2587
2587
|
function releaseMutation(id) { const i = ownWrites.indexOf(id); if (i >= 0) ownWrites.splice(i, 1); }
|
|
2588
2588
|
let C, PAL, WT;
|
|
2589
2589
|
let CatalogPicker = null; // steel-catalog-picker.js — provider-neutral Profile and Material catalogue dialogs
|
|
2590
|
+
// mm per foot, from the ONE definition (#951) rather than a seventh copy of the number. This
|
|
2591
|
+
// classic script cannot `import` at the top level, so it is bound in boot() the moment SteelCore
|
|
2592
|
+
// resolves — before main() runs, and before anything that reads it can be called. Two top-level
|
|
2593
|
+
// literals deliberately keep their own 304.8: `V2_PT_PER_FT` is a drawing SCALE that equals this number
|
|
2594
|
+
// because that is what makes mm→px the identity, and `REF_UNIT_RATIOS` is a table of ratios. Renaming
|
|
2595
|
+
// those would not be de-duplication, and both are evaluated at load, before SteelCore exists.
|
|
2596
|
+
// mm-per-inch is NOT bound here: this file has no `const` for it to collapse, only arithmetic, and
|
|
2597
|
+
// rewriting scores of `/25.4` expressions is churn #951 deliberately did not ask for.
|
|
2598
|
+
let FT_TO_MM = null;
|
|
2590
2599
|
let SteelCore = null; // steel-3d-core.js module namespace — boot() awaits its dynamic import before main() so the classic script can call its pure helpers (sanitizeDims3d) at load
|
|
2591
2600
|
let ViewGen = null; // steel-view-generation.js pure F11 helpers — loaded before saved views are sanitised
|
|
2592
2601
|
let ModelCmd = null; // steel-model-commands.js — the model boundary's WRITE half (unit 5, P3a); the read half is steel-model-adapter.js
|
|
@@ -3125,6 +3134,7 @@ async function boot() {
|
|
|
3125
3134
|
import('./steel-catalog-picker.js'), import('./connection-review-client.js'), import('./steel-profile-colours.js'),
|
|
3126
3135
|
import('./steel-reference-sheet.js'), import('./steel-read-confidence.js'),
|
|
3127
3136
|
]);
|
|
3137
|
+
({ FT_TO_MM } = SteelCore); // the shared mm-per-foot, bound before main() and every reader of it
|
|
3128
3138
|
// The recorded bases ride along so the read can answer whether each still names what it is about to
|
|
3129
3139
|
// serve — see draftBaseEtags(). The separator is computed rather than assumed: CONTRACT_QS is EMPTY
|
|
3130
3140
|
// on the app-keyed URL, where a literal '&' would make the value part of the path query.
|
|
@@ -3719,7 +3729,7 @@ function ensureMeta(m){return ModelCmd.ensureMeta(m);} // unit 5 P3a: the mode
|
|
|
3719
3729
|
// MIRROR of server/contract-to-scene.ts depthPosition (same 0.5774 ≈ 30° threshold, mm units) — the
|
|
3720
3730
|
// inspector must highlight the SAME default the bake uses, or the 3D differs from what the panel says.
|
|
3721
3731
|
function posDefault(m){
|
|
3722
|
-
const k=
|
|
3732
|
+
const k=FT_TO_MM/((P&&P.pt_per_ft>0)?P.pt_per_ft:1);
|
|
3723
3733
|
const z0=(m.ends&&m.ends[0]&&m.ends[0].tos!=null)?m.ends[0].tos:defaultTOS;
|
|
3724
3734
|
const z1=(m.ends&&m.ends[1]&&m.ends[1].tos!=null)?m.ends[1].tos:defaultTOS;
|
|
3725
3735
|
const dz=Math.abs((z0||0)-(z1||0))*25.4, horiz=Math.hypot(m.wp[1][0]-m.wp[0][0],m.wp[1][1]-m.wp[0][1])*k;
|
|
@@ -5738,8 +5748,10 @@ function overlaySvg(){
|
|
|
5738
5748
|
function lineX(p1,p2,p3,p4){const x1=p1[0],y1=p1[1],x2=p2[0],y2=p2[1],x3=p3[0],y3=p3[1],x4=p4[0],y4=p4[1];
|
|
5739
5749
|
const den=(x1-x2)*(y3-y4)-(y1-y2)*(x3-x4);if(Math.abs(den)<1e-9)return null; // parallel → no intersection
|
|
5740
5750
|
const t=((x1-x3)*(y3-y4)-(y1-y3)*(x3-x4))/den;return [x1+t*(x2-x1),y1+t*(y2-y1)];}
|
|
5741
|
-
|
|
5742
|
-
|
|
5751
|
+
// Clamped projection of a display-point onto a member's drawn span, for extend/trim and split. The
|
|
5752
|
+
// math is SteelCore's one implementation (#951); the tolerance stays this caller's historic rule, where
|
|
5753
|
+
// only a `L2 || 1` denominator substitution stands in for a zero span — display points, not millimetres.
|
|
5754
|
+
function projPt(p,a,b){const r=SteelCore.projectPointOnSegment2d(p,a,b,SteelCore.SEG_DEGENERACY.unitDenominator);return {pt:r.closest,t:r.t};}
|
|
5743
5755
|
// --- local coordinate frame: P.frame={o:[ox,oy],u:[ux,uy]} (unit local-X); local-Y v=[uy,-ux] (right-hand,
|
|
5744
5756
|
// plan convention X-right→Y-up in y-down screen). null = global. The math is direction-only (origin o is
|
|
5745
5757
|
// just the glyph anchor). frameRot() = the frame's bearing baked into each dim's `rot`. ---
|
|
@@ -8413,7 +8425,10 @@ function panel(){
|
|
|
8413
8425
|
// editable. Global (ft-in): x=wpx·12/ppf, y=−wpy·12/ppf (Y-flip to world), z=this end's elevation (in).
|
|
8414
8426
|
// LOCAL = relative to the active frame — 3D→frame3d (Steel3DView.frameInfo, mm), 2D→P.frame (planar, plan-px);
|
|
8415
8427
|
// same view-scoped resolution updCS() uses. Typing a value moves that endpoint through the same edit() path as
|
|
8416
|
-
// every geometry pill (undo + 2D + 3D + autosave).
|
|
8428
|
+
// every geometry pill (undo + 2D + 3D + autosave). The 3D leg calls SteelCore.worldToLocal/localToWorld
|
|
8429
|
+
// directly (#951). It used to inline a copy of them, explained by "this script isn't a module" — true of
|
|
8430
|
+
// the top level, but boot() awaits the SteelCore import before main() runs, so nothing here was ever
|
|
8431
|
+
// unable to call it.
|
|
8417
8432
|
const _dpPpf=(P&&P.pt_per_ft>0)?P.pt_per_ft:1;
|
|
8418
8433
|
const _dpFI=(view3d&&window.Steel3DView&&window.Steel3DView.frameInfo)?window.Steel3DView.frameInfo():null;
|
|
8419
8434
|
const _dp3d=!!(_dpFI&&_dpFI.mode==='local'); // a 3D UCS (frame3d) is set
|
|
@@ -8425,14 +8440,12 @@ function panel(){
|
|
|
8425
8440
|
const _dpZin=i=>col?_dpColZ(i):effEndTos(m.ends[i]);
|
|
8426
8441
|
const _dpGlobal=i=>{const p=col?m.wp[0]:m.wp[i];return [p[0]*12/_dpPpf,-p[1]*12/_dpPpf,_dpZin(i)];}; // point i → world, inches (a column's Bottom/Top share wp[0])
|
|
8427
8442
|
const _dpToLocal=g=>{ // world-in [x,y,z] → local-in, or null
|
|
8428
|
-
if(_dp3d)
|
|
8429
|
-
return [(d[0]*X[0]+d[1]*X[1]+d[2]*X[2])/25.4,(d[0]*Y[0]+d[1]*Y[1]+d[2]*Y[2])/25.4,(d[0]*Z[0]+d[1]*Z[1]+d[2]*Z[2])/25.4];}
|
|
8443
|
+
if(_dp3d)return SteelCore.worldToLocal([g[0]*25.4,g[1]*25.4,g[2]*25.4],_dpFI).map(mm=>mm/25.4); // _dpFI IS a {origin,xAxis,yAxis,normal} frame
|
|
8430
8444
|
if(_dp2d){const o=P.frame.o,u=P.frame.u,px=g[0]*_dpPpf/12,py=-g[1]*_dpPpf/12,dx=px-o[0],dy=py-o[1];
|
|
8431
8445
|
return [(dx*u[0]+dy*u[1])*12/_dpPpf,(dx*u[1]-dy*u[0])*12/_dpPpf,g[2]];} // v=[uy,−ux]; Z′=global Z (planar frame)
|
|
8432
8446
|
return null;};
|
|
8433
8447
|
const _dpFromLocal=l=>{ // local-in [x,y,z] → world-in, or null
|
|
8434
|
-
if(_dp3d)
|
|
8435
|
-
return [(o[0]+L[0]*X[0]+L[1]*Y[0]+L[2]*Z[0])/25.4,(o[1]+L[0]*X[1]+L[1]*Y[1]+L[2]*Z[1])/25.4,(o[2]+L[0]*X[2]+L[1]*Y[2]+L[2]*Z[2])/25.4];}
|
|
8448
|
+
if(_dp3d)return SteelCore.localToWorld([l[0]*25.4,l[1]*25.4,l[2]*25.4],_dpFI).map(mm=>mm/25.4);
|
|
8436
8449
|
if(_dp2d){const o=P.frame.o,u=P.frame.u,du=l[0]*_dpPpf/12,dv=l[1]*_dpPpf/12,px=o[0]+du*u[0]+dv*u[1],py=o[1]+du*u[1]-dv*u[0];
|
|
8437
8450
|
return [px*12/_dpPpf,-py*12/_dpPpf,l[2]];}
|
|
8438
8451
|
return null;};
|
|
@@ -10320,7 +10333,7 @@ function csSyncF3d(){const d3=window.Steel3DView;if(!d3||!d3.frameInfo)return;
|
|
|
10320
10333
|
const pick=(d3.framePicking&&d3.framePicking())?(d3.framePickStep?d3.framePickStep():0):null, pickChanged=pick!==csPrevPick; csPrevPick=pick;
|
|
10321
10334
|
const wasArmed=armB?armB.classList.contains('on'):false; // arm/disarm edge — take over / release #panel only on the transition (+ pick-step changes), not on every drag tick
|
|
10322
10335
|
if(armB)armB.classList.toggle('on',armed);if(fields)fields.classList.toggle('on',armed);
|
|
10323
|
-
if(armed){const FT=
|
|
10336
|
+
if(armed){const FT=FT_TO_MM,set=(id,v)=>{const el=document.getElementById(id);if(el&&document.activeElement!==el)el.value=v;};
|
|
10324
10337
|
const ori=document.getElementById('csF3dOri');
|
|
10325
10338
|
if(fi.mode==='local'){
|
|
10326
10339
|
if(ori)ori.textContent=fi.horizontal?(Math.round(fi.angleDeg)+'°'+(fi.zUp?'':' · Z down')):('Tilted '+Math.round(fi.tiltDeg)+'° · Z '+(fi.zUp?'up':'down')); // read-only: set by the pick, spun by the ring; note a flipped-Z horizontal frame (Codex)
|
|
@@ -10329,7 +10342,7 @@ function csSyncF3d(){const d3=window.Steel3DView;if(!d3||!d3.frameInfo)return;
|
|
|
10329
10342
|
if((wasArmed!==armed||pickChanged)&&typeof panel==='function')panel();} // arm/disarm edge OR a pick-step change → repaint #panel (drag ticks don't, so no per-move rebuild)
|
|
10330
10343
|
document.getElementById('csArm3dB').onclick=()=>{const d3=window.Steel3DView;if(!d3||!d3.armFrame3d)return;const armed=!!(d3.frameArmed&&d3.frameArmed());d3.armFrame3d(!armed);csSyncF3d();updCS();};
|
|
10331
10344
|
['csF3dX','csF3dY','csF3dZ'].forEach(id=>{const el=document.getElementById(id);if(!el)return; // Origin X/Y/Z stay editable (translate-only); orientation is read-only (pick + ring)
|
|
10332
|
-
el.addEventListener('input',()=>{const d3=window.Steel3DView;if(!d3)return;const FT=
|
|
10345
|
+
el.addEventListener('input',()=>{const d3=window.Steel3DView;if(!d3)return;const FT=FT_TO_MM;
|
|
10333
10346
|
const fi=d3.frameInfo(),o=fi.origin?[...fi.origin]:[0,0,0],x=parseFloat(document.getElementById('csF3dX').value)*FT,y=parseFloat(document.getElementById('csF3dY').value)*FT,z=parseFloat(document.getElementById('csF3dZ').value)*FT;
|
|
10334
10347
|
d3.setFrameOrigin([isNaN(x)?o[0]:x,isNaN(y)?o[1]:y,isNaN(z)?o[2]:z]);
|
|
10335
10348
|
updCS();});});
|
|
@@ -11239,7 +11252,7 @@ const view3dApi={
|
|
|
11239
11252
|
sel3dDimIds=new Set(next);render();},
|
|
11240
11253
|
selDim3d:()=>[...sel3dDimIds],
|
|
11241
11254
|
newDim3dId:()=>'d3'+Date.now()+'_'+(dimSeq++), // same scheme as 2D dim ids (Date.now + dimSeq tie-breaker)
|
|
11242
|
-
fmtLen:(mm)=>fmtFtIn(mm/
|
|
11255
|
+
fmtLen:(mm)=>fmtFtIn(mm/FT_TO_MM*12),
|
|
11243
11256
|
toast:(m)=>toast(m),
|
|
11244
11257
|
teklaSelectionIds, // Ctrl+Shift drag-out: the sendable member ids (the badge count and the payload are the same list)
|
|
11245
11258
|
teklaSendBusy:()=>teklaSendBusy, // one drop at a time — the view refuses to start a second drag mid-send
|
|
@@ -11265,7 +11278,7 @@ const view3dApi={
|
|
|
11265
11278
|
closeCmHud:()=>{if(cmHudIsOpen())cmHudClose();}, // the view closes an open typed-entry HUD on frame drift / rebuild (invalidatePointEntry)
|
|
11266
11279
|
|
|
11267
11280
|
disarmAdd:()=>{if(mode==='add'){mode='sel';setMode();render();}},
|
|
11268
|
-
onAddMember3d:(aMm,bMm,basis)=>{if(!basis||!basis.ok){positionRefuse('Profile Position unavailable: the captured 3D authoring axes are invalid.');return;}const k=
|
|
11281
|
+
onAddMember3d:(aMm,bMm,basis)=>{if(!basis||!basis.ok){positionRefuse('Profile Position unavailable: the captured 3D authoring axes are invalid.');return;}const k=FT_TO_MM/((P&&P.pt_per_ft>0)?P.pt_per_ft:1),r6=n=>Math.round(n*1e6)/1e6; // mm → wp px (Y FLIPPED) + elevation inches
|
|
11269
11282
|
const wpA=[r6(aMm[0]/k),r6(-aMm[1]/k)],wpB=[r6(bMm[0]/k),r6(-bMm[1]/k)];
|
|
11270
11283
|
const zA=r6(aMm[2]/25.4),zB=r6(bMm[2]/25.4);
|
|
11271
11284
|
const hpx=Math.hypot(wpB[0]-wpA[0],wpB[1]-wpA[1]),hIn=hpx/FT*12,dzIn=Math.abs(zB-zA);
|
|
@@ -13236,7 +13249,7 @@ function refMeasureDropFor(id){
|
|
|
13236
13249
|
renderRefsTab();
|
|
13237
13250
|
}
|
|
13238
13251
|
/** The measured distance in the editor's own length format, plus the millimetres the input takes bare. */
|
|
13239
|
-
function refMeasureWords(mm){return fmtFtIn(mm/
|
|
13252
|
+
function refMeasureWords(mm){return fmtFtIn(mm/FT_TO_MM*12)+' ('+Math.round(mm).toLocaleString('en-US')+' mm)';}
|
|
13240
13253
|
/**
|
|
13241
13254
|
* What typing this value would do — SHARED by the live caution and the accept, so the number the caution
|
|
13242
13255
|
* names and the number the button applies can never be two different numbers. Returns null when the typed
|
|
@@ -17942,8 +17955,10 @@ function spConnText(end){const r=end&&end.conn?connRowById(end.conn):null;return
|
|
|
17942
17955
|
function spIsMoment(t){return /moment|fixed|\bmf\b|fully\s*weld/i.test(t||'');}
|
|
17943
17956
|
function spIsShear(t){return /shear|fin|tab|clip|simple|pin|web/i.test(t||'');}
|
|
17944
17957
|
function spDist(a,b){return Math.hypot(a[0]-b[0],a[1]-b[1]);}
|
|
17945
|
-
|
|
17946
|
-
|
|
17958
|
+
// Distance from a beam end to a candidate support's drawn span. SteelCore's one projection (#951);
|
|
17959
|
+
// the rule is this caller's own `L2 < 1e-9` in DISPLAY POINTS² — STRICTLY below, which is not the same as
|
|
17960
|
+
// the server's `> 1e-9`: the two disagree at exactly 1e-9, and that double is constructible.
|
|
17961
|
+
function spDistToSeg(p,a,b){return SteelCore.projectPointOnSegment2d(p,a,b,SteelCore.SEG_DEGENERACY.below(1e-9)).distance;}
|
|
17947
17962
|
function spSupportTol(pl){const p=pl||P,k=(p.pt_per_ft&&p.pt_per_ft>0)?p.pt_per_ft:12;return Math.max(6,0.75*k);} // ~9in at the given plan's scale, min 6 display-pts: "the beam end meets this member". pt_per_ft is PER-SHEET, so the tolerance must use the beam's OWN plane (below), not the active one.
|
|
17948
17963
|
function spInferSupport(beam,endIdx){if(!beam||!Array.isArray(beam.wp)||beam.wp.length<2)return null;const pt=beam.wp[endIdx];if(!pt)return null;
|
|
17949
17964
|
const pl=planeOfMember(beam)||P; // measure distances AND scale the tolerance in the beam's OWN sheet (wp are per-sheet 2D coords at that sheet's pt_per_ft — cross-sheet proximity is meaningless)
|
|
@@ -146,9 +146,8 @@
|
|
|
146
146
|
* previous version was stale within one PR, twice.
|
|
147
147
|
*/
|
|
148
148
|
|
|
149
|
-
const IN_MM = 25.4;
|
|
150
|
-
|
|
151
149
|
import { V2CommandError, dispatchV2ProjectionCommand } from './steel-model-v2-commands.js';
|
|
150
|
+
import { IN_TO_MM as IN_MM } from './steel-units.js';
|
|
152
151
|
import { gridLabelPatch, mmPerPx } from './grid-core.js';
|
|
153
152
|
|
|
154
153
|
/** Display-pixel scale for one plan — the shared `mmPerPx`, not a fourth copy to keep in lock-step. */
|
|
@@ -14,6 +14,7 @@ import { planViewId } from './steel-plan-view-id.js';
|
|
|
14
14
|
import { sheetPxToWorld, worldToSheetPx } from './steel-plan-transform.js';
|
|
15
15
|
import { memberPresence, projectionLink } from './steel-model-v2-projection.js';
|
|
16
16
|
import { axisLabelsFor, gridLabelPatch, parseSpacings } from './grid-core.js';
|
|
17
|
+
import { IN_TO_MM as IN_MM } from './steel-units.js';
|
|
17
18
|
import {
|
|
18
19
|
basisFromAxes, effectiveDepthPosition, effectiveWidthPosition, outlineFor, partFrame,
|
|
19
20
|
positionOffsetVector, reversePlacement, sectionExtents,
|
|
@@ -22,7 +23,6 @@ import {
|
|
|
22
23
|
} from './steel-3d-core.js';
|
|
23
24
|
export const POSITION_BASIS_COMMAND_VERSION=POSITION_BASIS_CAPABILITY_VERSION;
|
|
24
25
|
|
|
25
|
-
const IN_MM = 25.4;
|
|
26
26
|
const clone = (v) => typeof structuredClone === 'function'
|
|
27
27
|
? structuredClone(v)
|
|
28
28
|
: JSON.parse(JSON.stringify(v));
|
|
@@ -11,10 +11,10 @@ import { planViewId, planViewLabels } from './steel-plan-view-id.js';
|
|
|
11
11
|
* ask what a row's identity and display name are — rather than reading `.sheet` and hoping (#938). */
|
|
12
12
|
export { planViewId, planViewLabels };
|
|
13
13
|
import { sheetIncludesElevation,POSITION_BASIS_CAPABILITY_VERSION } from './steel-3d-core.js';
|
|
14
|
+
import { IN_TO_MM as IN_MM } from './steel-units.js';
|
|
14
15
|
export const POSITION_BASIS_PROJECTION_VERSION=POSITION_BASIS_CAPABILITY_VERSION;
|
|
15
16
|
import { worldToSheetPx, planTransform, PlanTransformError } from './steel-plan-transform.js';
|
|
16
17
|
|
|
17
|
-
const IN_MM = 25.4;
|
|
18
18
|
export const V2_PROJECTION_LINK = Symbol.for('floless.steelModelV2ProjectionLink');
|
|
19
19
|
|
|
20
20
|
const clone = (v) => v == null ? v : (typeof structuredClone === 'function'
|
|
@@ -259,3 +259,46 @@ export function sheetPxToWorld(point, plan, keepZ, subject) {
|
|
|
259
259
|
z: keepZ,
|
|
260
260
|
};
|
|
261
261
|
}
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* An ELEVATION or SECTION's `sourceRegistration` display point → canonical world-mm point.
|
|
265
|
+
*
|
|
266
|
+
* The non-plan half of the same boundary the rest of this module owns. A plan registers through two
|
|
267
|
+
* grid controls and resolves to a 2D similarity (`planTransform`); an elevation or section registers
|
|
268
|
+
* through an origin plus a pair of world axes, and a sheet offset becomes `worldOrigin + du·worldU +
|
|
269
|
+
* dv·worldV`. Different registration, same boundary — which is why it belongs here rather than being
|
|
270
|
+
* written out again by whoever needs it next. It was written out twice (#951): once to PLACE an
|
|
271
|
+
* observation (`member-end-centerline-report`) and once to VALIDATE that a stored control agrees with
|
|
272
|
+
* the frame it claims (`steel-model-v2`), in two different but equivalent algebraic arrangements, with
|
|
273
|
+
* a hand-written `304.8` each. A validator and the placement it validates drifting apart is a defect
|
|
274
|
+
* that reports itself as the data being wrong.
|
|
275
|
+
*
|
|
276
|
+
* `displayOrigin[1] - point[1]` is not a sign slip: sheet Y runs DOWN and the registered `worldV` runs
|
|
277
|
+
* up the drawing, so the v component is measured against the sheet, not with it.
|
|
278
|
+
*
|
|
279
|
+
* The caller must have already established that `ptPerFt` is a positive finite number — both do, and
|
|
280
|
+
* both refuse the document otherwise, with their own message naming their own field. Returns the point
|
|
281
|
+
* unrounded and unchecked: `x`, `y` and `z.known` are whatever the registration produces, so a caller
|
|
282
|
+
* that cares about finiteness still asks. (Deliberately NOT put through `clean()` like the plan path —
|
|
283
|
+
* that would round at 1e-9 mm, which is a change to both callers' answers for no reason either asked for.)
|
|
284
|
+
*
|
|
285
|
+
* The types are spelled out because both callers are TypeScript. Without them this seam hands back
|
|
286
|
+
* `any`, and the placement site loses the very check — "is this a KNOWN elevation" — that decides
|
|
287
|
+
* whether an observation may be used at all.
|
|
288
|
+
*
|
|
289
|
+
* @param {number[]} point sheet display point [x, y]
|
|
290
|
+
* @param {{ displayOrigin: number[], worldOrigin: { x: number, y: number, z: { known: number } }, worldU: number[], worldV: number[] }} registration
|
|
291
|
+
* @param {number} ptPerFt the enclosing view's drawing scale; the caller has already refused a non-positive one
|
|
292
|
+
* @returns {{ x: number, y: number, z: { known: number } }}
|
|
293
|
+
*/
|
|
294
|
+
export function sourceRegistrationPointToWorld(point, registration, ptPerFt) {
|
|
295
|
+
const mmPerPoint = mmPerPx(ptPerFt);
|
|
296
|
+
const du = (point[0] - registration.displayOrigin[0]) * mmPerPoint;
|
|
297
|
+
const dv = (registration.displayOrigin[1] - point[1]) * mmPerPoint;
|
|
298
|
+
const o = registration.worldOrigin, u = registration.worldU, v = registration.worldV;
|
|
299
|
+
return {
|
|
300
|
+
x: o.x + u[0] * du + v[0] * dv,
|
|
301
|
+
y: o.y + u[1] * du + v[1] * dv,
|
|
302
|
+
z: { known: o.z.known + u[2] * du + v[2] * dv },
|
|
303
|
+
};
|
|
304
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* steel-units.js — the two unit constants, defined once.
|
|
3
|
+
*
|
|
4
|
+
* `304.8` and `25.4` had 24 definitions across 18 files (#951). They are exact by definition (an inch
|
|
5
|
+
* IS 25.4 mm), so unlike the tolerances in `steel-3d-core`'s point-on-segment work there was never a
|
|
6
|
+
* risk that consolidating them changed an answer — the risk was the opposite one: a file that writes
|
|
7
|
+
* its own copy of a shared number is a file that can be edited alone, and every guard in this repo
|
|
8
|
+
* exists because something eventually was.
|
|
9
|
+
*
|
|
10
|
+
* WHY ITS OWN MODULE rather than living in `steel-3d-core`, where two of the copies already sat.
|
|
11
|
+
* `grid-core` needs them and `steel-3d-core` imports `grid-core`, so putting the canonical pair in
|
|
12
|
+
* `steel-3d-core` would make that pair circular. A leaf module both can import has no such problem.
|
|
13
|
+
* `steel-3d-core` and `grid-core` each re-export them under the names their consumers already use
|
|
14
|
+
* (`FT_TO_MM`/`IN_TO_MM` and `FT_MM`/`IN_MM`), so no existing import had to change and both remain the
|
|
15
|
+
* seams they were. Two names for one binding is not two definitions.
|
|
16
|
+
*
|
|
17
|
+
* NOT everything spelled 304.8 belongs here. `V2_PT_PER_FT` in the editor is a drawing SCALE that
|
|
18
|
+
* happens to equal this number because that is the value making mm→px the identity, and a
|
|
19
|
+
* `REF_UNIT_RATIOS` table is data. Replacing those would be renaming, not de-duplicating.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
/** Millimetres per foot. Exact: a foot is 12 inches of 25.4 mm. */
|
|
23
|
+
export const FT_TO_MM = 304.8;
|
|
24
|
+
/** Millimetres per inch. Exact by international definition since 1959. */
|
|
25
|
+
export const IN_TO_MM = 25.4;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@floless/app",
|
|
3
|
-
"version": "0.137.
|
|
3
|
+
"version": "0.137.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Thin localhost host for floless.app — serves web/ and shells the aware CLI. No engine, no LLM.",
|
|
6
6
|
"bin": {
|
|
@@ -60,6 +60,7 @@
|
|
|
60
60
|
"verify:instructor-wired": "node build/verify-instructor-wired.mjs",
|
|
61
61
|
"verify:carrier-escaping": "node build/verify-instructor-carrier-escaping.mjs",
|
|
62
62
|
"verify:producer-purity": "node build/verify-producer-purity.mjs",
|
|
63
|
+
"verify:geometry-primitives": "node build/verify-geometry-primitives.mjs",
|
|
63
64
|
"verify:claim-lock": "node ../tools/routine-claim.mjs selftest",
|
|
64
65
|
"typecheck": "tsc --noEmit",
|
|
65
66
|
"prepack": "npm run build",
|