@roomle/web-sdk 2.68.0-alpha.2 → 2.68.0-alpha.4
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/{banana-for-scale-252beca3.nomodule.js → banana-for-scale-3aea88e3.nomodule.js} +2 -2
- package/lib/{banana-for-scale-252beca3.nomodule.js.map → banana-for-scale-3aea88e3.nomodule.js.map} +1 -1
- package/lib/{banana-for-scale-860a2c10.js → banana-for-scale-4ea6891d.js} +2 -2
- package/lib/{banana-for-scale-860a2c10.js.map → banana-for-scale-4ea6891d.js.map} +1 -1
- package/lib/{component-dimensioning-bbf099de.nomodule.js → component-dimensioning-39bd223f.nomodule.js} +2 -2
- package/lib/component-dimensioning-39bd223f.nomodule.js.map +1 -0
- package/lib/{component-dimensioning-ef664fb6.js → component-dimensioning-7c837a49.js} +2 -2
- package/lib/component-dimensioning-7c837a49.js.map +1 -0
- package/lib/{component-raycast-helper-c48cdebe.nomodule.js → component-raycast-helper-980d3fcf.nomodule.js} +2 -2
- package/lib/component-raycast-helper-980d3fcf.nomodule.js.map +1 -0
- package/lib/{component-raycast-helper-a4287ed8.js → component-raycast-helper-b15ddcb0.js} +2 -2
- package/lib/component-raycast-helper-b15ddcb0.js.map +1 -0
- package/lib/{configurator-f5a9b5c2.js → configurator-04686014.js} +2 -2
- package/lib/configurator-04686014.js.map +1 -0
- package/lib/{configurator-b0b9180b.nomodule.js → configurator-faf33eba.nomodule.js} +2 -2
- package/lib/configurator-faf33eba.nomodule.js.map +1 -0
- package/lib/configurator-main-0aad247f.js +2 -0
- package/lib/configurator-main-0aad247f.js.map +1 -0
- package/lib/configurator-main.nomodule.js +1 -1
- package/lib/{continuous-drawing-helper-2e7f3f5c.nomodule.js → continuous-drawing-helper-6dfed572.nomodule.js} +2 -2
- package/lib/continuous-drawing-helper-6dfed572.nomodule.js.map +1 -0
- package/lib/{continuous-drawing-helper-e2df0036.js → continuous-drawing-helper-936b58cd.js} +2 -2
- package/lib/continuous-drawing-helper-936b58cd.js.map +1 -0
- package/lib/{default-light-setting-b84b4d14.nomodule.js → default-light-setting-41fc1fb0.nomodule.js} +2 -2
- package/lib/default-light-setting-41fc1fb0.nomodule.js.map +1 -0
- package/lib/{default-light-setting-89a3a68f.js → default-light-setting-a195c619.js} +2 -2
- package/lib/default-light-setting-a195c619.js.map +1 -0
- package/lib/definitions/common-core/mock/mock-rapi-types.d.ts +5 -0
- package/lib/definitions/common-core/src/utils/threejs-utils.d.ts +1 -1
- package/lib/definitions/common-core/src/view-model/plan-object-view-model.d.ts +12 -2
- package/lib/definitions/common-core/src/webgl/mesh-generator.d.ts +2 -0
- package/lib/definitions/material-viewer/src/roomle-material-viewer.d.ts +1 -1
- package/lib/definitions/material-viewer/src/webgl/material-viewer-scene-manager.d.ts +1 -1
- package/lib/definitions/planner-core/src/roomle-planner-ui-callback.d.ts +3 -3
- package/lib/definitions/planner-core/src/roomle-planner.d.ts +1 -1
- package/lib/definitions/planner-core/src/webgl/planner-scene-manager.d.ts +2 -1
- package/lib/definitions/typings/planner.d.ts +27 -3
- package/lib/definitions/typings/rapi-types.d.ts +16 -1
- package/lib/{dimensioning-helper-8c610892.js → dimensioning-helper-34d18c8c.js} +2 -2
- package/lib/{dimensioning-helper-8c610892.js.map → dimensioning-helper-34d18c8c.js.map} +1 -1
- package/lib/{dimensioning-helper-6308004c.nomodule.js → dimensioning-helper-952fc8e5.nomodule.js} +2 -2
- package/lib/{dimensioning-helper-6308004c.nomodule.js.map → dimensioning-helper-952fc8e5.nomodule.js.map} +1 -1
- package/lib/{glb-viewer-f211bb94.nomodule.js → glb-viewer-08d3c062.nomodule.js} +2 -2
- package/lib/{glb-viewer-f211bb94.nomodule.js.map → glb-viewer-08d3c062.nomodule.js.map} +1 -1
- package/lib/{glb-viewer-d9b518bb.js → glb-viewer-6c9fff72.js} +2 -2
- package/lib/{glb-viewer-d9b518bb.js.map → glb-viewer-6c9fff72.js.map} +1 -1
- package/lib/glb-viewer-main-48c8290c.js +2 -0
- package/lib/glb-viewer-main-48c8290c.js.map +1 -0
- package/lib/glb-viewer-main.nomodule.js +1 -1
- package/lib/legacy/{banana-for-scale-32f7b9ca.legacy.js → banana-for-scale-f21a5440.legacy.js} +2 -2
- package/lib/legacy/{banana-for-scale-32f7b9ca.legacy.js.map → banana-for-scale-f21a5440.legacy.js.map} +1 -1
- package/lib/legacy/{component-dimensioning-542822e7.legacy.js → component-dimensioning-5e164484.legacy.js} +2 -2
- package/lib/legacy/component-dimensioning-5e164484.legacy.js.map +1 -0
- package/lib/legacy/{component-raycast-helper-b9817cec.legacy.js → component-raycast-helper-949ee9f0.legacy.js} +2 -2
- package/lib/legacy/component-raycast-helper-949ee9f0.legacy.js.map +1 -0
- package/lib/legacy/{configurator-98acf96b.legacy.js → configurator-c5a042b0.legacy.js} +2 -2
- package/lib/legacy/configurator-c5a042b0.legacy.js.map +1 -0
- package/lib/legacy/configurator-main.legacy.js +1 -1
- package/lib/legacy/{continuous-drawing-helper-97fd3f41.legacy.js → continuous-drawing-helper-876799b1.legacy.js} +2 -2
- package/lib/legacy/continuous-drawing-helper-876799b1.legacy.js.map +1 -0
- package/lib/legacy/{default-light-setting-1ce256f1.legacy.js → default-light-setting-f3894cdc.legacy.js} +2 -2
- package/lib/legacy/default-light-setting-f3894cdc.legacy.js.map +1 -0
- package/lib/legacy/{dimensioning-helper-6f84f307.legacy.js → dimensioning-helper-430e5708.legacy.js} +2 -2
- package/lib/legacy/{dimensioning-helper-6f84f307.legacy.js.map → dimensioning-helper-430e5708.legacy.js.map} +1 -1
- package/lib/legacy/{glb-viewer-e6b20e3b.legacy.js → glb-viewer-3d7edc5d.legacy.js} +2 -2
- package/lib/legacy/{glb-viewer-e6b20e3b.legacy.js.map → glb-viewer-3d7edc5d.legacy.js.map} +1 -1
- package/lib/legacy/glb-viewer-main.legacy.js +1 -1
- package/lib/legacy/material-viewer-00f18fc8.legacy.js +2 -0
- package/lib/legacy/material-viewer-00f18fc8.legacy.js.map +1 -0
- package/lib/legacy/material-viewer-main.legacy.js +1 -1
- package/lib/legacy/{planner-46635c19.legacy.js → planner-be4f26ed.legacy.js} +2 -2
- package/lib/legacy/{planner-46635c19.legacy.js.map → planner-be4f26ed.legacy.js.map} +1 -1
- package/lib/legacy/planner-main.legacy.js +1 -1
- package/lib/legacy/{roomle-configurator-24b33884.legacy.js → roomle-configurator-85aefa63.legacy.js} +2 -2
- package/lib/legacy/roomle-configurator-85aefa63.legacy.js.map +1 -0
- package/lib/legacy/{roomle-dependency-injection-2c9f9abd.legacy.js → roomle-dependency-injection-fe58841f.legacy.js} +3 -3
- package/lib/legacy/{roomle-dependency-injection-2c9f9abd.legacy.js.map → roomle-dependency-injection-fe58841f.legacy.js.map} +1 -1
- package/lib/legacy/roomle-sdk.legacy.js +1 -1
- package/lib/legacy/{scene-manager-6f652f05.legacy.js → scene-manager-16f204d3.legacy.js} +2 -2
- package/lib/legacy/{scene-manager-6f652f05.legacy.js.map → scene-manager-16f204d3.legacy.js.map} +1 -1
- package/lib/legacy/{script-loader-23d76f85.legacy.js → script-loader-76480382.legacy.js} +2 -2
- package/lib/legacy/script-loader-76480382.legacy.js.map +1 -0
- package/lib/legacy/{stats-helper-a5eef89a.legacy.js → stats-helper-ddcce2d7.legacy.js} +2 -2
- package/lib/legacy/stats-helper-ddcce2d7.legacy.js.map +1 -0
- package/lib/legacy/{tools-core-9dbd4bb5.legacy.js → tools-core-cd8c437b.legacy.js} +2 -2
- package/lib/legacy/tools-core-cd8c437b.legacy.js.map +1 -0
- package/lib/material-viewer-2d5eaabc.nomodule.js +2 -0
- package/lib/material-viewer-2d5eaabc.nomodule.js.map +1 -0
- package/lib/material-viewer-87f5e98b.js +2 -0
- package/lib/material-viewer-87f5e98b.js.map +1 -0
- package/lib/material-viewer-main-f5f4b8d8.js +2 -0
- package/lib/material-viewer-main-f5f4b8d8.js.map +1 -0
- package/lib/material-viewer-main.nomodule.js +1 -1
- package/lib/{planner-71a69c69.js → planner-3287e361.js} +2 -2
- package/lib/{planner-71a69c69.js.map → planner-3287e361.js.map} +1 -1
- package/lib/{planner-fd1f6b90.nomodule.js → planner-45fa06a4.nomodule.js} +2 -2
- package/lib/{planner-fd1f6b90.nomodule.js.map → planner-45fa06a4.nomodule.js.map} +1 -1
- package/lib/planner-main-51881be4.js +2 -0
- package/lib/planner-main-51881be4.js.map +1 -0
- package/lib/planner-main.nomodule.js +1 -1
- package/lib/{roomle-configurator-370e723b.js → roomle-configurator-38816c54.js} +2 -2
- package/lib/roomle-configurator-38816c54.js.map +1 -0
- package/lib/{roomle-configurator-c7570650.nomodule.js → roomle-configurator-5bfe9ed9.nomodule.js} +2 -2
- package/lib/roomle-configurator-5bfe9ed9.nomodule.js.map +1 -0
- package/lib/{roomle-dependency-injection-8f6178cf.nomodule.js → roomle-dependency-injection-5b1f09d5.nomodule.js} +3 -3
- package/lib/{roomle-dependency-injection-8f6178cf.nomodule.js.map → roomle-dependency-injection-5b1f09d5.nomodule.js.map} +1 -1
- package/lib/{roomle-dependency-injection-a3480854.js → roomle-dependency-injection-986d0a8f.js} +3 -3
- package/lib/{roomle-dependency-injection-a3480854.js.map → roomle-dependency-injection-986d0a8f.js.map} +1 -1
- package/lib/{roomle-sdk-de5997c1.js → roomle-sdk-6ab052e4.js} +2 -2
- package/lib/roomle-sdk-6ab052e4.js.map +1 -0
- package/lib/roomle-sdk.nomodule.js +1 -1
- package/lib/{scene-manager-66c78b0f.js → scene-manager-9231df1b.js} +2 -2
- package/lib/{scene-manager-66c78b0f.js.map → scene-manager-9231df1b.js.map} +1 -1
- package/lib/{scene-manager-6e7e3671.nomodule.js → scene-manager-9b770743.nomodule.js} +2 -2
- package/lib/{scene-manager-6e7e3671.nomodule.js.map → scene-manager-9b770743.nomodule.js.map} +1 -1
- package/lib/{script-loader-e2e66e5f.js → script-loader-917e8941.js} +2 -2
- package/lib/script-loader-917e8941.js.map +1 -0
- package/lib/{script-loader-7a077289.nomodule.js → script-loader-c2a01bb0.nomodule.js} +2 -2
- package/lib/script-loader-c2a01bb0.nomodule.js.map +1 -0
- package/lib/{stats-helper-4f65db1a.js → stats-helper-0c4ac5d6.js} +2 -2
- package/lib/stats-helper-0c4ac5d6.js.map +1 -0
- package/lib/{stats-helper-a2dbe8d5.nomodule.js → stats-helper-b0cc9d25.nomodule.js} +2 -2
- package/lib/stats-helper-b0cc9d25.nomodule.js.map +1 -0
- package/lib/{tools-core-66921307.nomodule.js → tools-core-aaf457c3.nomodule.js} +2 -2
- package/lib/tools-core-aaf457c3.nomodule.js.map +1 -0
- package/lib/{tools-core-11dbd92d.js → tools-core-f5ba1e23.js} +2 -2
- package/lib/tools-core-f5ba1e23.js.map +1 -0
- package/package.json +2 -2
- package/lib/component-dimensioning-bbf099de.nomodule.js.map +0 -1
- package/lib/component-dimensioning-ef664fb6.js.map +0 -1
- package/lib/component-raycast-helper-a4287ed8.js.map +0 -1
- package/lib/component-raycast-helper-c48cdebe.nomodule.js.map +0 -1
- package/lib/configurator-b0b9180b.nomodule.js.map +0 -1
- package/lib/configurator-f5a9b5c2.js.map +0 -1
- package/lib/configurator-main-d79789c7.js +0 -2
- package/lib/configurator-main-d79789c7.js.map +0 -1
- package/lib/continuous-drawing-helper-2e7f3f5c.nomodule.js.map +0 -1
- package/lib/continuous-drawing-helper-e2df0036.js.map +0 -1
- package/lib/default-light-setting-89a3a68f.js.map +0 -1
- package/lib/default-light-setting-b84b4d14.nomodule.js.map +0 -1
- package/lib/glb-viewer-main-895b50bd.js +0 -2
- package/lib/glb-viewer-main-895b50bd.js.map +0 -1
- package/lib/legacy/component-dimensioning-542822e7.legacy.js.map +0 -1
- package/lib/legacy/component-raycast-helper-b9817cec.legacy.js.map +0 -1
- package/lib/legacy/configurator-98acf96b.legacy.js.map +0 -1
- package/lib/legacy/continuous-drawing-helper-97fd3f41.legacy.js.map +0 -1
- package/lib/legacy/default-light-setting-1ce256f1.legacy.js.map +0 -1
- package/lib/legacy/material-viewer-d9c5b564.legacy.js +0 -2
- package/lib/legacy/material-viewer-d9c5b564.legacy.js.map +0 -1
- package/lib/legacy/roomle-configurator-24b33884.legacy.js.map +0 -1
- package/lib/legacy/script-loader-23d76f85.legacy.js.map +0 -1
- package/lib/legacy/stats-helper-a5eef89a.legacy.js.map +0 -1
- package/lib/legacy/tools-core-9dbd4bb5.legacy.js.map +0 -1
- package/lib/material-viewer-03b4b92d.js +0 -2
- package/lib/material-viewer-03b4b92d.js.map +0 -1
- package/lib/material-viewer-8bf4ac9e.nomodule.js +0 -2
- package/lib/material-viewer-8bf4ac9e.nomodule.js.map +0 -1
- package/lib/material-viewer-main-d1c9fab8.js +0 -2
- package/lib/material-viewer-main-d1c9fab8.js.map +0 -1
- package/lib/planner-main-04ece8e6.js +0 -2
- package/lib/planner-main-04ece8e6.js.map +0 -1
- package/lib/roomle-configurator-370e723b.js.map +0 -1
- package/lib/roomle-configurator-c7570650.nomodule.js.map +0 -1
- package/lib/roomle-sdk-de5997c1.js.map +0 -1
- package/lib/script-loader-7a077289.nomodule.js.map +0 -1
- package/lib/script-loader-e2e66e5f.js.map +0 -1
- package/lib/stats-helper-4f65db1a.js.map +0 -1
- package/lib/stats-helper-a2dbe8d5.nomodule.js.map +0 -1
- package/lib/tools-core-11dbd92d.js.map +0 -1
- package/lib/tools-core-66921307.nomodule.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./roomle-dependency-injection-
|
|
2
|
-
//# sourceMappingURL=banana-for-scale-
|
|
1
|
+
System.register(["./roomle-dependency-injection-5b1f09d5.nomodule.js","./main-thread-to-worker-a8fb30c0.nomodule.js"],(function(e){var n,t,a,s,i;return{setters:[function(e){n=e.aB,t=e._,a=e.i},function(e){s=e.g,i=e.a}],execute:function(){class o extends n{setScene(e){this._scene=e,this._staticItemLoader.loadGLB(s()+"static/banana_div2-1351c98ec2986be1.glb").then(e=>{this._banana=e.scene,this.updateBounds(null)})}updateBounds(e){if(e&&(this._bounds=e),this._bounds){if(this._banana){const e=this._bounds.getSize(new i),n=this._bounds.getCenter(new i).clone();n.x-=e.x/2+.18,n.z+=e.z/2+.05,n.y=0;let t=.03;this._banana.scale.copy(new i(t,t,t)),this._banana.rotation.y=.6,this._banana.position.copy(n)}this._scene.children.includes(this._banana)||this.addToScene()}}clearScene(e,n){super.clearScene(e,n),this.removeFromScene()}addToScene(){this._scene&&this._banana&&this._scene.add(this._banana)}removeFromScene(){this._scene&&this._banana&&this._scene.remove(this._banana)}}e("default",o),t([a],o.prototype,"_staticItemLoader",void 0)}}}));
|
|
2
|
+
//# sourceMappingURL=banana-for-scale-3aea88e3.nomodule.js.map
|
package/lib/{banana-for-scale-252beca3.nomodule.js.map → banana-for-scale-3aea88e3.nomodule.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"banana-for-scale-
|
|
1
|
+
{"version":3,"file":"banana-for-scale-3aea88e3.nomodule.js","sources":["../../packages/configurator-core/public/geometry/banana_div2.glb"],"sourcesContent":["export default \"static/banana_div2-1351c98ec2986be1.glb\""],"names":[],"mappings":"6TAAe"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{aB as ScenePluginDefaultImplementation,_ as __decorate,i as inject}from"./roomle-dependency-injection-
|
|
2
|
-
//# sourceMappingURL=banana-for-scale-
|
|
1
|
+
import{aB as ScenePluginDefaultImplementation,_ as __decorate,i as inject}from"./roomle-dependency-injection-986d0a8f.js";import{g as getAssetPath,a as Vector3}from"./main-thread-to-worker-9f925ba4.js";class BananaForScale extends ScenePluginDefaultImplementation{setScene(e){this._scene=e,this._staticItemLoader.loadGLB(getAssetPath()+"static/banana_div2-1351c98ec2986be1.glb").then(e=>{this._banana=e.scene,this.updateBounds(null)})}updateBounds(e){if(e&&(this._bounds=e),this._bounds){if(this._banana){const e=this._bounds.getSize(new Vector3),a=this._bounds.getCenter(new Vector3).clone();a.x-=e.x/2+.18,a.z+=e.z/2+.05,a.y=0;let n=.03;this._banana.scale.copy(new Vector3(n,n,n)),this._banana.rotation.y=.6,this._banana.position.copy(a)}this._scene.children.includes(this._banana)||this.addToScene()}}clearScene(e,a){super.clearScene(e,a),this.removeFromScene()}addToScene(){this._scene&&this._banana&&this._scene.add(this._banana)}removeFromScene(){this._scene&&this._banana&&this._scene.remove(this._banana)}}__decorate([inject],BananaForScale.prototype,"_staticItemLoader",void 0);export{BananaForScale as default};
|
|
2
|
+
//# sourceMappingURL=banana-for-scale-4ea6891d.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"banana-for-scale-
|
|
1
|
+
{"version":3,"file":"banana-for-scale-4ea6891d.js","sources":["../../packages/configurator-core/public/geometry/banana_div2.glb"],"sourcesContent":["export default \"static/banana_div2-1351c98ec2986be1.glb\""],"names":[],"mappings":"gVAAe"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./roomle-dependency-injection-
|
|
2
|
-
//# sourceMappingURL=component-dimensioning-
|
|
1
|
+
System.register(["./roomle-dependency-injection-5b1f09d5.nomodule.js","./main-thread-to-worker-a8fb30c0.nomodule.js","./TextGeometry-885c93d0.nomodule.js"],(function(e){var i,t,n,s,o,a,h,d,_,l,r,g,m,c,w,p;return{setters:[function(e){i=e._,t=e.i},function(e){n=e.O,s=e.a,o=e.u,a=e.h,h=e.w,d=e.bn,_=e.B,l=e.G,r=e.z,g=e.b,m=e.Q,c=e.aY,w=e.bb},function(e){p=e.T}],execute:function(){const u="component_dimensioning_line_material",x="component_dimensioning_plane_material",y="component_dimensioning_text_material";class v extends n{constructor(e,i,t,n){super(),this._center=i.getCenter(new s),this._size=i.getSize(new s),this._origin=this._center.clone().sub(this._size.clone().multiplyScalar(.5)),this._dimensioning=e,this._level=this._dimensioning.maxLevel-this._dimensioning.level,this._font=t,this._cameraPosition=n,this._init()}_initMaterials(){this._cacheHolder.materialCache.has(u)?this._lineMaterial=this._cacheHolder.materialCache.get(u):(this._lineMaterial=new o({color:3618615}),this._cacheHolder.materialCache.set(u,this._lineMaterial)),this._cacheHolder.materialCache.has(x)?this._planeMaterial=this._cacheHolder.materialCache.get(x):(this._planeMaterial=new a({color:16777215,side:h,opacity:.8,transparent:!0}),this._cacheHolder.materialCache.set(x,this._planeMaterial)),this._cacheHolder.materialCache.has(y)?this._textMaterial=this._cacheHolder.materialCache.get(y):(this._textMaterial=new d({color:3618615}),this._cacheHolder.materialCache.set(y,this._textMaterial))}_init(){this._initMaterials();let e=new _;this._line=new l(e,this._lineMaterial),this._line.name="component dimension line "+this._dimensioning.type.value,this._text=new r(e,this._textMaterial),this._text.name="component dimension text "+this._dimensioning.type.value,this._plane=new r(e,this._planeMaterial),this._plane.name="component dimension plane "+this._dimensioning.type.value;let i,t=new _,n=Math.round(Math.max(this._size.y,this._size.x,this._size.z)),o=Math.abs(this._dimensioning.to-this._dimensioning.from),a=.025+(n<4?0:.005*n);o<.3&&(a*=.5+o);let h={font:this._font,size:a,height:.001,curveSegments:2,bevelEnabled:!0,bevelThickness:.001,bevelSize:.001},d=this._dimensioning.label?this._dimensioning.label:this._unitFormatter.formatMMValueToUnitString(1e3*o),c=new p(d,h);c.computeBoundingBox();let w=c.boundingBox.getSize(new s).y;0===this._dimensioning.type.value&&(i=this._getXEdge(w),this._addXEdgeSideLines(w)),1===this._dimensioning.type.value&&(i=this._getYEdge(w),this._addYEdgeSideLines(w)),2===this._dimensioning.type.value&&(i=this._getZEdge(w),this._addZEdgeSideLines(w));let u=[i.start.x,i.start.y,i.start.z,i.end.x,i.end.y,i.end.z];if(t.setAttribute("position",new g(new Float32Array(u),3)),this._line.geometry.dispose(),this._line.geometry=t,this.add(this._line),this._text.geometry=c,0===this._dimensioning.type.value&&this._addText(i,c,new m,new s(0,.04,0)),1===this._dimensioning.type.value){let e=new m,t=this._getXSign()>0?Math.PI/2:Math.PI/2*3;e.setFromAxisAngle(new s(0,0,1),t),this._addText(i,c,e,new s(.04,0,0))}if(2===this._dimensioning.type.value){let e=this._getXSign()>0?Math.PI/2:Math.PI/2*3,t=(new m).setFromAxisAngle(new s(-1,0,0),Math.PI/2),n=(new m).setFromAxisAngle(new s(0,0,1),e);this._addText(i,c,t.multiply(n),new s(.04,0,0))}}_getXEdge(e){let i=this._size.y+.05+(.06+e)*this._level;const t=new s(0,this._origin.y,this._origin.z);let n=t.clone().add(new s(this._dimensioning.from,i,0)),o=t.clone().add(new s(this._dimensioning.to,i,0));return new c(n,o)}_addXEdgeSideLines(e){let i=this._size.y+.05+(.06+e)*(this._level-.5),t=this._size.y+.05+(.06+e)*this._level;const n=new s(0,this._origin.y,this._origin.z);let o=n.clone().add(new s(this._dimensioning.from,i,0)),a=n.clone().add(new s(this._dimensioning.from,t,0)),h=n.clone().add(new s(this._dimensioning.to,i,0)),d=n.clone().add(new s(this._dimensioning.to,t,0));this._addLine(o,a),this._addLine(h,d)}_getZEdge(e){let i=(this._getXSign()>0?this._size.x:0)+.05+(.06+e)*this._level;i*=this._getXSign();const t=new s(this._origin.x,this._origin.y,0);let n=t.clone().add(new s(i,0,this._dimensioning.from)),o=t.clone().add(new s(i,0,this._dimensioning.to));return new c(n,o)}_addZEdgeSideLines(e){let i=this._getXSign()>0?this._size.x:0,t=i+.05+(.06+e)*(this._level-.5),n=i+.05+(.06+e)*this._level;t*=this._getXSign(),n*=this._getXSign();const o=new s(this._origin.x,this._origin.y,0);let a=o.clone().add(new s(t,0,this._dimensioning.from)),h=o.clone().add(new s(n,0,this._dimensioning.from)),d=o.clone().add(new s(t,0,this._dimensioning.to)),_=o.clone().add(new s(n,0,this._dimensioning.to));this._addLine(a,h),this._addLine(d,_)}_getYEdge(e){let i=(this._getXSign()>0?this._size.x:0)+.05+(.06+e)*this._level;i*=this._getXSign();const t=new s(this._origin.x,0,this._origin.z);let n=t.clone().add(new s(i,this._dimensioning.from,0)),o=t.clone().add(new s(i,this._dimensioning.to,0));return new c(n,o)}_addYEdgeSideLines(e){let i=this._getXSign()>0?this._size.x:0,t=i+.05+(.06+e)*(this._level-.5),n=i+.05+(.06+e)*this._level;t*=this._getXSign(),n*=this._getXSign();const o=new s(this._origin.x,0,this._origin.z);let a=o.clone().add(new s(t,this._dimensioning.from,0)),h=o.clone().add(new s(n,this._dimensioning.from,0)),d=o.clone().add(new s(t,this._dimensioning.to,0)),_=o.clone().add(new s(n,this._dimensioning.to,0));this._addLine(a,h),this._addLine(d,_)}_addLine(e,i){let t=new _,n=[e.x,e.y,e.z,i.x,i.y,i.z];t.setAttribute("position",new g(new Float32Array(n),3)),this.add(new l(t,this._lineMaterial))}_addText(e,i,t,n){let o=e.getCenter(new s);n.x*=this._getXSign(),o.add(n);let a=i.boundingBox.getSize(new s);i.center(),this._text.position.copy(o),this._text.quaternion.copy(t),this.add(this._text);let h=new w(a.x+.02,a.y+.02,32);h.center(),this._plane.geometry=h,this._plane.position.copy(o),this._plane.quaternion.copy(t),this.add(this._plane)}_getXSign(){return this._cameraPosition.x>=0?1:-1}}e("default",v),i([t],v.prototype,"_cacheHolder",void 0),i([t],v.prototype,"_unitFormatter",void 0)}}}));
|
|
2
|
+
//# sourceMappingURL=component-dimensioning-39bd223f.nomodule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-dimensioning-39bd223f.nomodule.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{_ as __decorate,i as inject}from"./roomle-dependency-injection-
|
|
2
|
-
//# sourceMappingURL=component-dimensioning-
|
|
1
|
+
import{_ as __decorate,i as inject}from"./roomle-dependency-injection-986d0a8f.js";import{O as Object3D,a as Vector3,u as LineBasicMaterial,h as MeshBasicMaterial,w as DoubleSide,bn as MeshPhongMaterial,B as BufferGeometry,G as Line,z as Mesh,b as BufferAttribute,Q as Quaternion,aY as Line3,bb as PlaneGeometry}from"./main-thread-to-worker-9f925ba4.js";import{T as TextGeometry}from"./TextGeometry-2f1b3194.js";const LINE_MATERIAL="component_dimensioning_line_material",PLANE_MATERIAL="component_dimensioning_plane_material",TEXT_MATERIAL="component_dimensioning_text_material";class ComponentDimensioning extends Object3D{constructor(e,i,t,n){super(),this._center=i.getCenter(new Vector3),this._size=i.getSize(new Vector3),this._origin=this._center.clone().sub(this._size.clone().multiplyScalar(.5)),this._dimensioning=e,this._level=this._dimensioning.maxLevel-this._dimensioning.level,this._font=t,this._cameraPosition=n,this._init()}_initMaterials(){this._cacheHolder.materialCache.has(LINE_MATERIAL)?this._lineMaterial=this._cacheHolder.materialCache.get(LINE_MATERIAL):(this._lineMaterial=new LineBasicMaterial({color:3618615}),this._cacheHolder.materialCache.set(LINE_MATERIAL,this._lineMaterial)),this._cacheHolder.materialCache.has(PLANE_MATERIAL)?this._planeMaterial=this._cacheHolder.materialCache.get(PLANE_MATERIAL):(this._planeMaterial=new MeshBasicMaterial({color:16777215,side:DoubleSide,opacity:.8,transparent:!0}),this._cacheHolder.materialCache.set(PLANE_MATERIAL,this._planeMaterial)),this._cacheHolder.materialCache.has(TEXT_MATERIAL)?this._textMaterial=this._cacheHolder.materialCache.get(TEXT_MATERIAL):(this._textMaterial=new MeshPhongMaterial({color:3618615}),this._cacheHolder.materialCache.set(TEXT_MATERIAL,this._textMaterial))}_init(){this._initMaterials();let e=new BufferGeometry;this._line=new Line(e,this._lineMaterial),this._line.name="component dimension line "+this._dimensioning.type.value,this._text=new Mesh(e,this._textMaterial),this._text.name="component dimension text "+this._dimensioning.type.value,this._plane=new Mesh(e,this._planeMaterial),this._plane.name="component dimension plane "+this._dimensioning.type.value;let i,t=new BufferGeometry,n=Math.round(Math.max(this._size.y,this._size.x,this._size.z)),s=Math.abs(this._dimensioning.to-this._dimensioning.from),o=.025+(n<4?0:.005*n);s<.3&&(o*=.5+s);let a={font:this._font,size:o,height:.001,curveSegments:2,bevelEnabled:!0,bevelThickness:.001,bevelSize:.001},h=this._dimensioning.label?this._dimensioning.label:this._unitFormatter.formatMMValueToUnitString(1e3*s),r=new TextGeometry(h,a);r.computeBoundingBox();let _=r.boundingBox.getSize(new Vector3).y;0===this._dimensioning.type.value&&(i=this._getXEdge(_),this._addXEdgeSideLines(_)),1===this._dimensioning.type.value&&(i=this._getYEdge(_),this._addYEdgeSideLines(_)),2===this._dimensioning.type.value&&(i=this._getZEdge(_),this._addZEdgeSideLines(_));let d=[i.start.x,i.start.y,i.start.z,i.end.x,i.end.y,i.end.z];if(t.setAttribute("position",new BufferAttribute(new Float32Array(d),3)),this._line.geometry.dispose(),this._line.geometry=t,this.add(this._line),this._text.geometry=r,0===this._dimensioning.type.value&&this._addText(i,r,new Quaternion,new Vector3(0,.04,0)),1===this._dimensioning.type.value){let e=new Quaternion,t=this._getXSign()>0?Math.PI/2:Math.PI/2*3;e.setFromAxisAngle(new Vector3(0,0,1),t),this._addText(i,r,e,new Vector3(.04,0,0))}if(2===this._dimensioning.type.value){let e=this._getXSign()>0?Math.PI/2:Math.PI/2*3,t=(new Quaternion).setFromAxisAngle(new Vector3(-1,0,0),Math.PI/2),n=(new Quaternion).setFromAxisAngle(new Vector3(0,0,1),e);this._addText(i,r,t.multiply(n),new Vector3(.04,0,0))}}_getXEdge(e){let i=this._size.y+.05+(.06+e)*this._level;const t=new Vector3(0,this._origin.y,this._origin.z);let n=t.clone().add(new Vector3(this._dimensioning.from,i,0)),s=t.clone().add(new Vector3(this._dimensioning.to,i,0));return new Line3(n,s)}_addXEdgeSideLines(e){let i=this._size.y+.05+(.06+e)*(this._level-.5),t=this._size.y+.05+(.06+e)*this._level;const n=new Vector3(0,this._origin.y,this._origin.z);let s=n.clone().add(new Vector3(this._dimensioning.from,i,0)),o=n.clone().add(new Vector3(this._dimensioning.from,t,0)),a=n.clone().add(new Vector3(this._dimensioning.to,i,0)),h=n.clone().add(new Vector3(this._dimensioning.to,t,0));this._addLine(s,o),this._addLine(a,h)}_getZEdge(e){let i=(this._getXSign()>0?this._size.x:0)+.05+(.06+e)*this._level;i*=this._getXSign();const t=new Vector3(this._origin.x,this._origin.y,0);let n=t.clone().add(new Vector3(i,0,this._dimensioning.from)),s=t.clone().add(new Vector3(i,0,this._dimensioning.to));return new Line3(n,s)}_addZEdgeSideLines(e){let i=this._getXSign()>0?this._size.x:0,t=i+.05+(.06+e)*(this._level-.5),n=i+.05+(.06+e)*this._level;t*=this._getXSign(),n*=this._getXSign();const s=new Vector3(this._origin.x,this._origin.y,0);let o=s.clone().add(new Vector3(t,0,this._dimensioning.from)),a=s.clone().add(new Vector3(n,0,this._dimensioning.from)),h=s.clone().add(new Vector3(t,0,this._dimensioning.to)),r=s.clone().add(new Vector3(n,0,this._dimensioning.to));this._addLine(o,a),this._addLine(h,r)}_getYEdge(e){let i=(this._getXSign()>0?this._size.x:0)+.05+(.06+e)*this._level;i*=this._getXSign();const t=new Vector3(this._origin.x,0,this._origin.z);let n=t.clone().add(new Vector3(i,this._dimensioning.from,0)),s=t.clone().add(new Vector3(i,this._dimensioning.to,0));return new Line3(n,s)}_addYEdgeSideLines(e){let i=this._getXSign()>0?this._size.x:0,t=i+.05+(.06+e)*(this._level-.5),n=i+.05+(.06+e)*this._level;t*=this._getXSign(),n*=this._getXSign();const s=new Vector3(this._origin.x,0,this._origin.z);let o=s.clone().add(new Vector3(t,this._dimensioning.from,0)),a=s.clone().add(new Vector3(n,this._dimensioning.from,0)),h=s.clone().add(new Vector3(t,this._dimensioning.to,0)),r=s.clone().add(new Vector3(n,this._dimensioning.to,0));this._addLine(o,a),this._addLine(h,r)}_addLine(e,i){let t=new BufferGeometry,n=[e.x,e.y,e.z,i.x,i.y,i.z];t.setAttribute("position",new BufferAttribute(new Float32Array(n),3)),this.add(new Line(t,this._lineMaterial))}_addText(e,i,t,n){let s=e.getCenter(new Vector3);n.x*=this._getXSign(),s.add(n);let o=i.boundingBox.getSize(new Vector3);i.center(),this._text.position.copy(s),this._text.quaternion.copy(t),this.add(this._text);let a=new PlaneGeometry(o.x+.02,o.y+.02,32);a.center(),this._plane.geometry=a,this._plane.position.copy(s),this._plane.quaternion.copy(t),this.add(this._plane)}_getXSign(){return this._cameraPosition.x>=0?1:-1}}__decorate([inject],ComponentDimensioning.prototype,"_cacheHolder",void 0),__decorate([inject],ComponentDimensioning.prototype,"_unitFormatter",void 0);export{ComponentDimensioning as default};
|
|
2
|
+
//# sourceMappingURL=component-dimensioning-7c837a49.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-dimensioning-7c837a49.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./main-thread-to-worker-a8fb30c0.nomodule.js","./roomle-dependency-injection-
|
|
2
|
-
//# sourceMappingURL=component-raycast-helper-
|
|
1
|
+
System.register(["./main-thread-to-worker-a8fb30c0.nomodule.js","./roomle-dependency-injection-5b1f09d5.nomodule.js"],(function(e){var t,i,n,s,a,r,c,o,l;return{setters:[function(e){t=e.bw,i=e.bL,n=e.z,s=e.v,a=e.ad,r=e.a,c=e.bM,o=e.k},function(e){l=e.a0}],execute:function(){e("default",class{constructor(){this._nonTransparentComponent=null,this._raycaster=new t,this._raycaster.near=.1,this._raycaster.layers.enable(3)}init(e,t){this._scene=e,this._camera=t,this.checkComponentVisibility=i(this.checkComponentVisibility,100).bind(this),this.checkPreviewVisibility=i(this.checkPreviewVisibility,100).bind(this)}changeMaterialsOnSelect(e,t,i=!1){t!==this._nonTransparentComponent&&(this._nonTransparentComponent=t,this._changeMaterialsOnSelect(e,t,i))}_changeMaterialsOnSelect(e,t,i=!1){if(e.children.length>0&&e.children.forEach(s=>{const a=t&&e.id===t.id||i,r=!(s instanceof n);this._changeMaterialsOnSelect(s,t,(!a||!r)&&a)}),t)e instanceof n&&e.material instanceof s&&!e.userData.oldMaterial&&(e.userData.oldMaterial=e.material,e.material=e.material.clone(),i||l(e,{opacity:.2,transparent:!0}));else if(e.userData.oldMaterial&&e instanceof n&&e.material instanceof s){const{opacity:t,transparent:i}=e.userData.oldMaterial;l(e,{opacity:t,transparent:i}),e.userData.oldMaterial=void 0}}isComponentVisible(e){const t=[];e.traverse(e=>t.push(e.uuid));const i=(new a).setFromObject(e).getCenter(new r),n=(new r).subVectors(i,this._camera.position).normalize();this._raycaster.set(this._camera.position,n),this._raycaster.far=this._camera.position.distanceTo(i);const s=[];return this._raycaster.intersectObjects(this._scene.children,!0).forEach(e=>{e.object.material.visible&&(t.includes(e.object.uuid)||e.object.userData.ignoreComponentRaycast||s.push(e))}),0===s.length}checkComponentAndPreviewVisibility(e,t){e.hasSelection()?this.checkComponentVisibility(e,t):t.hasPreviews()?this.checkPreviewVisibility(t):this.changeMaterialsOnSelect(this._scene,null)}checkComponentVisibility(e,t){if(!e.hasSelection())return;const i=t.getComponentsForIds(e.getSelectedRuntimeComponentIds());if(i.length>1)return;const n=i[0];this.isComponentVisible(n)?this.changeMaterialsOnSelect(this._scene,null):this.changeMaterialsOnSelect(this._scene,n)}areAllPreviewsVisible(e){if(!e.hasPreviews())return!0;const t=e.getPreviews();return 0===t.length||t.map(e=>this.isComponentVisible(e)).reduce((e,t)=>e&&t)}areAllComponentsInFrustum(e){if(0===e.length)return!0;const t=new c,i=(new o).multiplyMatrices(this._camera.projectionMatrix,this._camera.matrixWorldInverse),n=new a;return t.setFromProjectionMatrix(i),e.map(e=>(e=>{const i=n.setFromObject(e).getCenter(new r);return t.containsPoint(i)})(e)).reduce((e,t)=>e&&t)}checkPreviewVisibility(e){e.hasPreviewLines()||(this.areAllPreviewsVisible(e)?this.changeMaterialsOnSelect(this._scene,null):this.changeMaterialsOnSelect(this._scene,{id:-1}))}})}}}));
|
|
2
|
+
//# sourceMappingURL=component-raycast-helper-980d3fcf.nomodule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-raycast-helper-980d3fcf.nomodule.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{bw as Raycaster,bL as throttle,z as Mesh,v as MeshStandardMaterial,ad as Box3,a as Vector3,bM as Frustum,k as Matrix4}from"./main-thread-to-worker-9f925ba4.js";import{a0 as transitionTransparencyOfMaterial}from"./roomle-dependency-injection-
|
|
2
|
-
//# sourceMappingURL=component-raycast-helper-
|
|
1
|
+
import{bw as Raycaster,bL as throttle,z as Mesh,v as MeshStandardMaterial,ad as Box3,a as Vector3,bM as Frustum,k as Matrix4}from"./main-thread-to-worker-9f925ba4.js";import{a0 as transitionTransparencyOfMaterial}from"./roomle-dependency-injection-986d0a8f.js";class ComponentRaycastHelper{constructor(){this._nonTransparentComponent=null,this._raycaster=new Raycaster,this._raycaster.near=.1,this._raycaster.layers.enable(3)}init(e,t){this._scene=e,this._camera=t,this.checkComponentVisibility=throttle(this.checkComponentVisibility,100).bind(this),this.checkPreviewVisibility=throttle(this.checkPreviewVisibility,100).bind(this)}changeMaterialsOnSelect(e,t,i=!1){t!==this._nonTransparentComponent&&(this._nonTransparentComponent=t,this._changeMaterialsOnSelect(e,t,i))}_changeMaterialsOnSelect(e,t,i=!1){if(e.children.length>0&&e.children.forEach(a=>{const s=t&&e.id===t.id||i,n=!(a instanceof Mesh);this._changeMaterialsOnSelect(a,t,(!s||!n)&&s)}),t)e instanceof Mesh&&e.material instanceof MeshStandardMaterial&&!e.userData.oldMaterial&&(e.userData.oldMaterial=e.material,e.material=e.material.clone(),i||transitionTransparencyOfMaterial(e,{opacity:.2,transparent:!0}));else if(e.userData.oldMaterial&&e instanceof Mesh&&e.material instanceof MeshStandardMaterial){const{opacity:t,transparent:i}=e.userData.oldMaterial;transitionTransparencyOfMaterial(e,{opacity:t,transparent:i}),e.userData.oldMaterial=void 0}}isComponentVisible(e){const t=[];e.traverse(e=>t.push(e.uuid));const i=(new Box3).setFromObject(e).getCenter(new Vector3),a=(new Vector3).subVectors(i,this._camera.position).normalize();this._raycaster.set(this._camera.position,a),this._raycaster.far=this._camera.position.distanceTo(i);const s=[];return this._raycaster.intersectObjects(this._scene.children,!0).forEach(e=>{e.object.material.visible&&(t.includes(e.object.uuid)||e.object.userData.ignoreComponentRaycast||s.push(e))}),0===s.length}checkComponentAndPreviewVisibility(e,t){e.hasSelection()?this.checkComponentVisibility(e,t):t.hasPreviews()?this.checkPreviewVisibility(t):this.changeMaterialsOnSelect(this._scene,null)}checkComponentVisibility(e,t){if(!e.hasSelection())return;const i=t.getComponentsForIds(e.getSelectedRuntimeComponentIds());if(i.length>1)return;const a=i[0];this.isComponentVisible(a)?this.changeMaterialsOnSelect(this._scene,null):this.changeMaterialsOnSelect(this._scene,a)}areAllPreviewsVisible(e){if(!e.hasPreviews())return!0;const t=e.getPreviews();return 0===t.length||t.map(e=>this.isComponentVisible(e)).reduce((e,t)=>e&&t)}areAllComponentsInFrustum(e){if(0===e.length)return!0;const t=new Frustum,i=(new Matrix4).multiplyMatrices(this._camera.projectionMatrix,this._camera.matrixWorldInverse),a=new Box3;return t.setFromProjectionMatrix(i),e.map(e=>(e=>{const i=a.setFromObject(e).getCenter(new Vector3);return t.containsPoint(i)})(e)).reduce((e,t)=>e&&t)}checkPreviewVisibility(e){e.hasPreviewLines()||(this.areAllPreviewsVisible(e)?this.changeMaterialsOnSelect(this._scene,null):this.changeMaterialsOnSelect(this._scene,{id:-1}))}}export{ComponentRaycastHelper as default};
|
|
2
|
+
//# sourceMappingURL=component-raycast-helper-b15ddcb0.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-raycast-helper-b15ddcb0.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{S as ScriptLoader,M as Main}from"./script-loader-
|
|
2
|
-
//# sourceMappingURL=configurator-
|
|
1
|
+
import{S as ScriptLoader,M as Main}from"./script-loader-917e8941.js";import{D as DependencyInjectionAssignment,L as Logger,R as RapiAccess,a as DataSyncer,C as ConfiguratorViewModel,b as RoomleDependencyInjection,A as AppContext}from"./roomle-dependency-injection-986d0a8f.js";import{C as CameraControl3D,a as CameraControl}from"./scene-manager-9231df1b.js";import ComponentRaycastHelper from"./component-raycast-helper-b15ddcb0.js";import{C as ConfiguratorSceneManager,R as RoomleConfigurator}from"./roomle-configurator-38816c54.js";import"./query-params-helper-a271f9dc.js";import"./main-thread-to-worker-9f925ba4.js";import"./default-light-setting-a195c619.js";const INJECTABLES=[new DependencyInjectionAssignment("logger",Logger),new DependencyInjectionAssignment("rapi-access",RapiAccess),new DependencyInjectionAssignment("script-loader",ScriptLoader),new DependencyInjectionAssignment("camera-control-3d",CameraControl3D),new DependencyInjectionAssignment("camera-control",CameraControl),new DependencyInjectionAssignment("data-syncer",DataSyncer),new DependencyInjectionAssignment("configurator-scene-manager",ConfiguratorSceneManager,1),new DependencyInjectionAssignment("configurator-view-model",ConfiguratorViewModel,1),new DependencyInjectionAssignment("component-raycast-helper",ComponentRaycastHelper,0)];class Configurator extends Main{setupDependencies(){RoomleDependencyInjection.setup(INJECTABLES),this.lookup("planner-kernel-access",this._context).init(1),this.lookup("rapi-access",this._context),this.lookup("script-loader",this._context),this.lookup("logger",this._context)}cleanUpGlobals(){delete window.RoomleConfigurator}cleanUpDependencies(){const e=this.lookup("script-loader"),n=this.lookup("rapi-access");this.lookup("dom-helper");const o=this.lookup("configurator-scene-manager");e&&e.cleanUp(),n&&n.cleanUp(),o&&o.cleanUp()}setupGlobals(e){const{kernelInstance:n,kernelContainer:o,planObjectId:t}=e||{};AppContext.init({kernelInstance:n,kernelContainer:o,planObjectId:t})}getApi(){return this._configurator}bootFinished(){this._configurator=new RoomleConfigurator(this._context),this._configurator.getMain=()=>this,window.RoomleConfigurator||(window.RoomleConfigurator=this._configurator)}getContextName(){return"configurator"}}export{Configurator};
|
|
2
|
+
//# sourceMappingURL=configurator-04686014.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configurator-04686014.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./script-loader-
|
|
2
|
-
//# sourceMappingURL=configurator-
|
|
1
|
+
System.register(["./script-loader-c2a01bb0.nomodule.js","./roomle-dependency-injection-5b1f09d5.nomodule.js","./scene-manager-9b770743.nomodule.js","./component-raycast-helper-980d3fcf.nomodule.js","./roomle-configurator-5bfe9ed9.nomodule.js","./query-params-helper-c231e1b8.nomodule.js","./main-thread-to-worker-a8fb30c0.nomodule.js","./default-light-setting-41fc1fb0.nomodule.js"],(function(e){var n,o,t,r,c,i,a,s,l,u,p,d,f,g;return{setters:[function(e){n=e.S,o=e.M},function(e){t=e.D,r=e.L,c=e.R,i=e.a,a=e.C,s=e.b,l=e.A},function(e){u=e.C,p=e.a},function(e){d=e.default},function(e){f=e.C,g=e.R},function(){},function(){},function(){}],execute:function(){const m=[new t("logger",r),new t("rapi-access",c),new t("script-loader",n),new t("camera-control-3d",u),new t("camera-control",p),new t("data-syncer",i),new t("configurator-scene-manager",f,1),new t("configurator-view-model",a,1),new t("component-raycast-helper",d,0)];e("Configurator",class extends o{setupDependencies(){s.setup(m),this.lookup("planner-kernel-access",this._context).init(1),this.lookup("rapi-access",this._context),this.lookup("script-loader",this._context),this.lookup("logger",this._context)}cleanUpGlobals(){delete window.RoomleConfigurator}cleanUpDependencies(){const e=this.lookup("script-loader"),n=this.lookup("rapi-access");this.lookup("dom-helper");const o=this.lookup("configurator-scene-manager");e&&e.cleanUp(),n&&n.cleanUp(),o&&o.cleanUp()}setupGlobals(e){const{kernelInstance:n,kernelContainer:o,planObjectId:t}=e||{};l.init({kernelInstance:n,kernelContainer:o,planObjectId:t})}getApi(){return this._configurator}bootFinished(){this._configurator=new g(this._context),this._configurator.getMain=()=>this,window.RoomleConfigurator||(window.RoomleConfigurator=this._configurator)}getContextName(){return"configurator"}})}}}));
|
|
2
|
+
//# sourceMappingURL=configurator-faf33eba.nomodule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configurator-faf33eba.nomodule.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Configurator}from"./configurator-04686014.js";import"./script-loader-917e8941.js";import"./query-params-helper-a271f9dc.js";import"./roomle-dependency-injection-986d0a8f.js";import"./main-thread-to-worker-9f925ba4.js";import"./scene-manager-9231df1b.js";import"./component-raycast-helper-b15ddcb0.js";import"./roomle-configurator-38816c54.js";import"./default-light-setting-a195c619.js";(new Configurator).boot(),window.requestIdleCallback||(window.requestIdleCallback=e=>setTimeout(()=>{let o=Date.now();e({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-o))})},1)),window.cancelIdleCallback||(window.cancelIdleCallback=window.cancelIdleCallback||function(e){clearTimeout(e)});
|
|
2
|
+
//# sourceMappingURL=configurator-main-0aad247f.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configurator-main-0aad247f.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./configurator-
|
|
1
|
+
System.register(["./configurator-faf33eba.nomodule.js","./script-loader-c2a01bb0.nomodule.js","./query-params-helper-c231e1b8.nomodule.js","./roomle-dependency-injection-5b1f09d5.nomodule.js","./main-thread-to-worker-a8fb30c0.nomodule.js","./scene-manager-9b770743.nomodule.js","./component-raycast-helper-980d3fcf.nomodule.js","./roomle-configurator-5bfe9ed9.nomodule.js","./default-light-setting-41fc1fb0.nomodule.js"],(function(){var e;return{setters:[function(n){e=n.Configurator},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function(){(new e).boot(),window.requestIdleCallback||(window.requestIdleCallback=e=>setTimeout(()=>{let n=Date.now();e({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-n))})},1)),window.cancelIdleCallback||(window.cancelIdleCallback=window.cancelIdleCallback||function(e){clearTimeout(e)})}}}));
|
|
2
2
|
//# sourceMappingURL=configurator-main.nomodule.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./roomle-dependency-injection-
|
|
2
|
-
//# sourceMappingURL=continuous-drawing-helper-
|
|
1
|
+
System.register(["./roomle-dependency-injection-5b1f09d5.nomodule.js","./main-thread-to-worker-a8fb30c0.nomodule.js"],(function(e){var i,t,r,n,s;return{setters:[function(e){i=e.a5},function(e){t=e.a_,r=e.h,n=e.w,s=e.z}],execute:function(){e("default",class{constructor(){this._currentInnerRadius=0}init(e,i,t){this._drawingGroup=e,this._continuousDrawingManager=i,this._kernelZoomFactor=t,this.update()}update(){this._initCircle(),this._updateCircle()}_initCircle(){if(this._circleMesh)return;const e=70/this._kernelZoomFactor/1e3,i=new t(e,e+e/50,32),c=new r({color:10066329,side:n});this._circleMesh=new s(i,c),this._circleMesh.name="Circle",this._circleMesh.rotation.set(Math.PI/2,0,0),this._circleMesh.visible=this._continuousDrawingManager.shouldShowCircle(),this._drawingGroup.add(this._circleMesh)}_updateCircle(){if(!this._circleMesh)return;const e=70/this._kernelZoomFactor/1e3;if(e!==this._currentInnerRadius){const i=e+e/50;this._circleMesh.geometry=new t(e,i,32)}const r=i(this._continuousDrawingManager.getStartPoint());r.y=5,this._circleMesh.position.copy(r),this._circleMesh.visible=this._continuousDrawingManager.shouldShowCircle(),this._currentInnerRadius=e}setKernelZoomFactor(e){this._kernelZoomFactor=e}endDrawing(){this._drawingGroup.remove(this._circleMesh),this._circleMesh=null}})}}}));
|
|
2
|
+
//# sourceMappingURL=continuous-drawing-helper-6dfed572.nomodule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"continuous-drawing-helper-6dfed572.nomodule.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a5 as convertToTHREE}from"./roomle-dependency-injection-
|
|
2
|
-
//# sourceMappingURL=continuous-drawing-helper-
|
|
1
|
+
import{a5 as convertToTHREE}from"./roomle-dependency-injection-986d0a8f.js";import{a_ as RingGeometry,h as MeshBasicMaterial,w as DoubleSide,z as Mesh}from"./main-thread-to-worker-9f925ba4.js";class ContinuousDrawingHelper{constructor(){this._currentInnerRadius=0}init(e,i,r){this._drawingGroup=e,this._continuousDrawingManager=i,this._kernelZoomFactor=r,this.update()}update(){this._initCircle(),this._updateCircle()}_initCircle(){if(this._circleMesh)return;const e=70/this._kernelZoomFactor/1e3,i=new RingGeometry(e,e+e/50,32),r=new MeshBasicMaterial({color:10066329,side:DoubleSide});this._circleMesh=new Mesh(i,r),this._circleMesh.name="Circle",this._circleMesh.rotation.set(Math.PI/2,0,0),this._circleMesh.visible=this._continuousDrawingManager.shouldShowCircle(),this._drawingGroup.add(this._circleMesh)}_updateCircle(){if(!this._circleMesh)return;const e=70/this._kernelZoomFactor/1e3;if(e!==this._currentInnerRadius){const i=e+e/50;this._circleMesh.geometry=new RingGeometry(e,i,32)}const i=convertToTHREE(this._continuousDrawingManager.getStartPoint());i.y=5,this._circleMesh.position.copy(i),this._circleMesh.visible=this._continuousDrawingManager.shouldShowCircle(),this._currentInnerRadius=e}setKernelZoomFactor(e){this._kernelZoomFactor=e}endDrawing(){this._drawingGroup.remove(this._circleMesh),this._circleMesh=null}}export{ContinuousDrawingHelper as default};
|
|
2
|
+
//# sourceMappingURL=continuous-drawing-helper-936b58cd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"continuous-drawing-helper-936b58cd.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./scene-manager-
|
|
2
|
-
//# sourceMappingURL=default-light-setting-
|
|
1
|
+
System.register(["./scene-manager-9b770743.nomodule.js","./roomle-dependency-injection-5b1f09d5.nomodule.js","./main-thread-to-worker-a8fb30c0.nomodule.js"],(function(i){var t,a,e,n,o,s,h;return{setters:[function(i){t=i.L},function(i){a=i.Q},function(i){e=i.D,n=i.C,o=i.V,s=i.a,h=i.A}],execute:function(){i("D",class extends t{constructor(i,t){super(i,t),this._params={ambientLight:{color:"#ffffff"},mainDirLight:{position:{x:-3,y:4,z:4},color:"#ffffff"},secondDirLight:{position:{x:3,y:4,z:3},color:"#ffffff"}},this._mainDirectionalLight=new e(new n(this._params.mainDirLight.color),.8),this._mainDirectionalLight.position.set(this._params.mainDirLight.position.x,this._params.mainDirLight.position.y,this._params.mainDirLight.position.z),this._mainDirectionalLight.layers.set(1),this._mainDirectionalLight.castShadow=!0,this._mainDirectionalLight.shadow.camera.near=.1,this._mainDirectionalLight.shadow.camera.far=100,this._mainDirectionalLight.shadow.mapSize=new o(1024,1024),this._mainDirectionalLight.visible=!0,this._mainDirectionalLight.lookAt(new s(0,0,0)),this._secondDirectionalLight=new e(new n(this._params.secondDirLight.color),.2),this._secondDirectionalLight.position.set(this._params.secondDirLight.position.x,this._params.secondDirLight.position.y,this._params.secondDirLight.position.z),this._secondDirectionalLight.layers.set(1),this._secondDirectionalLight.castShadow=!1,this._secondDirectionalLight.shadow.camera.near=.1,this._secondDirectionalLight.shadow.camera.far=100,this._secondDirectionalLight.shadow.mapSize=new o(1024,1024),this._secondDirectionalLight.visible=!0,this._secondDirectionalLight.lookAt(new s(0,0,0)),this._ambientLight=new h(new n(this._params.ambientLight.color),.5),this._ambientLight.layers.set(1),this.addToScene()}needsBounds(){return!0}updateBounds(i){const t=i.getSize(new s),a=Math.max(Math.max(t.x,t.y),t.z)+1,e=a/2;this._mainDirectionalLight.shadow.camera.top=e,this._mainDirectionalLight.shadow.camera.bottom=-e,this._mainDirectionalLight.shadow.camera.left=-e,this._mainDirectionalLight.shadow.camera.right=e,this._mainDirectionalLight.shadow.camera.near=.01,this._mainDirectionalLight.shadow.camera.far=4*a,this._mainDirectionalLight.shadow.camera.updateProjectionMatrix(),this._secondDirectionalLight.shadow.camera.top=e,this._secondDirectionalLight.shadow.camera.bottom=-e,this._secondDirectionalLight.shadow.camera.left=-e,this._secondDirectionalLight.shadow.camera.right=e,this._secondDirectionalLight.shadow.camera.near=.01,this._secondDirectionalLight.shadow.camera.far=4*a,this._secondDirectionalLight.shadow.camera.updateProjectionMatrix()}addToScene(){this._scene.add(this._mainDirectionalLight),this._scene.add(this._secondDirectionalLight),this._scene.add(this._ambientLight)}removeFromScene(){this._scene.remove(this._mainDirectionalLight),this._scene.remove(this._secondDirectionalLight),this._scene.remove(this._ambientLight)}reload(){this.removeFromScene(),this.addToScene()}showGUI(){let i=a();if(i){if(this._ambientLight){let t=i.addFolder("Ambient Light");t.add(this._ambientLight,"visible"),t.add(this._ambientLight,"intensity").min(0).max(5).step(.1),t.addColor(this._params.ambientLight,"color").onChange(i=>this._ambientLight.color=new n(i))}if(this._mainDirectionalLight){let t=i.addFolder("Main Directional Light");t.add(this._mainDirectionalLight,"visible"),t.add(this._mainDirectionalLight,"intensity").min(0).max(10).step(.1),t.add(this._mainDirectionalLight,"castShadow"),t.addColor(this._params.mainDirLight,"color").onChange(i=>this._mainDirectionalLight.color=new n(i)),t.add(this._mainDirectionalLight.position,"x").min(-10).max(10).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new s(0,0,0))),t.add(this._mainDirectionalLight.position,"y").min(-10).max(50).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new s(0,0,0))),t.add(this._mainDirectionalLight.position,"z").min(-10).max(10).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new s(0,0,0)))}if(this._secondDirectionalLight){let t=i.addFolder("Second Directional Light");t.add(this._secondDirectionalLight,"visible"),t.add(this._secondDirectionalLight,"intensity").min(0).max(10).step(.1),t.add(this._secondDirectionalLight,"castShadow"),t.addColor(this._params.mainDirLight,"color").onChange(i=>this._mainDirectionalLight.color=new n(i)),t.add(this._secondDirectionalLight.position,"x").min(-10).max(10).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new s(0,0,0))),t.add(this._secondDirectionalLight.position,"y").min(-10).max(50).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new s(0,0,0))),t.add(this._secondDirectionalLight.position,"z").min(-10).max(10).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new s(0,0,0)))}}}})}}}));
|
|
2
|
+
//# sourceMappingURL=default-light-setting-41fc1fb0.nomodule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-light-setting-41fc1fb0.nomodule.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{L as LightSetting}from"./scene-manager-
|
|
2
|
-
//# sourceMappingURL=default-light-setting-
|
|
1
|
+
import{L as LightSetting}from"./scene-manager-9231df1b.js";import{Q as getGUI}from"./roomle-dependency-injection-986d0a8f.js";import{D as DirectionalLight,C as Color,V as Vector2,a as Vector3,A as AmbientLight}from"./main-thread-to-worker-9f925ba4.js";class DefaultLightSetting extends LightSetting{constructor(i,t){super(i,t),this._params={ambientLight:{color:"#ffffff"},mainDirLight:{position:{x:-3,y:4,z:4},color:"#ffffff"},secondDirLight:{position:{x:3,y:4,z:3},color:"#ffffff"}},this._mainDirectionalLight=new DirectionalLight(new Color(this._params.mainDirLight.color),.8),this._mainDirectionalLight.position.set(this._params.mainDirLight.position.x,this._params.mainDirLight.position.y,this._params.mainDirLight.position.z),this._mainDirectionalLight.layers.set(1),this._mainDirectionalLight.castShadow=!0,this._mainDirectionalLight.shadow.camera.near=.1,this._mainDirectionalLight.shadow.camera.far=100,this._mainDirectionalLight.shadow.mapSize=new Vector2(1024,1024),this._mainDirectionalLight.visible=!0,this._mainDirectionalLight.lookAt(new Vector3(0,0,0)),this._secondDirectionalLight=new DirectionalLight(new Color(this._params.secondDirLight.color),.2),this._secondDirectionalLight.position.set(this._params.secondDirLight.position.x,this._params.secondDirLight.position.y,this._params.secondDirLight.position.z),this._secondDirectionalLight.layers.set(1),this._secondDirectionalLight.castShadow=!1,this._secondDirectionalLight.shadow.camera.near=.1,this._secondDirectionalLight.shadow.camera.far=100,this._secondDirectionalLight.shadow.mapSize=new Vector2(1024,1024),this._secondDirectionalLight.visible=!0,this._secondDirectionalLight.lookAt(new Vector3(0,0,0)),this._ambientLight=new AmbientLight(new Color(this._params.ambientLight.color),.5),this._ambientLight.layers.set(1),this.addToScene()}needsBounds(){return!0}updateBounds(i){const t=i.getSize(new Vector3),a=Math.max(Math.max(t.x,t.y),t.z)+1,o=a/2;this._mainDirectionalLight.shadow.camera.top=o,this._mainDirectionalLight.shadow.camera.bottom=-o,this._mainDirectionalLight.shadow.camera.left=-o,this._mainDirectionalLight.shadow.camera.right=o,this._mainDirectionalLight.shadow.camera.near=.01,this._mainDirectionalLight.shadow.camera.far=4*a,this._mainDirectionalLight.shadow.camera.updateProjectionMatrix(),this._secondDirectionalLight.shadow.camera.top=o,this._secondDirectionalLight.shadow.camera.bottom=-o,this._secondDirectionalLight.shadow.camera.left=-o,this._secondDirectionalLight.shadow.camera.right=o,this._secondDirectionalLight.shadow.camera.near=.01,this._secondDirectionalLight.shadow.camera.far=4*a,this._secondDirectionalLight.shadow.camera.updateProjectionMatrix()}addToScene(){this._scene.add(this._mainDirectionalLight),this._scene.add(this._secondDirectionalLight),this._scene.add(this._ambientLight)}removeFromScene(){this._scene.remove(this._mainDirectionalLight),this._scene.remove(this._secondDirectionalLight),this._scene.remove(this._ambientLight)}reload(){this.removeFromScene(),this.addToScene()}showGUI(){let i=getGUI();if(i){if(this._ambientLight){let t=i.addFolder("Ambient Light");t.add(this._ambientLight,"visible"),t.add(this._ambientLight,"intensity").min(0).max(5).step(.1),t.addColor(this._params.ambientLight,"color").onChange(i=>this._ambientLight.color=new Color(i))}if(this._mainDirectionalLight){let t=i.addFolder("Main Directional Light");t.add(this._mainDirectionalLight,"visible"),t.add(this._mainDirectionalLight,"intensity").min(0).max(10).step(.1),t.add(this._mainDirectionalLight,"castShadow"),t.addColor(this._params.mainDirLight,"color").onChange(i=>this._mainDirectionalLight.color=new Color(i)),t.add(this._mainDirectionalLight.position,"x").min(-10).max(10).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new Vector3(0,0,0))),t.add(this._mainDirectionalLight.position,"y").min(-10).max(50).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new Vector3(0,0,0))),t.add(this._mainDirectionalLight.position,"z").min(-10).max(10).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new Vector3(0,0,0)))}if(this._secondDirectionalLight){let t=i.addFolder("Second Directional Light");t.add(this._secondDirectionalLight,"visible"),t.add(this._secondDirectionalLight,"intensity").min(0).max(10).step(.1),t.add(this._secondDirectionalLight,"castShadow"),t.addColor(this._params.mainDirLight,"color").onChange(i=>this._mainDirectionalLight.color=new Color(i)),t.add(this._secondDirectionalLight.position,"x").min(-10).max(10).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new Vector3(0,0,0))),t.add(this._secondDirectionalLight.position,"y").min(-10).max(50).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new Vector3(0,0,0))),t.add(this._secondDirectionalLight.position,"z").min(-10).max(10).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new Vector3(0,0,0)))}}}}export{DefaultLightSetting as D};
|
|
2
|
+
//# sourceMappingURL=default-light-setting-a195c619.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-light-setting-a195c619.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -2,8 +2,13 @@ import type { RapiBaseColor, RapiItem, RapiJson, RapiMaterial, RapiPrice, RapiSk
|
|
|
2
2
|
import { RAPI_TEXTURE_TYPE } from '../../typings/rapi-types';
|
|
3
3
|
export declare const cloneMockObject: (object: any) => any;
|
|
4
4
|
export declare const MOCK_RAPI_BASE_COLOR: RapiBaseColor;
|
|
5
|
+
export declare const MOCK_RAPI_EMISSIVE_COLOR: RapiBaseColor;
|
|
6
|
+
export declare const MOCK_RAPI_SHEEN_COLOR: RapiBaseColor;
|
|
7
|
+
export declare const MOCK_RAPI_SPECULAR_COLOR: RapiBaseColor;
|
|
8
|
+
export declare const MOCK_RAPI_ATTENUATION_COLOR: RapiBaseColor;
|
|
5
9
|
export declare const MOCK_RAPI_TEXTURES_EMPTY: any[];
|
|
6
10
|
export declare const MOCK_RAPI_MATERIAL: RapiMaterial;
|
|
11
|
+
export declare const MOCK_RAPI_MATERIAL_V2: RapiMaterial;
|
|
7
12
|
export declare const MOCK_RAPI_MATERIAL_NO_TEXTURES: RapiMaterial;
|
|
8
13
|
export declare const MOCK_RAPI_TENANT: RapiTenant;
|
|
9
14
|
export declare const MOCK_RAPI_SKIN: RapiSkin;
|
|
@@ -28,7 +28,7 @@ export declare const createColorTexture: (red: number, green: number, blue: numb
|
|
|
28
28
|
export declare const createColorCubeTexture: (red: number, green: number, blue: number, alpha: number) => CubeTexture;
|
|
29
29
|
export declare const createMaterial: (material: RapiMaterial) => MeshPhysicalMaterial;
|
|
30
30
|
export declare const setMaterial: (meshPhysicalMaterial: MeshPhysicalMaterial, rapiMaterial: RapiMaterial) => MeshPhysicalMaterial;
|
|
31
|
-
export declare const getMaterialShading: (material: MeshPhysicalMaterial) => RapiMaterialShading;
|
|
31
|
+
export declare const getMaterialShading: (material: MeshPhysicalMaterial, version?: number) => RapiMaterialShading;
|
|
32
32
|
export declare const logColor: (color: Color) => void;
|
|
33
33
|
export declare const createTexture: (texture: Texture, rapiTexture: RapiTexture, width: number, height: number, maxAnisotropy: number) => Texture;
|
|
34
34
|
export declare const addTexture: (assetUrl: AssetUrl, rapiTexture: RapiTexture, material: MeshPhysicalMaterial, maxAnisotropy: number, repeatWidth: number, repeatHeight: number, maxTextures?: number) => Promise<void>;
|
|
@@ -3,10 +3,20 @@ import type { Nullable } from '../../../typings/helper';
|
|
|
3
3
|
import type { PlanObject } from '../../../typings/planner';
|
|
4
4
|
import type { Position2, Position3 } from '../common-interfaces';
|
|
5
5
|
import PlanElementViewModel from './plan-element-view-model';
|
|
6
|
-
import
|
|
6
|
+
import { Vector3 } from 'three';
|
|
7
7
|
type ObjectWallDimensionDefinition<Vector2Type = Vector3 | Position2, Vector3Type = Vector3 | Position3> = MeasurementBase<Vector2Type, Vector3Type>;
|
|
8
8
|
export type ObjectWallDimension = ObjectWallDimensionDefinition<Vector3, Vector3>;
|
|
9
9
|
export type ObjectToWallDimensionTransferable = ObjectWallDimensionDefinition<Position2, Position3>;
|
|
10
|
+
interface ObjectMeasurements {
|
|
11
|
+
rectMeasurements: ObjectWallDimension[];
|
|
12
|
+
objectMeasurements: ObjectWallDimension[];
|
|
13
|
+
objectToWallsMeasurements: ObjectWallDimension[];
|
|
14
|
+
}
|
|
15
|
+
export interface ObjectMeasurementsTransferable {
|
|
16
|
+
rectMeasurements: ObjectToWallDimensionTransferable[];
|
|
17
|
+
objectMeasurements: ObjectToWallDimensionTransferable[];
|
|
18
|
+
objectToWallsMeasurements: ObjectToWallDimensionTransferable[];
|
|
19
|
+
}
|
|
10
20
|
export declare const objectToWallDimensionToTransferable: (objectWallDimension: ObjectWallDimension) => ObjectToWallDimensionTransferable;
|
|
11
21
|
export default class PlanObjectViewModel extends PlanElementViewModel {
|
|
12
22
|
private _initDone;
|
|
@@ -18,7 +28,7 @@ export default class PlanObjectViewModel extends PlanElementViewModel {
|
|
|
18
28
|
isInitDone(): Promise<void>;
|
|
19
29
|
getPlanObject(): PlanObject;
|
|
20
30
|
getSize(): Vector3;
|
|
21
|
-
|
|
31
|
+
getObjectMeasurements(zoomFactor: number): Nullable<ObjectMeasurements>;
|
|
22
32
|
update(): void;
|
|
23
33
|
}
|
|
24
34
|
export {};
|
|
@@ -28,6 +28,8 @@ export default class MeshGenerator implements Context {
|
|
|
28
28
|
protected _generateGeometry(meshId: string, vertices: Int32Array, indices: Int32Array, uvCoords: Float32Array, normals: Float32Array): BufferGeometry;
|
|
29
29
|
changeMaterialOfMesh(mesh: Mesh, material: Material, materialAttributes?: Record<string, string>): void;
|
|
30
30
|
private _updateMaterialProperties;
|
|
31
|
+
private _updateStandardMaterialProperties;
|
|
32
|
+
private _updatePhysicalMaterialProperties;
|
|
31
33
|
protected _createMaterial(materialId: string, resolve: () => void, reject: (error: Error) => void, width?: number, height?: number): void;
|
|
32
34
|
private _loadBenchmarkTextures;
|
|
33
35
|
protected _loadTextures(rapiMaterial: RapiMaterial, material: MeshPhysicalMaterial, width?: number, height?: number): Promise<void>;
|
|
@@ -33,7 +33,7 @@ export default class RoomleMaterialViewer implements GlobalAPI, Context, Externa
|
|
|
33
33
|
loadMaterialId(materialId: RapiId, options?: {
|
|
34
34
|
flushCache?: boolean;
|
|
35
35
|
}): Promise<void>;
|
|
36
|
-
getMaterialShading(): RapiMaterialShading;
|
|
36
|
+
getMaterialShading(version?: number): RapiMaterialShading;
|
|
37
37
|
/**
|
|
38
38
|
* Loads a SceneSettings object, currently it can can contain a light setting definition
|
|
39
39
|
* (see {@link @roomle/web-sdk/configurator-core/src/roomle-configurator#RoomleConfigurator.loadDynamicLightSetting}) and an environment definition (see {@link @roomle/web-sdk/common-core/src/environment/dynamic-environment-setting-loader#EnvironmentSetting}).
|
|
@@ -28,7 +28,7 @@ export default class MaterialViewerSceneManager extends SceneManager {
|
|
|
28
28
|
loadMaterial(material: RapiMaterial): Promise<void>;
|
|
29
29
|
loadMaterialShading(materialShading: RapiMaterialShading): Promise<void>;
|
|
30
30
|
private _setMaterial;
|
|
31
|
-
getMaterialShading(): RapiMaterialShading;
|
|
31
|
+
getMaterialShading(version?: number): RapiMaterialShading;
|
|
32
32
|
protected createCameraControl(_mode: Enumify<typeof CAMERA_TYPE>, _offset: CanvasOffset): void;
|
|
33
33
|
protected _getInputManager(): InputManager;
|
|
34
34
|
sceneChanged(): void;
|
|
@@ -10,7 +10,7 @@ import type PlanElementViewModel from '../../common-core/src/view-model/plan-ele
|
|
|
10
10
|
import type { Enumify } from '../../common-core/src/types';
|
|
11
11
|
import type { CallbackObjectType } from './utils/planner-scene-manager';
|
|
12
12
|
import type { ConstructionMeasurementsTransferable } from './view-model/construction-plan-object-view-model';
|
|
13
|
-
import type {
|
|
13
|
+
import type { ObjectMeasurementsTransferable } from '../../common-core/src/view-model/plan-object-view-model';
|
|
14
14
|
export interface SelectionPayload {
|
|
15
15
|
item?: RapiItem;
|
|
16
16
|
configuration?: RapiConfiguration;
|
|
@@ -97,9 +97,9 @@ export default class RoomlePlannerUiCallback extends UiCallback {
|
|
|
97
97
|
* This function gets called when the camera has stopped moving,
|
|
98
98
|
* allowing for the calculation of the dimensions of plan element position.
|
|
99
99
|
* It is also called when the element is selected or dragged on the plan.
|
|
100
|
-
* @param
|
|
100
|
+
* @param objectMeasurements The measurements of plan element related to the walls plus object dimensions.
|
|
101
101
|
*/
|
|
102
|
-
|
|
102
|
+
onUpdateObjectMeasurements: (objectMeasurements: ObjectMeasurementsTransferable) => void;
|
|
103
103
|
/**
|
|
104
104
|
* This function gets called when the camera is moving and thus the wall dimensions should not be shown
|
|
105
105
|
*/
|
|
@@ -306,5 +306,5 @@ export default class RoomlePlanner implements KernelAccessCallbackI, RoomlePlann
|
|
|
306
306
|
* @param options PrepareImageOptions
|
|
307
307
|
*/
|
|
308
308
|
preparePerspectiveImageOf(runtimeId: RuntimeId, options?: PrepareImageOptions): Promise<import("../../common-core/src/common-interfaces").Base64Image>;
|
|
309
|
-
|
|
309
|
+
generateTCExport(planObjectIds?: string[]): Promise<any>;
|
|
310
310
|
}
|
|
@@ -133,7 +133,8 @@ export default class PlannerSceneManager extends ConfiguratorSceneManager implem
|
|
|
133
133
|
private _sendPlanObjectPositions;
|
|
134
134
|
private _updateMeasurementPositions;
|
|
135
135
|
private _sendElementMeasurements;
|
|
136
|
-
private
|
|
136
|
+
private _sendObjectMeasurements;
|
|
137
|
+
private transformMeasurements;
|
|
137
138
|
private _sendConstructionElementDimensions;
|
|
138
139
|
private _sendWallDimensions;
|
|
139
140
|
enableWallDrawing(): void;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { ConfiguratorKernelClass, KernelCube, KernelEnum, KernelObjectPtrList, KernelPlanObject, KernelVector3, ObjectGroupPtr, RuntimeId } from './kernel';
|
|
1
|
+
import type { ConfiguratorKernelClass, KernelCube, KernelEnum, KernelObjectPtrList, KernelPlanObject, KernelVector3, KernelVector3f, ObjectGroupPtr, RuntimeId } from './kernel';
|
|
2
2
|
import type { DrawingType, KernelPlanObjectList, PlanObjectList, ResizingAnchor, WallExtensionType, WALL_SIDES } from './planner-kernel-container';
|
|
3
3
|
import type { Position2 } from '../common-core/src/common-interfaces';
|
|
4
4
|
import type { Enumify } from '../common-core/src/types';
|
|
5
|
-
import
|
|
5
|
+
import * as ems from './ems';
|
|
6
|
+
declare const EmsArray: typeof ems.EmsArray;
|
|
6
7
|
export interface EMSReference {
|
|
7
8
|
jsObject: any;
|
|
8
9
|
delete(): any;
|
|
@@ -31,12 +32,34 @@ export interface PlanElement extends KernelObject {
|
|
|
31
32
|
getMeshCenter(): KernelVector3;
|
|
32
33
|
getId(): number;
|
|
33
34
|
}
|
|
35
|
+
export interface RectangleReferencePoints {
|
|
36
|
+
bottom: KernelVector3;
|
|
37
|
+
bottomLeft: KernelVector3;
|
|
38
|
+
bottomRight: KernelVector3;
|
|
39
|
+
center: KernelVector3;
|
|
40
|
+
left: KernelVector3;
|
|
41
|
+
right: KernelVector3;
|
|
42
|
+
top: KernelVector3;
|
|
43
|
+
topLeft: KernelVector3;
|
|
44
|
+
topRight: KernelVector3;
|
|
45
|
+
}
|
|
34
46
|
export interface ObjectToWallLine {
|
|
35
47
|
angle: number;
|
|
36
48
|
endPoint: KernelVector3;
|
|
37
49
|
length: number;
|
|
38
50
|
startPoint: KernelVector3;
|
|
39
51
|
}
|
|
52
|
+
declare class PointArray extends EmsArray<KernelVector3f> {
|
|
53
|
+
}
|
|
54
|
+
declare class ObjectToWallLineArray extends EmsArray<ObjectToWallLine> {
|
|
55
|
+
}
|
|
56
|
+
export interface Rectangle {
|
|
57
|
+
angle: number;
|
|
58
|
+
center: KernelVector3f;
|
|
59
|
+
cornerPoints: PointArray;
|
|
60
|
+
referencePoints: RectangleReferencePoints;
|
|
61
|
+
size: KernelVector3f;
|
|
62
|
+
}
|
|
40
63
|
export interface PlanObject extends PlanElement {
|
|
41
64
|
size: KernelVector3;
|
|
42
65
|
rotation: number;
|
|
@@ -49,7 +72,8 @@ export interface PlanObject extends PlanElement {
|
|
|
49
72
|
getCatalogItemId(): string;
|
|
50
73
|
getConfigurationRuntimeId(): number;
|
|
51
74
|
getObjectType(): string;
|
|
52
|
-
getWallDistances():
|
|
75
|
+
getWallDistances(): ObjectToWallLineArray;
|
|
76
|
+
getRectangle(): Rectangle;
|
|
53
77
|
}
|
|
54
78
|
export interface WallSide {
|
|
55
79
|
value: Enumify<typeof WALL_SIDES>;
|
|
@@ -55,6 +55,7 @@ export interface RapiMeshData {
|
|
|
55
55
|
[key: string]: number | string | RapiId;
|
|
56
56
|
}
|
|
57
57
|
export interface RapiMaterialShading {
|
|
58
|
+
version?: string;
|
|
58
59
|
alpha: number;
|
|
59
60
|
metallic: number;
|
|
60
61
|
specularity?: number;
|
|
@@ -64,7 +65,21 @@ export interface RapiMaterialShading {
|
|
|
64
65
|
alphaCutoff?: number;
|
|
65
66
|
occlusion?: number;
|
|
66
67
|
transmission?: number;
|
|
67
|
-
|
|
68
|
+
reflectivity?: number;
|
|
69
|
+
transmissionIOR?: number;
|
|
70
|
+
emissiveColor?: RapiBaseColor;
|
|
71
|
+
emissiveIntensity?: number;
|
|
72
|
+
clearcoatIntensity?: number;
|
|
73
|
+
clearcoatRoughness?: number;
|
|
74
|
+
clearcoatNormalScale?: number;
|
|
75
|
+
sheenColor?: RapiBaseColor;
|
|
76
|
+
sheenIntensity?: number;
|
|
77
|
+
sheenRoughness?: number;
|
|
78
|
+
specularColor?: RapiBaseColor;
|
|
79
|
+
thicknessFactor?: number;
|
|
80
|
+
attenuationColor?: RapiBaseColor;
|
|
81
|
+
attenuationDistance?: number;
|
|
82
|
+
[key: string]: number | boolean | string | RapiBaseColor;
|
|
68
83
|
}
|
|
69
84
|
export interface RapiMaterial extends RapiJson {
|
|
70
85
|
id: RapiId;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{o as dispose,_ as __decorate,i as inject,ae as AsyncGuard,aA as AsyncDependencyLoader}from"./roomle-dependency-injection-a3480854.js";import{O as Object3D,a as Vector3,h as MeshBasicMaterial,w as DoubleSide,bn as MeshPhongMaterial,B as BufferGeometry,z as Mesh,Q as Quaternion,bb as PlaneGeometry,u as LineBasicMaterial,G as Line,b as BufferAttribute,aY as Line3,ad as Box3}from"./main-thread-to-worker-9f925ba4.js";import{T as TextGeometry}from"./TextGeometry-2f1b3194.js";const PLANE_MATERIAL="component_dimensioning_plane_material",TEXT_MATERIAL="component_dimensioning_text_material";class TextWithBackground extends Object3D{constructor(e){super(),this._label="",this._parameters={font:null,size:.1,height:.001,curveSegments:2,bevelEnabled:!0,bevelThickness:.001,bevelSize:.001},this.topDown=!1,this._parameters.font=e,this._position=new Vector3,this._initMaterials(),this._init(),this._update()}_initMaterials(){this._cacheHolder.materialCache.has(PLANE_MATERIAL)?this._planeMaterial=this._cacheHolder.materialCache.get(PLANE_MATERIAL):(this._planeMaterial=new MeshBasicMaterial({color:16777215,side:DoubleSide,opacity:.8,transparent:!0}),this._cacheHolder.materialCache.set(PLANE_MATERIAL,this._planeMaterial)),this._cacheHolder.materialCache.has(TEXT_MATERIAL)?this._textMaterial=this._cacheHolder.materialCache.get(TEXT_MATERIAL):(this._textMaterial=new MeshPhongMaterial({color:3618615}),this._cacheHolder.materialCache.set(TEXT_MATERIAL,this._textMaterial))}_init(){let e=new BufferGeometry;this._text=new Mesh(e,this._textMaterial),this._text.userData.ignoreComponentRaycast=!0,this._text.name="text with background text "+this._label,this._plane=new Mesh(e,this._planeMaterial),this._plane.userData.ignoreComponentRaycast=!0,this._plane.name="text with background plane "+this._label,this._textGeometry=new TextGeometry(this._label,this._parameters),this._textGeometry.computeBoundingBox(),this._text.geometry=this._textGeometry,this.add(this._text),this.add(this._plane)}update(e,t,i,s){this._position.copy(e),this._dimensioningType=t,this._cameraPosition=s,this._label=i;const n=this._cameraPosition.distanceTo(this._text.position),h=Math.max(.01,n/100),o=Math.max(5e-4,n/5e3);this._parameters.bevelThickness=o,this._parameters.bevelSize=o,this._parameters.size=h,this._textGeometry=new TextGeometry(this._label,this._parameters),this._textGeometry.computeBoundingBox(),this._text.geometry=this._textGeometry,this._update()}_update(){if(this.topDown){let e=new Quaternion;e.setFromAxisAngle(new Vector3(-1,0,0),Math.PI/2),this._updateText(this._textGeometry,e,new Vector3)}else if(this._updateText(this._textGeometry,new Quaternion,new Vector3),this._cameraPosition){const e=Math.atan2(this._cameraPosition.x-this._position.x,this._cameraPosition.z-this._position.z);this._text.rotation.y=e,this._plane.rotation.y=e}}_updateText(e,t,i){let s=new Vector3;s.copy(this._position),i.x*=this._getXSign(),s.add(i);let n=e.boundingBox.getSize(new Vector3);e.center(),this._text.position.copy(s),this._text.quaternion.copy(t);let h=new PlaneGeometry(n.x+.02,n.y+.02,32);h.center(),this._plane.geometry=h,this._plane.position.copy(s),this._plane.quaternion.copy(t)}_getXSign(){return!this._cameraPosition||this._cameraPosition.x>=0?1:-1}dispose(){dispose(this)}}__decorate([inject],TextWithBackground.prototype,"_cacheHolder",void 0);class DimensioningHelper{constructor(e){this._cameraPosition=new Vector3,this._textUpdated=!1,this._topDimensions=!1,this._initialized=new AsyncGuard,this._enabled=!1,this._dimensionsVisible=!1,this._creator_=e,this._lineMaterial=new LineBasicMaterial({color:3618615,linewidth:2});let t=new BufferGeometry;this._widthLine=new Line(t,this._lineMaterial),this._widthLine.userData.ignoreComponentRaycast=!0,this._widthLine.name="dimension width line",this._heightLine=new Line(t,this._lineMaterial),this._heightLine.userData.ignoreComponentRaycast=!0,this._heightLine.name="dimension height line",this._depthLine=new Line(t,this._lineMaterial),this._depthLine.userData.ignoreComponentRaycast=!0,this._depthLine.name="dimension depth line",this._planeMaterial=new MeshBasicMaterial({color:16777215,side:DoubleSide,opacity:.8,transparent:!0}),AsyncDependencyLoader.loadFont("static/rubik_regular_sub-2dd2d5cca49018c5.json").then(e=>{this._font=e,this._loaded()})}_loaded(){this.update(!1),this.addToScene(this._scene,this._uiScene),this._initialized.resolve()}_performUpdate(e){this._enabled&&(this._lineBounds||e)&&this._font&&(this._updateHeight(),this._updateWidth(),this._updateDepth())}_updateWidth(){let e=new BufferGeometry,t=this._getWidthEdge(),i=[t.start.x,t.start.y,t.start.z,t.end.x,t.end.y,t.end.z];e.setAttribute("position",new BufferAttribute(new Float32Array(i),3)),this._widthLine.geometry.dispose(),this._widthLine.geometry=e;let s=t.getCenter(new Vector3);this._widthText||(this._widthText=new TextWithBackground(this._font)),this._widthText.topDown=this._topDimensions;const n=this._unitFormatter.formatMMValueToUnitString(1e3*this._dimensions.x);this._widthText.update(s,0,n,this._cameraPosition)}_updateHeight(){let e=new BufferGeometry,t=this._getHeightEdge(),i=[t.start.x,t.start.y,t.start.z,t.end.x,t.end.y,t.end.z];e.setAttribute("position",new BufferAttribute(new Float32Array(i),3)),this._heightLine.geometry.dispose(),this._heightLine.geometry=e;let s=t.getCenter(new Vector3);this._heightText||(this._heightText=new TextWithBackground(this._font)),this._heightText.topDown=this._topDimensions;const n=this._unitFormatter.formatMMValueToUnitString(1e3*this._dimensions.y);this._heightText.update(s,1,n,this._cameraPosition)}_updateDepth(){let e=new BufferGeometry,t=this._getDepthEdge(),i=[t.start.x,t.start.y,t.start.z,t.end.x,t.end.y,t.end.z];e.setAttribute("position",new BufferAttribute(new Float32Array(i),3)),this._depthLine.geometry.dispose(),this._depthLine.geometry=e;let s=t.getCenter(new Vector3);this._depthText||(this._depthText=new TextWithBackground(this._font)),this._depthText.topDown=this._topDimensions;const n=this._unitFormatter.formatMMValueToUnitString(1e3*this._dimensions.z);this._depthText.update(s,2,n,this._cameraPosition)}updateBounds(e){if(!e)return;this._dimensions=e.getSize(new Vector3),this._lineBounds=e.clone();let t=this._lineBounds.min.y<0?this._lineBounds.min.y:0;t-=.01,this._lineBounds.expandByVector(new Vector3(.05,t,.05)),this._textUpdated=!1,this.update()}update(e=!1){this._enabled&&!this._dimensionsVisible&&(this._dimensionsVisible=!0,this._visibilityChangedCallback()),this._performUpdate(e)}addToScene(e,t){this._widthText&&this._widthLine&&this._heightText&&this._heightLine&&this._heightText&&this._heightLine&&(e.add(this._widthLine),t.add(this._widthText),e.add(this._heightLine),t.add(this._heightText),e.add(this._depthLine),t.add(this._depthText))}removeFromScene(e,t){e.remove(this._widthLine),t.remove(this._widthText),e.remove(this._heightLine),t.remove(this._heightText),e.remove(this._depthLine),t.remove(this._depthText)}_getWidthEdge(){return this._cameraPosition.z>=0?new Line3(new Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.max.z),new Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.max.z)):new Line3(new Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.min.z),new Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.min.z))}_getDepthEdge(){return this._cameraPosition.x>=0?new Line3(new Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.min.z),new Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.max.z)):new Line3(new Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.min.z),new Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.max.z))}_getHeightEdge(){return this._cameraPosition.x>=0&&this._cameraPosition.z>=0?new Line3(new Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.max.z),new Vector3(this._lineBounds.max.x,this._lineBounds.max.y,this._lineBounds.max.z)):this._cameraPosition.x<0&&this._cameraPosition.z>=0?new Line3(new Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.max.z),new Vector3(this._lineBounds.min.x,this._lineBounds.max.y,this._lineBounds.max.z)):this._cameraPosition.x>=0&&this._cameraPosition.z<0?new Line3(new Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.min.z),new Vector3(this._lineBounds.max.x,this._lineBounds.max.y,this._lineBounds.min.z)):new Line3(new Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.min.z),new Vector3(this._lineBounds.min.x,this._lineBounds.max.y,this._lineBounds.min.z))}onDimensionsVisibilityChanged(e){this._onChange=e}enableTopDimensions(){this.enableDimensions(),this._topDimensions=!0,this._heightLine.visible=!1,this._heightText.visible=!1,this.update(!0)}disableTopDimensions(){this._topDimensions=!1,this._heightLine.visible=!0,this._heightText.visible=!0,this.disableDimensions()}enableDimensions(){this._enabled=!0,this.update(!0),this.addToScene(this._scene,this._uiScene)}disableDimensions(){this._enabled=!1,this._dimensionsVisible&&(this._dimensionsVisible=!1,this._visibilityChangedCallback()),this.removeFromScene(this._scene,this._uiScene)}_visibilityChangedCallback(){this._onChange&&this._onChange(this._dimensionsVisible)}_clear(){this._lineMaterial.dispose(),this._planeMaterial.dispose(),this._widthLine.geometry.dispose(),this._heightLine.geometry.dispose(),this._depthLine.geometry.dispose(),this._heightText.dispose(),this._heightText.dispose(),this._depthText.dispose()}getBoundingBox(){const e=new Box3;return e.expandByObject(this._widthLine),e.expandByObject(this._widthText),e.expandByObject(this._heightLine),e.expandByObject(this._heightText),e.expandByObject(this._depthLine),e.expandByObject(this._depthText),e}setVisibility(e){this._heightLine&&this._widthLine&&this._depthLine&&this._heightText&&this._widthText&&this._depthText&&(this._heightLine.visible=e,this._heightText.visible=e,this._widthLine.visible=e,this._widthText.visible=e,this._depthLine.visible=e,this._depthText.visible=e)}moveCameraStart(e){this.setVisibility(!1),this._cameraPosition=e,this.update()}moveCameraEnd(e){this.setVisibility(!0),this._cameraPosition=e,this.update()}clearScene(e){this._clear()}setScene(e){this._scene=e}setUiScene(e){this._uiScene=e}needsUiScene(){return!0}isInitialized(){return this._initialized.wait()}areDimensionsEnabled(){return this._enabled}}__decorate([inject],DimensioningHelper.prototype,"_unitFormatter",void 0);export{DimensioningHelper as default};
|
|
2
|
-
//# sourceMappingURL=dimensioning-helper-
|
|
1
|
+
import{o as dispose,_ as __decorate,i as inject,ae as AsyncGuard,aA as AsyncDependencyLoader}from"./roomle-dependency-injection-986d0a8f.js";import{O as Object3D,a as Vector3,h as MeshBasicMaterial,w as DoubleSide,bn as MeshPhongMaterial,B as BufferGeometry,z as Mesh,Q as Quaternion,bb as PlaneGeometry,u as LineBasicMaterial,G as Line,b as BufferAttribute,aY as Line3,ad as Box3}from"./main-thread-to-worker-9f925ba4.js";import{T as TextGeometry}from"./TextGeometry-2f1b3194.js";const PLANE_MATERIAL="component_dimensioning_plane_material",TEXT_MATERIAL="component_dimensioning_text_material";class TextWithBackground extends Object3D{constructor(e){super(),this._label="",this._parameters={font:null,size:.1,height:.001,curveSegments:2,bevelEnabled:!0,bevelThickness:.001,bevelSize:.001},this.topDown=!1,this._parameters.font=e,this._position=new Vector3,this._initMaterials(),this._init(),this._update()}_initMaterials(){this._cacheHolder.materialCache.has(PLANE_MATERIAL)?this._planeMaterial=this._cacheHolder.materialCache.get(PLANE_MATERIAL):(this._planeMaterial=new MeshBasicMaterial({color:16777215,side:DoubleSide,opacity:.8,transparent:!0}),this._cacheHolder.materialCache.set(PLANE_MATERIAL,this._planeMaterial)),this._cacheHolder.materialCache.has(TEXT_MATERIAL)?this._textMaterial=this._cacheHolder.materialCache.get(TEXT_MATERIAL):(this._textMaterial=new MeshPhongMaterial({color:3618615}),this._cacheHolder.materialCache.set(TEXT_MATERIAL,this._textMaterial))}_init(){let e=new BufferGeometry;this._text=new Mesh(e,this._textMaterial),this._text.userData.ignoreComponentRaycast=!0,this._text.name="text with background text "+this._label,this._plane=new Mesh(e,this._planeMaterial),this._plane.userData.ignoreComponentRaycast=!0,this._plane.name="text with background plane "+this._label,this._textGeometry=new TextGeometry(this._label,this._parameters),this._textGeometry.computeBoundingBox(),this._text.geometry=this._textGeometry,this.add(this._text),this.add(this._plane)}update(e,t,i,s){this._position.copy(e),this._dimensioningType=t,this._cameraPosition=s,this._label=i;const n=this._cameraPosition.distanceTo(this._text.position),h=Math.max(.01,n/100),o=Math.max(5e-4,n/5e3);this._parameters.bevelThickness=o,this._parameters.bevelSize=o,this._parameters.size=h,this._textGeometry=new TextGeometry(this._label,this._parameters),this._textGeometry.computeBoundingBox(),this._text.geometry=this._textGeometry,this._update()}_update(){if(this.topDown){let e=new Quaternion;e.setFromAxisAngle(new Vector3(-1,0,0),Math.PI/2),this._updateText(this._textGeometry,e,new Vector3)}else if(this._updateText(this._textGeometry,new Quaternion,new Vector3),this._cameraPosition){const e=Math.atan2(this._cameraPosition.x-this._position.x,this._cameraPosition.z-this._position.z);this._text.rotation.y=e,this._plane.rotation.y=e}}_updateText(e,t,i){let s=new Vector3;s.copy(this._position),i.x*=this._getXSign(),s.add(i);let n=e.boundingBox.getSize(new Vector3);e.center(),this._text.position.copy(s),this._text.quaternion.copy(t);let h=new PlaneGeometry(n.x+.02,n.y+.02,32);h.center(),this._plane.geometry=h,this._plane.position.copy(s),this._plane.quaternion.copy(t)}_getXSign(){return!this._cameraPosition||this._cameraPosition.x>=0?1:-1}dispose(){dispose(this)}}__decorate([inject],TextWithBackground.prototype,"_cacheHolder",void 0);class DimensioningHelper{constructor(e){this._cameraPosition=new Vector3,this._textUpdated=!1,this._topDimensions=!1,this._initialized=new AsyncGuard,this._enabled=!1,this._dimensionsVisible=!1,this._creator_=e,this._lineMaterial=new LineBasicMaterial({color:3618615,linewidth:2});let t=new BufferGeometry;this._widthLine=new Line(t,this._lineMaterial),this._widthLine.userData.ignoreComponentRaycast=!0,this._widthLine.name="dimension width line",this._heightLine=new Line(t,this._lineMaterial),this._heightLine.userData.ignoreComponentRaycast=!0,this._heightLine.name="dimension height line",this._depthLine=new Line(t,this._lineMaterial),this._depthLine.userData.ignoreComponentRaycast=!0,this._depthLine.name="dimension depth line",this._planeMaterial=new MeshBasicMaterial({color:16777215,side:DoubleSide,opacity:.8,transparent:!0}),AsyncDependencyLoader.loadFont("static/rubik_regular_sub-2dd2d5cca49018c5.json").then(e=>{this._font=e,this._loaded()})}_loaded(){this.update(!1),this.addToScene(this._scene,this._uiScene),this._initialized.resolve()}_performUpdate(e){this._enabled&&(this._lineBounds||e)&&this._font&&(this._updateHeight(),this._updateWidth(),this._updateDepth())}_updateWidth(){let e=new BufferGeometry,t=this._getWidthEdge(),i=[t.start.x,t.start.y,t.start.z,t.end.x,t.end.y,t.end.z];e.setAttribute("position",new BufferAttribute(new Float32Array(i),3)),this._widthLine.geometry.dispose(),this._widthLine.geometry=e;let s=t.getCenter(new Vector3);this._widthText||(this._widthText=new TextWithBackground(this._font)),this._widthText.topDown=this._topDimensions;const n=this._unitFormatter.formatMMValueToUnitString(1e3*this._dimensions.x);this._widthText.update(s,0,n,this._cameraPosition)}_updateHeight(){let e=new BufferGeometry,t=this._getHeightEdge(),i=[t.start.x,t.start.y,t.start.z,t.end.x,t.end.y,t.end.z];e.setAttribute("position",new BufferAttribute(new Float32Array(i),3)),this._heightLine.geometry.dispose(),this._heightLine.geometry=e;let s=t.getCenter(new Vector3);this._heightText||(this._heightText=new TextWithBackground(this._font)),this._heightText.topDown=this._topDimensions;const n=this._unitFormatter.formatMMValueToUnitString(1e3*this._dimensions.y);this._heightText.update(s,1,n,this._cameraPosition)}_updateDepth(){let e=new BufferGeometry,t=this._getDepthEdge(),i=[t.start.x,t.start.y,t.start.z,t.end.x,t.end.y,t.end.z];e.setAttribute("position",new BufferAttribute(new Float32Array(i),3)),this._depthLine.geometry.dispose(),this._depthLine.geometry=e;let s=t.getCenter(new Vector3);this._depthText||(this._depthText=new TextWithBackground(this._font)),this._depthText.topDown=this._topDimensions;const n=this._unitFormatter.formatMMValueToUnitString(1e3*this._dimensions.z);this._depthText.update(s,2,n,this._cameraPosition)}updateBounds(e){if(!e)return;this._dimensions=e.getSize(new Vector3),this._lineBounds=e.clone();let t=this._lineBounds.min.y<0?this._lineBounds.min.y:0;t-=.01,this._lineBounds.expandByVector(new Vector3(.05,t,.05)),this._textUpdated=!1,this.update()}update(e=!1){this._enabled&&!this._dimensionsVisible&&(this._dimensionsVisible=!0,this._visibilityChangedCallback()),this._performUpdate(e)}addToScene(e,t){this._widthText&&this._widthLine&&this._heightText&&this._heightLine&&this._heightText&&this._heightLine&&(e.add(this._widthLine),t.add(this._widthText),e.add(this._heightLine),t.add(this._heightText),e.add(this._depthLine),t.add(this._depthText))}removeFromScene(e,t){e.remove(this._widthLine),t.remove(this._widthText),e.remove(this._heightLine),t.remove(this._heightText),e.remove(this._depthLine),t.remove(this._depthText)}_getWidthEdge(){return this._cameraPosition.z>=0?new Line3(new Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.max.z),new Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.max.z)):new Line3(new Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.min.z),new Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.min.z))}_getDepthEdge(){return this._cameraPosition.x>=0?new Line3(new Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.min.z),new Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.max.z)):new Line3(new Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.min.z),new Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.max.z))}_getHeightEdge(){return this._cameraPosition.x>=0&&this._cameraPosition.z>=0?new Line3(new Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.max.z),new Vector3(this._lineBounds.max.x,this._lineBounds.max.y,this._lineBounds.max.z)):this._cameraPosition.x<0&&this._cameraPosition.z>=0?new Line3(new Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.max.z),new Vector3(this._lineBounds.min.x,this._lineBounds.max.y,this._lineBounds.max.z)):this._cameraPosition.x>=0&&this._cameraPosition.z<0?new Line3(new Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.min.z),new Vector3(this._lineBounds.max.x,this._lineBounds.max.y,this._lineBounds.min.z)):new Line3(new Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.min.z),new Vector3(this._lineBounds.min.x,this._lineBounds.max.y,this._lineBounds.min.z))}onDimensionsVisibilityChanged(e){this._onChange=e}enableTopDimensions(){this.enableDimensions(),this._topDimensions=!0,this._heightLine.visible=!1,this._heightText.visible=!1,this.update(!0)}disableTopDimensions(){this._topDimensions=!1,this._heightLine.visible=!0,this._heightText.visible=!0,this.disableDimensions()}enableDimensions(){this._enabled=!0,this.update(!0),this.addToScene(this._scene,this._uiScene)}disableDimensions(){this._enabled=!1,this._dimensionsVisible&&(this._dimensionsVisible=!1,this._visibilityChangedCallback()),this.removeFromScene(this._scene,this._uiScene)}_visibilityChangedCallback(){this._onChange&&this._onChange(this._dimensionsVisible)}_clear(){this._lineMaterial.dispose(),this._planeMaterial.dispose(),this._widthLine.geometry.dispose(),this._heightLine.geometry.dispose(),this._depthLine.geometry.dispose(),this._heightText.dispose(),this._heightText.dispose(),this._depthText.dispose()}getBoundingBox(){const e=new Box3;return e.expandByObject(this._widthLine),e.expandByObject(this._widthText),e.expandByObject(this._heightLine),e.expandByObject(this._heightText),e.expandByObject(this._depthLine),e.expandByObject(this._depthText),e}setVisibility(e){this._heightLine&&this._widthLine&&this._depthLine&&this._heightText&&this._widthText&&this._depthText&&(this._heightLine.visible=e,this._heightText.visible=e,this._widthLine.visible=e,this._widthText.visible=e,this._depthLine.visible=e,this._depthText.visible=e)}moveCameraStart(e){this.setVisibility(!1),this._cameraPosition=e,this.update()}moveCameraEnd(e){this.setVisibility(!0),this._cameraPosition=e,this.update()}clearScene(e){this._clear()}setScene(e){this._scene=e}setUiScene(e){this._uiScene=e}needsUiScene(){return!0}isInitialized(){return this._initialized.wait()}areDimensionsEnabled(){return this._enabled}}__decorate([inject],DimensioningHelper.prototype,"_unitFormatter",void 0);export{DimensioningHelper as default};
|
|
2
|
+
//# sourceMappingURL=dimensioning-helper-34d18c8c.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dimensioning-helper-
|
|
1
|
+
{"version":3,"file":"dimensioning-helper-34d18c8c.js","sources":["../../packages/configurator-core/public/fonts/rubik_regular_sub.json"],"sourcesContent":["export default \"static/rubik_regular_sub-2dd2d5cca49018c5.json\""],"names":[],"mappings":"wnIAAe"}
|