@leverege/tpi-viz 0.2.4 → 0.2.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leverege/tpi-viz",
3
- "version": "0.2.4",
3
+ "version": "0.2.6",
4
4
  "description": "3D scene viewer for TPI manufacturing data — renders blade geometry, PTZ cameras, defects, ply layers, and flows. Exports mountViewer()/destroy() for embedding (e.g. an Imaginarium React route); also runs standalone.",
5
5
  "type": "module",
6
6
  "exports": {
package/src/main.js CHANGED
@@ -1509,6 +1509,7 @@ function enterPOV(idx) {
1509
1509
  shell: pc.shell.visible,
1510
1510
  internals: pc.internals.visible,
1511
1511
  frustum: pc.frustum.visible,
1512
+ projection: pc.projection ? pc.projection.visible : undefined,
1512
1513
  frustumChildren: frustums[i]
1513
1514
  ? frustums[i].children.map(c => c.visible) : null,
1514
1515
  }));
@@ -1523,6 +1524,10 @@ function enterPOV(idx) {
1523
1524
  });
1524
1525
  } else {
1525
1526
  pc.frustum.visible = false;
1527
+ // Hide the other cameras' contour/image projections too — otherwise
1528
+ // their LPD patterns keep rendering at the (now-hidden) frustum's far
1529
+ // plane and appear to float in space. Restored from the snapshot on exit.
1530
+ if (pc.projection) pc.projection.visible = false;
1526
1531
  }
1527
1532
  });
1528
1533
 
@@ -1639,6 +1644,7 @@ function exitPOV() {
1639
1644
  pc.shell.visible = s.shell;
1640
1645
  pc.internals.visible = s.internals;
1641
1646
  pc.frustum.visible = s.frustum;
1647
+ if (pc.projection && s.projection !== undefined) pc.projection.visible = s.projection;
1642
1648
  if (s.frustumChildren && frustums[i]) {
1643
1649
  frustums[i].children.forEach((child, ci) => {
1644
1650
  if (s.frustumChildren[ci] !== undefined) child.visible = s.frustumChildren[ci];
@@ -2606,6 +2612,9 @@ export async function mountViewer( container, opts = {} ) {
2606
2612
  if ( el ) { el.textContent = `Init failed: ${err.message}`; }
2607
2613
  throw err;
2608
2614
  }
2615
+ // Debug/test handle: read-only access to the SceneRenderer for inspecting
2616
+ // scene state from outside (e.g. embed debugging, e2e assertions).
2617
+ _container.__tpiVizRenderer = renderer;
2609
2618
  return { destroy };
2610
2619
  }
2611
2620
 
@@ -164,10 +164,17 @@
164
164
  border-radius: var(--r-sm);
165
165
  }
166
166
 
167
- /* Layout */
168
- .container {
167
+ /* Layout. #app carries class="container" — a name that collides with CSS
168
+ frameworks' `.container` utility (e.g. Tailwind's max-width + margins, which
169
+ a host app like Imaginarium bundles). Scope under .tpi-viz (higher
170
+ specificity) and hard-reset the width caps so the host's `.container` can't
171
+ box or off-center the viewer shell. */
172
+ .tpi-viz .container {
169
173
  display: flex;
170
174
  height: 100%;
175
+ width: 100%;
176
+ max-width: none;
177
+ margin: 0;
171
178
  }
172
179
 
173
180
  .sidebar {