@roomle/web-sdk 3.6.0 → 3.7.0-alpha.2
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/lib/{BufferGeometry-DLEagG41.mjs → BufferGeometry-C696z6r3.mjs} +2 -2
- package/lib/{BufferGeometry-DLEagG41.mjs.map → BufferGeometry-C696z6r3.mjs.map} +1 -1
- package/lib/ConfiguratorKernel.js +54 -73
- package/lib/ConfiguratorKernel.wasm +0 -0
- package/lib/{GLTFExporter-D8qsdwDK.mjs → GLTFExporter-AfQIvZAD.mjs} +141 -141
- package/lib/{GLTFExporter-D8qsdwDK.mjs.map → GLTFExporter-AfQIvZAD.mjs.map} +1 -1
- package/lib/{Object3D-DSjIOhON.mjs → Object3D-C3wqWk6O.mjs} +1 -1
- package/lib/{Object3D-DSjIOhON.mjs.map → Object3D-C3wqWk6O.mjs.map} +1 -1
- package/lib/{PointLightHelper-BnjxGaOG.mjs → PointLightHelper-wVSmrAnD.mjs} +4 -4
- package/lib/{PointLightHelper-BnjxGaOG.mjs.map → PointLightHelper-wVSmrAnD.mjs.map} +1 -1
- package/lib/RoomleCore.js +59 -79
- package/lib/RoomleCore.wasm +0 -0
- package/lib/RoomleToolsCore.js +54 -74
- package/lib/RoomleToolsCore.wasm +0 -0
- package/lib/{SpotLightHelper-DqsfqCrs.mjs → SpotLightHelper-C7J95t4f.mjs} +3 -3
- package/lib/{SpotLightHelper-DqsfqCrs.mjs.map → SpotLightHelper-C7J95t4f.mjs.map} +1 -1
- package/lib/{USDZExporter-DxIqi8St.mjs → USDZExporter-BBk0APeK.mjs} +3 -3
- package/lib/{USDZExporter-DxIqi8St.mjs.map → USDZExporter-BBk0APeK.mjs.map} +1 -1
- package/lib/{Vector4-DGmBYfpK.mjs → Vector4-DUqY3Egg.mjs} +2 -2
- package/lib/{Vector4-DGmBYfpK.mjs.map → Vector4-DUqY3Egg.mjs.map} +1 -1
- package/lib/{api-xDJ-Uyom.mjs → api-oYzhcs_W.mjs} +2 -2
- package/lib/{api-xDJ-Uyom.mjs.map → api-oYzhcs_W.mjs.map} +1 -1
- package/lib/asset-loader.worker-A7nEeQB4.mjs +6 -0
- package/lib/asset-loader.worker-A7nEeQB4.mjs.map +1 -0
- package/lib/{banana-for-scale-C_iNmlCT.mjs → banana-for-scale-D8t2dmc7.mjs} +4 -4
- package/lib/banana-for-scale-D8t2dmc7.mjs.map +1 -0
- package/lib/budgeteer.sw-CQWYbQSc.mjs +6 -0
- package/lib/budgeteer.sw-CQWYbQSc.mjs.map +1 -0
- package/lib/{common-utils-DMSTohiS.mjs → common-utils-qErzZAiR.mjs} +2 -2
- package/lib/common-utils-qErzZAiR.mjs.map +1 -0
- package/lib/{component-dimensioning-CvRmUja4.mjs → component-dimensioning-DlB7-9Om.mjs} +49 -49
- package/lib/{component-dimensioning-CvRmUja4.mjs.map → component-dimensioning-DlB7-9Om.mjs.map} +1 -1
- package/lib/{component-raycast-helper-CEp7wy9c.mjs → component-raycast-helper-C6ptEb0K.mjs} +27 -32
- package/lib/component-raycast-helper-C6ptEb0K.mjs.map +1 -0
- package/lib/component-raycast-helper-LrhRpeDD.mjs +2 -0
- package/lib/configurator-CRMunIq7.mjs +45 -0
- package/lib/{configurator-CmuhFgC9.mjs.map → configurator-CRMunIq7.mjs.map} +1 -1
- package/lib/configurator-DqiW717d.mjs +2 -0
- package/lib/{continuous-drawing-helper-v_5UAM9A.mjs → continuous-drawing-helper-BwulJHKj.mjs} +12 -12
- package/lib/continuous-drawing-helper-BwulJHKj.mjs.map +1 -0
- package/lib/dat.gui.module-CZHqOVGq.mjs +1500 -0
- package/lib/dat.gui.module-CZHqOVGq.mjs.map +1 -0
- package/lib/{decorate-C1QnXPYw.mjs → decorate-BAtqSPNS.mjs} +3 -3
- package/lib/decorate-BAtqSPNS.mjs.map +1 -0
- package/lib/{dimensioning-helper-Fwpt1HTT.mjs → dimensioning-helper--Y0Y-Wr1.mjs} +42 -42
- package/lib/{dimensioning-helper-Fwpt1HTT.mjs.map → dimensioning-helper--Y0Y-Wr1.mjs.map} +1 -1
- package/lib/dimensioning-helper-BpUreWo2.mjs +2 -0
- package/lib/{fflate.module-dFNj5UPI.mjs → fflate.module-CBz7CLOg.mjs} +1 -1
- package/lib/{fflate.module-dFNj5UPI.mjs.map → fflate.module-CBz7CLOg.mjs.map} +1 -1
- package/lib/{glb-viewer-BzNA9-zH.mjs → glb-viewer-CXEoIw1b.mjs} +48 -48
- package/lib/glb-viewer-CXEoIw1b.mjs.map +1 -0
- package/lib/glb-viewer-IDXgmONx.mjs +2 -0
- package/lib/{homag-intelligence-BwGjJEws.mjs → homag-intelligence-gb9MqBrz.mjs} +6 -3
- package/lib/{homag-intelligence-BwGjJEws.mjs.map → homag-intelligence-gb9MqBrz.mjs.map} +1 -1
- package/lib/{imos-ix-poc-export-helper-CQh94HsO.mjs → imos-ix-poc-export-helper-CW7QZhhn.mjs} +5 -4
- package/lib/imos-ix-poc-export-helper-CW7QZhhn.mjs.map +1 -0
- package/lib/{kernel-BAQSG9r5.mjs → kernel-C7YDLxq8.mjs} +3 -2
- package/lib/kernel-C7YDLxq8.mjs.map +1 -0
- package/lib/{kernel-utils-H74uNY1h.mjs → kernel-utils-DCnHzW4n.mjs} +15 -15
- package/lib/kernel-utils-DCnHzW4n.mjs.map +1 -0
- package/lib/{layer-C_JtkhdO.mjs → layer-CFAr2mK_.mjs} +1 -1
- package/lib/{layer-C_JtkhdO.mjs.map → layer-CFAr2mK_.mjs.map} +1 -1
- package/lib/{main-CtVIB52l.mjs → main-BJZ9-cDk.mjs} +14470 -14187
- package/lib/main-BJZ9-cDk.mjs.map +1 -0
- package/lib/{material-viewer-Bq4smZ6f.mjs → material-viewer-D8Nmpwg0.mjs} +41 -41
- package/lib/material-viewer-D8Nmpwg0.mjs.map +1 -0
- package/lib/packages-Uv53SHfb.mjs +4 -0
- package/lib/planner-5VarJrpy.mjs +44 -0
- package/lib/{planner-CVw_xzGh.mjs.map → planner-5VarJrpy.mjs.map} +1 -1
- package/lib/planner-DJcn-iih.mjs +2 -0
- package/lib/{plugin-system-D9K46xJk.mjs → plugin-system-DInww4H_.mjs} +3 -3
- package/lib/{plugin-system-D9K46xJk.mjs.map → plugin-system-DInww4H_.mjs.map} +1 -1
- package/lib/rolldown-runtime-DgwB9i60.mjs +13 -0
- package/lib/roomle-headless-setup-LoBO7UJe.mjs +1150 -0
- package/lib/roomle-headless-setup-LoBO7UJe.mjs.map +1 -0
- package/lib/roomle-headless.d.ts +9910 -0
- package/lib/roomle-headless.js +321 -0
- package/lib/roomle-headless.js.map +1 -0
- package/lib/roomle-renderer-DVlJsHYn.mjs +49 -0
- package/lib/roomle-renderer-DVlJsHYn.mjs.map +1 -0
- package/lib/roomle-sdk.d.ts +466 -1129
- package/lib/roomle-sdk.js +8 -7
- package/lib/roomle-webgpu-renderer-CVxBRv6o.mjs +217 -0
- package/lib/roomle-webgpu-renderer-CVxBRv6o.mjs.map +1 -0
- package/lib/{scene-renderer-D8HkTFeZ.mjs → scene-renderer-BHZrQYAH.mjs} +501 -518
- package/lib/scene-renderer-BHZrQYAH.mjs.map +1 -0
- package/lib/script-loader-gpkcl1h-.mjs +86 -0
- package/lib/script-loader-gpkcl1h-.mjs.map +1 -0
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/package.json +1 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/configuratorCallback.d.ts +3 -3
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/configuratorCallback.js +3 -3
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/configuratorCallback.js.map +1 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/configuratorCoreInterface.d.ts +5 -3
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/configuratorCoreInterface.js +1 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/configuratorCoreInterface.js.map +1 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/plannerCoreCallback.d.ts +1 -0
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/plannerCoreCallback.js +3 -0
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/plannerCoreCallback.js.map +1 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/plannerCoreInterface.d.ts +4 -3
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/plannerCoreInterface.js.map +1 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/loader/configurationLoader.d.ts +3 -2
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/loader/configurationLoader.js +31 -9
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/loader/configurationLoader.js.map +1 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/loader/configurationManager.js +8 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/loader/configurationManager.js.map +1 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/ConfiguratorKernel.js +54 -73
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/ConfiguratorKernel.wasm +0 -0
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/RoomleCore.js +59 -79
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/RoomleCore.wasm +0 -0
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/RoomleToolsCore.js +54 -74
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/RoomleToolsCore.wasm +0 -0
- package/lib/{stats-helper-HM0TaIM5.mjs → stats-helper-Cv5SoEWT.mjs} +4 -3
- package/lib/{stats-helper-HM0TaIM5.mjs.map → stats-helper-Cv5SoEWT.mjs.map} +1 -1
- package/lib/{three.core-CLIofecG.mjs → three.core-mM-jZdgg.mjs} +926 -926
- package/lib/{three.core-CLIofecG.mjs.map → three.core-mM-jZdgg.mjs.map} +1 -1
- package/lib/{three.module-C4Q1skJQ.mjs → three.module-Bmy3sVQ-.mjs} +1210 -1210
- package/lib/{three.module-C4Q1skJQ.mjs.map → three.module-Bmy3sVQ-.mjs.map} +1 -1
- package/lib/{three.webgpu-dFspy2yF.mjs → three.webgpu-BbVYfCDp.mjs} +5360 -2940
- package/lib/{three.webgpu-dFspy2yF.mjs.map → three.webgpu-BbVYfCDp.mjs.map} +1 -1
- package/lib/three.webgpu-Bnp8Whu8.mjs +3 -0
- package/lib/threejs-utils-Bq4pVWBA.mjs +753 -0
- package/lib/threejs-utils-Bq4pVWBA.mjs.map +1 -0
- package/lib/{tools-core-Bf9WsK5v.mjs → tools-core-DqnhFefF.mjs} +6 -6
- package/lib/{tools-core-Bf9WsK5v.mjs.map → tools-core-DqnhFefF.mjs.map} +1 -1
- package/lib/workers-BJYv3y38.mjs +6 -0
- package/lib/workers-BJYv3y38.mjs.map +1 -0
- package/package.json +20 -5
- package/lib/banana-for-scale-C_iNmlCT.mjs.map +0 -1
- package/lib/common-utils-DMSTohiS.mjs.map +0 -1
- package/lib/component-raycast-helper-CEp7wy9c.mjs.map +0 -1
- package/lib/configurator-BaUt4_LF.mjs +0 -2
- package/lib/configurator-CmuhFgC9.mjs +0 -45
- package/lib/continuous-drawing-helper-v_5UAM9A.mjs.map +0 -1
- package/lib/decorate-C1QnXPYw.mjs.map +0 -1
- package/lib/dimensioning-helper-DTcW85Oq.mjs +0 -2
- package/lib/glb-viewer-BzNA9-zH.mjs.map +0 -1
- package/lib/glb-viewer-DOxBD5k-.mjs +0 -2
- package/lib/imos-ix-poc-export-helper-CQh94HsO.mjs.map +0 -1
- package/lib/kernel-BAQSG9r5.mjs.map +0 -1
- package/lib/kernel-utils-H74uNY1h.mjs.map +0 -1
- package/lib/main-CtVIB52l.mjs.map +0 -1
- package/lib/material-viewer-Bq4smZ6f.mjs.map +0 -1
- package/lib/planner-CVw_xzGh.mjs +0 -44
- package/lib/planner-si70gWA2.mjs +0 -2
- package/lib/scene-renderer-D8HkTFeZ.mjs.map +0 -1
- package/lib/script-loader-D8xCRzTr.mjs +0 -45
- package/lib/script-loader-D8xCRzTr.mjs.map +0 -1
- package/lib/threejs-utils-jEzvlJF1.mjs +0 -2233
- package/lib/threejs-utils-jEzvlJF1.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dimensioning-helper-Fwpt1HTT.mjs","names":[],"sources":["../../packages/common-core/src/async-guard.ts","../../../../node_modules/three/examples/jsm/renderers/CSS2DRenderer.js","../../packages/configurator-core/src/utils/dimensioning-helper.ts"],"sourcesContent":["export default class AsyncGuard<T> {\n public info: any;\n private _promise: Promise<T>;\n private _resolve: (value?: T | PromiseLike<T>) => void;\n private _reject: (error: Error) => void;\n\n constructor(info?: any) {\n this.info = info;\n this._init();\n }\n\n private _init() {\n this._promise = new Promise<T>((resolve, reject) => {\n this._resolve = resolve;\n this._reject = reject;\n });\n }\n\n public resolve(value?: any): void {\n if (value) {\n this._resolve(value);\n }\n this._resolve();\n }\n\n public reject(e: Error): void {\n this._reject(e);\n }\n\n public wait(): Promise<T> {\n return this._promise;\n }\n\n public reset() {\n this._init();\n }\n}\n","import {\n\tMatrix4,\n\tObject3D,\n\tVector2,\n\tVector3\n} from 'three';\n\n/**\n * The only type of 3D object that is supported by {@link CSS2DRenderer}.\n *\n * @augments Object3D\n * @three_import import { CSS2DObject } from 'three/addons/renderers/CSS2DRenderer.js';\n */\nclass CSS2DObject extends Object3D {\n\n\t/**\n\t * Constructs a new CSS2D object.\n\t *\n\t * @param {HTMLElement} [element] - The DOM element.\n\t */\n\tconstructor( element = document.createElement( 'div' ) ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isCSS2DObject = true;\n\n\t\t/**\n\t\t * The DOM element which defines the appearance of this 3D object.\n\t\t *\n\t\t * @type {HTMLElement}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.element = element;\n\n\t\tthis.element.style.position = 'absolute';\n\t\tthis.element.style.userSelect = 'none';\n\n\t\tthis.element.setAttribute( 'draggable', false );\n\n\t\t/**\n\t\t * The 3D objects center point.\n\t\t * `( 0, 0 )` is the lower left, `( 1, 1 )` is the top right.\n\t\t *\n\t\t * @type {Vector2}\n\t\t * @default (0.5,0.5)\n\t\t */\n\t\tthis.center = new Vector2( 0.5, 0.5 );\n\n\t\tthis.addEventListener( 'removed', function () {\n\n\t\t\tthis.traverse( function ( object ) {\n\n\t\t\t\tif (\n\t\t\t\t\tobject.element &&\n\t\t\t\t\tobject.element instanceof object.element.ownerDocument.defaultView.Element &&\n\t\t\t\t\tobject.element.parentNode !== null\n\t\t\t\t) {\n\n\t\t\t\t\tobject.element.remove();\n\n\t\t\t\t}\n\n\t\t\t} );\n\n\t\t} );\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.element = source.element.cloneNode( true );\n\n\t\tthis.center = source.center;\n\n\t\treturn this;\n\n\t}\n\n}\n\n//\n\nconst _vector = new Vector3();\nconst _viewMatrix = new Matrix4();\nconst _viewProjectionMatrix = new Matrix4();\nconst _a = new Vector3();\nconst _b = new Vector3();\n\n/**\n * This renderer is a simplified version of {@link CSS3DRenderer}. The only transformation that is\n * supported is translation.\n *\n * The renderer is very useful if you want to combine HTML based labels with 3D objects. Here too,\n * the respective DOM elements are wrapped into an instance of {@link CSS2DObject} and added to the\n * scene graph. All other types of renderable 3D objects (like meshes or point clouds) are ignored.\n *\n * `CSS2DRenderer` only supports 100% browser and display zoom.\n *\n * @three_import import { CSS2DRenderer } from 'three/addons/renderers/CSS2DRenderer.js';\n */\nclass CSS2DRenderer {\n\n\t/**\n\t * Constructs a new CSS2D renderer.\n\t *\n\t * @param {CSS2DRenderer~Parameters} [parameters] - The parameters.\n\t */\n\tconstructor( parameters = {} ) {\n\n\t\tconst _this = this;\n\n\t\tlet _width, _height;\n\t\tlet _widthHalf, _heightHalf;\n\n\t\tconst cache = {\n\t\t\tobjects: new WeakMap()\n\t\t};\n\n\t\tconst domElement = parameters.element !== undefined ? parameters.element : document.createElement( 'div' );\n\n\t\tdomElement.style.overflow = 'hidden';\n\n\t\t/**\n\t\t * The DOM where the renderer appends its child-elements.\n\t\t *\n\t\t * @type {HTMLElement}\n\t\t */\n\t\tthis.domElement = domElement;\n\n\t\t/**\n\t\t * Controls whether the renderer assigns `z-index` values to CSS2DObject DOM elements.\n\t\t * If set to `true`, z-index values are assigned first based on the `renderOrder`\n\t\t * and secondly - the distance to the camera. If set to `false`, no z-index values are assigned.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.sortObjects = true;\n\n\t\t/**\n\t\t * Returns an object containing the width and height of the renderer.\n\t\t *\n\t\t * @return {{width:number,height:number}} The size of the renderer.\n\t\t */\n\t\tthis.getSize = function () {\n\n\t\t\treturn {\n\t\t\t\twidth: _width,\n\t\t\t\theight: _height\n\t\t\t};\n\n\t\t};\n\n\t\t/**\n\t\t * Renders the given scene using the given camera.\n\t\t *\n\t\t * @param {Object3D} scene - A scene or any other type of 3D object.\n\t\t * @param {Camera} camera - The camera.\n\t\t */\n\t\tthis.render = function ( scene, camera ) {\n\n\t\t\tif ( scene.matrixWorldAutoUpdate === true ) scene.updateMatrixWorld();\n\t\t\tif ( camera.parent === null && camera.matrixWorldAutoUpdate === true ) camera.updateMatrixWorld();\n\n\t\t\t_viewMatrix.copy( camera.matrixWorldInverse );\n\t\t\t_viewProjectionMatrix.multiplyMatrices( camera.projectionMatrix, _viewMatrix );\n\n\t\t\trenderObject( scene, scene, camera );\n\t\t\tif ( this.sortObjects ) zOrder( scene );\n\n\t\t};\n\n\t\t/**\n\t\t * Resizes the renderer to the given width and height.\n\t\t *\n\t\t * @param {number} width - The width of the renderer.\n\t\t * @param {number} height - The height of the renderer.\n\t\t */\n\t\tthis.setSize = function ( width, height ) {\n\n\t\t\t_width = width;\n\t\t\t_height = height;\n\n\t\t\t_widthHalf = _width / 2;\n\t\t\t_heightHalf = _height / 2;\n\n\t\t\tdomElement.style.width = width + 'px';\n\t\t\tdomElement.style.height = height + 'px';\n\n\t\t};\n\n\t\tfunction hideObject( object ) {\n\n\t\t\tif ( object.isCSS2DObject ) object.element.style.display = 'none';\n\n\t\t\tfor ( let i = 0, l = object.children.length; i < l; i ++ ) {\n\n\t\t\t\thideObject( object.children[ i ] );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction renderObject( object, scene, camera ) {\n\n\t\t\tif ( object.visible === false ) {\n\n\t\t\t\thideObject( object );\n\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\tif ( object.isCSS2DObject ) {\n\n\t\t\t\t_vector.setFromMatrixPosition( object.matrixWorld );\n\t\t\t\t_vector.applyMatrix4( _viewProjectionMatrix );\n\n\t\t\t\tconst visible = ( _vector.z >= - 1 && _vector.z <= 1 ) && ( object.layers.test( camera.layers ) === true );\n\n\t\t\t\tconst element = object.element;\n\t\t\t\telement.style.display = visible === true ? '' : 'none';\n\n\t\t\t\tif ( visible === true ) {\n\n\t\t\t\t\tobject.onBeforeRender( _this, scene, camera );\n\n\t\t\t\t\telement.style.transform = 'translate(' + ( - 100 * object.center.x ) + '%,' + ( - 100 * object.center.y ) + '%)' + 'translate(' + ( _vector.x * _widthHalf + _widthHalf ) + 'px,' + ( - _vector.y * _heightHalf + _heightHalf ) + 'px)';\n\n\t\t\t\t\tif ( element.parentNode !== domElement ) {\n\n\t\t\t\t\t\tdomElement.appendChild( element );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tobject.onAfterRender( _this, scene, camera );\n\n\t\t\t\t}\n\n\t\t\t\tconst objectData = {\n\t\t\t\t\tdistanceToCameraSquared: getDistanceToSquared( camera, object )\n\t\t\t\t};\n\n\t\t\t\tcache.objects.set( object, objectData );\n\n\t\t\t}\n\n\t\t\tfor ( let i = 0, l = object.children.length; i < l; i ++ ) {\n\n\t\t\t\trenderObject( object.children[ i ], scene, camera );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction getDistanceToSquared( object1, object2 ) {\n\n\t\t\t_a.setFromMatrixPosition( object1.matrixWorld );\n\t\t\t_b.setFromMatrixPosition( object2.matrixWorld );\n\n\t\t\treturn _a.distanceToSquared( _b );\n\n\t\t}\n\n\t\tfunction filterAndFlatten( scene ) {\n\n\t\t\tconst result = [];\n\n\t\t\tscene.traverseVisible( function ( object ) {\n\n\t\t\t\tif ( object.isCSS2DObject ) result.push( object );\n\n\t\t\t} );\n\n\t\t\treturn result;\n\n\t\t}\n\n\t\tfunction zOrder( scene ) {\n\n\t\t\tconst sorted = filterAndFlatten( scene ).sort( function ( a, b ) {\n\n\t\t\t\tif ( a.renderOrder !== b.renderOrder ) {\n\n\t\t\t\t\treturn b.renderOrder - a.renderOrder;\n\n\t\t\t\t}\n\n\t\t\t\tconst distanceA = cache.objects.get( a ).distanceToCameraSquared;\n\t\t\t\tconst distanceB = cache.objects.get( b ).distanceToCameraSquared;\n\n\t\t\t\treturn distanceA - distanceB;\n\n\t\t\t} );\n\n\t\t\tconst zMax = sorted.length;\n\n\t\t\tfor ( let i = 0, l = sorted.length; i < l; i ++ ) {\n\n\t\t\t\tsorted[ i ].element.style.zIndex = zMax - i;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n}\n\n/**\n * Constructor parameters of `CSS2DRenderer`.\n *\n * @typedef {Object} CSS2DRenderer~Parameters\n * @property {HTMLElement} [element] - A DOM element where the renderer appends its child-elements.\n * If not passed in here, a new div element will be created.\n **/\n\nexport { CSS2DObject, CSS2DRenderer };\n","import inject from '../../../common-core/src/di/inject';\nimport AsyncGuard from '../../../common-core/src/async-guard';\nimport type { Object3D } from 'three';\nimport { Group, type Scene } from 'three';\nimport { Box3 } from 'three';\nimport {\n BufferAttribute,\n BufferGeometry,\n Line,\n Line3,\n LineBasicMaterial,\n Vector3,\n} from 'three';\nimport { type KernelCube } from '../../../typings/kernel';\nimport { convertToTHREE } from '../../../common-core/src/utils/kernel-utils';\nimport type UnitFormatter from '../services/unit-formatter';\nimport { CSS2DObject } from 'three/examples/jsm/renderers/CSS2DRenderer.js';\nimport { LAYER } from '../../../common-core/src/webgl/layer';\n\nexport const DIMENSIONING_GEOMETRY = 'dimensioning';\nexport const DIMENSION_LINE_OFFSET = 0.08;\nexport const MIN_CAMERA_DISTANCE_RATIO = 1.2;\nexport const FADE_DISTANCE_RATIO = 2.0;\nexport const EXTENSION_LINE_LENGTH_RATIO = 0.03;\n\nexport interface DimensionLineConfig {\n mainLine: Line3;\n extensionLines: Line3[];\n}\n\nconst LINE_COLOR = 0x373737;\n\nexport function createDimensioningHelper(creator: string): DimensioningHelper {\n return new DimensioningHelper(creator);\n}\n\nexport default class DimensioningHelper {\n public _creator_: string;\n\n @inject\n private _unitFormatter: UnitFormatter;\n\n private _object: Object3D;\n private _cameraPosition: Vector3 = new Vector3();\n private _onVisibilityChange: (visible: boolean) => void;\n private _initialized: AsyncGuard<void> = new AsyncGuard();\n\n private _origin: Vector3;\n private _dimensions: Vector3;\n\n private _lineMaterial: LineBasicMaterial;\n private readonly _mainLineMaterial: LineBasicMaterial;\n\n private readonly _widthLineGroup: Group;\n private readonly _heightLineGroup: Group;\n private readonly _depthLineGroup: Group;\n\n private _enabled: boolean = false;\n private _dimensionsVisible = false;\n\n private _dimensionLineGroup = new Group();\n\n constructor(creator: string) {\n this._creator_ = creator;\n\n this._lineMaterial = new LineBasicMaterial({\n color: LINE_COLOR,\n linewidth: 2,\n });\n\n this._mainLineMaterial = new LineBasicMaterial({\n color: LINE_COLOR,\n linewidth: 0.001,\n transparent: true,\n opacity: 1.0,\n });\n\n this._dimensionLineGroup.name = DIMENSIONING_GEOMETRY;\n\n this._widthLineGroup = this._createLineGroup('width');\n this._heightLineGroup = this._createLineGroup('height');\n this._depthLineGroup = this._createLineGroup('depth');\n\n this._dimensionLineGroup.add(this._widthLineGroup);\n this._dimensionLineGroup.add(this._heightLineGroup);\n this._dimensionLineGroup.add(this._depthLineGroup);\n\n this.update(false);\n this._initialized.resolve();\n }\n\n private _createLineGroup(_name: string): Group {\n const group = new Group();\n group.name = DIMENSIONING_GEOMETRY;\n group.userData.ignoreComponentRaycast = true;\n return group;\n }\n\n private _createLineFromConfig(\n config: Line3,\n material: LineBasicMaterial,\n ): Line {\n const geometry = new BufferGeometry();\n const vertices = [\n config.start.x,\n config.start.y,\n config.start.z,\n config.end.x,\n config.end.y,\n config.end.z,\n ];\n geometry.setAttribute(\n 'position',\n new BufferAttribute(new Float32Array(vertices), 3),\n );\n const line = new Line(geometry, material);\n line.name = DIMENSIONING_GEOMETRY;\n line.userData.ignoreComponentRaycast = true;\n line.layers.set(LAYER.DIMENSIONS);\n return line;\n }\n\n private addLinesToLineGroup(\n group: Group,\n config: DimensionLineConfig,\n mainMaterial: LineBasicMaterial,\n extMaterial: LineBasicMaterial,\n ) {\n config.extensionLines.forEach((extLine) => {\n group.add(this._createLineFromConfig(extLine, extMaterial));\n });\n\n group.add(this._createLineFromConfig(config.mainLine, mainMaterial));\n }\n\n private clearLineGroup(group: Group) {\n while (group.children.length > 0) {\n const child = group.children[0];\n if (child instanceof Line) {\n child.geometry.dispose();\n }\n group.remove(child);\n }\n }\n\n private addLabelToLineGroup(\n group: Group,\n labelText: string,\n labelWorldPosition: Vector3,\n ): void {\n const labelHtmlDiv = document.createElement('div');\n labelHtmlDiv.classList.add(\n 'dimension-label',\n 'dimension-label--primary',\n 'dimension-label--disabled',\n );\n const labelHtmlSpan = document.createElement('span');\n labelHtmlSpan.classList.add('dimension-label__value');\n labelHtmlSpan.innerHTML = labelText;\n labelHtmlDiv.appendChild(labelHtmlSpan);\n\n const labelObject = new CSS2DObject(labelHtmlDiv);\n const labelLocalPosition =\n this._dimensionLineGroup.worldToLocal(labelWorldPosition);\n labelObject.position.copy(labelLocalPosition);\n\n group.add(labelObject);\n }\n\n private _getWidthLineConfig(): DimensionLineConfig {\n const offset = DIMENSION_LINE_OFFSET;\n const extLength = EXTENSION_LINE_LENGTH_RATIO;\n const y = this._dimensions.y + offset;\n const localCam = this._getLocalCameraPosition();\n const z = localCam.z < this._dimensions.z / 2 ? 0 : this._dimensions.z;\n\n return {\n mainLine: new Line3(\n new Vector3(0, y, z),\n new Vector3(this._dimensions.x, y, z),\n ),\n extensionLines: [\n new Line3(\n new Vector3(0, y - extLength, z),\n new Vector3(0, y + extLength, z),\n ),\n new Line3(\n new Vector3(this._dimensions.x, y - extLength, z),\n new Vector3(this._dimensions.x, y + extLength, z),\n ),\n ],\n };\n }\n\n private _getDepthLineConfig(): DimensionLineConfig {\n const offset = DIMENSION_LINE_OFFSET;\n const extLength = EXTENSION_LINE_LENGTH_RATIO;\n const y = 0;\n const localCam = this._getLocalCameraPosition();\n const x =\n localCam.x < this._dimensions.x / 2\n ? -offset\n : this._dimensions.x + offset;\n\n return {\n mainLine: new Line3(\n new Vector3(x, y, this._dimensions.z),\n new Vector3(x, y, 0),\n ),\n extensionLines: [\n new Line3(\n new Vector3(x - extLength, y, 0),\n new Vector3(x + extLength, y, 0),\n ),\n new Line3(\n new Vector3(x - extLength, y, this._dimensions.z),\n new Vector3(x + extLength, y, this._dimensions.z),\n ),\n ],\n };\n }\n\n private _getHeightLineConfig(): DimensionLineConfig {\n const offset = DIMENSION_LINE_OFFSET;\n const extLength = EXTENSION_LINE_LENGTH_RATIO;\n const localCam = this._getLocalCameraPosition();\n const x =\n localCam.x < this._dimensions.x / 2\n ? -offset\n : this._dimensions.x + offset;\n const z = localCam.z < this._dimensions.z / 2 ? 0 : this._dimensions.z;\n\n return {\n mainLine: new Line3(\n new Vector3(x, 0, z),\n new Vector3(x, this._dimensions.y, z),\n ),\n extensionLines: [\n new Line3(\n new Vector3(x - extLength, 0, z),\n new Vector3(x + extLength, 0, z),\n ),\n new Line3(\n new Vector3(x - extLength, this._dimensions.y, z),\n new Vector3(x + extLength, this._dimensions.y, z),\n ),\n ],\n };\n }\n\n private _getLocalCameraPosition(): Vector3 {\n if (\n !this._cameraPosition ||\n !this._dimensionLineGroup ||\n !this._dimensions\n ) {\n return new Vector3(0, 0, 0);\n }\n return this._dimensionLineGroup.worldToLocal(this._cameraPosition.clone());\n }\n\n private _getCameraDistanceInfo(): {\n tooClose: boolean;\n opacity: number;\n distance: number;\n } {\n if (!this._object || !this._cameraPosition || !this._dimensions) {\n return { tooClose: false, opacity: 1.0, distance: Infinity };\n }\n const objPos = this._object.getWorldPosition(new Vector3());\n const distance = this._cameraPosition.distanceTo(objPos);\n const objectRadius =\n Math.max(this._dimensions.x, this._dimensions.y, this._dimensions.z) / 2;\n const minThreshold = objectRadius * MIN_CAMERA_DISTANCE_RATIO;\n const fadeThreshold = objectRadius * FADE_DISTANCE_RATIO;\n\n if (distance < minThreshold) {\n return { tooClose: true, opacity: 0, distance };\n }\n if (distance < fadeThreshold) {\n const opacity =\n (distance - minThreshold) / (fadeThreshold - minThreshold);\n return {\n tooClose: false,\n opacity: Math.max(0, Math.min(1, opacity)),\n distance,\n };\n }\n return { tooClose: false, opacity: 1.0, distance };\n }\n\n private _visibilityChangedCallback() {\n if (this._onVisibilityChange) {\n this._onVisibilityChange(this._dimensionsVisible);\n }\n }\n\n public update(force: boolean = false) {\n if (this._enabled && !this._dimensionsVisible) {\n this._dimensionsVisible = true;\n this._visibilityChangedCallback();\n }\n this._performUpdate(force);\n }\n\n public updateSize(boxForMeasurement: KernelCube) {\n this._origin = convertToTHREE(boxForMeasurement.origin);\n this._dimensionLineGroup.position.x =\n this._origin.x - this._object.position.x;\n this._dimensionLineGroup.position.y =\n this._origin.y - this._object.position.y;\n this._dimensionLineGroup.position.z =\n this._origin.z - this._object.position.z;\n this._dimensions = convertToTHREE(boxForMeasurement.size);\n this.update();\n }\n\n public removeFromObject(object: Object3D) {\n if (object) {\n object.remove(this._dimensionLineGroup);\n }\n }\n\n public onDimensionsVisibilityChanged(handler: (visible: boolean) => void) {\n this._onVisibilityChange = handler;\n }\n\n public setObject(object: Object3D): void {\n this._object = object;\n }\n\n public isInitialized(): Promise<void> {\n return this._initialized.wait();\n }\n\n public areDimensionsEnabled(): boolean {\n return this._enabled;\n }\n\n public clearScene(_scene: Scene): void {\n this._clear();\n }\n\n public addToObject(object: Object3D): void {\n if (!object || !this._dimensionLineGroup) {\n return;\n }\n object.add(this._dimensionLineGroup);\n }\n\n public enableDimensions(): void {\n this._enabled = true;\n this.addToObject(this._object);\n this.update(true);\n }\n\n public disableDimensions(): void {\n this._enabled = false;\n if (this._dimensionsVisible) {\n this._dimensionsVisible = false;\n this._visibilityChangedCallback();\n }\n this._clear();\n this.removeFromObject(this._object);\n }\n\n public enableTopDimensions(): void {\n this.enableDimensions();\n this._heightLineGroup.visible = false;\n this.update(true);\n }\n\n public disableTopDimensions(): void {\n this._heightLineGroup.visible = true;\n this.disableDimensions();\n }\n\n public getBoundingBox(): Box3 {\n const bbox = new Box3();\n bbox.expandByObject(this._dimensionLineGroup);\n return bbox;\n }\n\n public moveCameraStart(position: Vector3): void {\n this._cameraPosition = position;\n this.update();\n }\n\n public moveCameraEnd(position: Vector3): void {\n this._cameraPosition = position;\n this.update();\n }\n\n private _performUpdate(force: boolean): void {\n if (!this._enabled && !force) {\n return;\n }\n if (!this._dimensions) {\n return;\n }\n\n let opacity = 1.0;\n\n if (\n this._object &&\n this._cameraPosition &&\n !this._cameraPosition.equals(new Vector3(0, 0, 0))\n ) {\n const distanceCheck = this._getCameraDistanceInfo();\n if (distanceCheck.tooClose) {\n this._dimensionLineGroup.visible = false;\n } else {\n this._dimensionLineGroup.visible = true;\n opacity = distanceCheck.opacity;\n this._mainLineMaterial.opacity = opacity;\n }\n }\n\n this._dimensionLineGroup.updateMatrixWorld(true);\n\n const widthConfig = this._getWidthLineConfig();\n const widthLabelText = this._unitFormatter.formatMMValueToUnitString(\n this._dimensions.x * 1000,\n );\n const widthPos = this._dimensionLineGroup.localToWorld(\n widthConfig.mainLine.getCenter(new Vector3()),\n );\n this.clearLineGroup(this._widthLineGroup);\n this.addLinesToLineGroup(\n this._widthLineGroup,\n widthConfig,\n this._mainLineMaterial,\n this._mainLineMaterial,\n );\n this.addLabelToLineGroup(this._widthLineGroup, widthLabelText, widthPos);\n\n const heightConfig = this._getHeightLineConfig();\n const heightLabelText = this._unitFormatter.formatMMValueToUnitString(\n this._dimensions.y * 1000,\n );\n const heightPos = this._dimensionLineGroup.localToWorld(\n heightConfig.mainLine.getCenter(new Vector3()),\n );\n this.clearLineGroup(this._heightLineGroup);\n this.addLinesToLineGroup(\n this._heightLineGroup,\n heightConfig,\n this._mainLineMaterial,\n this._mainLineMaterial,\n );\n this.addLabelToLineGroup(this._heightLineGroup, heightLabelText, heightPos);\n\n const depthConfig = this._getDepthLineConfig();\n const depthLabelText = this._unitFormatter.formatMMValueToUnitString(\n this._dimensions.z * -1000,\n );\n const depthPos = this._dimensionLineGroup.localToWorld(\n depthConfig.mainLine.getCenter(new Vector3()),\n );\n this.clearLineGroup(this._depthLineGroup);\n this.addLinesToLineGroup(\n this._depthLineGroup,\n depthConfig,\n this._mainLineMaterial,\n this._mainLineMaterial,\n );\n this.addLabelToLineGroup(this._depthLineGroup, depthLabelText, depthPos);\n }\n\n private _clear(): void {\n this._lineMaterial.dispose();\n this._mainLineMaterial.dispose();\n [this._widthLineGroup, this._heightLineGroup, this._depthLineGroup].forEach(\n (group) => {\n this.clearLineGroup(group);\n },\n );\n }\n}\n"],"x_google_ignoreList":[1],"mappings":";;;;;AAAA,IAAqB,IAArB,MAAmC;CAMjC,YAAY,GAAY;AAEtB,EADA,KAAK,OAAO,GACZ,KAAK,OAAO;;CAGd,QAAgB;AACd,OAAK,WAAW,IAAI,SAAY,GAAS,MAAW;AAElD,GADA,KAAK,WAAW,GAChB,KAAK,UAAU;IACf;;CAGJ,QAAe,GAAmB;AAIhC,EAHI,KACF,KAAK,SAAS,EAAM,EAEtB,KAAK,UAAU;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B,EACzC,KAAK,oBACH,KAAK,iBACL,GACA,KAAK,mBACL,KAAK,kBACN,EACD,KAAK,oBAAoB,KAAK,iBAAiB,GAAgB,EAAS;EAExE,IAAM,IAAe,KAAK,sBAAsB,EAC1C,IAAkB,KAAK,eAAe,0BAC1C,KAAK,YAAY,IAAI,IACtB,EACK,IAAY,KAAK,oBAAoB,aACzC,EAAa,SAAS,UAAU,IAAI,GAAS,CAAC,CAC/C;AAQD,EAPA,KAAK,eAAe,KAAK,iBAAiB,EAC1C,KAAK,oBACH,KAAK,kBACL,GACA,KAAK,mBACL,KAAK,kBACN,EACD,KAAK,oBAAoB,KAAK,kBAAkB,GAAiB,EAAU;EAE3E,IAAM,IAAc,KAAK,qBAAqB,EACxC,IAAiB,KAAK,eAAe,0BACzC,KAAK,YAAY,IAAI,KACtB,EACK,IAAW,KAAK,oBAAoB,aACxC,EAAY,SAAS,UAAU,IAAI,GAAS,CAAC,CAC9C;AAQD,EAPA,KAAK,eAAe,KAAK,gBAAgB,EACzC,KAAK,oBACH,KAAK,iBACL,GACA,KAAK,mBACL,KAAK,kBACN,EACD,KAAK,oBAAoB,KAAK,iBAAiB,GAAgB,EAAS;;CAG1E,SAAuB;AAGrB,EAFA,KAAK,cAAc,SAAS,EAC5B,KAAK,kBAAkB,SAAS,EAChC;GAAC,KAAK;GAAiB,KAAK;GAAkB,KAAK;GAAgB,CAAC,SACjE,MAAU;AACT,QAAK,eAAe,EAAM;IAE7B;;;GArbF,GAAA,EAAA,eAAA,OAAA,CAAA,EAAA,EAAA,WAAA,kBAAA,KAAA,EAAA"}
|
|
1
|
+
{"version":3,"file":"dimensioning-helper--Y0Y-Wr1.mjs","names":[],"sources":["../../packages/common-core/src/async-guard.ts","../../../../node_modules/three/examples/jsm/renderers/CSS2DRenderer.js","../../packages/configurator-core/src/utils/dimensioning-helper.ts"],"sourcesContent":["export default class AsyncGuard<T> {\n public info: any;\n private _promise: Promise<T>;\n private _resolve: (value?: T | PromiseLike<T>) => void;\n private _reject: (error: Error) => void;\n\n constructor(info?: any) {\n this.info = info;\n this._init();\n }\n\n private _init() {\n this._promise = new Promise<T>((resolve, reject) => {\n this._resolve = resolve;\n this._reject = reject;\n });\n }\n\n public resolve(value?: any): void {\n if (value) {\n this._resolve(value);\n }\n this._resolve();\n }\n\n public reject(e: Error): void {\n this._reject(e);\n }\n\n public wait(): Promise<T> {\n return this._promise;\n }\n\n public reset() {\n this._init();\n }\n}\n","import {\n\tMatrix4,\n\tObject3D,\n\tVector2,\n\tVector3\n} from 'three';\n\n/**\n * The only type of 3D object that is supported by {@link CSS2DRenderer}.\n *\n * @augments Object3D\n * @three_import import { CSS2DObject } from 'three/addons/renderers/CSS2DRenderer.js';\n */\nclass CSS2DObject extends Object3D {\n\n\t/**\n\t * Constructs a new CSS2D object.\n\t *\n\t * @param {HTMLElement} [element] - The DOM element.\n\t */\n\tconstructor( element = document.createElement( 'div' ) ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isCSS2DObject = true;\n\n\t\t/**\n\t\t * The DOM element which defines the appearance of this 3D object.\n\t\t *\n\t\t * @type {HTMLElement}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.element = element;\n\n\t\tthis.element.style.position = 'absolute';\n\t\tthis.element.style.userSelect = 'none';\n\n\t\tthis.element.setAttribute( 'draggable', false );\n\n\t\t/**\n\t\t * The 3D objects center point.\n\t\t * `( 0, 0 )` is the lower left, `( 1, 1 )` is the top right.\n\t\t *\n\t\t * @type {Vector2}\n\t\t * @default (0.5,0.5)\n\t\t */\n\t\tthis.center = new Vector2( 0.5, 0.5 );\n\n\t\tthis.addEventListener( 'removed', function () {\n\n\t\t\tthis.traverse( function ( object ) {\n\n\t\t\t\tif (\n\t\t\t\t\tobject.element &&\n\t\t\t\t\tobject.element instanceof object.element.ownerDocument.defaultView.Element &&\n\t\t\t\t\tobject.element.parentNode !== null\n\t\t\t\t) {\n\n\t\t\t\t\tobject.element.remove();\n\n\t\t\t\t}\n\n\t\t\t} );\n\n\t\t} );\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.element = source.element.cloneNode( true );\n\n\t\tthis.center = source.center;\n\n\t\treturn this;\n\n\t}\n\n}\n\n//\n\nconst _vector = new Vector3();\nconst _viewMatrix = new Matrix4();\nconst _viewProjectionMatrix = new Matrix4();\nconst _a = new Vector3();\nconst _b = new Vector3();\n\n/**\n * This renderer is a simplified version of {@link CSS3DRenderer}. The only transformation that is\n * supported is translation.\n *\n * The renderer is very useful if you want to combine HTML based labels with 3D objects. Here too,\n * the respective DOM elements are wrapped into an instance of {@link CSS2DObject} and added to the\n * scene graph. All other types of renderable 3D objects (like meshes or point clouds) are ignored.\n *\n * `CSS2DRenderer` only supports 100% browser and display zoom.\n *\n * @three_import import { CSS2DRenderer } from 'three/addons/renderers/CSS2DRenderer.js';\n */\nclass CSS2DRenderer {\n\n\t/**\n\t * Constructs a new CSS2D renderer.\n\t *\n\t * @param {CSS2DRenderer~Parameters} [parameters] - The parameters.\n\t */\n\tconstructor( parameters = {} ) {\n\n\t\tconst _this = this;\n\n\t\tlet _width, _height;\n\t\tlet _widthHalf, _heightHalf;\n\n\t\tconst cache = {\n\t\t\tobjects: new WeakMap()\n\t\t};\n\n\t\tconst domElement = parameters.element !== undefined ? parameters.element : document.createElement( 'div' );\n\n\t\tdomElement.style.overflow = 'hidden';\n\n\t\t/**\n\t\t * The DOM where the renderer appends its child-elements.\n\t\t *\n\t\t * @type {HTMLElement}\n\t\t */\n\t\tthis.domElement = domElement;\n\n\t\t/**\n\t\t * Controls whether the renderer assigns `z-index` values to CSS2DObject DOM elements.\n\t\t * If set to `true`, z-index values are assigned first based on the `renderOrder`\n\t\t * and secondly - the distance to the camera. If set to `false`, no z-index values are assigned.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.sortObjects = true;\n\n\t\t/**\n\t\t * Returns an object containing the width and height of the renderer.\n\t\t *\n\t\t * @return {{width:number,height:number}} The size of the renderer.\n\t\t */\n\t\tthis.getSize = function () {\n\n\t\t\treturn {\n\t\t\t\twidth: _width,\n\t\t\t\theight: _height\n\t\t\t};\n\n\t\t};\n\n\t\t/**\n\t\t * Renders the given scene using the given camera.\n\t\t *\n\t\t * @param {Object3D} scene - A scene or any other type of 3D object.\n\t\t * @param {Camera} camera - The camera.\n\t\t */\n\t\tthis.render = function ( scene, camera ) {\n\n\t\t\tif ( scene.matrixWorldAutoUpdate === true ) scene.updateMatrixWorld();\n\t\t\tif ( camera.parent === null && camera.matrixWorldAutoUpdate === true ) camera.updateMatrixWorld();\n\n\t\t\t_viewMatrix.copy( camera.matrixWorldInverse );\n\t\t\t_viewProjectionMatrix.multiplyMatrices( camera.projectionMatrix, _viewMatrix );\n\n\t\t\trenderObject( scene, scene, camera );\n\t\t\tif ( this.sortObjects ) zOrder( scene );\n\n\t\t};\n\n\t\t/**\n\t\t * Resizes the renderer to the given width and height.\n\t\t *\n\t\t * @param {number} width - The width of the renderer.\n\t\t * @param {number} height - The height of the renderer.\n\t\t */\n\t\tthis.setSize = function ( width, height ) {\n\n\t\t\t_width = width;\n\t\t\t_height = height;\n\n\t\t\t_widthHalf = _width / 2;\n\t\t\t_heightHalf = _height / 2;\n\n\t\t\tdomElement.style.width = width + 'px';\n\t\t\tdomElement.style.height = height + 'px';\n\n\t\t};\n\n\t\tfunction hideObject( object ) {\n\n\t\t\tif ( object.isCSS2DObject ) object.element.style.display = 'none';\n\n\t\t\tfor ( let i = 0, l = object.children.length; i < l; i ++ ) {\n\n\t\t\t\thideObject( object.children[ i ] );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction renderObject( object, scene, camera ) {\n\n\t\t\tif ( object.visible === false ) {\n\n\t\t\t\thideObject( object );\n\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\tif ( object.isCSS2DObject ) {\n\n\t\t\t\t_vector.setFromMatrixPosition( object.matrixWorld );\n\t\t\t\t_vector.applyMatrix4( _viewProjectionMatrix );\n\n\t\t\t\tconst visible = ( _vector.z >= - 1 && _vector.z <= 1 ) && ( object.layers.test( camera.layers ) === true );\n\n\t\t\t\tconst element = object.element;\n\t\t\t\telement.style.display = visible === true ? '' : 'none';\n\n\t\t\t\tif ( visible === true ) {\n\n\t\t\t\t\tobject.onBeforeRender( _this, scene, camera );\n\n\t\t\t\t\telement.style.transform = 'translate(' + ( - 100 * object.center.x ) + '%,' + ( - 100 * object.center.y ) + '%)' + 'translate(' + ( _vector.x * _widthHalf + _widthHalf ) + 'px,' + ( - _vector.y * _heightHalf + _heightHalf ) + 'px)';\n\n\t\t\t\t\tif ( element.parentNode !== domElement ) {\n\n\t\t\t\t\t\tdomElement.appendChild( element );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tobject.onAfterRender( _this, scene, camera );\n\n\t\t\t\t}\n\n\t\t\t\tconst objectData = {\n\t\t\t\t\tdistanceToCameraSquared: getDistanceToSquared( camera, object )\n\t\t\t\t};\n\n\t\t\t\tcache.objects.set( object, objectData );\n\n\t\t\t}\n\n\t\t\tfor ( let i = 0, l = object.children.length; i < l; i ++ ) {\n\n\t\t\t\trenderObject( object.children[ i ], scene, camera );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction getDistanceToSquared( object1, object2 ) {\n\n\t\t\t_a.setFromMatrixPosition( object1.matrixWorld );\n\t\t\t_b.setFromMatrixPosition( object2.matrixWorld );\n\n\t\t\treturn _a.distanceToSquared( _b );\n\n\t\t}\n\n\t\tfunction filterAndFlatten( scene ) {\n\n\t\t\tconst result = [];\n\n\t\t\tscene.traverseVisible( function ( object ) {\n\n\t\t\t\tif ( object.isCSS2DObject ) result.push( object );\n\n\t\t\t} );\n\n\t\t\treturn result;\n\n\t\t}\n\n\t\tfunction zOrder( scene ) {\n\n\t\t\tconst sorted = filterAndFlatten( scene ).sort( function ( a, b ) {\n\n\t\t\t\tif ( a.renderOrder !== b.renderOrder ) {\n\n\t\t\t\t\treturn b.renderOrder - a.renderOrder;\n\n\t\t\t\t}\n\n\t\t\t\tconst distanceA = cache.objects.get( a ).distanceToCameraSquared;\n\t\t\t\tconst distanceB = cache.objects.get( b ).distanceToCameraSquared;\n\n\t\t\t\treturn distanceA - distanceB;\n\n\t\t\t} );\n\n\t\t\tconst zMax = sorted.length;\n\n\t\t\tfor ( let i = 0, l = sorted.length; i < l; i ++ ) {\n\n\t\t\t\tsorted[ i ].element.style.zIndex = zMax - i;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n}\n\n/**\n * Constructor parameters of `CSS2DRenderer`.\n *\n * @typedef {Object} CSS2DRenderer~Parameters\n * @property {HTMLElement} [element] - A DOM element where the renderer appends its child-elements.\n * If not passed in here, a new div element will be created.\n **/\n\nexport { CSS2DObject, CSS2DRenderer };\n","import inject from '../../../common-core/src/di/inject';\nimport AsyncGuard from '../../../common-core/src/async-guard';\nimport type { Object3D } from 'three';\nimport { Group, type Scene } from 'three';\nimport { Box3 } from 'three';\nimport {\n BufferAttribute,\n BufferGeometry,\n Line,\n Line3,\n LineBasicMaterial,\n Vector3,\n} from 'three';\nimport { type KernelCube } from '../../../typings/kernel';\nimport { convertToTHREE } from '../../../common-core/src/utils/kernel-utils';\nimport type UnitFormatter from '../services/unit-formatter';\nimport { CSS2DObject } from 'three/examples/jsm/renderers/CSS2DRenderer.js';\nimport { LAYER } from '../../../common-core/src/webgl/layer';\n\nexport const DIMENSIONING_GEOMETRY = 'dimensioning';\nexport const DIMENSION_LINE_OFFSET = 0.08;\nexport const MIN_CAMERA_DISTANCE_RATIO = 1.2;\nexport const FADE_DISTANCE_RATIO = 2.0;\nexport const EXTENSION_LINE_LENGTH_RATIO = 0.03;\n\nexport interface DimensionLineConfig {\n mainLine: Line3;\n extensionLines: Line3[];\n}\n\nconst LINE_COLOR = 0x373737;\n\nexport function createDimensioningHelper(creator: string): DimensioningHelper {\n return new DimensioningHelper(creator);\n}\n\nexport default class DimensioningHelper {\n public _creator_: string;\n\n @inject\n private _unitFormatter: UnitFormatter;\n\n private _object: Object3D;\n private _cameraPosition: Vector3 = new Vector3();\n private _onVisibilityChange: (visible: boolean) => void;\n private _initialized: AsyncGuard<void> = new AsyncGuard();\n\n private _origin: Vector3;\n private _dimensions: Vector3;\n\n private _lineMaterial: LineBasicMaterial;\n private readonly _mainLineMaterial: LineBasicMaterial;\n\n private readonly _widthLineGroup: Group;\n private readonly _heightLineGroup: Group;\n private readonly _depthLineGroup: Group;\n\n private _enabled: boolean = false;\n private _dimensionsVisible = false;\n\n private _dimensionLineGroup = new Group();\n\n constructor(creator: string) {\n this._creator_ = creator;\n\n this._lineMaterial = new LineBasicMaterial({\n color: LINE_COLOR,\n linewidth: 2,\n });\n\n this._mainLineMaterial = new LineBasicMaterial({\n color: LINE_COLOR,\n linewidth: 0.001,\n transparent: true,\n opacity: 1.0,\n });\n\n this._dimensionLineGroup.name = DIMENSIONING_GEOMETRY;\n\n this._widthLineGroup = this._createLineGroup('width');\n this._heightLineGroup = this._createLineGroup('height');\n this._depthLineGroup = this._createLineGroup('depth');\n\n this._dimensionLineGroup.add(this._widthLineGroup);\n this._dimensionLineGroup.add(this._heightLineGroup);\n this._dimensionLineGroup.add(this._depthLineGroup);\n\n this.update(false);\n this._initialized.resolve();\n }\n\n private _createLineGroup(_name: string): Group {\n const group = new Group();\n group.name = DIMENSIONING_GEOMETRY;\n group.userData.ignoreComponentRaycast = true;\n return group;\n }\n\n private _createLineFromConfig(\n config: Line3,\n material: LineBasicMaterial,\n ): Line {\n const geometry = new BufferGeometry();\n const vertices = [\n config.start.x,\n config.start.y,\n config.start.z,\n config.end.x,\n config.end.y,\n config.end.z,\n ];\n geometry.setAttribute(\n 'position',\n new BufferAttribute(new Float32Array(vertices), 3),\n );\n const line = new Line(geometry, material);\n line.name = DIMENSIONING_GEOMETRY;\n line.userData.ignoreComponentRaycast = true;\n line.layers.set(LAYER.DIMENSIONS);\n return line;\n }\n\n private addLinesToLineGroup(\n group: Group,\n config: DimensionLineConfig,\n mainMaterial: LineBasicMaterial,\n extMaterial: LineBasicMaterial,\n ) {\n config.extensionLines.forEach((extLine) => {\n group.add(this._createLineFromConfig(extLine, extMaterial));\n });\n\n group.add(this._createLineFromConfig(config.mainLine, mainMaterial));\n }\n\n private clearLineGroup(group: Group) {\n while (group.children.length > 0) {\n const child = group.children[0];\n if (child instanceof Line) {\n child.geometry.dispose();\n }\n group.remove(child);\n }\n }\n\n private addLabelToLineGroup(\n group: Group,\n labelText: string,\n labelWorldPosition: Vector3,\n ): void {\n const labelHtmlDiv = document.createElement('div');\n labelHtmlDiv.classList.add(\n 'dimension-label',\n 'dimension-label--primary',\n 'dimension-label--disabled',\n );\n const labelHtmlSpan = document.createElement('span');\n labelHtmlSpan.classList.add('dimension-label__value');\n labelHtmlSpan.innerHTML = labelText;\n labelHtmlDiv.appendChild(labelHtmlSpan);\n\n const labelObject = new CSS2DObject(labelHtmlDiv);\n const labelLocalPosition =\n this._dimensionLineGroup.worldToLocal(labelWorldPosition);\n labelObject.position.copy(labelLocalPosition);\n\n group.add(labelObject);\n }\n\n private _getWidthLineConfig(): DimensionLineConfig {\n const offset = DIMENSION_LINE_OFFSET;\n const extLength = EXTENSION_LINE_LENGTH_RATIO;\n const y = this._dimensions.y + offset;\n const localCam = this._getLocalCameraPosition();\n const z = localCam.z < this._dimensions.z / 2 ? 0 : this._dimensions.z;\n\n return {\n mainLine: new Line3(\n new Vector3(0, y, z),\n new Vector3(this._dimensions.x, y, z),\n ),\n extensionLines: [\n new Line3(\n new Vector3(0, y - extLength, z),\n new Vector3(0, y + extLength, z),\n ),\n new Line3(\n new Vector3(this._dimensions.x, y - extLength, z),\n new Vector3(this._dimensions.x, y + extLength, z),\n ),\n ],\n };\n }\n\n private _getDepthLineConfig(): DimensionLineConfig {\n const offset = DIMENSION_LINE_OFFSET;\n const extLength = EXTENSION_LINE_LENGTH_RATIO;\n const y = 0;\n const localCam = this._getLocalCameraPosition();\n const x =\n localCam.x < this._dimensions.x / 2\n ? -offset\n : this._dimensions.x + offset;\n\n return {\n mainLine: new Line3(\n new Vector3(x, y, this._dimensions.z),\n new Vector3(x, y, 0),\n ),\n extensionLines: [\n new Line3(\n new Vector3(x - extLength, y, 0),\n new Vector3(x + extLength, y, 0),\n ),\n new Line3(\n new Vector3(x - extLength, y, this._dimensions.z),\n new Vector3(x + extLength, y, this._dimensions.z),\n ),\n ],\n };\n }\n\n private _getHeightLineConfig(): DimensionLineConfig {\n const offset = DIMENSION_LINE_OFFSET;\n const extLength = EXTENSION_LINE_LENGTH_RATIO;\n const localCam = this._getLocalCameraPosition();\n const x =\n localCam.x < this._dimensions.x / 2\n ? -offset\n : this._dimensions.x + offset;\n const z = localCam.z < this._dimensions.z / 2 ? 0 : this._dimensions.z;\n\n return {\n mainLine: new Line3(\n new Vector3(x, 0, z),\n new Vector3(x, this._dimensions.y, z),\n ),\n extensionLines: [\n new Line3(\n new Vector3(x - extLength, 0, z),\n new Vector3(x + extLength, 0, z),\n ),\n new Line3(\n new Vector3(x - extLength, this._dimensions.y, z),\n new Vector3(x + extLength, this._dimensions.y, z),\n ),\n ],\n };\n }\n\n private _getLocalCameraPosition(): Vector3 {\n if (\n !this._cameraPosition ||\n !this._dimensionLineGroup ||\n !this._dimensions\n ) {\n return new Vector3(0, 0, 0);\n }\n return this._dimensionLineGroup.worldToLocal(this._cameraPosition.clone());\n }\n\n private _getCameraDistanceInfo(): {\n tooClose: boolean;\n opacity: number;\n distance: number;\n } {\n if (!this._object || !this._cameraPosition || !this._dimensions) {\n return { tooClose: false, opacity: 1.0, distance: Infinity };\n }\n const objPos = this._object.getWorldPosition(new Vector3());\n const distance = this._cameraPosition.distanceTo(objPos);\n const objectRadius =\n Math.max(this._dimensions.x, this._dimensions.y, this._dimensions.z) / 2;\n const minThreshold = objectRadius * MIN_CAMERA_DISTANCE_RATIO;\n const fadeThreshold = objectRadius * FADE_DISTANCE_RATIO;\n\n if (distance < minThreshold) {\n return { tooClose: true, opacity: 0, distance };\n }\n if (distance < fadeThreshold) {\n const opacity =\n (distance - minThreshold) / (fadeThreshold - minThreshold);\n return {\n tooClose: false,\n opacity: Math.max(0, Math.min(1, opacity)),\n distance,\n };\n }\n return { tooClose: false, opacity: 1.0, distance };\n }\n\n private _visibilityChangedCallback() {\n if (this._onVisibilityChange) {\n this._onVisibilityChange(this._dimensionsVisible);\n }\n }\n\n public update(force: boolean = false) {\n if (this._enabled && !this._dimensionsVisible) {\n this._dimensionsVisible = true;\n this._visibilityChangedCallback();\n }\n this._performUpdate(force);\n }\n\n public updateSize(boxForMeasurement: KernelCube) {\n this._origin = convertToTHREE(boxForMeasurement.origin);\n this._dimensionLineGroup.position.x =\n this._origin.x - this._object.position.x;\n this._dimensionLineGroup.position.y =\n this._origin.y - this._object.position.y;\n this._dimensionLineGroup.position.z =\n this._origin.z - this._object.position.z;\n this._dimensions = convertToTHREE(boxForMeasurement.size);\n this.update();\n }\n\n public removeFromObject(object: Object3D) {\n if (object) {\n object.remove(this._dimensionLineGroup);\n }\n }\n\n public onDimensionsVisibilityChanged(handler: (visible: boolean) => void) {\n this._onVisibilityChange = handler;\n }\n\n public setObject(object: Object3D): void {\n this._object = object;\n }\n\n public isInitialized(): Promise<void> {\n return this._initialized.wait();\n }\n\n public areDimensionsEnabled(): boolean {\n return this._enabled;\n }\n\n public clearScene(_scene: Scene): void {\n this._clear();\n }\n\n public addToObject(object: Object3D): void {\n if (!object || !this._dimensionLineGroup) {\n return;\n }\n object.add(this._dimensionLineGroup);\n }\n\n public enableDimensions(): void {\n this._enabled = true;\n this.addToObject(this._object);\n this.update(true);\n }\n\n public disableDimensions(): void {\n this._enabled = false;\n if (this._dimensionsVisible) {\n this._dimensionsVisible = false;\n this._visibilityChangedCallback();\n }\n this._clear();\n this.removeFromObject(this._object);\n }\n\n public enableTopDimensions(): void {\n this.enableDimensions();\n this._heightLineGroup.visible = false;\n this.update(true);\n }\n\n public disableTopDimensions(): void {\n this._heightLineGroup.visible = true;\n this.disableDimensions();\n }\n\n public getBoundingBox(): Box3 {\n const bbox = new Box3();\n bbox.expandByObject(this._dimensionLineGroup);\n return bbox;\n }\n\n public moveCameraStart(position: Vector3): void {\n this._cameraPosition = position;\n this.update();\n }\n\n public moveCameraEnd(position: Vector3): void {\n this._cameraPosition = position;\n this.update();\n }\n\n private _performUpdate(force: boolean): void {\n if (!this._enabled && !force) {\n return;\n }\n if (!this._dimensions) {\n return;\n }\n\n let opacity = 1.0;\n\n if (\n this._object &&\n this._cameraPosition &&\n !this._cameraPosition.equals(new Vector3(0, 0, 0))\n ) {\n const distanceCheck = this._getCameraDistanceInfo();\n if (distanceCheck.tooClose) {\n this._dimensionLineGroup.visible = false;\n } else {\n this._dimensionLineGroup.visible = true;\n opacity = distanceCheck.opacity;\n this._mainLineMaterial.opacity = opacity;\n }\n }\n\n this._dimensionLineGroup.updateMatrixWorld(true);\n\n const widthConfig = this._getWidthLineConfig();\n const widthLabelText = this._unitFormatter.formatMMValueToUnitString(\n this._dimensions.x * 1000,\n );\n const widthPos = this._dimensionLineGroup.localToWorld(\n widthConfig.mainLine.getCenter(new Vector3()),\n );\n this.clearLineGroup(this._widthLineGroup);\n this.addLinesToLineGroup(\n this._widthLineGroup,\n widthConfig,\n this._mainLineMaterial,\n this._mainLineMaterial,\n );\n if (widthLabelText !== null) {\n this.addLabelToLineGroup(this._widthLineGroup, widthLabelText, widthPos);\n }\n\n const heightConfig = this._getHeightLineConfig();\n const heightLabelText = this._unitFormatter.formatMMValueToUnitString(\n this._dimensions.y * 1000,\n );\n const heightPos = this._dimensionLineGroup.localToWorld(\n heightConfig.mainLine.getCenter(new Vector3()),\n );\n this.clearLineGroup(this._heightLineGroup);\n this.addLinesToLineGroup(\n this._heightLineGroup,\n heightConfig,\n this._mainLineMaterial,\n this._mainLineMaterial,\n );\n if (heightLabelText !== null) {\n this.addLabelToLineGroup(\n this._heightLineGroup,\n heightLabelText,\n heightPos,\n );\n }\n\n const depthConfig = this._getDepthLineConfig();\n const depthLabelText = this._unitFormatter.formatMMValueToUnitString(\n this._dimensions.z * -1000,\n );\n const depthPos = this._dimensionLineGroup.localToWorld(\n depthConfig.mainLine.getCenter(new Vector3()),\n );\n this.clearLineGroup(this._depthLineGroup);\n this.addLinesToLineGroup(\n this._depthLineGroup,\n depthConfig,\n this._mainLineMaterial,\n this._mainLineMaterial,\n );\n if (depthLabelText !== null) {\n this.addLabelToLineGroup(this._depthLineGroup, depthLabelText, depthPos);\n }\n }\n\n private _clear(): void {\n this._lineMaterial.dispose();\n this._mainLineMaterial.dispose();\n [this._widthLineGroup, this._heightLineGroup, this._depthLineGroup].forEach(\n (group) => {\n this.clearLineGroup(group);\n },\n );\n }\n}\n"],"x_google_ignoreList":[1],"mappings":";;;;;AAAA,IAAqB,IAArB,MAAmC;CAMjC,YAAY,GAAY;AAEtB,EADA,KAAK,OAAO,GACZ,KAAK,OAAO;;CAGd,QAAgB;AACd,OAAK,WAAW,IAAI,SAAY,GAAS,MAAW;AAElD,GADA,KAAK,WAAW,GAChB,KAAK,UAAU;IACf;;CAGJ,QAAe,GAAmB;AAIhC,EAHI,KACF,KAAK,SAAS,EAAM,EAEtB,KAAK,UAAU;;CAGjB,OAAc,GAAgB;AAC5B,OAAK,QAAQ,EAAE;;CAGjB,OAA0B;AACxB,SAAO,KAAK;;CAGd,QAAe;AACb,OAAK,OAAO;;GCrBV,IAAN,cAA0B,EAAS;CAOlC,YAAa,IAAU,SAAS,cAAe,MAAO,EAAG;AAoCxD,EAlCA,OAAO,EASP,KAAK,gBAAgB,IASrB,KAAK,UAAU,GAEf,KAAK,QAAQ,MAAM,WAAW,YAC9B,KAAK,QAAQ,MAAM,aAAa,QAEhC,KAAK,QAAQ,aAAc,aAAa,GAAO,EAS/C,KAAK,SAAS,IAAI,EAAS,IAAK,GAAK,EAErC,KAAK,iBAAkB,WAAW,WAAY;AAE7C,QAAK,SAAU,SAAW,GAAS;AAElC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