diff --git a/examples/AngleMeasurement/index.html b/examples/AngleMeasurement/index.html index efef3cf3..53bd8306 100644 --- a/examples/AngleMeasurement/index.html +++ b/examples/AngleMeasurement/index.html @@ -60,7 +60,7 @@ - + diff --git a/examples/AreaMeasurement/index.html b/examples/AreaMeasurement/index.html index b08101b1..e5513091 100644 --- a/examples/AreaMeasurement/index.html +++ b/examples/AreaMeasurement/index.html @@ -62,7 +62,7 @@ - +
diff --git a/examples/Civil3DNavigator/index.html b/examples/Civil3DNavigator/index.html index 526026d0..88611ee1 100644 --- a/examples/Civil3DNavigator/index.html +++ b/examples/Civil3DNavigator/index.html @@ -62,7 +62,7 @@ - + diff --git a/examples/CivilCrossSectionNavigator/index.html b/examples/CivilCrossSectionNavigator/index.html index 91c03868..6e913f33 100644 --- a/examples/CivilCrossSectionNavigator/index.html +++ b/examples/CivilCrossSectionNavigator/index.html @@ -79,8 +79,8 @@ - - + + diff --git a/examples/CivilElevationNavigator/index.html b/examples/CivilElevationNavigator/index.html index 698f5429..e6ec9e3e 100644 --- a/examples/CivilElevationNavigator/index.html +++ b/examples/CivilElevationNavigator/index.html @@ -79,9 +79,9 @@ - + - + diff --git a/examples/CivilPlanNavigator/index.html b/examples/CivilPlanNavigator/index.html index 740f22ce..ac2e07b9 100644 --- a/examples/CivilPlanNavigator/index.html +++ b/examples/CivilPlanNavigator/index.html @@ -68,9 +68,9 @@ - + - + diff --git a/examples/ClipEdges/index.html b/examples/ClipEdges/index.html index cd3eca2c..09fac88c 100644 --- a/examples/ClipEdges/index.html +++ b/examples/ClipEdges/index.html @@ -63,7 +63,7 @@ - + diff --git a/examples/EdgeMeasurement/index.html b/examples/EdgeMeasurement/index.html index d4d0c827..89fef940 100644 --- a/examples/EdgeMeasurement/index.html +++ b/examples/EdgeMeasurement/index.html @@ -62,7 +62,7 @@ - + diff --git a/examples/FaceMeasurement/index.html b/examples/FaceMeasurement/index.html index bd6cb53a..a0bb5b69 100644 --- a/examples/FaceMeasurement/index.html +++ b/examples/FaceMeasurement/index.html @@ -62,7 +62,7 @@ - + diff --git a/examples/Highlighter/index.html b/examples/Highlighter/index.html index ab3c8c85..082ca4c3 100644 --- a/examples/Highlighter/index.html +++ b/examples/Highlighter/index.html @@ -60,7 +60,7 @@ - + diff --git a/examples/IfcStreamer/index.html b/examples/IfcStreamer/index.html index 3e216b54..7ec8108b 100644 --- a/examples/IfcStreamer/index.html +++ b/examples/IfcStreamer/index.html @@ -62,7 +62,7 @@ - + diff --git a/examples/LengthMeasurement/index.html b/examples/LengthMeasurement/index.html index b0bec86a..76966af2 100644 --- a/examples/LengthMeasurement/index.html +++ b/examples/LengthMeasurement/index.html @@ -63,7 +63,7 @@ - + diff --git a/examples/Marker/index.html b/examples/Marker/index.html index 1d2a629a..df41aa5e 100644 --- a/examples/Marker/index.html +++ b/examples/Marker/index.html @@ -60,7 +60,7 @@ - + diff --git a/examples/Plans/index.html b/examples/Plans/index.html index dc94a548..1514a44d 100644 --- a/examples/Plans/index.html +++ b/examples/Plans/index.html @@ -60,7 +60,7 @@ - + diff --git a/examples/PostproductionRenderer/index.html b/examples/PostproductionRenderer/index.html index 9e5a761a..e7e89bc2 100644 --- a/examples/PostproductionRenderer/index.html +++ b/examples/PostproductionRenderer/index.html @@ -63,7 +63,7 @@ - + diff --git a/examples/Sections/index.html b/examples/Sections/index.html index b2fe9d1a..9370e6d6 100644 --- a/examples/Sections/index.html +++ b/examples/Sections/index.html @@ -63,7 +63,7 @@ - + diff --git a/examples/ShadowDropper/index.html b/examples/ShadowDropper/index.html index d80b1020..03b7fe62 100644 --- a/examples/ShadowDropper/index.html +++ b/examples/ShadowDropper/index.html @@ -63,7 +63,7 @@ - + diff --git a/examples/VolumeMeasurement/index.html b/examples/VolumeMeasurement/index.html index 92077e48..1384449f 100644 --- a/examples/VolumeMeasurement/index.html +++ b/examples/VolumeMeasurement/index.html @@ -62,7 +62,7 @@ - + diff --git a/examples/assets/angleMeasurement.js b/examples/assets/angleMeasurement.js index 4d206302..bfb9bcaf 100644 --- a/examples/assets/angleMeasurement.js +++ b/examples/assets/angleMeasurement.js @@ -1 +1 @@ -import{B as d,M as c,a as l}from"./web-ifc-api-CKmHUvxw.js";import{C as m,W as i,S as p,a as w,G as u}from"./index-7--X2BWW.js";import{W as b,w as f}from"./index-BIn5csQH.js";import{S as g}from"./stats.min-GTpOrGrX.js";import"./_commonjsHelpers-Cpj98o6Y.js";const r=document.getElementById("container"),o=new m,y=o.get(i),e=y.create();e.scene=new p(o);e.renderer=new b(o,r);e.camera=new w(o);o.init();e.camera.controls.setLookAt(5,5,5,0,0,0);e.scene.setup();const S=o.get(u);S.create(e);e.scene.three.background=null;const h=new d(3,3,3),k=new c({color:"#6528D7"}),s=new l(h,k);s.position.set(0,1.5,0);e.scene.three.add(s);e.meshes.add(s);const t=o.get(f);t.world=e;t.enabled=!0;r.ondblclick=()=>t.create();window.onkeydown=a=>{(a.code==="Delete"||a.code==="Backspace")&&t.deleteAll()};const n=new g;n.showPanel(2);document.body.append(n.dom);n.dom.style.left="0px";n.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>n.begin());e.renderer.onAfterUpdate.add(()=>n.end()); +import{B as d,M as c,a as l}from"./web-ifc-api-CKmHUvxw.js";import{C as m,W as i,S as p,a as w,G as u}from"./index-7--X2BWW.js";import{L as b,l as f}from"./index-DHdXOf4g.js";import{S as g}from"./stats.min-GTpOrGrX.js";import"./_commonjsHelpers-Cpj98o6Y.js";const r=document.getElementById("container"),o=new m,y=o.get(i),e=y.create();e.scene=new p(o);e.renderer=new b(o,r);e.camera=new w(o);o.init();e.camera.controls.setLookAt(5,5,5,0,0,0);e.scene.setup();const S=o.get(u);S.create(e);e.scene.three.background=null;const h=new d(3,3,3),k=new c({color:"#6528D7"}),s=new l(h,k);s.position.set(0,1.5,0);e.scene.three.add(s);e.meshes.add(s);const t=o.get(f);t.world=e;t.enabled=!0;r.ondblclick=()=>t.create();window.onkeydown=a=>{(a.code==="Delete"||a.code==="Backspace")&&t.deleteAll()};const n=new g;n.showPanel(2);document.body.append(n.dom);n.dom.style.left="0px";n.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>n.begin());e.renderer.onAfterUpdate.add(()=>n.end()); diff --git a/examples/assets/areaMeasurement.js b/examples/assets/areaMeasurement.js index 52c22790..8326fd30 100644 --- a/examples/assets/areaMeasurement.js +++ b/examples/assets/areaMeasurement.js @@ -1 +1 @@ -import{B as d,M as c,a as m}from"./web-ifc-api-CKmHUvxw.js";import{S as l}from"./stats.min-GTpOrGrX.js";import{C as i,W as p,S as w,a as u,G as b}from"./index-7--X2BWW.js";import{W as f,v as g}from"./index-BIn5csQH.js";import"./_commonjsHelpers-Cpj98o6Y.js";const s=document.getElementById("container"),n=new i,y=n.get(p),e=y.create();e.scene=new w(n);e.renderer=new f(n,s);e.camera=new u(n);n.init();e.camera.controls.setLookAt(5,5,5,0,0,0);e.scene.setup();const S=n.get(b);S.create(e);e.scene.three.background=null;const h=new d(3,3,3),k=new c({color:"#6528D7"}),a=new m(h,k);a.position.set(0,1.5,0);e.scene.three.add(a);e.meshes.add(a);const t=n.get(g);t.world=e;t.enabled=!0;s.ondblclick=()=>t.create();s.oncontextmenu=()=>t.endCreation();window.onkeydown=r=>{(r.code==="Delete"||r.code==="Backspace")&&t.deleteAll()};const o=new l;o.showPanel(2);document.body.append(o.dom);o.dom.style.left="0px";o.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>o.begin());e.renderer.onAfterUpdate.add(()=>o.end()); +import{B as c,M as d,a as m}from"./web-ifc-api-CKmHUvxw.js";import{S as l}from"./stats.min-GTpOrGrX.js";import{C as i,W as p,S as w,a as u,G as b}from"./index-7--X2BWW.js";import{L as f,c as g}from"./index-DHdXOf4g.js";import"./_commonjsHelpers-Cpj98o6Y.js";const s=document.getElementById("container"),n=new i,y=n.get(p),e=y.create();e.scene=new w(n);e.renderer=new f(n,s);e.camera=new u(n);n.init();e.camera.controls.setLookAt(5,5,5,0,0,0);e.scene.setup();const S=n.get(b);S.create(e);e.scene.three.background=null;const h=new c(3,3,3),k=new d({color:"#6528D7"}),a=new m(h,k);a.position.set(0,1.5,0);e.scene.three.add(a);e.meshes.add(a);const t=n.get(g);t.world=e;t.enabled=!0;s.ondblclick=()=>t.create();s.oncontextmenu=()=>t.endCreation();window.onkeydown=r=>{(r.code==="Delete"||r.code==="Backspace")&&t.deleteAll()};const o=new l;o.showPanel(2);document.body.append(o.dom);o.dom.style.left="0px";o.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>o.begin());e.renderer.onAfterUpdate.add(()=>o.end()); diff --git a/examples/assets/civil3DNavigator.js b/examples/assets/civil3DNavigator.js index cf363331..1761a061 100644 --- a/examples/assets/civil3DNavigator.js +++ b/examples/assets/civil3DNavigator.js @@ -1 +1 @@ -import{s as i,S as l}from"./web-ifc-api-CKmHUvxw.js";import{C as p,W as m,S as h,a as f,G as g,F as u,b as w}from"./index-7--X2BWW.js";import{S}from"./stats.min-GTpOrGrX.js";import{X as b,A as y}from"./index-BIn5csQH.js";import"./_commonjsHelpers-Cpj98o6Y.js";const c=document.getElementById("container"),t=new p,A=t.get(m),e=A.create();e.scene=new h(t);e.renderer=new b(t,c);e.camera=new f(t);t.init();e.scene.setup();e.camera.controls.setLookAt(5,5,5,0,0,0);c.appendChild(e.renderer.three2D.domElement);const C=t.get(g);C.create(e);e.scene.three.background=null;const U=t.get(u),v=await fetch("https://thatopen.github.io/engine_components/resources/road.frag"),B=await v.arrayBuffer(),E=new Uint8Array(B),r=await U.load(E);e.scene.three.add(r);const I=await fetch("https://thatopen.github.io/engine_components/resources/road.json");r.setLocalProperties(await I.json());const a=t.get(y);a.world=e;a.draw(r);const L=t.get(w),s=L.create(e);s.threshold=10;for(const o of r.children)o instanceof i&&s.add(o);s.needsUpdate=!0;e.camera.controls.addEventListener("sleep",()=>{s.needsUpdate=!0});const d=new l(void 0,20);a.onHighlight.add(({point:o})=>{d.center.copy(o),e.camera.controls.fitToSphere(d,!0)});const n=new S;n.showPanel(2);document.body.append(n.dom);n.dom.style.left="0px";n.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>n.begin());e.renderer.onAfterUpdate.add(()=>n.end()); +import{s as i,S as l}from"./web-ifc-api-CKmHUvxw.js";import{C as p,W as m,S as h,a as f,G as g,F as u,b as w}from"./index-7--X2BWW.js";import{S}from"./stats.min-GTpOrGrX.js";import{j as b,o as y}from"./index-DHdXOf4g.js";import"./_commonjsHelpers-Cpj98o6Y.js";const d=document.getElementById("container"),t=new p,C=t.get(m),e=C.create();e.scene=new h(t);e.renderer=new b(t,d);e.camera=new f(t);t.init();e.scene.setup();e.camera.controls.setLookAt(5,5,5,0,0,0);d.appendChild(e.renderer.three2D.domElement);const U=t.get(g);U.create(e);e.scene.three.background=null;const j=t.get(u),v=await fetch("https://thatopen.github.io/engine_components/resources/road.frag"),A=await v.arrayBuffer(),B=new Uint8Array(A),r=await j.load(B);e.scene.three.add(r);const E=await fetch("https://thatopen.github.io/engine_components/resources/road.json");r.setLocalProperties(await E.json());const a=t.get(y);a.world=e;a.draw(r);const I=t.get(w),s=I.create(e);s.threshold=10;for(const o of r.children)o instanceof i&&s.add(o);s.needsUpdate=!0;e.camera.controls.addEventListener("sleep",()=>{s.needsUpdate=!0});const c=new l(void 0,20);a.onHighlight.add(({point:o})=>{c.center.copy(o),e.camera.controls.fitToSphere(c,!0)});const n=new S;n.showPanel(2);document.body.append(n.dom);n.dom.style.left="0px";n.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>n.begin());e.renderer.onAfterUpdate.add(()=>n.end()); diff --git a/examples/assets/civilCrossSectionNavigator.js b/examples/assets/civilCrossSectionNavigator.js index 8fa7df1e..c3c11758 100644 --- a/examples/assets/civilCrossSectionNavigator.js +++ b/examples/assets/civilCrossSectionNavigator.js @@ -1 +1 @@ -import{C as M,L as S}from"./web-ifc-api-CKmHUvxw.js";import{C,W as x,S as B,O as E,G as k,F as v,c as A}from"./index-7--X2BWW.js";import{T as D}from"./index-ByMLC5eT.js";import{w as F}from"./index-Bq6zc5aT.js";import{S as I}from"./stats.min-GTpOrGrX.js";import{X as L,y as P,A as W,F as T,x as U}from"./index-BIn5csQH.js";import"./_commonjsHelpers-Cpj98o6Y.js";D.init();F.init();const y=document.getElementById("container"),e=new C,j=e.get(x),t=j.create();t.scene=new B(e);t.renderer=new L(e,y);t.camera=new E(e);e.init();t.scene.setup();t.camera.controls.setLookAt(5,5,5,0,0,0);y.appendChild(t.renderer.three2D.domElement);const G=e.get(k);G.create(t);t.scene.three.background=null;const b=e.get(v),H=await fetch("https://thatopen.github.io/engine_components/resources/road.frag"),N=await H.arrayBuffer(),O=new Uint8Array(N),d=b.load(O);t.scene.three.add(d);const X=await fetch("https://thatopen.github.io/engine_components/resources/road.json");d.setLocalProperties(await X.json());const f=document.getElementById("scene-2d-left");f.components=e;if(!f.world)throw new Error("World not found!");const c=e.get(P);c.world=f.world;await c.draw(d);const l=e.get(W);l.world=t;l.draw(d);const g=document.getElementById("scene-2d-right");g.components=e;if(!g.world)throw new Error("World not found!");const p=e.get(T);p.world=g.world;p.world3D=t;c.onMarkerChange.add(({alignment:o,percentage:n,type:r,curve:s})=>{if(l.setMarker(o,n,r),r==="select"){const i=s.alignment.absolute[s.index].mesh,m=o.getPointAt(n,"absolute");p.set(i,m)}});c.onHighlight.add(({mesh:o})=>{l.highlighter.select(o);const n=o.curve.index,r=o.curve.alignment.absolute[n];r.mesh.geometry.computeBoundingSphere();const s=r.mesh.geometry.boundingSphere;s&&t.camera.controls.fitToSphere(s,!0)});c.onMarkerHidden.add(({type:o})=>{l.hideMarker(o)});const h=e.get(A);h.byEntity(d);const _=h.list,w=e.get(U),u=w.styles.list;for(const o in _.entities){const n=h.find({entities:[o]}),r=new M(Math.random(),Math.random(),Math.random()),s=new S({color:r});w.styles.create(o,new Set,g.world,s);for(const i in n){const m=b.list.get(i);m&&(u[o].fragments[i]=new Set(n[i]),u[o].meshes.add(m.mesh))}}w.update(!0);const a=new I;a.showPanel(2);document.body.append(a.dom);a.dom.style.left="0px";a.dom.style.zIndex="unset";t.renderer.onBeforeUpdate.add(()=>a.begin());t.renderer.onAfterUpdate.add(()=>a.end()); +import{C as M,L as S}from"./web-ifc-api-CKmHUvxw.js";import{C as v,W as C,S as B,O as E,G as k,F as D,c as x}from"./index-7--X2BWW.js";import{T as I}from"./index-ByMLC5eT.js";import{w as L}from"./index-D2VaW7VV.js";import{S as j}from"./stats.min-GTpOrGrX.js";import{j as A,n as P,o as W,b as F,v as T}from"./index-DHdXOf4g.js";import"./_commonjsHelpers-Cpj98o6Y.js";I.init();L.init();const y=document.getElementById("container"),e=new v,U=e.get(C),t=U.create();t.scene=new B(e);t.renderer=new A(e,y);t.camera=new E(e);e.init();t.scene.setup();t.camera.controls.setLookAt(5,5,5,0,0,0);y.appendChild(t.renderer.three2D.domElement);const G=e.get(k);G.create(t);t.scene.three.background=null;const b=e.get(D),H=await fetch("https://thatopen.github.io/engine_components/resources/road.frag"),N=await H.arrayBuffer(),O=new Uint8Array(N),d=b.load(O);t.scene.three.add(d);const _=await fetch("https://thatopen.github.io/engine_components/resources/road.json");d.setLocalProperties(await _.json());const f=document.getElementById("scene-2d-left");f.components=e;if(!f.world)throw new Error("World not found!");const c=e.get(P);c.world=f.world;await c.draw(d);const l=e.get(W);l.world=t;l.draw(d);const g=document.getElementById("scene-2d-right");g.components=e;if(!g.world)throw new Error("World not found!");const p=e.get(F);p.world=g.world;p.world3D=t;c.onMarkerChange.add(({alignment:o,percentage:n,type:r,curve:s})=>{if(l.setMarker(o,n,r),r==="select"){const i=s.alignment.absolute[s.index].mesh,m=o.getPointAt(n,"absolute");p.set(i,m)}});c.onHighlight.add(({mesh:o})=>{l.highlighter.select(o);const n=o.curve.index,r=o.curve.alignment.absolute[n];r.mesh.geometry.computeBoundingSphere();const s=r.mesh.geometry.boundingSphere;s&&t.camera.controls.fitToSphere(s,!0)});c.onMarkerHidden.add(({type:o})=>{l.hideMarker(o)});const h=e.get(x);h.byEntity(d);const z=h.list,w=e.get(T),u=w.styles.list;for(const o in z.entities){const n=h.find({entities:[o]}),r=new M(Math.random(),Math.random(),Math.random()),s=new S({color:r});w.styles.create(o,new Set,g.world,s);for(const i in n){const m=b.list.get(i);m&&(u[o].fragments[i]=new Set(n[i]),u[o].meshes.add(m.mesh))}}w.update(!0);const a=new j;a.showPanel(2);document.body.append(a.dom);a.dom.style.left="0px";a.dom.style.zIndex="unset";t.renderer.onBeforeUpdate.add(()=>a.begin());t.renderer.onAfterUpdate.add(()=>a.end()); diff --git a/examples/assets/civilElevationNavigator.js b/examples/assets/civilElevationNavigator.js index 83f097b1..bcfcfd30 100644 --- a/examples/assets/civilElevationNavigator.js +++ b/examples/assets/civilElevationNavigator.js @@ -1 +1 @@ -import"./web-ifc-api-CKmHUvxw.js";import{C as S,W as v,S as b,O as A,G as B,F as k}from"./index-7--X2BWW.js";import{X as C,A as E,y as M,S as I}from"./index-BIn5csQH.js";import{T}from"./index-ByMLC5eT.js";import{w as W}from"./index-Bq6zc5aT.js";import{S as x}from"./stats.min-GTpOrGrX.js";import"./_commonjsHelpers-Cpj98o6Y.js";T.init();W.init();const f=document.getElementById("container"),t=new S,D=t.get(v),e=D.create();e.scene=new b(t);e.renderer=new C(t,f);e.camera=new A(t);t.init();e.scene.setup();e.camera.controls.setLookAt(5,5,5,0,0,0);f.appendChild(e.renderer.three2D.domElement);const P=t.get(B);P.create(e);e.scene.three.background=null;const U=t.get(k),z=await fetch("https://thatopen.github.io/engine_components/resources/road.frag"),F=await z.arrayBuffer(),G=new Uint8Array(F),c=U.load(G);e.scene.three.add(c);const i=t.get(E);i.world=e;i.draw(c);const g=document.getElementById("scene-2d-left");g.components=t;if(!g.world)throw new Error("World not found!");const l=new M(t);l.world=g.world;l.draw(c);const a=document.getElementById("scene-2d-right");a.components=t;if(!a.world)throw new Error("World not found!");const s=t.get(I);s.world=a.world;s.draw(c);l.onMarkerChange.add(({alignment:r,percentage:d})=>{s.setMarker(r,d,"hover"),i.setMarker(r,d,"hover")});l.onHighlight.add(({mesh:r,point:d})=>{const{index:y,alignment:h}=r.curve,m=h.getPercentageAt(d,"horizontal");if(m===null)return;const{curve:n}=h.getCurveAt(m,"vertical");if(s.highlighter.select(n.mesh),s.setMarker(n.alignment,m,"select"),a.world){n.mesh.geometry.boundingSphere||n.mesh.geometry.computeBoundingSphere();const w=n.mesh.geometry.boundingSphere.clone();w.radius*=1.5,a.world.camera.controls.fitToSphere(w,!0)}i.highlighter.select(r);const p=r.curve.alignment.absolute[y];p.mesh.geometry.computeBoundingSphere();const u=p.mesh.geometry.boundingSphere;u&&e.camera.controls.fitToSphere(u,!0)});const o=new x;o.showPanel(2);document.body.append(o.dom);o.dom.style.left="0px";o.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>o.begin());e.renderer.onAfterUpdate.add(()=>o.end()); +import"./web-ifc-api-CKmHUvxw.js";import{C as y,W as S,S as b,O as B,G as k,F as C}from"./index-7--X2BWW.js";import{j as E,o as A,n as M,r as I}from"./index-DHdXOf4g.js";import{T}from"./index-ByMLC5eT.js";import{w as W}from"./index-D2VaW7VV.js";import{S as x}from"./stats.min-GTpOrGrX.js";import"./_commonjsHelpers-Cpj98o6Y.js";T.init();W.init();const f=document.getElementById("container"),t=new y,D=t.get(S),e=D.create();e.scene=new b(t);e.renderer=new E(t,f);e.camera=new B(t);t.init();e.scene.setup();e.camera.controls.setLookAt(5,5,5,0,0,0);f.appendChild(e.renderer.three2D.domElement);const P=t.get(k);P.create(e);e.scene.three.background=null;const U=t.get(C),j=await fetch("https://thatopen.github.io/engine_components/resources/road.frag"),z=await j.arrayBuffer(),F=new Uint8Array(z),c=U.load(F);e.scene.three.add(c);const i=t.get(A);i.world=e;i.draw(c);const g=document.getElementById("scene-2d-left");g.components=t;if(!g.world)throw new Error("World not found!");const l=new M(t);l.world=g.world;l.draw(c);const a=document.getElementById("scene-2d-right");a.components=t;if(!a.world)throw new Error("World not found!");const s=t.get(I);s.world=a.world;s.draw(c);l.onMarkerChange.add(({alignment:r,percentage:d})=>{s.setMarker(r,d,"hover"),i.setMarker(r,d,"hover")});l.onHighlight.add(({mesh:r,point:d})=>{const{index:v,alignment:h}=r.curve,m=h.getPercentageAt(d,"horizontal");if(m===null)return;const{curve:n}=h.getCurveAt(m,"vertical");if(s.highlighter.select(n.mesh),s.setMarker(n.alignment,m,"select"),a.world){n.mesh.geometry.boundingSphere||n.mesh.geometry.computeBoundingSphere();const w=n.mesh.geometry.boundingSphere.clone();w.radius*=1.5,a.world.camera.controls.fitToSphere(w,!0)}i.highlighter.select(r);const p=r.curve.alignment.absolute[v];p.mesh.geometry.computeBoundingSphere();const u=p.mesh.geometry.boundingSphere;u&&e.camera.controls.fitToSphere(u,!0)});const o=new x;o.showPanel(2);document.body.append(o.dom);o.dom.style.left="0px";o.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>o.begin());e.renderer.onAfterUpdate.add(()=>o.end()); diff --git a/examples/assets/civilPlanNavigator.js b/examples/assets/civilPlanNavigator.js index 82f0b7b5..4016bbe3 100644 --- a/examples/assets/civilPlanNavigator.js +++ b/examples/assets/civilPlanNavigator.js @@ -1 +1 @@ -import"./web-ifc-api-CKmHUvxw.js";import{C as p,W as g,S as h,O as w,G as u,F as f}from"./index-7--X2BWW.js";import{X as y,A as S,y as b}from"./index-BIn5csQH.js";import{T as v}from"./index-ByMLC5eT.js";import{w as A}from"./index-Bq6zc5aT.js";import{S as B}from"./stats.min-GTpOrGrX.js";import"./_commonjsHelpers-Cpj98o6Y.js";v.init();A.init();const i=document.getElementById("container"),t=new p,x=t.get(g),e=x.create();e.scene=new h(t);e.renderer=new y(t,i);e.camera=new w(t);t.init();e.scene.setup();e.camera.controls.setLookAt(5,5,5,0,0,0);i.appendChild(e.renderer.three2D.domElement);const C=t.get(u);C.create(e);e.scene.three.background=null;const E=t.get(f),I=await fetch("https://thatopen.github.io/engine_components/resources/road.frag"),T=await I.arrayBuffer(),U=new Uint8Array(T),r=E.load(U);e.scene.three.add(r);const a=t.get(S);a.world=e;a.draw(r);const m=document.getElementById("scene-2d"),s=t.get(b);m.components=t;s.world=m.world;await s.draw(r);s.onHighlight.add(({mesh:o})=>{a.highlighter.select(o);const l=o.curve.index,d=o.curve.alignment.absolute[l];d.mesh.geometry.computeBoundingSphere();const c=d.mesh.geometry.boundingSphere;c&&e.camera.controls.fitToSphere(c,!0)});const n=new B;n.showPanel(2);document.body.append(n.dom);n.dom.style.left="0px";n.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>n.begin());e.renderer.onAfterUpdate.add(()=>n.end()); +import"./web-ifc-api-CKmHUvxw.js";import{C as p,W as g,S as h,O as w,G as f,F as u}from"./index-7--X2BWW.js";import{j as y,o as S,n as b}from"./index-DHdXOf4g.js";import{T as v}from"./index-ByMLC5eT.js";import{w as B}from"./index-D2VaW7VV.js";import{S as x}from"./stats.min-GTpOrGrX.js";import"./_commonjsHelpers-Cpj98o6Y.js";v.init();B.init();const i=document.getElementById("container"),t=new p,C=t.get(g),e=C.create();e.scene=new h(t);e.renderer=new y(t,i);e.camera=new w(t);t.init();e.scene.setup();e.camera.controls.setLookAt(5,5,5,0,0,0);i.appendChild(e.renderer.three2D.domElement);const A=t.get(f);A.create(e);e.scene.three.background=null;const E=t.get(u),I=await fetch("https://thatopen.github.io/engine_components/resources/road.frag"),T=await I.arrayBuffer(),U=new Uint8Array(T),r=E.load(U);e.scene.three.add(r);const a=t.get(S);a.world=e;a.draw(r);const m=document.getElementById("scene-2d"),s=t.get(b);m.components=t;s.world=m.world;await s.draw(r);s.onHighlight.add(({mesh:o})=>{a.highlighter.select(o);const l=o.curve.index,d=o.curve.alignment.absolute[l];d.mesh.geometry.computeBoundingSphere();const c=d.mesh.geometry.boundingSphere;c&&e.camera.controls.fitToSphere(c,!0)});const n=new x;n.showPanel(2);document.body.append(n.dom);n.dom.style.left="0px";n.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>n.begin());e.renderer.onAfterUpdate.add(()=>n.end()); diff --git a/examples/assets/clipEdges.js b/examples/assets/clipEdges.js index de063fa6..4c059268 100644 --- a/examples/assets/clipEdges.js +++ b/examples/assets/clipEdges.js @@ -1,4 +1,4 @@ -import{B as M,M as y,a as d,b as c,L as b}from"./web-ifc-api-CKmHUvxw.js";import{S as f}from"./stats.min-GTpOrGrX.js";import{T as x,L as m,m as p}from"./index-ByMLC5eT.js";import{C as k,W as v,S as C,a as L,G as P,R as S,e as B}from"./index-7--X2BWW.js";import{W as I,x as $,C as D}from"./index-BIn5csQH.js";import"./_commonjsHelpers-Cpj98o6Y.js";const u=document.getElementById("container"),o=new k,W=o.get(v),e=W.create();e.scene=new C(o);e.renderer=new I(o,u);e.camera=new L(o);e.renderer.postproduction.enabled=!0;e.renderer.postproduction.customEffects.outlineEnabled=!0;o.init();e.camera.controls.setLookAt(12,6,8,0,0,-10);e.scene.setup();const z=o.get(P),h=z.create(e);h.config.color.setHex(6710886);e.renderer.postproduction.customEffects.excludedMeshes.push(h.three);e.scene.three.background=null;const g=new M(3,3,3),w=new y({color:"#6528D7"}),a=new d(g,w);a.position.set(-2,1.5,0);e.scene.three.add(a);e.meshes.add(a);const l=new d(g,w);l.position.set(2,1.5,0);e.scene.three.add(l);e.meshes.add(l);const E=o.get(S);E.get(e);const n=o.get(B);n.enabled=!0;const r=o.get($);n.Type=D;const G=new c({color:"lightblue",side:2}),R=new b({color:"blue"}),T=new c({color:"blue",opacity:.5,side:2,transparent:!0});r.styles.create("Red lines",new Set([a]),e,R,G,T);const A=new c({color:"salmon",side:2}),O=new b({color:"red"}),F=new c({color:"red",opacity:.5,side:2,transparent:!0});r.styles.create("Blue lines",new Set([l]),e,O,A,F);u.ondblclick=()=>{n.enabled&&n.create(e)};window.onkeydown=t=>{(t.code==="Delete"||t.code==="Backspace")&&n.enabled&&n.delete(e)};const s=new f;s.showPanel(2);document.body.append(s.dom);s.dom.style.left="0px";s.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>s.begin());e.renderer.onAfterUpdate.add(()=>s.end());x.init();const i=m.create(()=>p` +import{B as M,M as y,a as d,b as c,L as b}from"./web-ifc-api-CKmHUvxw.js";import{S as f}from"./stats.min-GTpOrGrX.js";import{T as k,L as m,m as p}from"./index-ByMLC5eT.js";import{C as v,W as x,S as L,a as C,G as P,R as S,e as B}from"./index-7--X2BWW.js";import{L as I,v as $,a as D}from"./index-DHdXOf4g.js";import"./_commonjsHelpers-Cpj98o6Y.js";const u=document.getElementById("container"),o=new v,z=o.get(x),e=z.create();e.scene=new L(o);e.renderer=new I(o,u);e.camera=new C(o);e.renderer.postproduction.enabled=!0;e.renderer.postproduction.customEffects.outlineEnabled=!0;o.init();e.camera.controls.setLookAt(12,6,8,0,0,-10);e.scene.setup();const E=o.get(P),h=E.create(e);h.config.color.setHex(6710886);e.renderer.postproduction.customEffects.excludedMeshes.push(h.three);e.scene.three.background=null;const g=new M(3,3,3),w=new y({color:"#6528D7"}),a=new d(g,w);a.position.set(-2,1.5,0);e.scene.three.add(a);e.meshes.add(a);const l=new d(g,w);l.position.set(2,1.5,0);e.scene.three.add(l);e.meshes.add(l);const G=o.get(S);G.get(e);const n=o.get(B);n.enabled=!0;const r=o.get($);n.Type=D;const R=new c({color:"lightblue",side:2}),T=new b({color:"blue"}),W=new c({color:"blue",opacity:.5,side:2,transparent:!0});r.styles.create("Red lines",new Set([a]),e,T,R,W);const A=new c({color:"salmon",side:2}),O=new b({color:"red"}),F=new c({color:"red",opacity:.5,side:2,transparent:!0});r.styles.create("Blue lines",new Set([l]),e,O,A,F);u.ondblclick=()=>{n.enabled&&n.create(e)};window.onkeydown=t=>{(t.code==="Delete"||t.code==="Backspace")&&n.enabled&&n.delete(e)};const s=new f;s.showPanel(2);document.body.append(s.dom);s.dom.style.left="0px";s.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>s.begin());e.renderer.onAfterUpdate.add(()=>s.end());k.init();const i=m.create(()=>p`