@plasius/gpu-demo-viewer 0.2.3 → 0.3.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/CHANGELOG.md +15 -0
- package/README.md +24 -1
- package/docs/adrs/adr-0006-composite-study-consumer.md +9 -0
- package/docs/public-composite-definitions.md +30 -0
- package/model-library/scenes.js +2 -45
- package/model-library/studies.d.ts +10 -0
- package/model-library/studies.js +51 -0
- package/package.json +7 -3
package/CHANGELOG.md
CHANGED
|
@@ -18,6 +18,20 @@ The format is based on Keep a Changelog and this project adheres to SemVer.
|
|
|
18
18
|
- **Security**
|
|
19
19
|
- (placeholder)
|
|
20
20
|
|
|
21
|
+
## [0.3.0] - 2026-10-21
|
|
22
|
+
|
|
23
|
+
- **Added**
|
|
24
|
+
- Typed, data-only composite study definitions for host applications, sharing the four workshop arrangements without copying placements.
|
|
25
|
+
|
|
26
|
+
- **Changed**
|
|
27
|
+
- (placeholder)
|
|
28
|
+
|
|
29
|
+
- **Fixed**
|
|
30
|
+
- (placeholder)
|
|
31
|
+
|
|
32
|
+
- **Security**
|
|
33
|
+
- (placeholder)
|
|
34
|
+
|
|
21
35
|
## [0.2.3] - 2026-10-21
|
|
22
36
|
|
|
23
37
|
- **Added**
|
|
@@ -338,3 +352,4 @@ The format is based on Keep a Changelog and this project adheres to SemVer.
|
|
|
338
352
|
[0.2.1]: https://github.com/Plasius-LTD/gpu-demo-viewer/releases/tag/v0.2.1
|
|
339
353
|
[0.2.2]: https://github.com/Plasius-LTD/gpu-demo-viewer/releases/tag/v0.2.2
|
|
340
354
|
[0.2.3]: https://github.com/Plasius-LTD/gpu-demo-viewer/releases/tag/v0.2.3
|
|
355
|
+
[0.3.0]: https://github.com/Plasius-LTD/gpu-demo-viewer/releases/tag/v0.3.0
|
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@ plus a workspace launcher for the `gpu-*` package demos. The workshop provides
|
|
|
12
12
|
camera gestures, progressive rendering, quality controls and model credits.
|
|
13
13
|
|
|
14
14
|
The npm package includes the viewer source, manifest and build-time acquisition
|
|
15
|
-
helper. Model binaries are downloaded separately; they are not bundled in npm.
|
|
15
|
+
helper and typed composite layout definitions. Model binaries are downloaded separately; they are not bundled in npm.
|
|
16
16
|
|
|
17
17
|
## Run the model workshop
|
|
18
18
|
|
|
@@ -202,3 +202,26 @@ npm 11.5.1 or newer, uses the protected `production` environment and
|
|
|
202
202
|
short-lived npm OIDC with provenance, and has no long-lived npm write-token
|
|
203
203
|
fallback. Rollback disables CD; it never rewrites published package history.
|
|
204
204
|
<!-- END PLASIUS RELEASE INTEGRITY -->
|
|
205
|
+
|
|
206
|
+
## Reuse composite layouts
|
|
207
|
+
|
|
208
|
+
Import the small data-only subpath to offer the workshop's four arrangements in
|
|
209
|
+
another application:
|
|
210
|
+
|
|
211
|
+
```ts
|
|
212
|
+
import { compositeStudyDefinitions } from '@plasius/gpu-demo-viewer/model-library/studies';
|
|
213
|
+
|
|
214
|
+
const layouts = compositeStudyDefinitions();
|
|
215
|
+
const interior = layouts.find(layout => layout.key === 'study-furnished-interior');
|
|
216
|
+
// Each placement is [sourceKey, bottomCentreAnchor, longestDimension, yawRadians].
|
|
217
|
+
console.log(interior?.placements);
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
Every call returns independent arrays. The import performs no asset requests,
|
|
221
|
+
DOM work or GPU allocation. Resolve each source key against your admitted asset
|
|
222
|
+
catalogue and pass its URL, complete integrity map and placement to
|
|
223
|
+
`createSceneInspection` from `@plasius/gpu-shared/model-inspection`. Omit a layout
|
|
224
|
+
if any source is unavailable. Keep source licences/credits, translate the supplied
|
|
225
|
+
review copy as needed, and enforce the host application's access controls before
|
|
226
|
+
loading models. Dimensions are illustrative scene units. See the
|
|
227
|
+
[host integration contract](https://github.com/Plasius-LTD/gpu-demo-viewer/blob/main/docs/public-composite-definitions.md).
|
|
@@ -19,3 +19,12 @@ browser review with the registry package before release.
|
|
|
19
19
|
The existing scene-fidelity feature flag and route capability continue to govern
|
|
20
20
|
hosted product access. This local review does not add public-site navigation or
|
|
21
21
|
change the existing localhost review gate.
|
|
22
|
+
|
|
23
|
+
## Host-consumer contract — 21 October 2026
|
|
24
|
+
|
|
25
|
+
Story site#2321 / viewer Task #83 adds the typed `model-library/studies` subpath.
|
|
26
|
+
A pure function returns fresh copies of the same four layout definitions used by
|
|
27
|
+
the workshop. This keeps placement ownership here without coupling host apps to
|
|
28
|
+
the workshop UI, catalogue loading or its localhost gate. Hosts resolve their
|
|
29
|
+
own admitted sources and retain capability/rollout ownership. Shared inspection
|
|
30
|
+
still owns all rendering and resource limits. The local gate remains unchanged.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Composite definitions for host applications
|
|
2
|
+
|
|
3
|
+
Tracked work: site Story #2321 and viewer Task #83.
|
|
4
|
+
|
|
5
|
+
Expose the four existing qualified arrangements through the typed package
|
|
6
|
+
subpath `@plasius/gpu-demo-viewer/model-library/studies`. A pure
|
|
7
|
+
`compositeStudyDefinitions()` function returns fresh definitions containing the
|
|
8
|
+
stable key, source keys, bottom-centre anchors, longest dimensions, yaw and review
|
|
9
|
+
copy. Extract the existing definitions without changing any value. The workshop
|
|
10
|
+
and website then share one owner for placement.
|
|
11
|
+
|
|
12
|
+
The module must import no renderer, DOM, acquisition helper or local-review
|
|
13
|
+
bootstrap, and perform no I/O. Return independent arrays so consumer edits do not
|
|
14
|
+
alter another call or the workshop. Hosts resolve keys against their own admitted
|
|
15
|
+
catalogue, translate display copy, retain every credit/integrity entry, and apply
|
|
16
|
+
their capability/feature controls before calling released shared scene inspection.
|
|
17
|
+
The definitions are layout data, not entitlement decisions or additional models.
|
|
18
|
+
|
|
19
|
+
Parent Feature site#1170 / Epic site#2271 and inherited flag
|
|
20
|
+
`gpu-demo.scene-fidelity.enabled` apply. The local review gate stays unchanged;
|
|
21
|
+
public access is governed by the website's existing studio capability and GPU
|
|
22
|
+
runtime. Rollback uses those stored rules or reverts the consuming package version.
|
|
23
|
+
|
|
24
|
+
Before implementation, require tests for the supported export, its type/file
|
|
25
|
+
contract, exact unchanged scene membership and placement, isolated return values,
|
|
26
|
+
and continued workshop composition. Keep existing rendering/credit tests. Update
|
|
27
|
+
consumer README, Unreleased changelog and ADR0006. Run all package validation and
|
|
28
|
+
coverage with changed-source LCOV, publish only through approved main/production
|
|
29
|
+
CD after CI, and compare npm contents to the attested release artifact before
|
|
30
|
+
the site consumes the new export.
|
package/model-library/scenes.js
CHANGED
|
@@ -1,51 +1,8 @@
|
|
|
1
1
|
import { fixtureRequest } from './controller.js';
|
|
2
|
-
|
|
3
|
-
const definitions = [
|
|
4
|
-
{ key: 'study-furnished-interior', name: 'Furnished interior',
|
|
5
|
-
renderer_target: 'Compare woven fabric, silk, leather, wicker and aged wood in one arrangement.',
|
|
6
|
-
preparation: 'Inspect relative scale, fabric response and contact shadows. Sizes are chosen scene units, not verified physical dimensions.',
|
|
7
|
-
placements: [
|
|
8
|
-
['SheenWoodLeatherSofa', [0, 0, -.8], 2.4, 0],
|
|
9
|
-
['vintage_cabinet_01', [-2.15, 0, -.8], 1.7, 0],
|
|
10
|
-
['SpecularSilkPouf', [.55, 0, .85], .7, 0],
|
|
11
|
-
['wicker_basket_01', [1.6, 0, -.3], .6, 0],
|
|
12
|
-
] },
|
|
13
|
-
{ key: 'study-workshop', name: 'Workshop still life',
|
|
14
|
-
renderer_target: 'Compare worked metal, rough timber and worn surfaces under shared light.',
|
|
15
|
-
preparation: 'Inspect object contact and the contrast between brass, painted metal and timber. These are static review arrangements.',
|
|
16
|
-
placements: [
|
|
17
|
-
['spinning_wheel_01', [-1.1, 0, -.65], 1.8, 0],
|
|
18
|
-
['wine_barrel_01', [1.15, 0, -.7], 1.25, 0],
|
|
19
|
-
['wooden_crate_02', [0, 0, .7], 1.2, 0],
|
|
20
|
-
['bench_vice_01', [-1.3, 0, 1.05], .55, .3],
|
|
21
|
-
// Crate lid height from the original accessor bounds and lid translation,
|
|
22
|
-
// uniformly scaled to its chosen 1.2-unit longest dimension.
|
|
23
|
-
['brass_blowtorch', [0, .47735, .7], .55, 0],
|
|
24
|
-
] },
|
|
25
|
-
{ key: 'study-relic-collection', name: 'Relic collection',
|
|
26
|
-
renderer_target: 'Compare carved stone, chess pieces and aged metal under shared light.',
|
|
27
|
-
preparation: 'Inspect silhouette, surface detail and contact shadows across five originals. Dimensions are illustrative scene units.',
|
|
28
|
-
placements: [
|
|
29
|
-
['gothic_statue', [-1.2, 0, -.7], 1.8, .15],
|
|
30
|
-
['marble_bust_01', [.65, 0, -.7], .85, -.25],
|
|
31
|
-
['chess_set', [0, 0, .8], 1.15, .1],
|
|
32
|
-
['kite_shield', [1.5, 0, .15], 1.15, -.4],
|
|
33
|
-
['antique_estoc', [-1.5, 0, .8], 1.25, .25],
|
|
34
|
-
] },
|
|
35
|
-
{ key: 'study-tool-chest', name: 'Tool-chest arrangement',
|
|
36
|
-
renderer_target: 'Compare painted metal, rust and wooden handles in one working collection.',
|
|
37
|
-
preparation: 'Inspect relative scale, worn surfaces and small contact shadows. These are static originals placed on a shared inspection floor.',
|
|
38
|
-
placements: [
|
|
39
|
-
['metal_tool_chest', [0, 0, -.8], 1.7, 0],
|
|
40
|
-
['hand_plane_no4', [-.65, 0, .8], .5, -.25],
|
|
41
|
-
['vintage_hand_drill', [.25, 0, .9], .55, .3],
|
|
42
|
-
['rusted_spade_01', [1.25, 0, .05], 1.5, -.3],
|
|
43
|
-
['can_rusted', [-1.25, 0, .2], .4, 0],
|
|
44
|
-
] },
|
|
45
|
-
];
|
|
2
|
+
import { compositeStudyDefinitions } from './studies.js';
|
|
46
3
|
|
|
47
4
|
export function compositeStudies(assets) {
|
|
48
|
-
return
|
|
5
|
+
return compositeStudyDefinitions().flatMap(({ placements, ...definition }) => {
|
|
49
6
|
const models = placements.map(([key, anchor, size, yaw]) => ({
|
|
50
7
|
asset: assets.find(a => a.key === key), anchor: [...anchor], size, yaw,
|
|
51
8
|
}));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Layout data only. Host applications own assets, credits and access decisions. */
|
|
2
|
+
export interface CompositeStudyDefinition {
|
|
3
|
+
key: string;
|
|
4
|
+
name: string;
|
|
5
|
+
renderer_target: string;
|
|
6
|
+
preparation: string;
|
|
7
|
+
/** Source key, bottom-centre anchor, longest dimension in scene units, Y rotation in radians. */
|
|
8
|
+
placements: [string, [number, number, number], number, number][];
|
|
9
|
+
}
|
|
10
|
+
export function compositeStudyDefinitions(): CompositeStudyDefinition[];
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
const definitions = [
|
|
2
|
+
{ key: 'study-furnished-interior', name: 'Furnished interior',
|
|
3
|
+
renderer_target: 'Compare woven fabric, silk, leather, wicker and aged wood in one arrangement.',
|
|
4
|
+
preparation: 'Inspect relative scale, fabric response and contact shadows. Sizes are chosen scene units, not verified physical dimensions.',
|
|
5
|
+
placements: [
|
|
6
|
+
['SheenWoodLeatherSofa', [0, 0, -.8], 2.4, 0],
|
|
7
|
+
['vintage_cabinet_01', [-2.15, 0, -.8], 1.7, 0],
|
|
8
|
+
['SpecularSilkPouf', [.55, 0, .85], .7, 0],
|
|
9
|
+
['wicker_basket_01', [1.6, 0, -.3], .6, 0],
|
|
10
|
+
] },
|
|
11
|
+
{ key: 'study-workshop', name: 'Workshop still life',
|
|
12
|
+
renderer_target: 'Compare worked metal, rough timber and worn surfaces under shared light.',
|
|
13
|
+
preparation: 'Inspect object contact and the contrast between brass, painted metal and timber. These are static review arrangements.',
|
|
14
|
+
placements: [
|
|
15
|
+
['spinning_wheel_01', [-1.1, 0, -.65], 1.8, 0],
|
|
16
|
+
['wine_barrel_01', [1.15, 0, -.7], 1.25, 0],
|
|
17
|
+
['wooden_crate_02', [0, 0, .7], 1.2, 0],
|
|
18
|
+
['bench_vice_01', [-1.3, 0, 1.05], .55, .3],
|
|
19
|
+
// Crate lid height from the original accessor bounds and lid translation,
|
|
20
|
+
// uniformly scaled to its chosen 1.2-unit longest dimension.
|
|
21
|
+
['brass_blowtorch', [0, .47735, .7], .55, 0],
|
|
22
|
+
] },
|
|
23
|
+
{ key: 'study-relic-collection', name: 'Relic collection',
|
|
24
|
+
renderer_target: 'Compare carved stone, chess pieces and aged metal under shared light.',
|
|
25
|
+
preparation: 'Inspect silhouette, surface detail and contact shadows across five originals. Dimensions are illustrative scene units.',
|
|
26
|
+
placements: [
|
|
27
|
+
['gothic_statue', [-1.2, 0, -.7], 1.8, .15],
|
|
28
|
+
['marble_bust_01', [.65, 0, -.7], .85, -.25],
|
|
29
|
+
['chess_set', [0, 0, .8], 1.15, .1],
|
|
30
|
+
['kite_shield', [1.5, 0, .15], 1.15, -.4],
|
|
31
|
+
['antique_estoc', [-1.5, 0, .8], 1.25, .25],
|
|
32
|
+
] },
|
|
33
|
+
{ key: 'study-tool-chest', name: 'Tool-chest arrangement',
|
|
34
|
+
renderer_target: 'Compare painted metal, rust and wooden handles in one working collection.',
|
|
35
|
+
preparation: 'Inspect relative scale, worn surfaces and small contact shadows. These are static originals placed on a shared inspection floor.',
|
|
36
|
+
placements: [
|
|
37
|
+
['metal_tool_chest', [0, 0, -.8], 1.7, 0],
|
|
38
|
+
['hand_plane_no4', [-.65, 0, .8], .5, -.25],
|
|
39
|
+
['vintage_hand_drill', [.25, 0, .9], .55, .3],
|
|
40
|
+
['rusted_spade_01', [1.25, 0, .05], 1.5, -.3],
|
|
41
|
+
['can_rusted', [-1.25, 0, .2], .4, 0],
|
|
42
|
+
] },
|
|
43
|
+
];
|
|
44
|
+
|
|
45
|
+
/** Independent layout data; the host resolves sources and controls access. */
|
|
46
|
+
export function compositeStudyDefinitions() {
|
|
47
|
+
return definitions.map(({ placements, ...definition }) => ({
|
|
48
|
+
...definition,
|
|
49
|
+
placements: placements.map(([key, anchor, size, yaw]) => [key, [...anchor], size, yaw]),
|
|
50
|
+
}));
|
|
51
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plasius/gpu-demo-viewer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Root validation viewer for Plasius gpu-* demos.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -19,7 +19,11 @@
|
|
|
19
19
|
".": "./viewer-manifest.js",
|
|
20
20
|
"./viewer-manifest": "./viewer-manifest.js",
|
|
21
21
|
"./package.json": "./package.json",
|
|
22
|
-
"./model-library/acquire": "./model-library/acquire.js"
|
|
22
|
+
"./model-library/acquire": "./model-library/acquire.js",
|
|
23
|
+
"./model-library/studies": {
|
|
24
|
+
"types": "./model-library/studies.d.ts",
|
|
25
|
+
"default": "./model-library/studies.js"
|
|
26
|
+
}
|
|
23
27
|
},
|
|
24
28
|
"files": [
|
|
25
29
|
"assets/",
|
|
@@ -47,7 +51,7 @@
|
|
|
47
51
|
"lint": "npm run typecheck",
|
|
48
52
|
"pack:check": "node scripts/verify-public-package.cjs",
|
|
49
53
|
"prepublishOnly": "npm run build && npm run pack:check",
|
|
50
|
-
"typecheck": "node --check index.js && node --check main.js && node --check viewer-manifest.js && node --check showcase/index.js && node --check showcase/main.js && node --check wavefront/main.js && node --check model-library/main.js && node --check model-library/controller.js && node --check model-library/scenes.js && node --check model-library/acquire.js && node --check model-library/rollout.js",
|
|
54
|
+
"typecheck": "node --check index.js && node --check main.js && node --check viewer-manifest.js && node --check showcase/index.js && node --check showcase/main.js && node --check wavefront/main.js && node --check model-library/main.js && node --check model-library/controller.js && node --check model-library/scenes.js && node --check model-library/acquire.js && node --check model-library/rollout.js && node --check model-library/studies.js",
|
|
51
55
|
"test": "node --test",
|
|
52
56
|
"models:download": "node scripts/acquire-model-library.mjs",
|
|
53
57
|
"models:dev": "vite --config model-library/vite.config.js",
|