@combeenation/3d-viewer 18.0.0-beta1 → 18.0.0-beta3
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/lib-cjs/buildinfo.json +1 -1
- package/dist/lib-cjs/commonjs.tsconfig.tsbuildinfo +1 -1
- package/dist/lib-cjs/index.d.ts +6 -0
- package/dist/lib-cjs/index.js +6 -0
- package/dist/lib-cjs/index.js.map +1 -1
- package/dist/lib-cjs/internal/cloning-helper.js +1 -1
- package/dist/lib-cjs/internal/cloning-helper.js.map +1 -1
- package/dist/lib-cjs/manager/camera-manager.d.ts +23 -2
- package/dist/lib-cjs/manager/camera-manager.js +90 -25
- package/dist/lib-cjs/manager/camera-manager.js.map +1 -1
- package/dist/lib-cjs/manager/debug-manager.d.ts +1 -1
- package/dist/lib-cjs/manager/debug-manager.js +2 -2
- package/dist/lib-cjs/manager/debug-manager.js.map +1 -1
- package/dist/lib-cjs/manager/dimension-line-manager.d.ts +87 -0
- package/dist/lib-cjs/manager/dimension-line-manager.js +126 -0
- package/dist/lib-cjs/manager/dimension-line-manager.js.map +1 -0
- package/dist/lib-cjs/manager/html-anchor-manager.d.ts +93 -0
- package/dist/lib-cjs/manager/html-anchor-manager.js +228 -0
- package/dist/lib-cjs/manager/html-anchor-manager.js.map +1 -0
- package/dist/lib-cjs/manager/model-manager.d.ts +0 -1
- package/dist/lib-cjs/manager/model-manager.js +0 -1
- package/dist/lib-cjs/manager/model-manager.js.map +1 -1
- package/dist/lib-cjs/manager/parameter-manager.d.ts +1 -1
- package/dist/lib-cjs/manager/scene-manager.js +10 -3
- package/dist/lib-cjs/manager/scene-manager.js.map +1 -1
- package/dist/lib-cjs/viewer.d.ts +6 -2
- package/dist/lib-cjs/viewer.js +13 -1
- package/dist/lib-cjs/viewer.js.map +1 -1
- package/package.json +2 -1
- package/src/index.ts +6 -0
- package/src/internal/cloning-helper.ts +1 -1
- package/src/manager/camera-manager.ts +152 -40
- package/src/manager/debug-manager.ts +2 -2
- package/src/manager/dimension-line-manager.ts +210 -0
- package/src/manager/html-anchor-manager.ts +332 -0
- package/src/manager/model-manager.ts +0 -1
- package/src/manager/parameter-manager.ts +1 -1
- package/src/manager/scene-manager.ts +12 -3
- package/src/viewer.ts +17 -1
package/dist/lib-cjs/viewer.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as Index from './index';
|
|
2
|
-
import { AbstractEngine, CameraManager, DebugManager, DefaultSceneSettings, EngineOptions, EventManager, GltfExportManager, MaterialManager, ModelManager, ParameterManager, ParameterSubject, Scene, SceneManager, TextureManager, TransformNode } from './index';
|
|
2
|
+
import { AbstractEngine, CameraManager, DebugManager, DefaultSceneSettings, DimensionLineManager, EngineOptions, EventManager, GltfExportManager, HtmlAnchorManager, MaterialManager, ModelManager, ParameterManager, ParameterSubject, Scene, SceneManager, TextureManager, TransformNode } from './index';
|
|
3
3
|
/**
|
|
4
4
|
* Use this to define geometry to be excluded from autofocus, GLB export, etc.
|
|
5
5
|
*/
|
|
@@ -51,8 +51,10 @@ export declare class Viewer {
|
|
|
51
51
|
protected _scene: Scene;
|
|
52
52
|
protected _cameraManager: CameraManager;
|
|
53
53
|
protected _debugManager: DebugManager;
|
|
54
|
+
protected _dimensionLineManager: DimensionLineManager;
|
|
54
55
|
protected _eventManager: EventManager;
|
|
55
56
|
protected _gltfExportManager: GltfExportManager;
|
|
57
|
+
protected _htmlAnchorManager: HtmlAnchorManager;
|
|
56
58
|
protected _materialManager: MaterialManager;
|
|
57
59
|
protected _modelManager: ModelManager;
|
|
58
60
|
protected _parameterManager: ParameterManager;
|
|
@@ -64,8 +66,10 @@ export declare class Viewer {
|
|
|
64
66
|
get engine(): AbstractEngine;
|
|
65
67
|
get cameraManager(): CameraManager;
|
|
66
68
|
get debugManager(): DebugManager;
|
|
69
|
+
get dimensionLineManager(): DimensionLineManager;
|
|
67
70
|
get eventManager(): EventManager;
|
|
68
71
|
get gltfExportManager(): GltfExportManager;
|
|
72
|
+
get htmlAnchorManager(): HtmlAnchorManager;
|
|
69
73
|
get materialManager(): MaterialManager;
|
|
70
74
|
get modelManager(): ModelManager;
|
|
71
75
|
get parameterManager(): ParameterManager;
|
|
@@ -88,7 +92,7 @@ export declare class Viewer {
|
|
|
88
92
|
*/
|
|
89
93
|
constructor(canvas?: HTMLCanvasElement | undefined, viewerSettings?: DeepPartial<ViewerSettings>, defaultSceneSettings?: DeepPartial<DefaultSceneSettings>);
|
|
90
94
|
/**
|
|
91
|
-
* Pause rendering can be
|
|
95
|
+
* Pause rendering can be useful when doing internal scene processings that should not be visible to the user,
|
|
92
96
|
* e.g. cloning meshes for gltf export
|
|
93
97
|
*/
|
|
94
98
|
pauseRendering(): void;
|
package/dist/lib-cjs/viewer.js
CHANGED
|
@@ -84,12 +84,18 @@ class Viewer {
|
|
|
84
84
|
get debugManager() {
|
|
85
85
|
return this._debugManager;
|
|
86
86
|
}
|
|
87
|
+
get dimensionLineManager() {
|
|
88
|
+
return this._dimensionLineManager;
|
|
89
|
+
}
|
|
87
90
|
get eventManager() {
|
|
88
91
|
return this._eventManager;
|
|
89
92
|
}
|
|
90
93
|
get gltfExportManager() {
|
|
91
94
|
return this._gltfExportManager;
|
|
92
95
|
}
|
|
96
|
+
get htmlAnchorManager() {
|
|
97
|
+
return this._htmlAnchorManager;
|
|
98
|
+
}
|
|
93
99
|
get materialManager() {
|
|
94
100
|
return this._materialManager;
|
|
95
101
|
}
|
|
@@ -119,7 +125,7 @@ class Viewer {
|
|
|
119
125
|
return Index;
|
|
120
126
|
}
|
|
121
127
|
/**
|
|
122
|
-
* Pause rendering can be
|
|
128
|
+
* Pause rendering can be useful when doing internal scene processings that should not be visible to the user,
|
|
123
129
|
* e.g. cloning meshes for gltf export
|
|
124
130
|
*/
|
|
125
131
|
pauseRendering() {
|
|
@@ -162,13 +168,19 @@ class Viewer {
|
|
|
162
168
|
engine.getCaps().parallelShaderCompile = undefined;
|
|
163
169
|
}
|
|
164
170
|
this._scene = new index_1.Scene(engine);
|
|
171
|
+
// NOTE: rendering group id "1" is reserved for occlusion helper sphere (see `HtmlAnchorManager`)
|
|
172
|
+
// rendering group id "1" has the same depth buffer as 0 in order to make this work
|
|
173
|
+
// => use rendering group id "2" or higher for keeping meshes in foreground
|
|
174
|
+
this._scene.setRenderingAutoClearDepthStencil(1, false, false, false);
|
|
165
175
|
// NOTE: order of manage seems to be a bit counter intuitive as it's sorted alphabetically
|
|
166
176
|
// semantically one would start with scene manager, etc...
|
|
167
177
|
// still this is a good test as the order of manager constructors should not matter
|
|
168
178
|
this._cameraManager = new index_1.CameraManager(this);
|
|
169
179
|
this._debugManager = new index_1.DebugManager(this);
|
|
180
|
+
this._dimensionLineManager = new index_1.DimensionLineManager(this);
|
|
170
181
|
this._eventManager = new index_1.EventManager(this);
|
|
171
182
|
this._gltfExportManager = new index_1.GltfExportManager(this);
|
|
183
|
+
this._htmlAnchorManager = new index_1.HtmlAnchorManager(this);
|
|
172
184
|
this._materialManager = new index_1.MaterialManager(this);
|
|
173
185
|
this._modelManager = new index_1.ModelManager(this);
|
|
174
186
|
this._parameterManager = new index_1.ParameterManager(this);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"viewer.js","sourceRoot":"","sources":["../../src/viewer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sEAAyC;AACzC,+CAAiC;AACjC,
|
|
1
|
+
{"version":3,"file":"viewer.js","sourceRoot":"","sources":["../../src/viewer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sEAAyC;AACzC,+CAAiC;AACjC,mCAoBiB;AACjB,kGAAmG;AACnG,4DAAiE;AACjE,yCAA6C;AAwC7C;;;;;;;;;GASG;AACH,MAAa,MAAM;IA4FjB;;;;;OAKG;IACH,YACkB,MAA0B,EAC1C,cAA4C,EAC5C,oBAAwD;QAFxC,WAAM,GAAN,MAAM,CAAoB;QAhF5C,0BAA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IAAI,CAAC,eAAe,GAAG,IAAI,sBAAc,CAAC,IAAI,CAAC,CAAC;QAEhD,qBAAqB;QACrB,sGAAsG;QACtG,IAAI,CAAC,aAAa,CAAC,mBAAmB,EAAE,CAAC;QAEzC,gHAAgH;QAChH,2BAA2B;QAC3B,IAAI,CAAC,aAAa,CAAC,2BAA2B,EAAE,CAAC;QAEjD,IAAI,CAAC,aAAa,CAAC,8BAA8B,EAAE,CAAC;QAEpD,MAAM,CAAC,aAAa,CAAC,GAAG,EAAE;YACxB,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE;gBAC7B,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;aACrB;QACH,CAAC,CAAC,CAAC;IACL,CAAC;;AAvMH,wBAwMC;AAvMiB,cAAO,GAAG,wBAAS,CAAC,OAAO,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@combeenation/3d-viewer",
|
|
3
|
-
"version": "18.0.0-
|
|
3
|
+
"version": "18.0.0-beta3",
|
|
4
4
|
"description": "Combeenation 3D Viewer",
|
|
5
5
|
"homepage": "https://github.com/Combeenation/3d-viewer#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -54,6 +54,7 @@
|
|
|
54
54
|
"@babylonjs/loaders": "7.47.3",
|
|
55
55
|
"@babylonjs/serializers": "7.47.3",
|
|
56
56
|
"eventemitter3": "4.0.7",
|
|
57
|
+
"html2canvas": "1.4.1",
|
|
57
58
|
"is-svg": "^5.0.0",
|
|
58
59
|
"lodash-es": "4.17.21"
|
|
59
60
|
},
|
package/src/index.ts
CHANGED
|
@@ -21,6 +21,7 @@ export * from '@babylonjs/core/Debug/axesViewer';
|
|
|
21
21
|
export * from '@babylonjs/core/Debug/debugLayer';
|
|
22
22
|
export * from '@babylonjs/core/Engines/abstractEngine';
|
|
23
23
|
export * from '@babylonjs/core/Engines/engine';
|
|
24
|
+
export * from '@babylonjs/core/Engines/Extensions/engine.query';
|
|
24
25
|
export * from '@babylonjs/core/Engines/nullEngine';
|
|
25
26
|
export * from '@babylonjs/core/Engines/thinEngine';
|
|
26
27
|
export * from '@babylonjs/core/Lights';
|
|
@@ -33,14 +34,17 @@ export * from '@babylonjs/core/Maths';
|
|
|
33
34
|
export * from '@babylonjs/core/Meshes/abstractMesh';
|
|
34
35
|
export * from '@babylonjs/core/Meshes/geometry';
|
|
35
36
|
export * from '@babylonjs/core/Meshes/instancedMesh';
|
|
37
|
+
export * from '@babylonjs/core/Meshes/linesMesh';
|
|
36
38
|
export * from '@babylonjs/core/Meshes/mesh';
|
|
37
39
|
export * from '@babylonjs/core/Meshes/meshBuilder';
|
|
38
40
|
export * from '@babylonjs/core/Meshes/transformNode';
|
|
41
|
+
export * from '@babylonjs/core/Misc/observable';
|
|
39
42
|
export * from '@babylonjs/core/Misc/interfaces/screenshotSize';
|
|
40
43
|
export * from '@babylonjs/core/Misc/screenshotTools';
|
|
41
44
|
export * from '@babylonjs/core/Misc/tags';
|
|
42
45
|
export * from '@babylonjs/core/Morph';
|
|
43
46
|
export * from '@babylonjs/core/node';
|
|
47
|
+
export * from '@babylonjs/core/Rendering/boundingBoxRenderer';
|
|
44
48
|
export * from '@babylonjs/core/Rendering/utilityLayerRenderer';
|
|
45
49
|
export * from '@babylonjs/core/scene';
|
|
46
50
|
export * from '@babylonjs/core/types';
|
|
@@ -66,9 +70,11 @@ export * from '@babylonjs/core/Materials/Node';
|
|
|
66
70
|
export * from './viewer';
|
|
67
71
|
export * from './viewer-error';
|
|
68
72
|
export * from './manager/camera-manager';
|
|
73
|
+
export * from './manager/dimension-line-manager';
|
|
69
74
|
export * from './manager/debug-manager';
|
|
70
75
|
export * from './manager/event-manager';
|
|
71
76
|
export * from './manager/gltf-export-manager';
|
|
77
|
+
export * from './manager/html-anchor-manager';
|
|
72
78
|
export * from './manager/material-manager';
|
|
73
79
|
export * from './manager/model-manager';
|
|
74
80
|
export * from './manager/parameter-manager';
|
|
@@ -186,7 +186,7 @@ function _cloneNode(
|
|
|
186
186
|
// making deep copies of the node metadata might be an optional flag in the cloning functions in the future
|
|
187
187
|
|
|
188
188
|
// ATM the assignment from clone to source is needed for reassigning instanced meshes after cloning
|
|
189
|
-
// may be
|
|
189
|
+
// may be useful for other node types in the future as well
|
|
190
190
|
setInternalMetadataValue(clone, 'cloneSource', node.uniqueId);
|
|
191
191
|
setInternalMetadataValue(node, 'cloneTarget', clone.uniqueId);
|
|
192
192
|
|
|
@@ -4,7 +4,6 @@ import {
|
|
|
4
4
|
ArcRotateCamera,
|
|
5
5
|
BoundingSphere,
|
|
6
6
|
ExcludedGeometryList,
|
|
7
|
-
IScreenshotSize,
|
|
8
7
|
ScreenshotTools,
|
|
9
8
|
Vector3,
|
|
10
9
|
Viewer,
|
|
@@ -64,6 +63,11 @@ export type ScreenshotSettings = {
|
|
|
64
63
|
autofocusScene?: boolean;
|
|
65
64
|
/** Optional list of geometry to be excluded from consideration */
|
|
66
65
|
exclude?: ExcludedGeometryList;
|
|
66
|
+
/**
|
|
67
|
+
* Optional list of html anchor groups (see {@link HtmlAnchorManager}), that should be excluded from the screenshot.\
|
|
68
|
+
* Excludes ALL html anchor groups if set to `true`.
|
|
69
|
+
*/
|
|
70
|
+
excludeHtmlAnchorGroups?: string[] | true;
|
|
67
71
|
/**
|
|
68
72
|
* "MIME type" of the returned screenshot image, defaults to `image/png`
|
|
69
73
|
*
|
|
@@ -89,11 +93,27 @@ export type ScreenshotSettings = {
|
|
|
89
93
|
quality?: number;
|
|
90
94
|
};
|
|
91
95
|
|
|
96
|
+
/**
|
|
97
|
+
* Internal data type for screenshot sizing.
|
|
98
|
+
* `imageWidth/Height` defines the size of the final image.
|
|
99
|
+
* `canvasWidth/Height` is the size of the canvas from which the screenshot is taken.
|
|
100
|
+
* Canvas size always has the same aspect ratio as the viewport and is larger than image size, as the final image may be
|
|
101
|
+
* cropped.
|
|
102
|
+
*
|
|
103
|
+
* @internal
|
|
104
|
+
*/
|
|
105
|
+
export type ScreenshotSize = {
|
|
106
|
+
imageWidth: number;
|
|
107
|
+
imageHeight: number;
|
|
108
|
+
canvasWidth: number;
|
|
109
|
+
canvasHeight: number;
|
|
110
|
+
};
|
|
111
|
+
|
|
92
112
|
/**
|
|
93
113
|
* Manager for camera related tasks
|
|
94
114
|
*/
|
|
95
115
|
export class CameraManager {
|
|
96
|
-
public static readonly CAMERA_ANIMATION_NAME = '
|
|
116
|
+
public static readonly CAMERA_ANIMATION_NAME = '$cameraAnimation';
|
|
97
117
|
|
|
98
118
|
/** @internal */
|
|
99
119
|
public static readonly DEFAULT_CAMERA_POSITION: CameraPosition = {
|
|
@@ -112,7 +132,7 @@ export class CameraManager {
|
|
|
112
132
|
|
|
113
133
|
protected static readonly _DEFAULT_AUTOFOCUS_RADIUS_FACTOR = 1;
|
|
114
134
|
protected static readonly _DEFAULT_CAM_SPEED_MS = 250;
|
|
115
|
-
protected static readonly _SCREENSHOT_CAMERA_NAME = '
|
|
135
|
+
protected static readonly _SCREENSHOT_CAMERA_NAME = '$screenshotCamera';
|
|
116
136
|
|
|
117
137
|
/** @internal */
|
|
118
138
|
public constructor(protected viewer: Viewer) {}
|
|
@@ -269,21 +289,38 @@ export class CameraManager {
|
|
|
269
289
|
* The result is a string containing a base64 encoded image.
|
|
270
290
|
*/
|
|
271
291
|
public async createScreenshot(settings?: ScreenshotSettings): Promise<string> {
|
|
292
|
+
const {
|
|
293
|
+
width,
|
|
294
|
+
height,
|
|
295
|
+
alpha,
|
|
296
|
+
beta,
|
|
297
|
+
radius,
|
|
298
|
+
target,
|
|
299
|
+
autofocusScene,
|
|
300
|
+
exclude,
|
|
301
|
+
excludeHtmlAnchorGroups,
|
|
302
|
+
fileName,
|
|
303
|
+
samples,
|
|
304
|
+
antialiasing,
|
|
305
|
+
renderSprites,
|
|
306
|
+
enableStencilBuffer,
|
|
307
|
+
useLayerMask,
|
|
308
|
+
quality,
|
|
309
|
+
} = settings ?? {};
|
|
310
|
+
|
|
272
311
|
const screenshotCam = this.viewer.scene.activeCamera?.clone(
|
|
273
312
|
CameraManager._SCREENSHOT_CAMERA_NAME
|
|
274
313
|
) as ArcRotateCamera;
|
|
275
|
-
const boundingInfo =
|
|
276
|
-
? this.viewer.sceneManager.calculateBoundingInfo(settings.exclude)
|
|
277
|
-
: undefined;
|
|
314
|
+
const boundingInfo = autofocusScene ? this.viewer.sceneManager.calculateBoundingInfo(exclude) : undefined;
|
|
278
315
|
|
|
279
|
-
if (
|
|
280
|
-
screenshotCam.alpha =
|
|
316
|
+
if (alpha !== undefined) {
|
|
317
|
+
screenshotCam.alpha = alpha;
|
|
281
318
|
}
|
|
282
|
-
if (
|
|
283
|
-
screenshotCam.beta =
|
|
319
|
+
if (beta !== undefined) {
|
|
320
|
+
screenshotCam.beta = beta;
|
|
284
321
|
}
|
|
285
|
-
if (
|
|
286
|
-
screenshotCam.radius =
|
|
322
|
+
if (radius !== undefined) {
|
|
323
|
+
screenshotCam.radius = radius;
|
|
287
324
|
} else if (boundingInfo) {
|
|
288
325
|
// zoom out to have full scene in view if requested by `autofocusScene` flag
|
|
289
326
|
const distance = this._getAutofocusZoomingDistance(boundingInfo.boundingSphere, screenshotCam);
|
|
@@ -292,44 +329,90 @@ export class CameraManager {
|
|
|
292
329
|
}
|
|
293
330
|
// `cloneAlphaBetaRadius` has to be set to true, otherwise these values get adapted by setting the new target
|
|
294
331
|
// this would also be the case when setting `screenshotCam.target` directly
|
|
295
|
-
if (
|
|
296
|
-
screenshotCam.setTarget(
|
|
332
|
+
if (target !== undefined) {
|
|
333
|
+
screenshotCam.setTarget(target, undefined, undefined, true);
|
|
297
334
|
} else if (boundingInfo) {
|
|
298
335
|
screenshotCam.setTarget(boundingInfo.boundingSphere.center, undefined, undefined, true);
|
|
299
336
|
}
|
|
300
337
|
|
|
301
|
-
//
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
338
|
+
// calculate screenshot size manually as it is used for html anchor screenshot as well
|
|
339
|
+
const screenshotSize = this._getScreenshotSize(width, height);
|
|
340
|
+
const mimeType = settings?.mimeType ?? 'image/png';
|
|
341
|
+
|
|
342
|
+
const imageStr3d = await ScreenshotTools.CreateScreenshotUsingRenderTargetAsync(
|
|
343
|
+
this.viewer.engine,
|
|
344
|
+
screenshotCam,
|
|
345
|
+
{ width: screenshotSize.imageWidth, height: screenshotSize.imageHeight },
|
|
346
|
+
mimeType,
|
|
347
|
+
samples,
|
|
348
|
+
antialiasing,
|
|
349
|
+
undefined,
|
|
350
|
+
renderSprites,
|
|
351
|
+
enableStencilBuffer,
|
|
352
|
+
useLayerMask,
|
|
353
|
+
quality,
|
|
354
|
+
texture => {
|
|
355
|
+
// NOTE: this doesn't work ATM, see https://github.com/BabylonJS/Babylon.js/pull/16081#issuecomment-2652861176
|
|
356
|
+
// we'll have to wait for a fix or solve the visibility in a different way (e.g. camera layer mask)
|
|
357
|
+
texture.renderList = this.viewer.scene.meshes.filter(
|
|
358
|
+
mesh => !settings?.exclude || !isNodeExcluded(mesh, settings.exclude)
|
|
359
|
+
);
|
|
360
|
+
}
|
|
361
|
+
);
|
|
305
362
|
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
this.viewer.
|
|
363
|
+
let imageStr = '';
|
|
364
|
+
const htmlAnchorKeys =
|
|
365
|
+
excludeHtmlAnchorGroups === true
|
|
366
|
+
? []
|
|
367
|
+
: this.viewer.htmlAnchorManager.getHtmlAnchorKeys(undefined, excludeHtmlAnchorGroups, true);
|
|
368
|
+
if (htmlAnchorKeys.length) {
|
|
369
|
+
// html anchors are not included in the main screenshot, as the html elements are located outside of the canvas
|
|
370
|
+
// the idea is to create a dedicated canvas for these elements and merge the result with the main screenshot into
|
|
371
|
+
// a combined canvas
|
|
372
|
+
const screenshotHtmlCanvas = await this.viewer.htmlAnchorManager.createScreenshotCanvas(
|
|
373
|
+
screenshotSize,
|
|
311
374
|
screenshotCam,
|
|
312
|
-
|
|
313
|
-
(data: string) => resolve(data),
|
|
314
|
-
settings?.mimeType,
|
|
315
|
-
settings?.samples,
|
|
316
|
-
settings?.antialiasing,
|
|
317
|
-
settings?.fileName,
|
|
318
|
-
settings?.renderSprites,
|
|
319
|
-
settings?.enableStencilBuffer,
|
|
320
|
-
settings?.useLayerMask,
|
|
321
|
-
settings?.quality,
|
|
322
|
-
texture => {
|
|
323
|
-
texture.renderList = this.viewer.scene.meshes.filter(
|
|
324
|
-
mesh => !settings?.exclude || !isNodeExcluded(mesh, settings.exclude)
|
|
325
|
-
);
|
|
326
|
-
}
|
|
375
|
+
htmlAnchorKeys
|
|
327
376
|
);
|
|
328
|
-
|
|
377
|
+
|
|
378
|
+
// convert the main screenshot into an image, so that it can be drawn onto a canvas as well
|
|
379
|
+
const screenshot3dImg = new Image();
|
|
380
|
+
screenshot3dImg.src = imageStr3d;
|
|
381
|
+
await new Promise(resolve => {
|
|
382
|
+
screenshot3dImg.onload = resolve;
|
|
383
|
+
});
|
|
384
|
+
|
|
385
|
+
const screenshotCombinedCanvas = document.createElement('canvas');
|
|
386
|
+
screenshotCombinedCanvas.width = screenshotSize.imageWidth;
|
|
387
|
+
screenshotCombinedCanvas.height = screenshotSize.imageHeight;
|
|
388
|
+
|
|
389
|
+
// draw main and html screenshot on a new canvas and get the base64 string from it
|
|
390
|
+
const context = screenshotCombinedCanvas.getContext('2d')!;
|
|
391
|
+
context.drawImage(screenshot3dImg, 0, 0, screenshotSize.imageWidth, screenshotSize.imageHeight);
|
|
392
|
+
context.drawImage(screenshotHtmlCanvas, 0, 0, screenshotSize.imageWidth, screenshotSize.imageHeight);
|
|
393
|
+
imageStr = screenshotCombinedCanvas.toDataURL(mimeType);
|
|
394
|
+
|
|
395
|
+
screenshotCombinedCanvas.remove();
|
|
396
|
+
} else {
|
|
397
|
+
imageStr = imageStr3d;
|
|
398
|
+
}
|
|
329
399
|
|
|
330
400
|
screenshotCam.dispose();
|
|
331
401
|
|
|
332
|
-
|
|
402
|
+
if (fileName) {
|
|
403
|
+
// rebuild Babylon.js default behaviour: if a file name is given, download the screenshot instead of returning the
|
|
404
|
+
// data string
|
|
405
|
+
const link = document.createElement('a');
|
|
406
|
+
link.href = imageStr;
|
|
407
|
+
link.download = fileName;
|
|
408
|
+
document.body.appendChild(link);
|
|
409
|
+
link.click();
|
|
410
|
+
document.body.removeChild(link);
|
|
411
|
+
|
|
412
|
+
return '';
|
|
413
|
+
} else {
|
|
414
|
+
return imageStr;
|
|
415
|
+
}
|
|
333
416
|
}
|
|
334
417
|
|
|
335
418
|
protected static _addCameraAnimationToGroup(
|
|
@@ -375,4 +458,33 @@ export class CameraManager {
|
|
|
375
458
|
|
|
376
459
|
return distance;
|
|
377
460
|
}
|
|
461
|
+
|
|
462
|
+
protected _getScreenshotSize(width?: number, height?: number): ScreenshotSize {
|
|
463
|
+
const canvas = this.viewer.canvas!;
|
|
464
|
+
const aspectRatio = canvas.width / canvas.height;
|
|
465
|
+
|
|
466
|
+
let imageWidth = 0;
|
|
467
|
+
let imageHeight = 0;
|
|
468
|
+
if (width && height) {
|
|
469
|
+
imageWidth = width;
|
|
470
|
+
imageHeight = height;
|
|
471
|
+
} else if (width && !height) {
|
|
472
|
+
imageWidth = width;
|
|
473
|
+
imageHeight = width / aspectRatio;
|
|
474
|
+
} else if (!width && height) {
|
|
475
|
+
imageWidth = height * aspectRatio;
|
|
476
|
+
imageHeight = height;
|
|
477
|
+
} else {
|
|
478
|
+
imageWidth = canvas.width;
|
|
479
|
+
imageHeight = canvas.height;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
// canvas size only differs from image size if both width and height are set
|
|
483
|
+
// in this case the aspect ratio differs from the canvas aspect ratio and some parts of the canvas have to be
|
|
484
|
+
// cropped for the screenshot
|
|
485
|
+
const canvasWidth = width && height ? height * aspectRatio : imageWidth;
|
|
486
|
+
const canvasHeight = imageHeight;
|
|
487
|
+
|
|
488
|
+
return { imageWidth, imageHeight, canvasWidth, canvasHeight };
|
|
489
|
+
}
|
|
378
490
|
}
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
* Manager for debugging functionalities
|
|
21
21
|
*/
|
|
22
22
|
export class DebugManager {
|
|
23
|
-
protected static _BOUNDING_SPHERE_KEY = '
|
|
23
|
+
protected static _BOUNDING_SPHERE_KEY = '$boundingSphere';
|
|
24
24
|
|
|
25
25
|
protected _axesViewer: AxesViewer | null = null;
|
|
26
26
|
protected _showBoundingSphereForAutofocus: boolean = false;
|
|
@@ -145,7 +145,7 @@ The inspector can only be used in development builds.`);
|
|
|
145
145
|
|
|
146
146
|
/**
|
|
147
147
|
* Draws a wireframe bounding sphere on the next call of {@link CameraManager.autofocusActiveCamera}.\
|
|
148
|
-
* This is
|
|
148
|
+
* This is useful for checking which parts of the scene get centered.
|
|
149
149
|
*/
|
|
150
150
|
public showBoundingSphereForAutofocus(): void {
|
|
151
151
|
this._showBoundingSphereForAutofocus = true;
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { Color3, LinesMesh, MeshBuilder, Tags, TransformNode, Vector3, Viewer } from '../index';
|
|
2
|
+
import { merge } from 'lodash-es';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Options for dimension line creation
|
|
6
|
+
*/
|
|
7
|
+
export type DimensionLineOptions = {
|
|
8
|
+
/**
|
|
9
|
+
* Default: `Color3.Black()`
|
|
10
|
+
*/
|
|
11
|
+
lineColor: Color3;
|
|
12
|
+
/**
|
|
13
|
+
* Default: 0.05m
|
|
14
|
+
*/
|
|
15
|
+
closingLineHeight: number;
|
|
16
|
+
/**
|
|
17
|
+
* Optional direction of the closing lines on start and end.\
|
|
18
|
+
* Use built-in vector functions like `Vector3.Left()` or `Vector3.Forward()` for simple directions of use a custom
|
|
19
|
+
* normal vector like `Vector3(1, 0.5 ,0)`.
|
|
20
|
+
*
|
|
21
|
+
* Default: x or y direction is taken, depending on the normal vector between start and end point
|
|
22
|
+
*/
|
|
23
|
+
closingLineDirection?: Vector3;
|
|
24
|
+
/**
|
|
25
|
+
* Optional parent node of dimension line, can be used for easier calculation of start and end point
|
|
26
|
+
*
|
|
27
|
+
* Default: no parent node set
|
|
28
|
+
*/
|
|
29
|
+
parentNode?: TransformNode;
|
|
30
|
+
/**
|
|
31
|
+
* `true`: html elements can be occluded by other meshes
|
|
32
|
+
* `false`: html elements will always be shown in front of the scene
|
|
33
|
+
*
|
|
34
|
+
* Default: `false`
|
|
35
|
+
*/
|
|
36
|
+
hideIfOccluded: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* `true`: html element size is relative to camera distance, just like a "normal" 3d object
|
|
39
|
+
* `false`: html element size remains constant
|
|
40
|
+
*
|
|
41
|
+
* Default: `false`
|
|
42
|
+
*/
|
|
43
|
+
scaleWithCameraDistance: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Optional callback for label text creation.\
|
|
46
|
+
* Provides calculated length from `startPoint` and `endPoint` as parameter in meters.
|
|
47
|
+
*
|
|
48
|
+
* Default: rounded (2 digits) "mm" value (e.g. "1234.56 mm")
|
|
49
|
+
*/
|
|
50
|
+
labelTextCb: (lengthM: number) => string;
|
|
51
|
+
/**
|
|
52
|
+
* Custom CSS class for dimension line label.\
|
|
53
|
+
* Can be used to overwrite the styling of the label.
|
|
54
|
+
*/
|
|
55
|
+
labelCssClass: string;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Manager for dimension lines, which can be used to display certain dimensions like object sizes in the scene
|
|
60
|
+
*/
|
|
61
|
+
export class DimensionLineManager {
|
|
62
|
+
public static readonly DIMENSION_LINE_KEY = '$dimLine';
|
|
63
|
+
|
|
64
|
+
protected _defaultLineOptions: DimensionLineOptions = {
|
|
65
|
+
lineColor: Color3.Black(),
|
|
66
|
+
closingLineHeight: 0.05,
|
|
67
|
+
hideIfOccluded: false,
|
|
68
|
+
scaleWithCameraDistance: false,
|
|
69
|
+
labelTextCb: (lengthM): string => {
|
|
70
|
+
const lengthRounded = Math.round(lengthM * 1000 * 100) / 100;
|
|
71
|
+
return `${lengthRounded} mm`;
|
|
72
|
+
},
|
|
73
|
+
labelCssClass: '',
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
// map with all dimension lines that are currently visible in the scene
|
|
77
|
+
// holds data of all disposable objects for a clean up
|
|
78
|
+
protected _dimensionLineObjs: {
|
|
79
|
+
[name: string]: {
|
|
80
|
+
linesMesh: LinesMesh;
|
|
81
|
+
htmlLabelName: string;
|
|
82
|
+
};
|
|
83
|
+
} = {};
|
|
84
|
+
|
|
85
|
+
/** @internal */
|
|
86
|
+
public constructor(protected viewer: Viewer) {}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Define dimension line options that are used for each line by default.\
|
|
90
|
+
* Options can be overwritten by each line individually.
|
|
91
|
+
*/
|
|
92
|
+
public setDefaultDimensionLineOptions(defaultLineOptions: Partial<DimensionLineOptions>): void {
|
|
93
|
+
merge(this._defaultLineOptions, defaultLineOptions);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Create dimension line between two points
|
|
98
|
+
*/
|
|
99
|
+
public addDimensionLine(
|
|
100
|
+
name: string,
|
|
101
|
+
startPoint: Vector3,
|
|
102
|
+
endPoint: Vector3,
|
|
103
|
+
options?: Partial<DimensionLineOptions>
|
|
104
|
+
): void {
|
|
105
|
+
if (this._dimensionLineObjs[name]) {
|
|
106
|
+
console.warn(`Dimension line "${name}" already exists`);
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const resDefaultOptions = { ...this._defaultLineOptions };
|
|
111
|
+
merge(resDefaultOptions, options);
|
|
112
|
+
const {
|
|
113
|
+
lineColor,
|
|
114
|
+
closingLineHeight,
|
|
115
|
+
closingLineDirection: closingLineDirectionIn,
|
|
116
|
+
parentNode,
|
|
117
|
+
hideIfOccluded,
|
|
118
|
+
scaleWithCameraDistance,
|
|
119
|
+
labelTextCb,
|
|
120
|
+
labelCssClass,
|
|
121
|
+
} = resDefaultOptions;
|
|
122
|
+
|
|
123
|
+
let closingLineDirection = closingLineDirectionIn;
|
|
124
|
+
if (!closingLineDirection) {
|
|
125
|
+
// evaluate closing line direction if not given
|
|
126
|
+
const normal = endPoint.subtract(startPoint);
|
|
127
|
+
const yIsMainDirection = Math.abs(normal.y) > Math.abs(normal.x) && Math.abs(normal.y) > Math.abs(normal.z);
|
|
128
|
+
closingLineDirection = yIsMainDirection ? Vector3.Right() : Vector3.Up();
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// calculate and create main and closing lines
|
|
132
|
+
const lineCenter = Vector3.Center(startPoint, endPoint);
|
|
133
|
+
const relStartPt = startPoint.subtract(lineCenter);
|
|
134
|
+
const relEndPt = endPoint.subtract(lineCenter);
|
|
135
|
+
const closingLineOffsetVector = closingLineDirection.normalizeToNew().scale(closingLineHeight / 2);
|
|
136
|
+
const closingLineStartPts = [relStartPt.add(closingLineOffsetVector), relStartPt.subtract(closingLineOffsetVector)];
|
|
137
|
+
const closingLineEndPts = [relEndPt.add(closingLineOffsetVector), relEndPt.subtract(closingLineOffsetVector)];
|
|
138
|
+
|
|
139
|
+
const linesMesh = MeshBuilder.CreateLineSystem(`${DimensionLineManager.DIMENSION_LINE_KEY}_${name}`, {
|
|
140
|
+
lines: [[relStartPt, relEndPt], closingLineStartPts, closingLineEndPts],
|
|
141
|
+
});
|
|
142
|
+
linesMesh.position = lineCenter;
|
|
143
|
+
linesMesh.color = lineColor;
|
|
144
|
+
// rendering group id 1 reserved for html anchor meshes, which are required for occlusion checking
|
|
145
|
+
linesMesh.renderingGroupId = hideIfOccluded ? 0 : 2;
|
|
146
|
+
// tag can be used to exclude dimension lines from autofocus or gltf export
|
|
147
|
+
Tags.AddTagsTo(linesMesh, DimensionLineManager.DIMENSION_LINE_KEY);
|
|
148
|
+
if (parentNode) {
|
|
149
|
+
linesMesh.parent = parentNode;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
const lengthM = Vector3.Distance(startPoint, endPoint);
|
|
153
|
+
const labelText = labelTextCb(lengthM);
|
|
154
|
+
|
|
155
|
+
// create default html element
|
|
156
|
+
const span = document.createElement('span');
|
|
157
|
+
span.textContent = labelText;
|
|
158
|
+
|
|
159
|
+
if (labelCssClass) {
|
|
160
|
+
span.classList.add(labelCssClass);
|
|
161
|
+
} else {
|
|
162
|
+
const labelHeight = 24;
|
|
163
|
+
span.style.display = 'block';
|
|
164
|
+
span.style.height = `${labelHeight}px`;
|
|
165
|
+
span.style.lineHeight = `${labelHeight}px`;
|
|
166
|
+
span.style.fontSize = `${(labelHeight * 2) / 3}px`;
|
|
167
|
+
span.style.fontFamily = 'Arial';
|
|
168
|
+
span.style.border = `1px solid black`;
|
|
169
|
+
span.style.paddingLeft = `${labelHeight / 2}px`;
|
|
170
|
+
span.style.paddingRight = `${labelHeight / 2}px`;
|
|
171
|
+
span.style.borderRadius = `${labelHeight / 2}px`;
|
|
172
|
+
span.style.background = 'white';
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
const htmlLabelName = `${DimensionLineManager.DIMENSION_LINE_KEY}_${name}`;
|
|
176
|
+
this.viewer.htmlAnchorManager.addHtmlAnchor(name, span, Vector3.Zero(), {
|
|
177
|
+
parentNode: linesMesh,
|
|
178
|
+
group: DimensionLineManager.DIMENSION_LINE_KEY,
|
|
179
|
+
hideIfOccluded,
|
|
180
|
+
scaleWithCameraDistance,
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
this._dimensionLineObjs[name] = { linesMesh, htmlLabelName };
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Remove dimension line and disposes all associated ressources
|
|
188
|
+
*/
|
|
189
|
+
public removeDimensionLine(name: string): void {
|
|
190
|
+
const dimensionLine = this._dimensionLineObjs[name];
|
|
191
|
+
if (!dimensionLine) {
|
|
192
|
+
console.warn(`Dimension line "${name}" does not exist`);
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
this.viewer.htmlAnchorManager.removeHtmlAnchor(name);
|
|
197
|
+
dimensionLine.linesMesh.dispose(false, true);
|
|
198
|
+
|
|
199
|
+
delete this._dimensionLineObjs[name];
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Remove all dimension lines that have been created with the `DimensionLineManager`
|
|
204
|
+
*/
|
|
205
|
+
public removeAllDimensionLines(): void {
|
|
206
|
+
Object.keys(this._dimensionLineObjs).forEach(dimLineName => {
|
|
207
|
+
this.removeDimensionLine(dimLineName);
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
}
|