beckhoff-xts-viewer-3d 3.0.0 → 4.0.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/README.md +23 -21
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +102 -125
- package/dist/index.d.ts +102 -125
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/docs/screenshots/README.md +1 -1
- package/package.json +2 -3
package/dist/index.d.cts
CHANGED
|
@@ -12,7 +12,7 @@ import { GLTF } from 'three-stdlib';
|
|
|
12
12
|
* Run `npm run sync-version` (or any script that depends on it) to refresh
|
|
13
13
|
* after bumping the package version.
|
|
14
14
|
*/
|
|
15
|
-
declare const VERSION: "
|
|
15
|
+
declare const VERSION: "4.0.0";
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* Default CDN URL for the GLB asset bundle (`beckhoff-xts-viewer-3d-assets`).
|
|
@@ -37,25 +37,24 @@ declare const JSDELIVR_ASSETS_BASE_URL: "https://cdn.jsdelivr.net/npm/beckhoff-x
|
|
|
37
37
|
/**
|
|
38
38
|
* Public type surface for beckhoff-xts-viewer-3d.
|
|
39
39
|
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
* Component boundary — props, refs, callbacks — is declared here.
|
|
40
|
+
* Anything that crosses the Component boundary — props, refs, callbacks —
|
|
41
|
+
* is declared here.
|
|
43
42
|
*/
|
|
44
|
-
/** Beckhoff XTS module types supported by the 3D viewer
|
|
43
|
+
/** Beckhoff XTS module types supported by the 3D viewer. */
|
|
45
44
|
type ModuleType3D = 'AT2000_0250' | 'AT2001_0250' | 'AT2002_0250' | 'AT2002_0249' | 'AT2002_0249_ZX2002_0001' | 'AT2000_0233' | 'AT2000_0249' | 'AT2100_0250' | 'AT2102_0250' | 'AT2020_0250' | 'AT2021_0250' | 'AT2025_0250' | 'AT2026_0250' | 'AT2040_0250' | 'AT2041_0250' | 'AT2042_0250' | 'AT2140_0250' | 'AT2050_0500' | 'AT2050_0501' | 'AT2050_0500_180' | 'AT2200_0500' | 'AT2202_0500' | 'ATH2000_0250' | 'ATH2001_0250' | 'ATH2002_0250' | 'ATH2020_0250' | 'ATH2040_0250' | 'ATH2041_0250' | 'ATH2042_0250' | 'ATH2050_0500' | 'ATH2050_0501' | 'ATH2050_0500_180';
|
|
46
45
|
/**
|
|
47
|
-
*
|
|
48
|
-
* (Beckhoff
|
|
46
|
+
* Rail system beneath the module. Only affects the visual mesh
|
|
47
|
+
* (Beckhoff aluminium rail vs. Hepco GFX), not the path math.
|
|
49
48
|
*
|
|
50
|
-
* `Beckhoff`
|
|
51
|
-
* AT-Standard
|
|
52
|
-
* Hepco
|
|
53
|
-
*
|
|
49
|
+
* `Beckhoff` is the Beckhoff aluminium guiding rail (all
|
|
50
|
+
* AT-Standard + Eco families); `HepcoGfx` is the alternative
|
|
51
|
+
* Hepco GFX profile. ATH modules ship with their rail baked into
|
|
52
|
+
* the module GLB and are independent of this choice.
|
|
54
53
|
*/
|
|
55
54
|
type RailSystem = 'Beckhoff' | 'HepcoGfx';
|
|
56
55
|
/** Beckhoff XTS + Hepco mover types. `Custom` requires `customMoverLayout`. */
|
|
57
56
|
type MoverType3D = 'AT9011_0050' | 'AT9011_0070' | 'AT9012_0050' | 'AT9014_0055' | 'AT9014_0070' | 'ATH9011_0075' | 'ATH9013_0075' | 'Hepco_GFX2_1TC_S25' | 'Custom';
|
|
58
|
-
/** Predefined mover-tool / carrier-plate types
|
|
57
|
+
/** Predefined mover-tool / carrier-plate types. */
|
|
59
58
|
type MoverToolType3D = 'AT8200_1000_0100' | 'AT8200_2000_0100' | 'Custom';
|
|
60
59
|
/**
|
|
61
60
|
* Beckhoff guiding-rail GLB variants. Rendered alongside the motor modules
|
|
@@ -137,11 +136,11 @@ interface XtsConfig {
|
|
|
137
136
|
processingUnits: ProcessingUnitConfig[];
|
|
138
137
|
stations?: StationConfig[];
|
|
139
138
|
/**
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
*
|
|
143
|
-
*
|
|
144
|
-
*
|
|
139
|
+
* Labelled regions along the track. Like a StationConfig, but
|
|
140
|
+
* without stop positions — only a coloured tube segment plus an
|
|
141
|
+
* optional description billboard. For zone markings (e.g. "Manual
|
|
142
|
+
* Access", "Safety Area", "Cleanroom") that have no
|
|
143
|
+
* machine stops.
|
|
145
144
|
*/
|
|
146
145
|
areas?: AreaConfig[];
|
|
147
146
|
infoBars?: InfoBarConfig[];
|
|
@@ -218,7 +217,7 @@ interface PartConfig {
|
|
|
218
217
|
* the contract is violated.
|
|
219
218
|
*/
|
|
220
219
|
objectId: number;
|
|
221
|
-
/** = ServerTypes.PartModel.ObjectId —
|
|
220
|
+
/** = ServerTypes.PartModel.ObjectId — unique system-wide. */
|
|
222
221
|
globalNumber: number;
|
|
223
222
|
modules: ModuleEntry[];
|
|
224
223
|
partTransformation?: PartTransformation;
|
|
@@ -291,16 +290,16 @@ interface MoverConfig {
|
|
|
291
290
|
* is unique across all movers in the config.
|
|
292
291
|
*/
|
|
293
292
|
id: number;
|
|
294
|
-
/**
|
|
293
|
+
/** References PartConfig.globalNumber. */
|
|
295
294
|
partOid: number;
|
|
296
|
-
/** [0, part.trackLengthMm] — clamped
|
|
295
|
+
/** [0, part.trackLengthMm] — clamped when out-of-bounds. */
|
|
297
296
|
partPositionMm: number;
|
|
298
297
|
status?: {
|
|
299
298
|
warning?: boolean;
|
|
300
299
|
error?: boolean;
|
|
301
300
|
};
|
|
302
301
|
selected?: boolean;
|
|
303
|
-
/**
|
|
302
|
+
/** Predefined tool carriers or custom GLBs attached to this mover. */
|
|
304
303
|
tools?: MoverToolConfig[];
|
|
305
304
|
}
|
|
306
305
|
/**
|
|
@@ -382,7 +381,7 @@ interface CustomAssetConfig {
|
|
|
382
381
|
}
|
|
383
382
|
interface DisplayOptions {
|
|
384
383
|
displayStations?: boolean;
|
|
385
|
-
/** Render
|
|
384
|
+
/** Render configured areas. Default: true (when `areas[]` is set). */
|
|
386
385
|
displayAreas?: boolean;
|
|
387
386
|
displayDimensions?: boolean;
|
|
388
387
|
showDriveErrors?: boolean;
|
|
@@ -431,7 +430,7 @@ interface DisplayOptions {
|
|
|
431
430
|
* Use during calibration to verify that adjacent modules' mating-faces
|
|
432
431
|
* are in geometrically the same place — when the corner spheres of two
|
|
433
432
|
* neighbouring modules overlap, the chain has C0 continuity at that
|
|
434
|
-
* boundary
|
|
433
|
+
* boundary. Off by default.
|
|
435
434
|
*/
|
|
436
435
|
showModuleCornerMarkers?: boolean;
|
|
437
436
|
/** Diameter (mm) of the corner-marker spheres. Default: 10. */
|
|
@@ -689,7 +688,7 @@ interface StationConfig {
|
|
|
689
688
|
partOids: number[];
|
|
690
689
|
startPositionOnPart: number;
|
|
691
690
|
endPositionOnPart: number;
|
|
692
|
-
/** ARGB int (
|
|
691
|
+
/** ARGB int (same as 2D). */
|
|
693
692
|
stationColor: number;
|
|
694
693
|
stopPositions?: number[];
|
|
695
694
|
/**
|
|
@@ -716,14 +715,14 @@ interface StationConfig {
|
|
|
716
715
|
stopMarkerSizeMm?: number;
|
|
717
716
|
}
|
|
718
717
|
/**
|
|
719
|
-
*
|
|
720
|
-
* `StationConfig`,
|
|
721
|
-
*
|
|
722
|
-
*
|
|
718
|
+
* Labelled region along the track. Identical to
|
|
719
|
+
* `StationConfig`, but without stop positions — areas only carry text +
|
|
720
|
+
* colour and describe a zone (e.g. "Cleanroom", "Manual Access",
|
|
721
|
+
* "Safety Loop") that does not trigger machine stops.
|
|
723
722
|
*
|
|
724
|
-
* Multi-part:
|
|
725
|
-
*
|
|
726
|
-
*
|
|
723
|
+
* Multi-part: same semantics as `StationConfig.partOids`. With a single
|
|
724
|
+
* partOid and `endPositionOnPart < startPositionOnPart`, a closed loop
|
|
725
|
+
* is rendered (to the end of the track, then from 0 to End).
|
|
727
726
|
*/
|
|
728
727
|
interface AreaConfig {
|
|
729
728
|
areaId: number;
|
|
@@ -732,7 +731,7 @@ interface AreaConfig {
|
|
|
732
731
|
partOids: number[];
|
|
733
732
|
startPositionOnPart: number;
|
|
734
733
|
endPositionOnPart: number;
|
|
735
|
-
/** ARGB int (
|
|
734
|
+
/** ARGB int (same as StationConfig). Used for tube + default label. */
|
|
736
735
|
color: number;
|
|
737
736
|
}
|
|
738
737
|
interface InfoBarConfig {
|
|
@@ -776,7 +775,7 @@ type SelectionMode = 'Off' | 'Single' | 'Multi';
|
|
|
776
775
|
interface CameraState {
|
|
777
776
|
positionMm: Vec3;
|
|
778
777
|
targetMm: Vec3;
|
|
779
|
-
/** Always 'Z'
|
|
778
|
+
/** Always 'Z' in the current spec. */
|
|
780
779
|
upAxis: 'Z' | 'Y';
|
|
781
780
|
zoom?: number;
|
|
782
781
|
}
|
|
@@ -855,16 +854,15 @@ interface XtsRuntimeState {
|
|
|
855
854
|
/**
|
|
856
855
|
* Module catalog (3D-canonical).
|
|
857
856
|
*
|
|
858
|
-
*
|
|
859
|
-
*
|
|
860
|
-
*
|
|
861
|
-
*
|
|
857
|
+
* Every module declares its path topology (Straight / Curve / Free), its
|
|
858
|
+
* arc length, and — for curves — the signed end-of-module yaw delta in
|
|
859
|
+
* degrees. Centerline radius for analytic curves is derived from
|
|
860
|
+
* `R = L / |θ_rad|`.
|
|
862
861
|
*
|
|
863
|
-
* Hygienic ATH variants share path math with their AT pendants
|
|
864
|
-
*
|
|
862
|
+
* Hygienic ATH variants share path math with their AT pendants — only the
|
|
863
|
+
* GLB mesh differs.
|
|
865
864
|
*
|
|
866
|
-
* This file is hand-curated
|
|
867
|
-
* and §14.1 AABB inspection. The geometry module imports from here directly
|
|
865
|
+
* This file is hand-curated. The geometry module imports from here directly
|
|
868
866
|
* (no JSON fetch) so the library has zero runtime data deps.
|
|
869
867
|
*/
|
|
870
868
|
|
|
@@ -876,14 +874,14 @@ interface ModuleCatalogEntry {
|
|
|
876
874
|
pathType: PathType;
|
|
877
875
|
/**
|
|
878
876
|
* Encoder-side end-of-module yaw, in degrees, in the module-local 3D frame.
|
|
879
|
-
* Sign convention
|
|
877
|
+
* Sign convention: positive endAngle ⇒ Y-flip math curves toward
|
|
880
878
|
* −Y (= right of path). 0 for Straight. 180 for AT2050_*_180 free path.
|
|
881
879
|
*/
|
|
882
880
|
endAngleDeg: number;
|
|
883
881
|
/**
|
|
884
882
|
* Centerline radius for analytic curves, in mm. `null` for Straight + Free.
|
|
885
883
|
* Computed as R = L / |θ_rad|; equals 636.6198 for ±22.5° and 318.3099 for
|
|
886
|
-
* ±45° curves at L=250
|
|
884
|
+
* ±45° curves at L=250.
|
|
887
885
|
*/
|
|
888
886
|
centerlineRadiusMm: number | null;
|
|
889
887
|
/**
|
|
@@ -892,7 +890,7 @@ interface ModuleCatalogEntry {
|
|
|
892
890
|
* geometry/PointClouds.ts.
|
|
893
891
|
*/
|
|
894
892
|
freePathId?: string;
|
|
895
|
-
/** True if STP is not delivered yet
|
|
893
|
+
/** True if STP is not delivered yet. */
|
|
896
894
|
prepared?: boolean;
|
|
897
895
|
}
|
|
898
896
|
declare const MODULE_CATALOG: Readonly<Record<ModuleType3D, ModuleCatalogEntry>>;
|
|
@@ -904,7 +902,7 @@ declare function isKnownModuleType(value: string): value is ModuleType3D;
|
|
|
904
902
|
/**
|
|
905
903
|
* ChainBuilder — builds the per-module `startWorldMatrix` for a Part.
|
|
906
904
|
*
|
|
907
|
-
*
|
|
905
|
+
* Chain composition (simplified — modules butt up edge-to-edge in this build):
|
|
908
906
|
* chain_world = Identity
|
|
909
907
|
* for each module_i:
|
|
910
908
|
* module_i.startWorldMatrix = chain_world
|
|
@@ -960,8 +958,8 @@ interface BuiltChain {
|
|
|
960
958
|
declare function buildChain(modules: ReadonlyArray<ModuleEntry>): BuiltChain;
|
|
961
959
|
/**
|
|
962
960
|
* Locate the module containing `partPositionMm` along the chain.
|
|
963
|
-
*
|
|
964
|
-
*
|
|
961
|
+
* First module with partPosition < startInPart + trackLength; at boundary
|
|
962
|
+
* `partPosition == trackLength` the LAST module is returned with
|
|
965
963
|
* `localPos = trackLength`.
|
|
966
964
|
*/
|
|
967
965
|
declare function findModuleAt(chain: BuiltChain, partPositionMm: number): {
|
|
@@ -969,7 +967,7 @@ declare function findModuleAt(chain: BuiltChain, partPositionMm: number): {
|
|
|
969
967
|
localPosMm: number;
|
|
970
968
|
} | null;
|
|
971
969
|
/**
|
|
972
|
-
* Mover world pose at `partPositionMm
|
|
970
|
+
* Mover world pose at `partPositionMm`.
|
|
973
971
|
*
|
|
974
972
|
* The module's startWorldPose is composed with the local path sample at
|
|
975
973
|
* `localPosMm` along that module's path.
|
|
@@ -1091,14 +1089,14 @@ declare function checkSamePathCollisions(chain: BuiltChain, partOid: number, pro
|
|
|
1091
1089
|
/**
|
|
1092
1090
|
* normalizeXtsConfig — pre-render pass.
|
|
1093
1091
|
*
|
|
1094
|
-
*
|
|
1092
|
+
* Fail-fast validation + AT2050 half-clothoid merging:
|
|
1095
1093
|
* AT2050_0500 + AT2050_0501 (gap=0) → AT2050_0500_180
|
|
1096
1094
|
* ATH2050_0500 + ATH2050_0501 (gap=0) → ATH2050_0500_180
|
|
1097
1095
|
*
|
|
1098
1096
|
* Errors thrown via XtsViewerErrorException:
|
|
1099
1097
|
* - 'unknown-module-type'
|
|
1100
1098
|
* - 'unknown-mover-type'
|
|
1101
|
-
* - 'unmatched-clothoid-half' (0500
|
|
1099
|
+
* - 'unmatched-clothoid-half' (0500 without 0501 or vice versa)
|
|
1102
1100
|
*
|
|
1103
1101
|
* Warnings (collected, non-fatal) returned alongside the normalized config:
|
|
1104
1102
|
* - mover.partOid not in part-list
|
|
@@ -1298,15 +1296,15 @@ interface XtsViewer3DRef {
|
|
|
1298
1296
|
}
|
|
1299
1297
|
|
|
1300
1298
|
/**
|
|
1301
|
-
* SidecarLoader — fetches per-asset JSON sidecars
|
|
1299
|
+
* SidecarLoader — fetches per-asset JSON sidecars.
|
|
1302
1300
|
*
|
|
1303
1301
|
* Sidecars carry origin-correction (translateMm + rotationDegEuler) plus
|
|
1304
1302
|
* path metadata. They live next to the GLB at <baseUrl>/<id>.meta.json (or
|
|
1305
1303
|
* <id>.tool.meta.json for mover tools).
|
|
1306
1304
|
*
|
|
1307
1305
|
* On 404 the loader falls back to default origin-correction `(0,0,0)` /
|
|
1308
|
-
* `(0,0,0)
|
|
1309
|
-
*
|
|
1306
|
+
* `(0,0,0)`. The renderer can still place the GLB; the calibration tool is
|
|
1307
|
+
* the authoritative source for sidecar values.
|
|
1310
1308
|
*/
|
|
1311
1309
|
|
|
1312
1310
|
interface OriginCorrection {
|
|
@@ -1391,7 +1389,7 @@ declare function railSidecarFilename(railType: RailType3D): string;
|
|
|
1391
1389
|
/**
|
|
1392
1390
|
* Pure helper: pick the GLB filename for a moduleSidecar with rail-system
|
|
1393
1391
|
* fallback. Returns null when the sidecar marks the module 'prepared but
|
|
1394
|
-
* not delivered'
|
|
1392
|
+
* not delivered'.
|
|
1395
1393
|
*/
|
|
1396
1394
|
declare function pickGlbForRail(sidecar: ModuleSidecar | undefined, rail: RailSystem): string | null;
|
|
1397
1395
|
|
|
@@ -1493,7 +1491,7 @@ declare function createHepcoGfxBaseplateShape(dims?: HepcoGfxRailProfileDims): S
|
|
|
1493
1491
|
declare function createHepcoGfxRailShape(dims?: HepcoGfxRailProfileDims): Shape;
|
|
1494
1492
|
|
|
1495
1493
|
/**
|
|
1496
|
-
* <XtsViewer3D> — Top-level React component
|
|
1494
|
+
* <XtsViewer3D> — Top-level React component.
|
|
1497
1495
|
*
|
|
1498
1496
|
* Thin wrapper around the r3f <Canvas>:
|
|
1499
1497
|
* - useNormalizedConfig: pre-render validate + clamp pass
|
|
@@ -1516,33 +1514,33 @@ interface SidecarOverrides {
|
|
|
1516
1514
|
rails?: Partial<Record<RailType3D, OriginCorrection>>;
|
|
1517
1515
|
}
|
|
1518
1516
|
interface XtsViewer3DProps {
|
|
1519
|
-
/**
|
|
1517
|
+
/** Complete XTS configuration. */
|
|
1520
1518
|
config: XtsConfig;
|
|
1521
1519
|
/**
|
|
1522
|
-
*
|
|
1520
|
+
* Base URL for GLB assets.
|
|
1523
1521
|
*
|
|
1524
|
-
* Default: `JSDELIVR_ASSETS_BASE_URL`,
|
|
1522
|
+
* Default: `JSDELIVR_ASSETS_BASE_URL`, which points to
|
|
1525
1523
|
* `https://cdn.jsdelivr.net/npm/beckhoff-xts-viewer-3d-assets@<version>/models`
|
|
1526
|
-
*
|
|
1527
|
-
*
|
|
1524
|
+
* — the sister package with all GLBs, version-pinned to the
|
|
1525
|
+
* viewer version.
|
|
1528
1526
|
*/
|
|
1529
1527
|
assetsBaseUrl?: string;
|
|
1530
1528
|
/**
|
|
1531
|
-
*
|
|
1529
|
+
* Source of the sidecar calibration data.
|
|
1532
1530
|
*
|
|
1533
|
-
* • `true` (default) —
|
|
1534
|
-
* `BUILTIN_*_SIDECARS
|
|
1535
|
-
* • `false` —
|
|
1536
|
-
* `<assetsBaseUrl>/<id>.meta.json
|
|
1531
|
+
* • `true` (default) — sidecars come from the bundled
|
|
1532
|
+
* `BUILTIN_*_SIDECARS` constants in the JS library.
|
|
1533
|
+
* • `false` — each sidecar is fetched live from
|
|
1534
|
+
* `<assetsBaseUrl>/<id>.meta.json`.
|
|
1537
1535
|
*/
|
|
1538
1536
|
useBuiltinSidecars?: boolean;
|
|
1539
|
-
/** Override
|
|
1537
|
+
/** Override of the module / mover asset manifest (for tests, alternative skins). */
|
|
1540
1538
|
assetManifest?: AssetManifest;
|
|
1541
|
-
/** Display
|
|
1539
|
+
/** Display options. */
|
|
1542
1540
|
display?: DisplayOptions;
|
|
1543
|
-
/** Initial
|
|
1541
|
+
/** Initial camera. */
|
|
1544
1542
|
initialCamera?: CameraState;
|
|
1545
|
-
/**
|
|
1543
|
+
/** Lock interactions. */
|
|
1546
1544
|
lock?: {
|
|
1547
1545
|
rotate?: boolean;
|
|
1548
1546
|
pan?: boolean;
|
|
@@ -1574,8 +1572,8 @@ interface XtsViewer3DProps {
|
|
|
1574
1572
|
autoPauseOnHidden?: boolean;
|
|
1575
1573
|
};
|
|
1576
1574
|
/**
|
|
1577
|
-
* Live override of the per-asset origin-correction sidecars
|
|
1578
|
-
*
|
|
1575
|
+
* Live override of the per-asset origin-correction sidecars. Useful for
|
|
1576
|
+
* the calibration tool.
|
|
1579
1577
|
*/
|
|
1580
1578
|
sidecarOverrides?: SidecarOverrides;
|
|
1581
1579
|
/**
|
|
@@ -1622,8 +1620,8 @@ declare const XtsViewer3D: React__default.ForwardRefExoticComponent<XtsViewer3DP
|
|
|
1622
1620
|
/**
|
|
1623
1621
|
* Mover catalog (3D-canonical).
|
|
1624
1622
|
*
|
|
1625
|
-
*
|
|
1626
|
-
*
|
|
1623
|
+
* Magnet-plate-center-Mm is the canonical attachment point on the path
|
|
1624
|
+
* centerline (after originCorrection of the GLB).
|
|
1627
1625
|
*/
|
|
1628
1626
|
|
|
1629
1627
|
interface MoverCatalogEntry {
|
|
@@ -1643,12 +1641,12 @@ declare function getMoverEntry(moverType: MoverType3D): MoverCatalogEntry | unde
|
|
|
1643
1641
|
declare function isKnownMoverType(value: string): value is MoverType3D;
|
|
1644
1642
|
|
|
1645
1643
|
/**
|
|
1646
|
-
* Module-local path math
|
|
1644
|
+
* Module-local path math.
|
|
1647
1645
|
*
|
|
1648
1646
|
* Pure functions, no Three.js dependency. Returns position + tangent + yaw
|
|
1649
1647
|
* in the module-local 3D frame after originCorrection (centerline on Z=0).
|
|
1650
1648
|
*
|
|
1651
|
-
* Coordinate conventions
|
|
1649
|
+
* Coordinate conventions:
|
|
1652
1650
|
* - Y-flip: 3D-Y = -2D-canvas-Y, so positive endAngle (2D-positive)
|
|
1653
1651
|
* curves toward −Y in 3D.
|
|
1654
1652
|
* - 1 unit = 1 mm.
|
|
@@ -1668,7 +1666,7 @@ interface PathSample {
|
|
|
1668
1666
|
*/
|
|
1669
1667
|
declare function sampleModulePath(module: ModuleCatalogEntry, sMm: number): PathSample;
|
|
1670
1668
|
/**
|
|
1671
|
-
* End-of-module local transform
|
|
1669
|
+
* End-of-module local transform:
|
|
1672
1670
|
* Δ_local = T( ΔX, -ΔY_canvas, 0 ) ⊗ R_z( -θ )
|
|
1673
1671
|
*
|
|
1674
1672
|
* We return the position delta and yaw delta separately so callers can compose
|
|
@@ -1685,14 +1683,13 @@ declare function moduleEndDelta(module: ModuleCatalogEntry): EndDelta;
|
|
|
1685
1683
|
/**
|
|
1686
1684
|
* XtsArcCurve3 — Three.js Curve3 wrapper around the analytic Curve sample.
|
|
1687
1685
|
*
|
|
1688
|
-
*
|
|
1689
|
-
*
|
|
1686
|
+
* Each module exposes a THREE.Curve<Vector3> that the part-level CurvePath
|
|
1687
|
+
* chains together. For analytic Curves we just wrap the math from
|
|
1690
1688
|
* pathMath.ts; for Free paths see XtsPointCloudCurve3.
|
|
1691
1689
|
*
|
|
1692
|
-
* Note
|
|
1693
|
-
*
|
|
1694
|
-
*
|
|
1695
|
-
* just-works.
|
|
1690
|
+
* Note: CurvePath delegates to subcurve length-proportional, so `getLength()`
|
|
1691
|
+
* MUST return the actual arc length so subcurves are weighted correctly.
|
|
1692
|
+
* Our subcurves are arc-length parametrised (t = s / L), so this just-works.
|
|
1696
1693
|
*/
|
|
1697
1694
|
|
|
1698
1695
|
declare class XtsArcCurve3 extends Curve<Vector3> {
|
|
@@ -1706,8 +1703,8 @@ declare class XtsArcCurve3 extends Curve<Vector3> {
|
|
|
1706
1703
|
/**
|
|
1707
1704
|
* XtsPointCloudCurve3 — Three.js Curve3 wrapper around the Free-path sample.
|
|
1708
1705
|
*
|
|
1709
|
-
*
|
|
1710
|
-
*
|
|
1706
|
+
* The off-by-one clamp at s == ModuleLength is handled in
|
|
1707
|
+
* pathMath.sampleModulePath.
|
|
1711
1708
|
*/
|
|
1712
1709
|
|
|
1713
1710
|
declare class XtsPointCloudCurve3 extends Curve<Vector3> {
|
|
@@ -1721,8 +1718,8 @@ declare class XtsPointCloudCurve3 extends Curve<Vector3> {
|
|
|
1721
1718
|
/**
|
|
1722
1719
|
* PathBuilder — assemble a `THREE.CurvePath<Vector3>` for a Part.
|
|
1723
1720
|
*
|
|
1724
|
-
*
|
|
1725
|
-
*
|
|
1721
|
+
* One CurvePath per part, chaining all module curves end-to-end.
|
|
1722
|
+
* Per module:
|
|
1726
1723
|
* - Straight → THREE.LineCurve3 (module geometry baked in)
|
|
1727
1724
|
* - Curve → XtsArcCurve3 (analytic)
|
|
1728
1725
|
* - Free → XtsPointCloudCurve3
|
|
@@ -1742,9 +1739,9 @@ interface PartPath {
|
|
|
1742
1739
|
}
|
|
1743
1740
|
/**
|
|
1744
1741
|
* Build a Part path. Returns the BuiltChain plus a CurvePath for visual
|
|
1745
|
-
* debug splines (
|
|
1746
|
-
*
|
|
1747
|
-
*
|
|
1742
|
+
* debug splines (continuity overlay). The CurvePath subcurves live in
|
|
1743
|
+
* MODULE-LOCAL coordinates; the consumer is responsible for placing each
|
|
1744
|
+
* module under a parent group with `startWorldPose` applied.
|
|
1748
1745
|
*/
|
|
1749
1746
|
declare function buildPartPath(modules: ReadonlyArray<ModuleEntry>): PartPath;
|
|
1750
1747
|
/**
|
|
@@ -1754,7 +1751,7 @@ declare function buildPartPath(modules: ReadonlyArray<ModuleEntry>): PartPath;
|
|
|
1754
1751
|
declare function poseToMatrix4(pose: PlanarPose, out?: Matrix4): Matrix4;
|
|
1755
1752
|
|
|
1756
1753
|
/**
|
|
1757
|
-
* Point-cloud registry for Free-path modules
|
|
1754
|
+
* Point-cloud registry for Free-path modules.
|
|
1758
1755
|
*
|
|
1759
1756
|
* The AT2050 / ATH2050 180° U-turn is sampled at Δs = 0.1 mm with 5001
|
|
1760
1757
|
* points covering [0..500] mm of arc length. The data ships as JSON files
|
|
@@ -1763,7 +1760,7 @@ declare function poseToMatrix4(pose: PlanarPose, out?: Matrix4): Matrix4;
|
|
|
1763
1760
|
*
|
|
1764
1761
|
* Y-axis convention in the JSON is 2D-canvas-down (positive = "into the
|
|
1765
1762
|
* curve"). XtsPointCloudCurve3 applies the Y-flip when projecting into the
|
|
1766
|
-
* 3D RH-Z-up frame
|
|
1763
|
+
* 3D RH-Z-up frame.
|
|
1767
1764
|
*
|
|
1768
1765
|
* Build note: `tsc` does not emit imported .json files. A postbuild copy
|
|
1769
1766
|
* step (scripts/copy-runtime-data.mjs) mirrors src/geometry/data/*.json
|
|
@@ -1860,7 +1857,7 @@ declare function normaliseToHeatmapRange(value: number, min: number, max: number
|
|
|
1860
1857
|
/**
|
|
1861
1858
|
* Path-sample helpers — convert a chain + a [startMm, endMm] range into a
|
|
1862
1859
|
* world-frame polyline of Vector3s. Used by Stations, Dimensions and
|
|
1863
|
-
* InfoBars
|
|
1860
|
+
* InfoBars to build TubeGeometries that follow the path.
|
|
1864
1861
|
*/
|
|
1865
1862
|
|
|
1866
1863
|
/**
|
|
@@ -1894,9 +1891,9 @@ declare function sampleChainPoint(chain: BuiltChain, positionMm: number, liftZ?:
|
|
|
1894
1891
|
*
|
|
1895
1892
|
* The XtsViewer3D owns a SelectionManager instance internally and exposes
|
|
1896
1893
|
* selection updates through the controlled `selection` prop and the
|
|
1897
|
-
* `onSelectionChange` callback
|
|
1894
|
+
* `onSelectionChange` callback.
|
|
1898
1895
|
*
|
|
1899
|
-
*
|
|
1896
|
+
* Selection modes:
|
|
1900
1897
|
* - Off → ignore clicks
|
|
1901
1898
|
* - Single → click replaces selection with one item
|
|
1902
1899
|
* - Multi → ctrl/meta-click adds, shift-click range-selects (modules
|
|
@@ -1924,8 +1921,8 @@ declare function applyEmptyClick(selection: SelectionState, mode: SelectionMode)
|
|
|
1924
1921
|
* <ModuleCornerMarkers> — 8 red spheres at the GLB's CAD-frame AABB corners.
|
|
1925
1922
|
*
|
|
1926
1923
|
* Calibration helper: when two adjacent modules are placed correctly in the
|
|
1927
|
-
* chain (
|
|
1928
|
-
*
|
|
1924
|
+
* chain (C0/C1 continuity), the corner sphere on Module N's exit face
|
|
1925
|
+
* overlaps the matching corner sphere on Module N+1's entry face. A
|
|
1929
1926
|
* visible gap or overlap signals a bad origin-correction (or a bad chain
|
|
1930
1927
|
* transform — but the latter is unit-tested).
|
|
1931
1928
|
*
|
|
@@ -2045,19 +2042,18 @@ declare const SidecarSourceContext: React.Context<SidecarSourceConfig>;
|
|
|
2045
2042
|
declare function useSidecarSource(): SidecarSourceConfig;
|
|
2046
2043
|
|
|
2047
2044
|
/**
|
|
2048
|
-
* Default asset manifest (
|
|
2045
|
+
* Default asset manifest (UPPERCASE-hyphen filenames).
|
|
2049
2046
|
*
|
|
2050
2047
|
* URLs are relative to `assetsBaseUrl` (default `/models`). The viewer can
|
|
2051
2048
|
* override entries via the `assetManifest` prop (e.g. for tests, alternative
|
|
2052
2049
|
* skins, or to plug in user GLBs).
|
|
2053
2050
|
*
|
|
2054
2051
|
* Hygienic ATH modules carry per-RailSystem URLs. Standard AT/Eco modules
|
|
2055
|
-
* only set `Beckhoff`; the loader silently falls back to that
|
|
2056
|
-
*
|
|
2052
|
+
* only set `Beckhoff`; the loader silently falls back to that variant when
|
|
2053
|
+
* `HepcoGfx` is requested but unavailable.
|
|
2057
2054
|
*
|
|
2058
2055
|
* `null` for `Beckhoff` marks "prepared but not delivered"
|
|
2059
|
-
* (AT2042 / AT2140) — the loader renders a placeholder AABB mesh
|
|
2060
|
-
* (spec §14.4).
|
|
2056
|
+
* (AT2042 / AT2140) — the loader renders a placeholder AABB mesh.
|
|
2061
2057
|
*/
|
|
2062
2058
|
|
|
2063
2059
|
/** Filename mapping per ModuleType3D (relative to assetsBaseUrl). */
|
|
@@ -2077,7 +2073,7 @@ declare const DEFAULT_RAIL_MANIFEST: Readonly<Record<RailType3D, {
|
|
|
2077
2073
|
glbUrl: string;
|
|
2078
2074
|
}>>;
|
|
2079
2075
|
/**
|
|
2080
|
-
* ModuleType → guiding-rail mapping
|
|
2076
|
+
* ModuleType → guiding-rail mapping.
|
|
2081
2077
|
*
|
|
2082
2078
|
* Picks the rail GLB by curve sign + arc length:
|
|
2083
2079
|
* - Straights pick the matching-length AT9000 rail (0249 / 0250 / 0500).
|
|
@@ -2108,15 +2104,14 @@ declare function resolveGuidingRailGlbUrl(railType: RailType3D, override?: Asset
|
|
|
2108
2104
|
/**
|
|
2109
2105
|
* AssetLoader — promise-cached GLB loader for the viewer.
|
|
2110
2106
|
*
|
|
2111
|
-
*
|
|
2112
|
-
*
|
|
2107
|
+
* Performance strategy: exactly one GLB is loaded per module / mover type,
|
|
2108
|
+
* then `clone()` is called per instance. The loader is keyed by absolute URL
|
|
2113
2109
|
* (concat of assetsBaseUrl + entry filename), and concurrent loads of the
|
|
2114
2110
|
* same URL share a single in-flight Promise.
|
|
2115
2111
|
*
|
|
2116
2112
|
* Asset failure: a 404 (or any fetch error) surfaces as
|
|
2117
2113
|
* XtsViewerErrorException(code='asset-load-failed'). The renderer is
|
|
2118
|
-
* expected to fall back to a
|
|
2119
|
-
* §10.4).
|
|
2114
|
+
* expected to fall back to a wireframe-AABB placeholder.
|
|
2120
2115
|
*
|
|
2121
2116
|
* Concurrent-cancel: when `cancel()` is called for a URL, future awaiters
|
|
2122
2117
|
* receive an AbortError. The cache entry is cleared so a fresh `load()`
|
|
@@ -2149,22 +2144,4 @@ declare function getSharedAssetLoader(): AssetLoader;
|
|
|
2149
2144
|
/** Compose a URL from a base + a filename, normalising trailing slashes. */
|
|
2150
2145
|
declare function composeAssetUrl(baseUrl: string, filename: string): string;
|
|
2151
2146
|
|
|
2152
|
-
|
|
2153
|
-
* beckhoff-xts-viewer-3d
|
|
2154
|
-
*
|
|
2155
|
-
* 3D React component for rendering Beckhoff XTS linear-motor systems.
|
|
2156
|
-
*
|
|
2157
|
-
* Public surface:
|
|
2158
|
-
* - <XtsViewer3D> React component (Phase 1 — see components/XtsViewer3D.tsx)
|
|
2159
|
-
* - Geometry primitives (XtsArcCurve3, XtsPointCloudCurve3, ChainBuilder)
|
|
2160
|
-
* - normalizeXtsConfig pre-pass
|
|
2161
|
-
* - Module + Mover catalogs
|
|
2162
|
-
* - All TypeScript types from spec §6
|
|
2163
|
-
*/
|
|
2164
|
-
|
|
2165
|
-
declare const SPEC_VERSION: "v5";
|
|
2166
|
-
|
|
2167
|
-
/** Returns the spec version this package targets. */
|
|
2168
|
-
declare function specVersion(): string;
|
|
2169
|
-
|
|
2170
|
-
export { type AreaConfig, type AreaOptions, AssetLoader, type AssetManifest, BUILTIN_MODULE_SIDECARS, BUILTIN_MOVER_SIDECARS, BUILTIN_RAIL_SIDECARS, BUILTIN_TOOL_SIDECARS, type BuiltChain, type BuiltModule, type CameraState, type CheckMoverCollisionsOptions, type ClickModifiers, type CustomAssetBinding, type CustomAssetConfig, type CustomMoverLayout, DEFAULT_LABEL_FONT_URL, DEFAULT_MODULE_MANIFEST, DEFAULT_MOVER_MANIFEST, DEFAULT_ORIGIN_CORRECTION, DEFAULT_RAIL_MANIFEST, DEFAULT_TOOL_MANIFEST, type DimensionOptions, type DisplayOptions, EMPTY_SELECTION, type EndDelta, HEPCO_GFX_PROFILE, type HeatmapSample, type HepcoGfxRailProfileDims, IDENTITY_POSE, type InfoBarConfig, type InfoBarMarkerConfig, type InfoBarOptions, JSDELIVR_ASSETS_BASE_URL, MODULE_CATALOG, MODULE_GUIDING_RAIL_MAP, MOVER_CATALOG, type MarkerOptions, type MarkerShape, type ModuleAssetEntry, type ModuleCatalogEntry, ModuleCornerMarkers, type ModuleEntry, type ModuleRef, type ModuleSidecar, type ModuleStatusEntry, type ModuleType3D, type MoverAssetEntry, type MoverCatalogEntry, type MoverCollision, type MoverConfig, MoverIdLabel, type MoverIdLabelOptions, type MoverPositionEntry, type MoverProbe, type MoverRef, type MoverSidecar, type MoverToolAssetEntry, type MoverToolConfig, type MoverToolSidecar, type MoverToolType3D, type MoverType3D, type NormalizationWarning, type NormalizedXtsConfig, type Orientation, type OriginCorrection, type PartConfig, type PartPath, type PartTransformation, type PathSample, type PathType, type PlanarPose, type PointCloud, type PositionFrame, type ProcessingUnitConfig, type RailAssetEntry, type RailSidecar, type RailSystem, type RailType3D, SPEC_VERSION, type ScreenshotFormat, type ScreenshotMode, type ScreenshotOptions, type ScreenshotResult, type SelectionMode, type SelectionState, SidecarLoader, type SidecarOverrides, type SidecarSourceConfig, SidecarSourceContext, type StationConfig, type StationOptions, type StatorHeatmap, type StopPositionMoverOptions, type TextOptions, type TrackTransform, VERSION, type Vec2, type Vec3, XtsArcCurve3, type XtsConfig, XtsConfigNormalizer, type XtsModelDocument, XtsPointCloudCurve3, type XtsRuntimeState, XtsViewer3D, type XtsViewer3DProps, type XtsViewer3DRef, type XtsViewerError, type XtsViewerErrorCode, XtsViewerErrorException, applyEmptyClick, applyModuleClick, applyMoverClick, buildChain, buildPartPath, chainToUserPositionMm, checkSamePathCollisions, composeAssetUrl, createHepcoGfxBaseplateShape, createHepcoGfxRailShape, deselectAll, findModuleAt, getModuleEntry, getMoverEntry, getPointCloud, getSharedAssetLoader, interpolateHeatmapValue, isKnownModuleType, isKnownMoverType, isModuleSelected, isMoverSelected, moduleEndDelta, moduleSidecarFilename, moverSidecarFilename, moverWorldAt, normaliseToHeatmapRange, normalizeXtsConfig, pickGlbForRail, poseToMatrix4, railSidecarFilename, registerPointCloud, resolveGuidingRailGlbUrl, resolveGuidingRailType, resolveHepcoGfxProfile, resolveModuleGlbUrl, resolveMoverGlbUrl, resolveOriginCorrection, resolveStopPositionMm, resolveToolGlbUrl, sampleChainPoint, sampleChainRange, sampleModulePath, sortHeatmapSamples, specVersion, toolSidecarFilename, trackLengthOf, unregisterPointCloud, useSidecarSource, userToChainPositionMm };
|
|
2147
|
+
export { type AreaConfig, type AreaOptions, AssetLoader, type AssetManifest, BUILTIN_MODULE_SIDECARS, BUILTIN_MOVER_SIDECARS, BUILTIN_RAIL_SIDECARS, BUILTIN_TOOL_SIDECARS, type BuiltChain, type BuiltModule, type CameraState, type CheckMoverCollisionsOptions, type ClickModifiers, type CustomAssetBinding, type CustomAssetConfig, type CustomMoverLayout, DEFAULT_LABEL_FONT_URL, DEFAULT_MODULE_MANIFEST, DEFAULT_MOVER_MANIFEST, DEFAULT_ORIGIN_CORRECTION, DEFAULT_RAIL_MANIFEST, DEFAULT_TOOL_MANIFEST, type DimensionOptions, type DisplayOptions, EMPTY_SELECTION, type EndDelta, HEPCO_GFX_PROFILE, type HeatmapSample, type HepcoGfxRailProfileDims, IDENTITY_POSE, type InfoBarConfig, type InfoBarMarkerConfig, type InfoBarOptions, JSDELIVR_ASSETS_BASE_URL, MODULE_CATALOG, MODULE_GUIDING_RAIL_MAP, MOVER_CATALOG, type MarkerOptions, type MarkerShape, type ModuleAssetEntry, type ModuleCatalogEntry, ModuleCornerMarkers, type ModuleEntry, type ModuleRef, type ModuleSidecar, type ModuleStatusEntry, type ModuleType3D, type MoverAssetEntry, type MoverCatalogEntry, type MoverCollision, type MoverConfig, MoverIdLabel, type MoverIdLabelOptions, type MoverPositionEntry, type MoverProbe, type MoverRef, type MoverSidecar, type MoverToolAssetEntry, type MoverToolConfig, type MoverToolSidecar, type MoverToolType3D, type MoverType3D, type NormalizationWarning, type NormalizedXtsConfig, type Orientation, type OriginCorrection, type PartConfig, type PartPath, type PartTransformation, type PathSample, type PathType, type PlanarPose, type PointCloud, type PositionFrame, type ProcessingUnitConfig, type RailAssetEntry, type RailSidecar, type RailSystem, type RailType3D, type ScreenshotFormat, type ScreenshotMode, type ScreenshotOptions, type ScreenshotResult, type SelectionMode, type SelectionState, SidecarLoader, type SidecarOverrides, type SidecarSourceConfig, SidecarSourceContext, type StationConfig, type StationOptions, type StatorHeatmap, type StopPositionMoverOptions, type TextOptions, type TrackTransform, VERSION, type Vec2, type Vec3, XtsArcCurve3, type XtsConfig, XtsConfigNormalizer, type XtsModelDocument, XtsPointCloudCurve3, type XtsRuntimeState, XtsViewer3D, type XtsViewer3DProps, type XtsViewer3DRef, type XtsViewerError, type XtsViewerErrorCode, XtsViewerErrorException, applyEmptyClick, applyModuleClick, applyMoverClick, buildChain, buildPartPath, chainToUserPositionMm, checkSamePathCollisions, composeAssetUrl, createHepcoGfxBaseplateShape, createHepcoGfxRailShape, deselectAll, findModuleAt, getModuleEntry, getMoverEntry, getPointCloud, getSharedAssetLoader, interpolateHeatmapValue, isKnownModuleType, isKnownMoverType, isModuleSelected, isMoverSelected, moduleEndDelta, moduleSidecarFilename, moverSidecarFilename, moverWorldAt, normaliseToHeatmapRange, normalizeXtsConfig, pickGlbForRail, poseToMatrix4, railSidecarFilename, registerPointCloud, resolveGuidingRailGlbUrl, resolveGuidingRailType, resolveHepcoGfxProfile, resolveModuleGlbUrl, resolveMoverGlbUrl, resolveOriginCorrection, resolveStopPositionMm, resolveToolGlbUrl, sampleChainPoint, sampleChainRange, sampleModulePath, sortHeatmapSamples, toolSidecarFilename, trackLengthOf, unregisterPointCloud, useSidecarSource, userToChainPositionMm };
|