@geometra/renderer-three 0.2.0 → 1.4.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/dist/__tests__/scene3d-manager.test.d.ts +2 -0
- package/dist/__tests__/scene3d-manager.test.d.ts.map +1 -0
- package/dist/__tests__/scene3d-manager.test.js +80 -0
- package/dist/__tests__/scene3d-manager.test.js.map +1 -0
- package/dist/host-css-coerce.d.ts +39 -0
- package/dist/host-css-coerce.d.ts.map +1 -0
- package/dist/host-css-coerce.js +69 -0
- package/dist/host-css-coerce.js.map +1 -0
- package/dist/host-layout-plain.d.ts +164 -0
- package/dist/host-layout-plain.d.ts.map +1 -0
- package/dist/host-layout-plain.js +255 -0
- package/dist/host-layout-plain.js.map +1 -0
- package/dist/index.d.ts +43 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +42 -5
- package/dist/index.js.map +1 -1
- package/dist/layout-sync.d.ts +51 -0
- package/dist/layout-sync.d.ts.map +1 -0
- package/dist/layout-sync.js +59 -0
- package/dist/layout-sync.js.map +1 -0
- package/dist/page-host.d.ts +41 -0
- package/dist/page-host.d.ts.map +1 -0
- package/dist/page-host.js +89 -0
- package/dist/page-host.js.map +1 -0
- package/dist/scene3d-manager.d.ts +33 -0
- package/dist/scene3d-manager.d.ts.map +1 -0
- package/dist/scene3d-manager.js +394 -0
- package/dist/scene3d-manager.js.map +1 -0
- package/dist/split-host.d.ts +65 -9
- package/dist/split-host.d.ts.map +1 -1
- package/dist/split-host.js +115 -39
- package/dist/split-host.js.map +1 -1
- package/dist/stacked-host.d.ts +64 -14
- package/dist/stacked-host.d.ts.map +1 -1
- package/dist/stacked-host.js +77 -41
- package/dist/stacked-host.js.map +1 -1
- package/dist/three-scene-basics.d.ts +313 -2
- package/dist/three-scene-basics.d.ts.map +1 -1
- package/dist/three-scene-basics.js +418 -1
- package/dist/three-scene-basics.js.map +1 -1
- package/dist/utils.d.ts +156 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +207 -6
- package/dist/utils.js.map +1 -1
- package/package.json +15 -18
- package/LICENSE +0 -21
- package/README.md +0 -111
|
@@ -0,0 +1,394 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
/** True when `a` and `b` have the same discriminated `type` and matching nested `group` arity/shape. */
|
|
3
|
+
function sameObjectStructure(a, b) {
|
|
4
|
+
if (a.type !== b.type)
|
|
5
|
+
return false;
|
|
6
|
+
if (a.type !== 'group')
|
|
7
|
+
return true;
|
|
8
|
+
const ga = a;
|
|
9
|
+
const gb = b;
|
|
10
|
+
if (ga.objects.length !== gb.objects.length)
|
|
11
|
+
return false;
|
|
12
|
+
for (let i = 0; i < ga.objects.length; i++) {
|
|
13
|
+
if (!sameObjectStructure(ga.objects[i], gb.objects[i]))
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Manages a Three.js scene graph from declarative {@link Scene3dObject} descriptors streamed
|
|
20
|
+
* from a Geometra server. Call {@link Scene3dManager.sync} each frame (or when the tree updates)
|
|
21
|
+
* to reconcile the live scene with the latest descriptor array.
|
|
22
|
+
*/
|
|
23
|
+
export class Scene3dManager {
|
|
24
|
+
scene;
|
|
25
|
+
camera;
|
|
26
|
+
managed = [];
|
|
27
|
+
sceneGroup = new THREE.Group();
|
|
28
|
+
orbitControls = null;
|
|
29
|
+
orbitControlsModule = null;
|
|
30
|
+
cameraInitialized = false;
|
|
31
|
+
lastCameraTarget;
|
|
32
|
+
constructor(scene, camera) {
|
|
33
|
+
this.scene = scene;
|
|
34
|
+
this.camera = camera;
|
|
35
|
+
scene.add(this.sceneGroup);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Reconcile the live Three.js scene with the given element's props.
|
|
39
|
+
* Creates, updates, or removes objects as needed.
|
|
40
|
+
* Camera position/target are applied on the first call; subsequent calls update
|
|
41
|
+
* orbit controls target but leave camera position to user interaction.
|
|
42
|
+
*/
|
|
43
|
+
sync(element, canvas) {
|
|
44
|
+
const { objects, background, fov, near, far, cameraPosition, cameraTarget, orbitControls } = element.props;
|
|
45
|
+
// Update scene background
|
|
46
|
+
if (background !== undefined) {
|
|
47
|
+
this.scene.background = new THREE.Color(background);
|
|
48
|
+
}
|
|
49
|
+
// Update camera projection (always safe to update)
|
|
50
|
+
if (fov !== undefined && fov > 0 && fov < 180) {
|
|
51
|
+
this.camera.fov = fov;
|
|
52
|
+
}
|
|
53
|
+
if (near !== undefined && near > 0) {
|
|
54
|
+
this.camera.near = near;
|
|
55
|
+
}
|
|
56
|
+
if (far !== undefined && far > this.camera.near) {
|
|
57
|
+
this.camera.far = far;
|
|
58
|
+
}
|
|
59
|
+
this.camera.updateProjectionMatrix();
|
|
60
|
+
// Set camera position only on first sync (subsequent frames: orbit controls owns it)
|
|
61
|
+
if (!this.cameraInitialized) {
|
|
62
|
+
if (cameraPosition) {
|
|
63
|
+
this.camera.position.set(cameraPosition[0], cameraPosition[1], cameraPosition[2]);
|
|
64
|
+
}
|
|
65
|
+
if (cameraTarget) {
|
|
66
|
+
this.camera.lookAt(cameraTarget[0], cameraTarget[1], cameraTarget[2]);
|
|
67
|
+
}
|
|
68
|
+
this.cameraInitialized = true;
|
|
69
|
+
}
|
|
70
|
+
// Track the latest target for orbit controls
|
|
71
|
+
if (cameraTarget) {
|
|
72
|
+
this.lastCameraTarget = cameraTarget;
|
|
73
|
+
}
|
|
74
|
+
// Orbit controls
|
|
75
|
+
this.syncOrbitControls(orbitControls, canvas);
|
|
76
|
+
// Update orbit controls target to track the scene center
|
|
77
|
+
if (this.orbitControls && this.lastCameraTarget) {
|
|
78
|
+
this.orbitControls.target.set(this.lastCameraTarget[0], this.lastCameraTarget[1], this.lastCameraTarget[2]);
|
|
79
|
+
}
|
|
80
|
+
// Reconcile objects
|
|
81
|
+
this.reconcileObjects(objects);
|
|
82
|
+
}
|
|
83
|
+
/** Update orbit controls damping each frame. */
|
|
84
|
+
tick() {
|
|
85
|
+
this.orbitControls?.update();
|
|
86
|
+
}
|
|
87
|
+
syncOrbitControls(config, canvas) {
|
|
88
|
+
if (!config) {
|
|
89
|
+
if (this.orbitControls) {
|
|
90
|
+
this.orbitControls.dispose();
|
|
91
|
+
this.orbitControls = null;
|
|
92
|
+
}
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
if (!canvas)
|
|
96
|
+
return;
|
|
97
|
+
if (!this.orbitControls && this.orbitControlsModule) {
|
|
98
|
+
this.orbitControls = new this.orbitControlsModule.OrbitControls(this.camera, canvas);
|
|
99
|
+
this.orbitControls.enableDamping = true;
|
|
100
|
+
this.orbitControls.enableZoom = false;
|
|
101
|
+
}
|
|
102
|
+
if (!this.orbitControls && !this.orbitControlsModule) {
|
|
103
|
+
// Lazy-load OrbitControls
|
|
104
|
+
void import('three/examples/jsm/controls/OrbitControls.js').then((mod) => {
|
|
105
|
+
this.orbitControlsModule = mod;
|
|
106
|
+
if (!this.orbitControls) {
|
|
107
|
+
this.orbitControls = new mod.OrbitControls(this.camera, canvas);
|
|
108
|
+
this.orbitControls.enableDamping = true;
|
|
109
|
+
this.orbitControls.enableZoom = false;
|
|
110
|
+
this.applyOrbitConfig(config);
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
this.applyOrbitConfig(config);
|
|
116
|
+
}
|
|
117
|
+
applyOrbitConfig(config) {
|
|
118
|
+
if (!this.orbitControls || typeof config === 'boolean')
|
|
119
|
+
return;
|
|
120
|
+
if (config.damping !== undefined)
|
|
121
|
+
this.orbitControls.dampingFactor = config.damping;
|
|
122
|
+
if (config.minDistance !== undefined)
|
|
123
|
+
this.orbitControls.minDistance = config.minDistance;
|
|
124
|
+
if (config.maxDistance !== undefined)
|
|
125
|
+
this.orbitControls.maxDistance = config.maxDistance;
|
|
126
|
+
if (config.maxPolarAngle !== undefined)
|
|
127
|
+
this.orbitControls.maxPolarAngle = config.maxPolarAngle;
|
|
128
|
+
}
|
|
129
|
+
reconcileObjects(objects) {
|
|
130
|
+
// Simple reconciliation: rebuild if count or types changed, update positions otherwise
|
|
131
|
+
const needsRebuild = objects.length !== this.managed.length ||
|
|
132
|
+
objects.some((obj, i) => obj.type !== this.managed[i]?.descriptor.type);
|
|
133
|
+
if (needsRebuild) {
|
|
134
|
+
this.clearManaged();
|
|
135
|
+
for (const desc of objects) {
|
|
136
|
+
const object = createThreeObject(desc);
|
|
137
|
+
this.managed.push({ descriptor: desc, object });
|
|
138
|
+
this.sceneGroup.add(object);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
// Update existing objects in place
|
|
143
|
+
for (let i = 0; i < objects.length; i++) {
|
|
144
|
+
const desc = objects[i];
|
|
145
|
+
const entry = this.managed[i];
|
|
146
|
+
updateThreeObject(entry.object, entry.descriptor, desc);
|
|
147
|
+
entry.descriptor = desc;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
clearManaged() {
|
|
152
|
+
for (const entry of this.managed) {
|
|
153
|
+
this.sceneGroup.remove(entry.object);
|
|
154
|
+
disposeObject(entry.object);
|
|
155
|
+
}
|
|
156
|
+
this.managed = [];
|
|
157
|
+
}
|
|
158
|
+
dispose() {
|
|
159
|
+
this.clearManaged();
|
|
160
|
+
this.scene.remove(this.sceneGroup);
|
|
161
|
+
if (this.orbitControls) {
|
|
162
|
+
this.orbitControls.dispose();
|
|
163
|
+
this.orbitControls = null;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
// ---------------------------------------------------------------------------
|
|
168
|
+
// Object creation from descriptors
|
|
169
|
+
// ---------------------------------------------------------------------------
|
|
170
|
+
function createThreeObject(desc) {
|
|
171
|
+
switch (desc.type) {
|
|
172
|
+
case 'sphere':
|
|
173
|
+
return createSphere(desc);
|
|
174
|
+
case 'points':
|
|
175
|
+
return createPoints(desc);
|
|
176
|
+
case 'line':
|
|
177
|
+
return createLine(desc);
|
|
178
|
+
case 'ring':
|
|
179
|
+
return createRing(desc);
|
|
180
|
+
case 'ambientLight':
|
|
181
|
+
return createAmbientLight(desc);
|
|
182
|
+
case 'directionalLight':
|
|
183
|
+
return createDirectionalLight(desc);
|
|
184
|
+
case 'group':
|
|
185
|
+
return createGroup(desc);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
function createSphere(desc) {
|
|
189
|
+
const geom = new THREE.SphereGeometry(desc.radius ?? 1, desc.widthSegments ?? 32, desc.heightSegments ?? 32);
|
|
190
|
+
const mat = new THREE.MeshStandardMaterial({
|
|
191
|
+
color: desc.color ?? 0xffffff,
|
|
192
|
+
emissive: desc.emissive ?? 0x000000,
|
|
193
|
+
metalness: desc.metalness ?? 0,
|
|
194
|
+
roughness: desc.roughness ?? 1,
|
|
195
|
+
});
|
|
196
|
+
const mesh = new THREE.Mesh(geom, mat);
|
|
197
|
+
if (desc.position)
|
|
198
|
+
mesh.position.set(desc.position[0], desc.position[1], desc.position[2]);
|
|
199
|
+
return mesh;
|
|
200
|
+
}
|
|
201
|
+
function createPoints(desc) {
|
|
202
|
+
const geom = new THREE.BufferGeometry();
|
|
203
|
+
const positions = new Float32Array(desc.positions);
|
|
204
|
+
geom.setAttribute('position', new THREE.BufferAttribute(positions, 3));
|
|
205
|
+
const mat = new THREE.PointsMaterial({
|
|
206
|
+
color: desc.color ?? 0xffffff,
|
|
207
|
+
size: desc.size ?? 1,
|
|
208
|
+
depthWrite: false,
|
|
209
|
+
opacity: desc.opacity ?? 1,
|
|
210
|
+
transparent: (desc.opacity ?? 1) < 1,
|
|
211
|
+
});
|
|
212
|
+
return new THREE.Points(geom, mat);
|
|
213
|
+
}
|
|
214
|
+
function createLine(desc) {
|
|
215
|
+
const pts = desc.points.map((p) => new THREE.Vector3(p[0], p[1], p[2]));
|
|
216
|
+
const geom = new THREE.BufferGeometry().setFromPoints(pts);
|
|
217
|
+
let mat;
|
|
218
|
+
if (desc.dashed) {
|
|
219
|
+
mat = new THREE.LineDashedMaterial({
|
|
220
|
+
color: desc.color ?? 0xffffff,
|
|
221
|
+
transparent: (desc.opacity ?? 1) < 1,
|
|
222
|
+
opacity: desc.opacity ?? 1,
|
|
223
|
+
dashSize: desc.dashSize ?? 0.14,
|
|
224
|
+
gapSize: desc.gapSize ?? 0.1,
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
else {
|
|
228
|
+
mat = new THREE.LineBasicMaterial({
|
|
229
|
+
color: desc.color ?? 0xffffff,
|
|
230
|
+
transparent: (desc.opacity ?? 1) < 1,
|
|
231
|
+
opacity: desc.opacity ?? 1,
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
const line = new THREE.Line(geom, mat);
|
|
235
|
+
if (desc.dashed)
|
|
236
|
+
line.computeLineDistances();
|
|
237
|
+
return line;
|
|
238
|
+
}
|
|
239
|
+
function createRing(desc) {
|
|
240
|
+
const geom = new THREE.RingGeometry(desc.innerRadius, desc.outerRadius, desc.segments ?? 128);
|
|
241
|
+
const mat = new THREE.MeshBasicMaterial({
|
|
242
|
+
color: desc.color ?? 0xffffff,
|
|
243
|
+
side: THREE.DoubleSide,
|
|
244
|
+
transparent: (desc.opacity ?? 1) < 1,
|
|
245
|
+
opacity: desc.opacity ?? 1,
|
|
246
|
+
});
|
|
247
|
+
const mesh = new THREE.Mesh(geom, mat);
|
|
248
|
+
if (desc.position)
|
|
249
|
+
mesh.position.set(desc.position[0], desc.position[1], desc.position[2]);
|
|
250
|
+
if (desc.rotation)
|
|
251
|
+
mesh.rotation.set(desc.rotation[0], desc.rotation[1], desc.rotation[2]);
|
|
252
|
+
return mesh;
|
|
253
|
+
}
|
|
254
|
+
function createAmbientLight(desc) {
|
|
255
|
+
return new THREE.AmbientLight(desc.color ?? 0xffffff, desc.intensity ?? 1);
|
|
256
|
+
}
|
|
257
|
+
function createDirectionalLight(desc) {
|
|
258
|
+
const light = new THREE.DirectionalLight(desc.color ?? 0xffffff, desc.intensity ?? 1);
|
|
259
|
+
if (desc.position)
|
|
260
|
+
light.position.set(desc.position[0], desc.position[1], desc.position[2]);
|
|
261
|
+
return light;
|
|
262
|
+
}
|
|
263
|
+
function createGroup(desc) {
|
|
264
|
+
const group = new THREE.Group();
|
|
265
|
+
if (desc.position)
|
|
266
|
+
group.position.set(desc.position[0], desc.position[1], desc.position[2]);
|
|
267
|
+
for (const child of desc.objects) {
|
|
268
|
+
group.add(createThreeObject(child));
|
|
269
|
+
}
|
|
270
|
+
return group;
|
|
271
|
+
}
|
|
272
|
+
// ---------------------------------------------------------------------------
|
|
273
|
+
// In-place updates (position, color, etc.) without full rebuild
|
|
274
|
+
// ---------------------------------------------------------------------------
|
|
275
|
+
function updateThreeObject(object, _oldDesc, newDesc) {
|
|
276
|
+
switch (newDesc.type) {
|
|
277
|
+
case 'sphere':
|
|
278
|
+
updateSphere(object, newDesc);
|
|
279
|
+
break;
|
|
280
|
+
case 'points':
|
|
281
|
+
updatePoints(object, newDesc);
|
|
282
|
+
break;
|
|
283
|
+
case 'line':
|
|
284
|
+
updateLine(object, newDesc);
|
|
285
|
+
break;
|
|
286
|
+
case 'ring':
|
|
287
|
+
updateRing(object, newDesc);
|
|
288
|
+
break;
|
|
289
|
+
case 'ambientLight':
|
|
290
|
+
updateAmbientLight(object, newDesc);
|
|
291
|
+
break;
|
|
292
|
+
case 'directionalLight':
|
|
293
|
+
updateDirectionalLight(object, newDesc);
|
|
294
|
+
break;
|
|
295
|
+
case 'group':
|
|
296
|
+
updateGroup(object, _oldDesc, newDesc);
|
|
297
|
+
break;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
function updateGroup(group, oldDesc, newDesc) {
|
|
301
|
+
if (newDesc.position) {
|
|
302
|
+
group.position.set(newDesc.position[0], newDesc.position[1], newDesc.position[2]);
|
|
303
|
+
}
|
|
304
|
+
if (!sameObjectStructure(oldDesc, newDesc) || group.children.length !== newDesc.objects.length) {
|
|
305
|
+
for (const child of [...group.children]) {
|
|
306
|
+
group.remove(child);
|
|
307
|
+
disposeObject(child);
|
|
308
|
+
}
|
|
309
|
+
for (const childDesc of newDesc.objects) {
|
|
310
|
+
group.add(createThreeObject(childDesc));
|
|
311
|
+
}
|
|
312
|
+
return;
|
|
313
|
+
}
|
|
314
|
+
for (let i = 0; i < newDesc.objects.length; i++) {
|
|
315
|
+
const ch = group.children[i];
|
|
316
|
+
if (ch) {
|
|
317
|
+
updateThreeObject(ch, oldDesc.objects[i], newDesc.objects[i]);
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
function updateSphere(mesh, desc) {
|
|
322
|
+
if (desc.position)
|
|
323
|
+
mesh.position.set(desc.position[0], desc.position[1], desc.position[2]);
|
|
324
|
+
const mat = mesh.material;
|
|
325
|
+
if (desc.color !== undefined)
|
|
326
|
+
mat.color.setHex(desc.color);
|
|
327
|
+
if (desc.emissive !== undefined)
|
|
328
|
+
mat.emissive.setHex(desc.emissive);
|
|
329
|
+
}
|
|
330
|
+
function updatePoints(points, desc) {
|
|
331
|
+
const geom = points.geometry;
|
|
332
|
+
const posAttr = geom.getAttribute('position');
|
|
333
|
+
const newPositions = new Float32Array(desc.positions);
|
|
334
|
+
if (posAttr.count * 3 === newPositions.length) {
|
|
335
|
+
posAttr.set(newPositions);
|
|
336
|
+
posAttr.needsUpdate = true;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
function updateLine(line, desc) {
|
|
340
|
+
const pts = desc.points.map((p) => new THREE.Vector3(p[0], p[1], p[2]));
|
|
341
|
+
line.geometry.dispose();
|
|
342
|
+
line.geometry = new THREE.BufferGeometry().setFromPoints(pts);
|
|
343
|
+
if (desc.dashed)
|
|
344
|
+
line.computeLineDistances();
|
|
345
|
+
}
|
|
346
|
+
function updateRing(mesh, desc) {
|
|
347
|
+
if (desc.position)
|
|
348
|
+
mesh.position.set(desc.position[0], desc.position[1], desc.position[2]);
|
|
349
|
+
if (desc.rotation)
|
|
350
|
+
mesh.rotation.set(desc.rotation[0], desc.rotation[1], desc.rotation[2]);
|
|
351
|
+
}
|
|
352
|
+
function updateAmbientLight(light, desc) {
|
|
353
|
+
if (desc.color !== undefined)
|
|
354
|
+
light.color.setHex(desc.color);
|
|
355
|
+
if (desc.intensity !== undefined)
|
|
356
|
+
light.intensity = desc.intensity;
|
|
357
|
+
}
|
|
358
|
+
function updateDirectionalLight(light, desc) {
|
|
359
|
+
if (desc.color !== undefined)
|
|
360
|
+
light.color.setHex(desc.color);
|
|
361
|
+
if (desc.intensity !== undefined)
|
|
362
|
+
light.intensity = desc.intensity;
|
|
363
|
+
if (desc.position)
|
|
364
|
+
light.position.set(desc.position[0], desc.position[1], desc.position[2]);
|
|
365
|
+
}
|
|
366
|
+
// ---------------------------------------------------------------------------
|
|
367
|
+
// Disposal
|
|
368
|
+
// ---------------------------------------------------------------------------
|
|
369
|
+
function disposeObject(object) {
|
|
370
|
+
if (object instanceof THREE.Mesh) {
|
|
371
|
+
object.geometry.dispose();
|
|
372
|
+
if (Array.isArray(object.material)) {
|
|
373
|
+
for (const mat of object.material)
|
|
374
|
+
mat.dispose();
|
|
375
|
+
}
|
|
376
|
+
else {
|
|
377
|
+
object.material.dispose();
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
else if (object instanceof THREE.Points) {
|
|
381
|
+
object.geometry.dispose();
|
|
382
|
+
object.material.dispose();
|
|
383
|
+
}
|
|
384
|
+
else if (object instanceof THREE.Line) {
|
|
385
|
+
object.geometry.dispose();
|
|
386
|
+
object.material.dispose();
|
|
387
|
+
}
|
|
388
|
+
else if (object instanceof THREE.Group) {
|
|
389
|
+
for (const child of [...object.children]) {
|
|
390
|
+
disposeObject(child);
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
//# sourceMappingURL=scene3d-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scene3d-manager.js","sourceRoot":"","sources":["../src/scene3d-manager.ts"],"names":[],"mapp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M,YAAY,KAAK,CAAC,KAAK,EAAE,CAAC;QACzC,KAAK,MAAM,KAAK,IAAI,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;YACzC,aAAa,CAAC,KAAK,CAAC,CAAA;QACtB,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/dist/split-host.d.ts
CHANGED
|
@@ -1,24 +1,62 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
2
|
import { type BrowserCanvasClientHandle, type BrowserCanvasClientOptions } from '@geometra/renderer-canvas';
|
|
3
3
|
import { type GeometraThreeSceneBasicsOptions } from './three-scene-basics.js';
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Every {@link createBrowserCanvasClient} option except `canvas`, which split/stacked hosts create
|
|
6
|
+
* internally. Includes `url`, `binaryFraming`, optional explicit `window` for tests/iframes, and
|
|
7
|
+
* the rest of {@link BrowserCanvasClientOptions}.
|
|
8
|
+
*/
|
|
9
|
+
export type GeometraHostBrowserCanvasClientOptions = Omit<BrowserCanvasClientOptions, 'canvas'>;
|
|
10
|
+
/**
|
|
11
|
+
* Default Geometra column width for {@link createThreeGeometraSplitHost}; same value as the
|
|
12
|
+
* `geometraWidth` option fallback and README.
|
|
13
|
+
*/
|
|
14
|
+
export declare const GEOMETRA_SPLIT_HOST_LAYOUT_DEFAULTS: {
|
|
15
|
+
readonly geometraWidth: 420;
|
|
16
|
+
};
|
|
17
|
+
export interface ThreeGeometraSplitHostOptions extends GeometraHostBrowserCanvasClientOptions, GeometraThreeSceneBasicsOptions {
|
|
5
18
|
/** Host element; a flex row is appended as a child (existing children are left untouched). */
|
|
6
19
|
container: HTMLElement;
|
|
7
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* Geometra column width in CSS pixels. Default: 420 ({@link GEOMETRA_SPLIT_HOST_LAYOUT_DEFAULTS}).
|
|
22
|
+
* Non-finite or negative values fall back to the default so layout does not emit invalid `px` styles.
|
|
23
|
+
*/
|
|
8
24
|
geometraWidth?: number;
|
|
9
25
|
/** When true, Geometra panel is on the left. Default: false (Three.js left, Geometra right). */
|
|
10
26
|
geometraOnLeft?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Upper bound for `window.devicePixelRatio` when sizing the WebGL drawing buffer (e.g. `2` on retina
|
|
29
|
+
* to cut memory and fragment cost). When omitted, the full device pixel ratio is used.
|
|
30
|
+
*/
|
|
31
|
+
maxDevicePixelRatio?: number;
|
|
11
32
|
/**
|
|
12
33
|
* Called once after scene, camera, and renderer are created.
|
|
13
34
|
* Add meshes, lights, controls, etc. Call `ctx.destroy()` to tear down immediately; the render loop
|
|
14
|
-
* will not start if the host is already destroyed.
|
|
35
|
+
* will not start if the host is already destroyed. If this callback throws, the host is fully torn
|
|
36
|
+
* down and the error is rethrown.
|
|
15
37
|
*/
|
|
16
38
|
onThreeReady?: (ctx: ThreeRuntimeContext) => void;
|
|
17
39
|
/**
|
|
18
40
|
* Called every frame before `renderer.render`.
|
|
19
|
-
* Use for animations
|
|
41
|
+
* Use for animations. Return **`false`** to skip `render` for this frame only (same idea as
|
|
42
|
+
* {@link tickGeometraThreeWebGLWithSceneBasicsFrame}). If you call {@link ThreeRuntimeContext.destroy} here,
|
|
43
|
+
* teardown runs and this frame’s `render` is skipped (avoids rendering after WebGL dispose).
|
|
44
|
+
* If this callback throws, the host is fully torn down and the error is rethrown (same as {@link onThreeReady}).
|
|
45
|
+
*/
|
|
46
|
+
onThreeFrame?: (ctx: ThreeFrameContext) => void | false;
|
|
47
|
+
/**
|
|
48
|
+
* WebSocket URL for a transparent Geometra overlay canvas on the Three.js panel.
|
|
49
|
+
* When set, a second canvas is absolutely positioned over the Three.js panel and connected
|
|
50
|
+
* to this URL. Use for HUD elements (pills, labels, info panels) rendered by a separate
|
|
51
|
+
* Geometra server view.
|
|
20
52
|
*/
|
|
21
|
-
|
|
53
|
+
overlayUrl?: string;
|
|
54
|
+
/** Renderer options for the overlay canvas. Default: transparent background. */
|
|
55
|
+
overlayRendererOptions?: Record<string, unknown>;
|
|
56
|
+
/** CSS pointer-events for the overlay. Default: ‘none’ (click-through). */
|
|
57
|
+
overlayPointerEvents?: string;
|
|
58
|
+
/** Binary framing for the overlay WebSocket. Default: same as main client. */
|
|
59
|
+
overlayBinaryFraming?: boolean;
|
|
22
60
|
}
|
|
23
61
|
export interface ThreeRuntimeContext {
|
|
24
62
|
renderer: THREE.WebGLRenderer;
|
|
@@ -39,12 +77,21 @@ export interface ThreeGeometraSplitHostHandle {
|
|
|
39
77
|
geometraPanel: HTMLDivElement;
|
|
40
78
|
threeCanvas: HTMLCanvasElement;
|
|
41
79
|
geometraCanvas: HTMLCanvasElement;
|
|
80
|
+
/** Overlay canvas on the Three.js panel (present when `overlayUrl` was provided). */
|
|
81
|
+
overlayCanvas?: HTMLCanvasElement;
|
|
42
82
|
renderer: THREE.WebGLRenderer;
|
|
43
83
|
scene: THREE.Scene;
|
|
44
84
|
camera: THREE.PerspectiveCamera;
|
|
45
85
|
clock: THREE.Clock;
|
|
46
86
|
geometra: BrowserCanvasClientHandle;
|
|
47
|
-
/**
|
|
87
|
+
/** Overlay Geometra client (present when `overlayUrl` was provided). */
|
|
88
|
+
overlay?: BrowserCanvasClientHandle;
|
|
89
|
+
/**
|
|
90
|
+
* Stops the render loop, tears down WebGL via {@link disposeGeometraThreeWebGLWithSceneBasics} (clock stop +
|
|
91
|
+
* the same renderer registration headless {@link renderGeometraThreeWebGLWithSceneBasicsFrame} /
|
|
92
|
+
* {@link tickGeometraThreeWebGLWithSceneBasicsFrame} use to skip draws after dispose), disconnects observers,
|
|
93
|
+
* and tears down the Geometra client and overlay.
|
|
94
|
+
*/
|
|
48
95
|
destroy(): void;
|
|
49
96
|
}
|
|
50
97
|
/**
|
|
@@ -52,11 +99,20 @@ export interface ThreeGeometraSplitHostHandle {
|
|
|
52
99
|
*
|
|
53
100
|
* This is the recommended **hybrid** layout: 3D stays in Three; chrome and data panes stay in Geometra’s protocol.
|
|
54
101
|
* Geometra’s client still uses `resizeTarget: window` by default; when only the Geometra column changes size,
|
|
55
|
-
* a `ResizeObserver`
|
|
56
|
-
*
|
|
102
|
+
* a `ResizeObserver` schedules a synthetic `resize` on `window` so layout width/height track the panel.
|
|
103
|
+
* The host `root` and both flex panes are observed (same idea as {@link createThreeGeometraStackedHost} observing
|
|
104
|
+
* its `root`) so container-driven root box changes still coalesce into the same rAF pass even if a panel callback
|
|
105
|
+
* ordering quirk would otherwise miss a tick.
|
|
106
|
+
* Panel-driven updates coalesce to at most **one** animation frame per burst: a single `requestAnimationFrame`
|
|
107
|
+
* pass runs the Three.js buffer resize and (when needed) that synthetic `resize`, so both flex panes firing
|
|
108
|
+
* in the same frame do not call `renderer.setSize` twice.
|
|
109
|
+
*
|
|
110
|
+
* Real `window` `resize` events schedule the same coalesced Three.js pass **without** an extra synthetic
|
|
111
|
+
* `resize`, so the thin client is not double-notified when the browser already fired `resize`.
|
|
57
112
|
*
|
|
58
113
|
* The Three.js pane listens to `window` `resize` as well so `devicePixelRatio` updates (zoom / display changes)
|
|
59
|
-
* refresh the WebGL drawing buffer without relying on panel `ResizeObserver` alone.
|
|
114
|
+
* refresh the WebGL drawing buffer without relying on panel `ResizeObserver` alone. Optional
|
|
115
|
+
* {@link ThreeGeometraSplitHostOptions.maxDevicePixelRatio} caps the ratio used for the WebGL buffer.
|
|
60
116
|
*
|
|
61
117
|
* Pass through {@link BrowserCanvasClientOptions} from `@geometra/renderer-canvas` / `@geometra/client`
|
|
62
118
|
* (for example `binaryFraming`, `onError`, `onFrameMetrics`, `onData` for JSON side-channels on the same
|
package/dist/split-host.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"split-host.d.ts","sourceRoot":"","sources":["../src/split-host.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAEL,KAAK,yBAAyB,EAC9B,KAAK,0BAA0B,EAChC,MAAM,2BAA2B,CAAA;AAClC,OAAO,
|
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