poly-extrude 0.20.6 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
1
  /*!
2
- * poly-extrude v0.20.6
2
+ * poly-extrude v0.21.0
3
3
  */
4
- !function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((t="undefined"!=typeof globalThis?globalThis:t||self).polyextrude=t.polyextrude||{})}(this,(function(t){"use strict";function n(t,n){for(var i=0;i<n.length;i++){var e=n[i];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(t,e.key,e)}}function i(t,n){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},i(t,n)}function e(t,n,i){void 0===i&&(i=2);var e,s,h,a=n&&n.length,c=a?n[0]*i:t.length,u=r(t,0,c,i,!0),y=[];if(!u||u.next===u.prev)return y;if(a&&(u=function(t,n,i,e){for(var s=[],o=0,h=n.length;o<h;o++){var a=r(t,n[o]*e,o<h-1?n[o+1]*e:t.length,e,!1);a===a.next&&(a.steiner=!0),s.push(p(a))}s.sort(l);for(var c=0;c<s.length;c++)i=f(s[c],i);return i}(t,n,u,i)),t.length>80*i){e=1/0,s=1/0;for(var x=-1/0,d=-1/0,v=i;v<c;v+=i){var g=t[v],_=t[v+1];g<e&&(e=g),_<s&&(s=_),g>x&&(x=g),_>d&&(d=_)}h=0!==(h=Math.max(x-e,d-s))?32767/h:0}return o(u,y,i,e,s,h,0),y}function r(t,n,i,e,r){var s;if(r===function(t,n,i,e){for(var r=0,s=n,o=i-e;s<i;s+=e)r+=(t[o]-t[s])*(t[s+1]+t[o+1]),o=s;return r}(t,n,i,e)>0)for(var o=n;o<i;o+=e)s=P(o/e|0,t[o],t[o+1],s);else for(var h=i-e;h>=n;h-=e)s=P(h/e|0,t[h],t[h+1],s);return s&&z(s,s.next)&&(S(s),s=s.next),s}function s(t,n){if(!t)return t;n||(n=t);var i,e=t;do{if(i=!1,e.steiner||!z(e,e.next)&&0!==_(e.prev,e,e.next))e=e.next;else{if(S(e),(e=n=e.prev)===e.next)break;i=!0}}while(i||e!==n);return n}function o(t,n,i,e,r,l,f){if(t){!f&&l&&function(t,n,i,e){var r=t;do{0===r.z&&(r.z=x(r.x,r.y,n,i,e)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){var n,i=1;do{var e=t,r=void 0;t=null;var s=null;for(n=0;e;){n++;for(var o=e,h=0,a=0;a<i&&(h++,o=o.nextZ);a++);for(var c=i;h>0||c>0&&o;)0!==h&&(0===c||!o||e.z<=o.z)?(r=e,e=e.nextZ,h--):(r=o,o=o.nextZ,c--),s?s.nextZ=r:t=r,r.prevZ=s,s=r;e=o}s.nextZ=null,i*=2}while(n>1)}(r)}(t,e,r,l);for(var y=t;t.prev!==t.next;){var p=t.prev,d=t.next;if(l?a(t,e,r,l):h(t))n.push(p.i,t.i,d.i),S(t),t=d.next,y=d.next;else if((t=d)===y){f?1===f?o(t=c(s(t),n),n,i,e,r,l,2):2===f&&u(t,n,i,e,r,l):o(s(t),n,i,e,r,l,1);break}}}}function h(t){var n=t.prev,i=t,e=t.next;if(_(n,i,e)>=0)return!1;for(var r=n.x,s=i.x,o=e.x,h=n.y,a=i.y,c=e.y,u=Math.min(r,s,o),l=Math.min(h,a,c),f=Math.max(r,s,o),y=Math.max(h,a,c),x=e.next;x!==n;){if(x.x>=u&&x.x<=f&&x.y>=l&&x.y<=y&&v(r,h,s,a,o,c,x.x,x.y)&&_(x.prev,x,x.next)>=0)return!1;x=x.next}return!0}function a(t,n,i,e){var r=t.prev,s=t,o=t.next;if(_(r,s,o)>=0)return!1;for(var h=r.x,a=s.x,c=o.x,u=r.y,l=s.y,f=o.y,y=Math.min(h,a,c),p=Math.min(u,l,f),d=Math.max(h,a,c),g=Math.max(u,l,f),z=x(y,p,n,i,e),m=x(d,g,n,i,e),w=t.prevZ,M=t.nextZ;w&&w.z>=z&&M&&M.z<=m;){if(w.x>=y&&w.x<=d&&w.y>=p&&w.y<=g&&w!==r&&w!==o&&v(h,u,a,l,c,f,w.x,w.y)&&_(w.prev,w,w.next)>=0)return!1;if(w=w.prevZ,M.x>=y&&M.x<=d&&M.y>=p&&M.y<=g&&M!==r&&M!==o&&v(h,u,a,l,c,f,M.x,M.y)&&_(M.prev,M,M.next)>=0)return!1;M=M.nextZ}for(;w&&w.z>=z;){if(w.x>=y&&w.x<=d&&w.y>=p&&w.y<=g&&w!==r&&w!==o&&v(h,u,a,l,c,f,w.x,w.y)&&_(w.prev,w,w.next)>=0)return!1;w=w.prevZ}for(;M&&M.z<=m;){if(M.x>=y&&M.x<=d&&M.y>=p&&M.y<=g&&M!==r&&M!==o&&v(h,u,a,l,c,f,M.x,M.y)&&_(M.prev,M,M.next)>=0)return!1;M=M.nextZ}return!0}function c(t,n){var i=t;do{var e=i.prev,r=i.next.next;!z(e,r)&&m(e,i,i.next,r)&&b(e,r)&&b(r,e)&&(n.push(e.i,i.i,r.i),S(i),S(i.next),i=t=r),i=i.next}while(i!==t);return s(i)}function u(t,n,i,e,r,h){var a=t;do{for(var c=a.next.next;c!==a.prev;){if(a.i!==c.i&&g(a,c)){var u=A(a,c);return a=s(a,a.next),u=s(u,u.next),o(a,n,i,e,r,h,0),void o(u,n,i,e,r,h,0)}c=c.next}a=a.next}while(a!==t)}function l(t,n){var i=t.x-n.x;0===i&&(0===(i=t.y-n.y)&&(i=(t.next.y-t.y)/(t.next.x-t.x)-(n.next.y-n.y)/(n.next.x-n.x)));return i}function f(t,n){var i=function(t,n){var i,e=n,r=t.x,s=t.y,o=-1/0;if(z(t,e))return e;do{if(z(t,e.next))return e.next;if(s<=e.y&&s>=e.next.y&&e.next.y!==e.y){var h=e.x+(s-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(h<=r&&h>o&&(o=h,i=e.x<e.next.x?e:e.next,h===r))return i}e=e.next}while(e!==n);if(!i)return null;var a=i,c=i.x,u=i.y,l=1/0;e=i;do{if(r>=e.x&&e.x>=c&&r!==e.x&&d(s<u?r:o,s,c,u,s<u?o:r,s,e.x,e.y)){var f=Math.abs(s-e.y)/(r-e.x);b(e,t)&&(f<l||f===l&&(e.x>i.x||e.x===i.x&&y(i,e)))&&(i=e,l=f)}e=e.next}while(e!==a);return i}(t,n);if(!i)return n;var e=A(i,t);return s(e,e.next),s(i,i.next)}function y(t,n){return _(t.prev,t,n.prev)<0&&_(n.next,t,t.next)<0}function x(t,n,i,e,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*r|0)|t<<8))|t<<4))|t<<2))|t<<1))|(n=1431655765&((n=858993459&((n=252645135&((n=16711935&((n=(n-e)*r|0)|n<<8))|n<<4))|n<<2))|n<<1))<<1}function p(t){var n=t,i=t;do{(n.x<i.x||n.x===i.x&&n.y<i.y)&&(i=n),n=n.next}while(n!==t);return i}function d(t,n,i,e,r,s,o,h){return(r-o)*(n-h)>=(t-o)*(s-h)&&(t-o)*(e-h)>=(i-o)*(n-h)&&(i-o)*(s-h)>=(r-o)*(e-h)}function v(t,n,i,e,r,s,o,h){return!(t===o&&n===h)&&d(t,n,i,e,r,s,o,h)}function g(t,n){return t.next.i!==n.i&&t.prev.i!==n.i&&!function(t,n){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==n.i&&i.next.i!==n.i&&m(i,i.next,t,n))return!0;i=i.next}while(i!==t);return!1}(t,n)&&(b(t,n)&&b(n,t)&&function(t,n){var i=t,e=!1,r=(t.x+n.x)/2,s=(t.y+n.y)/2;do{i.y>s!=i.next.y>s&&i.next.y!==i.y&&r<(i.next.x-i.x)*(s-i.y)/(i.next.y-i.y)+i.x&&(e=!e),i=i.next}while(i!==t);return e}(t,n)&&(_(t.prev,t,n.prev)||_(t,n.prev,n))||z(t,n)&&_(t.prev,t,t.next)>0&&_(n.prev,n,n.next)>0)}function _(t,n,i){return(n.y-t.y)*(i.x-n.x)-(n.x-t.x)*(i.y-n.y)}function z(t,n){return t.x===n.x&&t.y===n.y}function m(t,n,i,e){var r=M(_(t,n,i)),s=M(_(t,n,e)),o=M(_(i,e,t)),h=M(_(i,e,n));return r!==s&&o!==h||(!(0!==r||!w(t,i,n))||(!(0!==s||!w(t,e,n))||(!(0!==o||!w(i,t,e))||!(0!==h||!w(i,n,e)))))}function w(t,n,i){return n.x<=Math.max(t.x,i.x)&&n.x>=Math.min(t.x,i.x)&&n.y<=Math.max(t.y,i.y)&&n.y>=Math.min(t.y,i.y)}function M(t){return t>0?1:t<0?-1:0}function b(t,n){return _(t.prev,t,t.next)<0?_(t,n,t.next)>=0&&_(t,t.prev,n)>=0:_(t,n,t.prev)<0||_(t,t.next,n)<0}function A(t,n){var i=k(t.i,t.x,t.y),e=k(n.i,n.x,n.y),r=t.next,s=n.prev;return t.next=n,n.prev=t,i.next=r,r.prev=i,e.next=i,i.prev=e,s.next=e,e.prev=s,e}function P(t,n,i,e){var r=k(t,n,i);return e?(r.next=e.next,r.prev=e,e.next.prev=r,e.next=r):(r.prev=r,r.next=r),r}function S(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function k(t,n,i){return{i:t,x:n,y:i,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}var C=new(function(){function t(t,n,i,e){void 0===t&&(t=0),void 0===n&&(n=0),void 0===i&&(i=0),void 0===e&&(e=1),this.isQuaternion=!0,this._x=t,this._y=n,this._z=i,this._w=e}t.slerpFlat=function(t,n,i,e,r,s,o){var h=i[e+0],a=i[e+1],c=i[e+2],u=i[e+3],l=r[s+0],f=r[s+1],y=r[s+2],x=r[s+3];if(0===o)return t[n+0]=h,t[n+1]=a,t[n+2]=c,void(t[n+3]=u);if(1===o)return t[n+0]=l,t[n+1]=f,t[n+2]=y,void(t[n+3]=x);if(u!==x||h!==l||a!==f||c!==y){var p=1-o,d=h*l+a*f+c*y+u*x,v=d>=0?1:-1,g=1-d*d;if(g>Number.EPSILON){var _=Math.sqrt(g),z=Math.atan2(_,d*v);p=Math.sin(p*z)/_,o=Math.sin(o*z)/_}var m=o*v;if(h=h*p+l*m,a=a*p+f*m,c=c*p+y*m,u=u*p+x*m,p===1-o){var w=1/Math.sqrt(h*h+a*a+c*c+u*u);h*=w,a*=w,c*=w,u*=w}}t[n]=h,t[n+1]=a,t[n+2]=c,t[n+3]=u},t.multiplyQuaternionsFlat=function(t,n,i,e,r,s){var o=i[e],h=i[e+1],a=i[e+2],c=i[e+3],u=r[s],l=r[s+1],f=r[s+2],y=r[s+3];return t[n]=o*y+c*u+h*f-a*l,t[n+1]=h*y+c*l+a*u-o*f,t[n+2]=a*y+c*f+o*l-h*u,t[n+3]=c*y-o*u-h*l-a*f,t};var i,e,r,s=t.prototype;return s.set=function(t,n,i,e){return this._x=t,this._y=n,this._z=i,this._w=e,this._onChangeCallback(),this},s.clone=function(){return new this.constructor(this._x,this._y,this._z,this._w)},s.copy=function(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this},s.setFromEuler=function(t,n){void 0===n&&(n=!0);var i=t._x,e=t._y,r=t._z,s=t._order,o=Math.cos,h=Math.sin,a=o(i/2),c=o(e/2),u=o(r/2),l=h(i/2),f=h(e/2),y=h(r/2);switch(s){case"XYZ":this._x=l*c*u+a*f*y,this._y=a*f*u-l*c*y,this._z=a*c*y+l*f*u,this._w=a*c*u-l*f*y;break;case"YXZ":this._x=l*c*u+a*f*y,this._y=a*f*u-l*c*y,this._z=a*c*y-l*f*u,this._w=a*c*u+l*f*y;break;case"ZXY":this._x=l*c*u-a*f*y,this._y=a*f*u+l*c*y,this._z=a*c*y+l*f*u,this._w=a*c*u-l*f*y;break;case"ZYX":this._x=l*c*u-a*f*y,this._y=a*f*u+l*c*y,this._z=a*c*y-l*f*u,this._w=a*c*u+l*f*y;break;case"YZX":this._x=l*c*u+a*f*y,this._y=a*f*u+l*c*y,this._z=a*c*y-l*f*u,this._w=a*c*u-l*f*y;break;case"XZY":this._x=l*c*u-a*f*y,this._y=a*f*u-l*c*y,this._z=a*c*y+l*f*u,this._w=a*c*u+l*f*y;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return!0===n&&this._onChangeCallback(),this},s.setFromAxisAngle=function(t,n){var i=n/2,e=Math.sin(i);return this._x=t.x*e,this._y=t.y*e,this._z=t.z*e,this._w=Math.cos(i),this._onChangeCallback(),this},s.setFromRotationMatrix=function(t){var n=t.elements,i=n[0],e=n[4],r=n[8],s=n[1],o=n[5],h=n[9],a=n[2],c=n[6],u=n[10],l=i+o+u;if(l>0){var f=.5/Math.sqrt(l+1);this._w=.25/f,this._x=(c-h)*f,this._y=(r-a)*f,this._z=(s-e)*f}else if(i>o&&i>u){var y=2*Math.sqrt(1+i-o-u);this._w=(c-h)/y,this._x=.25*y,this._y=(e+s)/y,this._z=(r+a)/y}else if(o>u){var x=2*Math.sqrt(1+o-i-u);this._w=(r-a)/x,this._x=(e+s)/x,this._y=.25*x,this._z=(h+c)/x}else{var p=2*Math.sqrt(1+u-i-o);this._w=(s-e)/p,this._x=(r+a)/p,this._y=(h+c)/p,this._z=.25*p}return this._onChangeCallback(),this},s.setFromUnitVectors=function(t,n){var i=t.dot(n)+1;return i<Number.EPSILON?(i=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=i):(this._x=0,this._y=-t.z,this._z=t.y,this._w=i)):(this._x=t.y*n.z-t.z*n.y,this._y=t.z*n.x-t.x*n.z,this._z=t.x*n.y-t.y*n.x,this._w=i),this.normalize()},s.rotateTowards=function(t,n){var i=this.angleTo(t);if(0===i)return this;var e=Math.min(1,n/i);return this.slerp(t,e),this},s.identity=function(){return this.set(0,0,0,1)},s.invert=function(){return this.conjugate()},s.conjugate=function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this},s.dot=function(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w},s.lengthSq=function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},s.length=function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},s.normalize=function(){var t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this},s.multiply=function(t){return this.multiplyQuaternions(this,t)},s.premultiply=function(t){return this.multiplyQuaternions(t,this)},s.multiplyQuaternions=function(t,n){var i=t._x,e=t._y,r=t._z,s=t._w,o=n._x,h=n._y,a=n._z,c=n._w;return this._x=i*c+s*o+e*a-r*h,this._y=e*c+s*h+r*o-i*a,this._z=r*c+s*a+i*h-e*o,this._w=s*c-i*o-e*h-r*a,this._onChangeCallback(),this},s.slerp=function(t,n){if(0===n)return this;if(1===n)return this.copy(t);var i=this._x,e=this._y,r=this._z,s=this._w,o=s*t._w+i*t._x+e*t._y+r*t._z;if(o<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,o=-o):this.copy(t),o>=1)return this._w=s,this._x=i,this._y=e,this._z=r,this;var h=1-o*o;if(h<=Number.EPSILON){var a=1-n;return this._w=a*s+n*this._w,this._x=a*i+n*this._x,this._y=a*e+n*this._y,this._z=a*r+n*this._z,this.normalize(),this}var c=Math.sqrt(h),u=Math.atan2(c,o),l=Math.sin((1-n)*u)/c,f=Math.sin(n*u)/c;return this._w=s*l+this._w*f,this._x=i*l+this._x*f,this._y=e*l+this._y*f,this._z=r*l+this._z*f,this._onChangeCallback(),this},s.slerpQuaternions=function(t,n,i){return this.copy(t).slerp(n,i)},s.random=function(){var t=2*Math.PI*Math.random(),n=2*Math.PI*Math.random(),i=Math.random(),e=Math.sqrt(1-i),r=Math.sqrt(i);return this.set(e*Math.sin(t),e*Math.cos(t),r*Math.sin(n),r*Math.cos(n))},s.equals=function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w},s.fromArray=function(t,n){return void 0===n&&(n=0),this._x=t[n],this._y=t[n+1],this._z=t[n+2],this._w=t[n+3],this._onChangeCallback(),this},s.toArray=function(t,n){return void 0===t&&(t=[]),void 0===n&&(n=0),t[n]=this._x,t[n+1]=this._y,t[n+2]=this._z,t[n+3]=this._w,t},s.fromBufferAttribute=function(t,n){return this._x=t.getX(n),this._y=t.getY(n),this._z=t.getZ(n),this._w=t.getW(n),this._onChangeCallback(),this},s.toJSON=function(){return this.toArray()},s._onChange=function(t){return this._onChangeCallback=t,this},s._onChangeCallback=function(){},i=t,(e=[{key:"x",get:function(){return this._x},set:function(t){this._x=t,this._onChangeCallback()}},{key:"y",get:function(){return this._y},set:function(t){this._y=t,this._onChangeCallback()}},{key:"z",get:function(){return this._z},set:function(t){this._z=t,this._onChangeCallback()}},{key:"w",get:function(){return this._w},set:function(t){this._w=t,this._onChangeCallback()}}])&&n(i.prototype,e),r&&n(i,r),Object.defineProperty(i,"prototype",{writable:!1}),t}()),F=function(){function t(t,n,i){void 0===t&&(t=0),void 0===n&&(n=0),void 0===i&&(i=0),this.x=t,this.y=n,this.z=i}var n=t.prototype;return n.set=function(t,n,i){return void 0===i&&(i=this.z),this.x=t,this.y=n,this.z=i,this},n.clone=function(){return new this.constructor(this.x,this.y,this.z)},n.copy=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},n.add=function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this},n.addScalar=function(t){return this.x+=t,this.y+=t,this.z+=t,this},n.addVectors=function(t,n){return this.x=t.x+n.x,this.y=t.y+n.y,this.z=t.z+n.z,this},n.addScaledVector=function(t,n){return this.x+=t.x*n,this.y+=t.y*n,this.z+=t.z*n,this},n.sub=function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this},n.subScalar=function(t){return this.x-=t,this.y-=t,this.z-=t,this},n.subVectors=function(t,n){return this.x=t.x-n.x,this.y=t.y-n.y,this.z=t.z-n.z,this},n.multiply=function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this},n.multiplyScalar=function(t){return this.x*=t,this.y*=t,this.z*=t,this},n.multiplyVectors=function(t,n){return this.x=t.x*n.x,this.y=t.y*n.y,this.z=t.z*n.z,this},n.applyAxisAngle=function(t,n){return this.applyQuaternion(C.setFromAxisAngle(t,n))},n.applyMatrix4=function(t){var n=this.x,i=this.y,e=this.z,r=t.elements,s=1/(r[3]*n+r[7]*i+r[11]*e+r[15]);return this.x=(r[0]*n+r[4]*i+r[8]*e+r[12])*s,this.y=(r[1]*n+r[5]*i+r[9]*e+r[13])*s,this.z=(r[2]*n+r[6]*i+r[10]*e+r[14])*s,this},n.applyQuaternion=function(t){var n=this.x,i=this.y,e=this.z,r=t.x,s=t.y,o=t.z,h=t.w,a=h*n+s*e-o*i,c=h*i+o*n-r*e,u=h*e+r*i-s*n,l=-r*n-s*i-o*e;return this.x=a*h+l*-r+c*-o-u*-s,this.y=c*h+l*-s+u*-r-a*-o,this.z=u*h+l*-o+a*-s-c*-r,this},n.divide=function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this},n.divideScalar=function(t){return this.multiplyScalar(1/t)},n.min=function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},n.max=function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},n.clamp=function(t,n){return this.x=Math.max(t.x,Math.min(n.x,this.x)),this.y=Math.max(t.y,Math.min(n.y,this.y)),this.z=Math.max(t.z,Math.min(n.z,this.z)),this},n.clampScalar=function(t,n){return this.x=Math.max(t,Math.min(n,this.x)),this.y=Math.max(t,Math.min(n,this.y)),this.z=Math.max(t,Math.min(n,this.z)),this},n.clampLength=function(t,n){var i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(n,i)))},n.dot=function(t){return this.x*t.x+this.y*t.y+this.z*t.z},n.lengthSq=function(){return this.x*this.x+this.y*this.y+this.z*this.z},n.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},n.normalize=function(){return this.divideScalar(this.length()||1)},n.setLength=function(t){return this.normalize().multiplyScalar(t)},n.lerp=function(t,n){return this.x+=(t.x-this.x)*n,this.y+=(t.y-this.y)*n,this.z+=(t.z-this.z)*n,this},n.lerpVectors=function(t,n,i){return this.x=t.x+(n.x-t.x)*i,this.y=t.y+(n.y-t.y)*i,this.z=t.z+(n.z-t.z)*i,this},n.cross=function(t){return this.crossVectors(this,t)},n.crossVectors=function(t,n){var i=t.x,e=t.y,r=t.z,s=n.x,o=n.y,h=n.z;return this.x=e*h-r*o,this.y=r*s-i*h,this.z=i*o-e*s,this},n.distanceTo=function(t){return Math.sqrt(this.distanceToSquared(t))},n.equals=function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z},n.fromArray=function(t,n){return void 0===n&&(n=0),this.x=t[n],this.y=t[n+1],this.z=t[n+2],this},n.random=function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this},t}();function V(t,n){let i=t.length-1;for(let e=0,r=n.length;e<r;e++)t[++i]=n[e]}function Z(t){let n,i,e=0,r=1;const s=t.length;for(;r<s;)n=i||t[0],i=t[r],e+=(i[0]-n[0])*(i[1]+n[1]),r++;return e>0}function L(t){O(t)||t.push(t[0])}function O(t){const n=t.length,[i,e]=t[0],[r,s]=t[n-1];return i===r&&e===s}function q(t){let n=0,i=0;const e=t.length;for(;i<e;)n+=t[i].length,i++;return n}function U(t,n){n=n||[1/0,1/0,-1/0,-1/0];for(let i=0,e=t.length;i<e;i++){const e=t[i];if(Array.isArray(e[0][0]))U(e,n);else for(let t=0,i=e.length;t<i;t++){const i=e[t],[r,s]=i;n[0]=Math.min(n[0],r),n[1]=Math.min(n[1],s),n[2]=Math.max(n[2],r),n[3]=Math.max(n[3],s)}}return n}function I(t,n){for(let i=0,e=t.length;i<e;i++){const e=t[i];L(e),0===i?Z(e)||(t[i]=e.reverse()):Z(e)&&(t[i]=e.reverse()),n&&O(e)&&e.splice(e.length-1,1)}}function j(t,n,i){return t[0]=n[0]-i[0],t[1]=n[1]-i[1],t[2]=n[2]-i[2],t}function E(t,n){const i=n[0],e=n[1],r=n[2],s=Math.sqrt(i*i+e*e+r*r)||1;return t[0]=i/s,t[1]=e/s,t[2]=r/s,t}function N(t,n,i){const e=n[0],r=n[1],s=n[2],o=i[0],h=i[1],a=i[2];return t[0]=r*a-s*h,t[1]=s*o-e*a,t[2]=e*h-r*o,t}function R(t,n){function i(t,n,i,e){t[0]=n,t[1]=i,t[2]=e}const e=[],r=[],s=[],o=[],h=[],a=[],c=t.length,u=new Float32Array(n.length);let l=0;for(;l<c;){const c=3*t[l],f=3*t[l+1],y=3*t[l+2];i(e,n[c],n[c+1],n[c+2]),i(r,n[f],n[f+1],n[f+2]),i(s,n[y],n[y+1],n[y+2]),j(h,s,r),j(o,e,r),N(a,h,o);for(let t=0;t<3;t++)u[c+t]+=a[t],u[f+t]+=a[t],u[y+t]+=a[t];l+=3}let f=0;const y=u.length;for(;f<y;)i(a,u[f],u[f+1],u[f+2]),E(a,a),u[f]=a[0]||0,u[f+1]=a[1]||0,u[f+2]=a[2]||0,f+=3;return u}function T(t){if(1===t.length){return{position:t[0].position,normal:t[0].normal,uv:t[0].uv,indices:t[0].indices,results:t}}let n=0,i=0;for(let e=0,r=t.length;e<r;e++){const{position:r,indices:s}=t[e];n+=r.length,i+=s.length}const e={position:new Float32Array(n),normal:new Float32Array(n),uv:new Float32Array(n/3*2),indices:new Uint32Array(i),results:t};let r=0,s=0,o=0,h=0;for(let n=0,i=t.length;n<i;n++){const{position:i,indices:a,normal:c,uv:u}=t[n];e.position.set(i,r),e.normal.set(c,r),e.uv.set(u,h);let l=0;const f=a.length;for(;l<f;){const t=a[l]+s;e.indices[o]=t,o++,l++}h+=u.length,r+=i.length,s+=i.length/3}return e}function Q(t){return 180*t/Math.PI}function W(t){return t/180*Math.PI}function X(t,n,i,e,r,s){const o=3*i,h=3*e,a=3*r,c=3*s,u=n[o],l=n[o+1],f=n[o+2],y=n[h],x=n[h+1],p=n[h+2],d=n[a],v=n[a+1],g=n[a+2],_=n[c],z=n[c+1],m=n[c+2];let w=t.length-1;Math.abs(l-x)<Math.abs(u-y)?(t[++w]=u,t[++w]=1-f,t[++w]=y,t[++w]=1-p,t[++w]=d,t[++w]=1-g,t[++w]=_,t[++w]=1-m):(t[++w]=l,t[++w]=1-f,t[++w]=x,t[++w]=1-p,t[++w]=v,t[++w]=1-g,t[++w]=z,t[++w]=1-m)}function B(t){const n=[];for(let i=0,e=t.length;i<e;i++){const e=t[i],[r,s,o]=e,h=new F(r,s,o||0);n[i]=h}return n}function Y(t){t.lineWidth=Math.max(0,t.lineWidth),t.depth=Math.max(0,t.depth),t.sideDepth=Math.max(0,t.sideDepth)}function D(t,n){const i=n.bottomStickGround,e=n.depth,r=t.depths;let s=e,o=e;r&&(s=r[0],o=r[1]);const{leftPoints:h,rightPoints:a}=t,c=t.line,u=n.pathUV;let l=c;if(h.length>l.length&&(l=h),u){!function(t){let n=0;for(let i=0,e=t.length;i<e;i++){const e=t[i],r=t[i+1];if(0===i&&(e.distance=0),e&&r){const[t,i,s]=e,[o,h,a]=r,c=t-o,u=i-h,l=(s||0)-(a||0);n+=Math.sqrt(c*c+u*u+l*l),r.distance=n}}}(l);for(let t=0,n=l.length;t<n;t++)h[t].distance=a[t].distance=l[t].distance}let f=0,y=h.length;const x=[],p=[],d=[];for(;f<y;){const t=3*f,[n,e,r]=h[f];x[t]=n,x[t+1]=e,x[t+2]=s+r;const[c,p,v]=a[f],g=3*y+t;x[g]=c,x[g+1]=p,x[g+2]=o+v;const _=2*y*3+t;x[_]=n,x[_+1]=e,x[_+2]=r,i&&(x[_+2]=0);const z=2*y*3+3*y+t;if(x[z]=c,x[z+1]=p,x[z+2]=v,i&&(x[z+2]=0),u){let t=l[f].distance;const n=2*f;d[n]=t,d[n+1]=1;const i=2*y+n;d[i]=t,d[i+1]=0;const e=2*y*2+n;d[e]=t,d[e+1]=1;const r=2*y*2+2*y+n;d[r]=t,d[r+1]=0}f++}if(!u){f=0,y=x.length;let t=d.length-1;for(;f<y;){const n=x[f],i=x[f+1];d[++t]=n,d[++t]=i,f+=3}}f=0,y=h.length;let v=p.length-1;for(;f<y-1;){const t=f,n=f+1,i=t+y,e=n+y;p[++v]=t,p[++v]=i,p[++v]=n,p[++v]=i,p[++v]=e,p[++v]=n;const r=f+2*y,s=r+1,o=r+y,h=s+y;p[++v]=r,p[++v]=o,p[++v]=s,p[++v]=o,p[++v]=h,p[++v]=s,f++}if(t.indices=p,t.points=x,t.uv=d,r)for(y=h.length,f=0;f<y;)h[f].depth=s,a[f].depth=o,f++}function G(t,n){const{points:i,indices:e,leftPoints:r,rightPoints:s,uv:o}=t,h=n.depth,a=n.bottomStickGround,c=[r,s],u=t.depths,l=n.pathUV,f=n.lineWidth;let y=i.length-1,x=e.length-1,p=o.length-1;function d(t,n){const r=i.length/3,s=u?t.depth:h,c=u?n.depth:h;i[++y]=t[0],i[++y]=t[1],i[++y]=s+t[2],i[++y]=n[0],i[++y]=n[1],i[++y]=c+n[2],i[++y]=t[0],i[++y]=t[1],i[++y]=a?0:t[2],i[++y]=n[0],i[++y]=n[1],i[++y]=a?0:n[2];const d=r+2,v=r+3,g=r,_=r+1;e[++x]=d,e[++x]=g,e[++x]=v,e[++x]=g,e[++x]=_,e[++x]=v,l?(o[++p]=t.distance,o[++p]=s/f,o[++p]=n.distance,o[++p]=c/f,o[++p]=t.distance,o[++p]=0,o[++p]=n.distance,o[++p]=0):X(o,i,d,v,g,_)}for(let t=0,n=c.length;t<n;t++){let n=c[t];t>0&&(n=n.map((t=>t)),n=n.reverse());let i=0;const e=n.length-1;for(;i<e;){d(n[i],n[i+1]),i++}}const v=r.length,g=[s[0],r[0],r[v-1],s[v-1]];for(let t=0;t<g.length;t+=2){d(g[t],g[t+1])}}const H={x:0,y:0},J={x:0,y:0};function K(t,n){let i=(n=Object.assign({},{lineWidth:1,cutCorner:!1},n)).lineWidth/2;n.isSlope&&(i*=2);const{cutCorner:e}=n,r=[],s=[],o=[],h=t.length,a=()=>{const t=s.length;if(t){s.push(s[t-1]),o.push(o[t-1]);const n=r.length;r.push(r[n-2],r[n-1])}};let c,u,l,f=0;for(;f<h;){let n,y=t[f],x=t[f+1];const p=y;if(c&&$(c,p)){a(),f++;continue}let d=!1;if(f===h-1){if(y=t[h-2],x=t[h-1],$(y,x))for(let n=t.indexOf(y);n>=0;n--){const i=t[n];if(!$(i,p)){y=i;break}}}else{if($(y,x))for(let n=t.indexOf(x);n<h;n++){const i=t[n];if(!$(i,p)){x=i;break}}if($(y,x)){d=!0;for(let n=t.indexOf(y);n>=0;n--){const i=t[n];if(!$(i,p)){y=i;break}}}}if($(y,x)){console.error("not find next vertex:index:",f,t),a(),f++;continue}let v=x[1]-y[1],g=x[0]-y[0],_=0;const z=Q(Math.atan2(v,g));if(0===f||f===h-1||d)_=z-90;else{if(n=t[f-1],$(n,x)||$(n,y))for(let i=t.indexOf(x);i>=0;i--){const e=t[i];if(!$(e,x)&&!$(e,y)){n=e;break}}if($(n,x)||$(n,y)||$(y,x)){console.error("not find pre vertex:index:",f,t),a(),f++;continue}const i=y[1]-n[1],e=y[0]-n[0],r=Q(Math.atan2(i,e));if(Math.abs(Math.abs(r-z)-180)<=1e-4)_=z-90;else{H.x=n[0]-y[0],H.y=n[1]-y[1],J.x=x[0]-y[0],J.y=x[1]-y[1],(0===H.x&&0===H.y||0===J.x&&0===J.y)&&console.error("has repeat vertex,the index:",f);const t=tt(H,J);_=Math.abs(t)<=1?z-90:z-t/2}}const m=W(_),w=p,M=[Math.cos(m)+w[0],Math.sin(m)+w[1]],[b,A]=et(y,x,i);if(!b||!A){console.error("translateLine line eror,the index:",f,t),f++;continue}let P=rt(b[0],b[1],w,M),S=rt(A[0],A[1],w,M);if(!P||!S){console.error("not find Intersection,the index:",f,t);const n=r.length,i=r[n-2],e=r[n-1];if(!i||!e){f++;continue}P=[i[0],i[1]],S=[e[0],e[1]]}P[2]=p[2]||0,S[2]=p[2]||0,r.push(P,S);let k=!1;if(e){const t=2*i;(nt(p,P)>t||nt(p,S)>t)&&(k=!0)}if(k&&n&&u&&l){let t=P;nt(P,n)<nt(S,n)&&(t=S);const e=t[1]-p[1],r=t[0]-p[0],h=Math.atan2(e,r)/Math.PI*180,a=W(h),c=Math.cos(a)*i+p[0],f=Math.sin(a)*i+p[1],d=[c,f],v=W(h+90),g=[Math.cos(v)+c,Math.sin(v)+f];let _=u,z=b,m=s,w=o;it(t,y,x)||(_=l,z=A,m=o,w=s);let M=rt(_[0],_[1],d,g),k=rt(z[0],z[1],d,g);M[2]=p[2]||0,k[2]=p[2]||0;const C=t===P?S:P;m.push(M,k),w.push(C,[...C])}else it(P,y,x)?(s.push(P),o.push(S)):(s.push(S),o.push(P));u=b,l=A,c=p,f++}return{offsetPoints:r,leftPoints:s,rightPoints:o,line:t}}function $(t,n){return t[0]===n[0]&&t[1]===n[1]}const tt=({x:t,y:n},{x:i,y:e})=>{const r=t*i+n*e,s=t*e-n*i;return Math.atan2(s,r)/Math.PI*180};function nt(t,n){const i=n[0]-t[0],e=n[1]-t[1];return Math.sqrt(i*i+e*e)}function it(t,n,i){const[e,r]=n,[s,o]=i,[h,a]=t;return(r-o)*h+(s-e)*a+e*o-s*r>0}function et(t,n,i){const e=n[1]-t[1],r=n[0]-t[0];if(0===e&&0===r)return null;const s=Math.atan2(e,r),o=s+Math.PI/2;let h=Math.cos(o)*i,a=Math.sin(o)*i;const c=[t[0]+h,t[1]+a],u=[n[0]+h,n[1]+a],l=s-Math.PI/2;h=Math.cos(l)*i,a=Math.sin(l)*i;return[[c,u],[[t[0]+h,t[1]+a],[n[0]+h,n[1]+a]]]}function rt(t,n,i,e){const r=n[0]-t[0],s=n[1]-t[1],o=e[0]-i[0],h=e[1]-i[1];if(0===r&&0===o)return null;if(0===s&&0===h)return null;const a=s/r,c=h/o,u=t[1]-a*t[0],l=i[1]-c*i[0];let f,y;return 0===r?(f=t[0],y=c*f+l):0===o?(f=i[0],y=a*f+u):0===s?(y=t[1],f=(y-l)/c):0===h?(y=i[1],f=(y-u)/a):(f=(l-u)/(a-c),y=a*f+u),[f,y]}var st=function(){function t(){this.pos=new F,this.dir=new F,this.right=new F,this.up=new F,this.dist=0,this.widthScale=1,this.sharp=!1}var n=t.prototype;return n.lerpPathPoints=function(t,n,i){this.pos.lerpVectors(t.pos,n.pos,i),this.dir.lerpVectors(t.dir,n.dir,i),this.up.lerpVectors(t.up,n.up,i),this.right.lerpVectors(t.right,n.right,i),this.dist=(n.dist-t.dist)*i+t.dist,this.widthScale=(n.widthScale-t.widthScale)*i+t.widthScale},n.copy=function(t){this.pos.copy(t.pos),this.dir.copy(t.dir),this.up.copy(t.up),this.right.copy(t.right),this.dist=t.dist,this.widthScale=t.widthScale},t}(),ot=function(){function t(t,n,i,e,r,s,o,h,a,c,u,l,f,y,x,p){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==t&&this.set(t,n,i,e,r,s,o,h,a,c,u,l,f,y,x,p)}var n=t.prototype;return n.set=function(t,n,i,e,r,s,o,h,a,c,u,l,f,y,x,p){var d=this.elements;return d[0]=t,d[4]=n,d[8]=i,d[12]=e,d[1]=r,d[5]=s,d[9]=o,d[13]=h,d[2]=a,d[6]=c,d[10]=u,d[14]=l,d[3]=f,d[7]=y,d[11]=x,d[15]=p,this},n.multiply=function(t){return this.multiplyMatrices(this,t)},n.makeRotationAxis=function(t,n){var i=Math.cos(n),e=Math.sin(n),r=1-i,s=t.x,o=t.y,h=t.z,a=r*s,c=r*o;return this.set(a*s+i,a*o-e*h,a*h+e*o,0,a*o+e*h,c*o+i,c*h-e*s,0,a*h-e*o,c*h+e*s,r*h*h+i,0,0,0,0,1),this},n.equals=function(t){for(var n=this.elements,i=t.elements,e=0;e<16;e++)if(n[e]!==i[e])return!1;return!0},t}(),ht=function(){function t(){this.type="Curve",this.arcLengthDivisions=200}var n=t.prototype;return n.getPoint=function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},n.getPointAt=function(t,n){var i=this.getUtoTmapping(t);return this.getPoint(i,n)},n.getPoints=function(t){void 0===t&&(t=5);for(var n=[],i=0;i<=t;i++)n.push(this.getPoint(i/t));return n},n.getLength=function(){var t=this.getLengths();return t[t.length-1]},n.getLengths=function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var n,i=[],e=this.getPoint(0),r=0;i.push(0);for(var s=1;s<=t;s++)r+=(n=this.getPoint(s/t)).distanceTo(e),i.push(r),e=n;return this.cacheArcLengths=i,i},n.getUtoTmapping=function(t,n){var i,e=this.getLengths(),r=0,s=e.length;i=n||t*e[s-1];for(var o,h=0,a=s-1;h<=a;)if((o=e[r=Math.floor(h+(a-h)/2)]-i)<0)h=r+1;else{if(!(o>0)){a=r;break}a=r-1}if(e[r=a]===i)return r/(s-1);var c=e[r];return(r+(i-c)/(e[r+1]-c))/(s-1)},t}();function at(t,n,i,e){return function(t,n){var i=1-t;return i*i*n}(t,n)+function(t,n){return 2*(1-t)*t*n}(t,i)+function(t,n){return t*t*n}(t,e)}var ct=function(t){var n,e;function r(n,i,e){var r;return void 0===n&&(n=new F),void 0===i&&(i=new F),void 0===e&&(e=new F),(r=t.call(this)||this).isQuadraticBezierCurve3=!0,r.type="QuadraticBezierCurve3",r.v0=n,r.v1=i,r.v2=e,r}return e=t,(n=r).prototype=Object.create(e.prototype),n.prototype.constructor=n,i(n,e),r.prototype.getPoint=function(t,n){void 0===n&&(n=new F);var i=n,e=this.v0,r=this.v1,s=this.v2;return i.set(at(t,e.x,r.x,s.x),at(t,e.y,r.y,s.y),at(t,e.z,r.z,s.z)),i},r}(ht),ut=new F,lt=new F,ft=new F,yt=new ot,xt=new ct;var pt=function(){function t(){this.array=[],this.count=0}var n=t.prototype;return n.set=function(t,n,i,e,r){if(void 0===n&&(n=.1),void 0===i&&(i=10),void 0===e&&(e=null),void 0===r&&(r=!1),(t=t.slice(0)).length<2)return console.warn("PathPointList: points length less than 2."),void(this.count=0);r&&!t[0].equals(t[t.length-1])&&t.push((new F).copy(t[0]));for(var s=0,o=t.length;s<o;s++)if(0===s)this._start(t[s],t[s+1],e);else if(s===o-1)if(r){this._corner(t[s],t[1],n,i,e);var h=this.array[0].dist;this.array[0].copy(this.array[this.count-1]),this.array[0].dist=h}else this._end(t[s]);else this._corner(t[s],t[s+1],n,i,e)},n.distance=function(){return this.count>0?this.array[this.count-1].dist:0},n._getByIndex=function(t){return this.array[t]||(this.array[t]=new st),this.array[t]},n._start=function(t,n,i){this.count=0;var e=this._getByIndex(this.count);if(e.pos.copy(t),e.dir.subVectors(n,t),i)e.up.copy(i);else{var r=Number.MAX_VALUE,s=Math.abs(e.dir.x),o=Math.abs(e.dir.y),h=Math.abs(e.dir.z);s<r&&(r=s,e.up.set(1,0,0)),o<r&&(r=o,e.up.set(0,1,0)),h<r&&e.up.set(0,0,1)}e.right.crossVectors(e.dir,e.up).normalize(),e.up.crossVectors(e.right,e.dir).normalize(),e.dist=0,e.widthScale=1,e.sharp=!1,e.dir.normalize(),this.count++},n._end=function(t){var n=this.array[this.count-1],i=this._getByIndex(this.count);i.pos.copy(t),i.dir.subVectors(t,n.pos);var e=i.dir.length();i.dir.normalize(),i.up.copy(n.up);var r=ut.crossVectors(n.dir,i.dir);if(r.length()>Number.EPSILON){r.normalize();var s=Math.acos(Math.min(Math.max(n.dir.dot(i.dir),-1),1));i.up.applyMatrix4(yt.makeRotationAxis(r,s))}i.right.crossVectors(i.dir,i.up).normalize(),i.dist=n.dist+e,i.widthScale=1,i.sharp=!1,this.count++},n._corner=function(t,n,i,e,r){if(i>0&&e>0){for(var s=function(t,n,i,e,r,s){var o=ut.subVectors(n,t),h=lt.subVectors(i,n),a=o.length(),c=h.length();o.normalize(),h.normalize();var u=Math.min(.999999*(r?a/2:a),e);s.v0.copy(n).sub(o.multiplyScalar(u)),s.v1.copy(n);var l=Math.min(c/2*.999999,e);return s.v2.copy(n).add(h.multiplyScalar(l)),s}(this.array[this.count-1].pos,t,n,i,this.count-1==0,xt),o=s.getPoints(e),h=0;h<e;h++)this._sharpCorner(o[h],o[h+1],r,0===h?1:0);o[e].equals(n)||this._sharpCorner(o[e],n,r,2)}else this._sharpCorner(t,n,r,0,!0)},n._sharpCorner=function(t,n,i,e,r){void 0===e&&(e=0),void 0===r&&(r=!1);var s=this.array[this.count-1],o=this._getByIndex(this.count),h=ut.subVectors(t,s.pos),a=lt.subVectors(n,t),c=h.length();if(h.normalize(),a.normalize(),o.pos.copy(t),1===e?o.dir.copy(h):2===e?o.dir.copy(a):(o.dir.addVectors(h,a),o.dir.normalize()),i)1===o.dir.dot(i)?o.right.crossVectors(a,i).normalize():o.right.crossVectors(o.dir,i).normalize(),o.up.crossVectors(o.right,o.dir).normalize();else{o.up.copy(s.up);var u=ft.crossVectors(s.dir,o.dir);if(u.length()>Number.EPSILON){u.normalize();var l=Math.acos(Math.min(Math.max(s.dir.dot(o.dir),-1),1));o.up.applyMatrix4(yt.makeRotationAxis(u,l))}o.right.crossVectors(o.dir,o.up).normalize()}o.dist=s.dist+c;var f=h.dot(a);o.widthScale=Math.min(1/Math.sqrt((1+f)/2),1.415)||1,o.sharp=Math.abs(f-1)>.05&&r,this.count++},t}();const dt=new F(0,0,1),vt=new F,gt=new F,_t=new F,zt=new F,mt=new F,wt=new F;const Mt=new F(0,0,1),bt=new F;const At=new F(0,0,1),Pt=new F;function St(t,n){const[i,e]=t,[r,s]=n,o=s-e,h=r-i;return Math.atan2(o,h)}const kt=new F(0,0,0);t.cylinder=function(t,n){const i=Object.assign({},{radius:1,height:2,radialSegments:6},n),e=Math.round(Math.max(4,i.radialSegments));let{radius:r,height:s}=i;const o=360/e/360*Math.PI*2,h=e+1,a=new Float32Array(3*h*2),[c,u]=t;let l=0,f=0;const y=3*h,x=2*h,p=[],d=[];let v=p.length-1;for(let t=-1;t<e;t++){const n=o*t,i=Math.cos(n)*r+c,e=Math.sin(n)*r+u;a[l]=i,a[l+1]=e,a[l+2]=0,a[l+y]=i,a[l+1+y]=e,a[l+2+y]=s;let h=0,g=0;h=.5+i/r/2,g=.5+e/r/2,d[f]=h,d[f+1]=g,d[f+x]=h,d[f+1+x]=g,l+=3,f+=2,t>1&&(p[++v]=0,p[++v]=t-1,p[++v]=t)}l-=3,a[l]=a[0],a[l+1]=a[1],a[l+2]=a[2];const g=a.length;a[g-3]=a[0],a[g-2]=a[1],a[g-1]=s;const _=p.length;v=p.length-1;for(let t=0;t<_;t++){const n=p[t];p[++v]=n+h}const z=new Float32Array(2*(3*h*2-6));let m=-1;l=2*h,f=0,v=p.length-1;let w=d.length-1;for(let t=0,n=a.length/2;t<n-3;t+=3){const n=a[t],i=a[t+1],e=a[t+3],o=a[t+4];z[++m]=n,z[++m]=i,z[++m]=s,z[++m]=e,z[++m]=o,z[++m]=s,z[++m]=n,z[++m]=i,z[++m]=0,z[++m]=e,z[++m]=o,z[++m]=0;const c=l+2,u=l+3,y=l,x=l+1;p[++v]=y,p[++v]=c,p[++v]=x,p[++v]=c,p[++v]=u,p[++v]=x,l+=4;const g=f/h,_=(f+1)/h;d[++w]=g,d[++w]=s/r/2,d[++w]=_,d[++w]=s/r/2,d[++w]=g,d[++w]=0,d[++w]=_,d[++w]=0,f++}const M=new Float32Array(a.length+z.length);M.set(a,0),M.set(z,a.length);const b=R(p,M);return{points:a,indices:new Uint32Array(p),position:M,normal:b,uv:new Float32Array(d)}},t.expandLine=K,t.expandPaths=function(t,n){const i=Object.assign({},{lineWidth:1,cornerRadius:0,cornerSplit:10},n),e=t.map((t=>{const n=B(t),e=new pt;e.set(n,i.cornerRadius,i.cornerSplit,dt);const r=function(t,n){const i=n.lineWidth||.1,e=1,r=i/2,s=i,o=t.distance(),h=e*o;let a=0;const c=[],u=[],l=[],f=[];let y=0;if(0===o)return{position:c,normal:u,uv:l,indices:f,count:a};const x=r/s;let p,d=c.length-1,v=u.length-1,g=l.length-1,_=f.length-1;function z(t){const n=0===c.length,i=t.sharp&&!n,e=t.dist/s,o=t.dir,h=t.up,p=t.right;if(vt.copy(p).multiplyScalar(r*t.widthScale),gt.copy(p).multiplyScalar(-r*t.widthScale),vt.add(t.pos),gt.add(t.pos),i){_t.fromArray(c,c.length-6).sub(gt),zt.fromArray(c,c.length-3).sub(vt);const t=_t.length()-zt.length();let n,i;t>0?(n=_t,i=gt):(n=zt,i=vt),mt.copy(n).setLength(Math.abs(t)).add(i);let r=wt.copy(i).sub(mt).normalize().dot(o)*wt.copy(i).sub(mt).length()*2;wt.copy(o).setLength(r).add(mt),t>0?(c[++d]=mt.x,c[++d]=mt.y,c[++d]=mt.z,c[++d]=vt.x,c[++d]=vt.y,c[++d]=vt.z,c[++d]=gt.x,c[++d]=gt.y,c[++d]=gt.z,c[++d]=vt.x,c[++d]=vt.y,c[++d]=vt.z,c[++d]=wt.x,c[++d]=wt.y,c[++d]=wt.z,c[++d]=vt.x,c[++d]=vt.y,c[++d]=vt.z,y+=6,f[++_]=y-6,f[++_]=y-8,f[++_]=y-7,f[++_]=y-6,f[++_]=y-7,f[++_]=y-5,f[++_]=y-4,f[++_]=y-6,f[++_]=y-5,f[++_]=y-2,f[++_]=y-4,f[++_]=y-1,a+=12):(c[++d]=gt.x,c[++d]=gt.y,c[++d]=gt.z,c[++d]=mt.x,c[++d]=mt.y,c[++d]=mt.z,c[++d]=gt.x,c[++d]=gt.y,c[++d]=gt.z,c[++d]=vt.x,c[++d]=vt.y,c[++d]=vt.z,c[++d]=gt.x,c[++d]=gt.y,c[++d]=gt.z,c[++d]=wt.x,c[++d]=wt.y,c[++d]=wt.z,y+=6,f[++_]=y-6,f[++_]=y-8,f[++_]=y-7,f[++_]=y-6,f[++_]=y-7,f[++_]=y-5,f[++_]=y-6,f[++_]=y-5,f[++_]=y-3,f[++_]=y-2,f[++_]=y-3,f[++_]=y-1,a+=12);for(let t=0;t<6;t++)u[++v]=h.x,u[++v]=h.y,u[++v]=h.z;l[++g]=e-x,l[++g]=0,l[++g]=e-x,l[++g]=1,l[++g]=e,l[++g]=0,l[++g]=e,l[++g]=1,l[++g]=e+x,l[++g]=0,l[++g]=e+x,l[++g]=1}else c[++d]=gt.x,c[++d]=gt.y,c[++d]=gt.z,c[++d]=vt.x,c[++d]=vt.y,c[++d]=vt.z,u[++v]=h.x,u[++v]=h.y,u[++v]=h.z,u[++v]=h.x,u[++v]=h.y,u[++v]=h.z,l[++g]=e,l[++g]=0,l[++g]=e,l[++g]=1,y+=2,n||(f[++_]=y-2,f[++_]=y-4,f[++_]=y-3,f[++_]=y-2,f[++_]=y-3,f[++_]=y-1,a+=6)}if(h>0)for(let n=0;n<t.count;n++){const i=t.array[n];if(i.dist>h){const e=t.array[n-1];p=new st;const r=(h-e.dist)/(i.dist-e.dist);p.lerpPathPoints(e,i,r),z(p);break}z(i)}else p=t.array[0];return{position:c,normal:u,uv:l,indices:f,count:a}}(e,i);return{position:new Float32Array(r.position),indices:new Uint32Array(r.indices),uv:new Float32Array(r.uv),normal:new Float32Array(r.normal),line:t,count:r.count}})),r=T(e);return r.lines=t,r},t.expandTubes=function(t,n){const i=Object.assign({},{radius:1,cornerSplit:0,radialSegments:8,startRad:-Math.PI/4},n),e=t.map((t=>{const n=B(t),e=new pt;e.set(n,0,i.cornerSplit,Mt);const r=function(t,n){const i=Math.max(n.radius||1,1e-8),e=void 0!==n.progress?n.progress:1,r=Math.max(3,n.radialSegments||8),s=n.startRad||0,o=2*i*Math.PI,h=t.distance(),a=e*h;if(0===a)return null;let c=0;const u=[],l=[],f=[],y=[];let x=0,p=-1,d=-1,v=-1,g=-1;function _(t,n,i){const e=0===u.length,r=t.dist/o;for(let e=0;e<=i;e++){let o=e;o===i&&(o=0),bt.copy(t.up).applyAxisAngle(t.dir,s+2*Math.PI*o/i).normalize();const h=n*t.widthScale;u[++p]=t.pos.x+bt.x*h,u[++p]=t.pos.y+bt.y*h,u[++p]=t.pos.z+bt.z*h,l[++d]=bt.x,l[++d]=bt.y,l[++d]=bt.z,f[++v]=r,f[++v]=e/i,x++}if(!e){const t=x-2*(i+1),n=x-(i+1);for(let e=0;e<i;e++)y[++g]=n+e,y[++g]=t+e,y[++g]=t+e+1,y[++g]=n+e,y[++g]=t+e+1,y[++g]=n+e+1,c+=6}}if(a>0)for(let n=0;n<t.count;n++){const e=t.array[n];if(e.dist>a){const s=t.array[n-1],o=new st,h=(a-s.dist)/(e.dist-s.dist);o.lerpPathPoints(s,e,h),_(o,i,r);break}_(e,i,r)}return{points:u,normal:l,uv:f,indices:y,count:c}}(e,i);return r.line=t,r.position=new Float32Array(r.points),r.indices=new Uint32Array(r.indices),r.uv=new Float32Array(r.uv),r.normal=new Float32Array(r.normal),r})),r=T(e);return r.lines=t,r},t.extrudePolygons=function(t,n){const i=Object.assign({},{depth:2,top:!0},n),r=t.map((t=>{I(t,!0);const n=function(t,n){const i=q(t),e=t.length,r=[],s=new Float32Array(2*i),o=[],h=[],a=3*i,c=2*i,u=n.depth;let l=0,f=0,y=0;for(let n=0;n<e;n++){const i=t[n];n>0&&r.push(l/2);let e=0;const x=i.length;for(;e<x;){const t=i[e],n=t[0],r=t[1],x=t[2]||0;s[l++]=n,s[l++]=r,o[f]=n,o[f+1]=r,o[f+2]=u+x,o[a+f]=n,o[a+f+1]=r,o[a+f+2]=x,h[y]=n,h[y+1]=r,h[c+y]=n,h[c+y+1]=r,f+=3,y+=2,e++}}return{flatVertices:s,holes:r,points:o,count:i,uv:h}}(t,i);n.polygon=t;return function(t,n,i){const e=[],{count:r}=t,s=i.top;for(let t=0,i=n.length;t<i;t+=3){const o=n[t],h=n[t+1],a=n[t+2];s&&(e[t]=o,e[t+1]=h,e[t+2]=a);let c=i+t;const u=r+o,l=r+h,f=r+a;s||(c=t),e[c]=u,e[c+1]=l,e[c+2]=f}t.indices=e}(n,e(n.flatVertices,n.holes,2),i),function(t,n){const{points:i,indices:e,polygon:r,uv:s}=t,o=n.depth;let h=i.length-1,a=e.length-1;for(let t=0,n=r.length;t<n;t++){const n=r[t];let c=0;const u=n.length;for(;c<u;){const t=n[c];let r=n[c+1];c===u-1&&(r=n[0]);const l=i.length/3,f=t[0],y=t[1],x=t[2]||0,p=r[0],d=r[1],v=r[2]||0;i[++h]=f,i[++h]=y,i[++h]=x+o,i[++h]=p,i[++h]=d,i[++h]=v+o,i[++h]=f,i[++h]=y,i[++h]=x,i[++h]=p,i[++h]=d,i[++h]=v;const g=l+2,_=l+3,z=l,m=l+1;e[++a]=g,e[++a]=z,e[++a]=_,e[++a]=z,e[++a]=m,e[++a]=_,X(s,i,g,_,z,m),c++}}}(n,i),n.position=new Float32Array(n.points),n.indices=new Uint32Array(n.indices),n.uv=new Float32Array(n.uv),n.normal=R(n.indices,n.position),n})),s=T(r);return s.polygons=t,s},t.extrudePolygonsOnPath=function(t,n){const i=Object.assign({},{openEnd:!1,openEndUV:!0,polygonRotation:0},n),{extrudePath:r,openEnd:s}=i;if(!r||!Array.isArray(r)||r.length<2)return console.error("extrudePath is error:",r),null;const o=U(t),[h,a,c,u]=o,l=[(h+c)/2,(a+u)/2];i.center=l,i.bbox=o;const f=B(r),y=new pt;y.set(f,0,i.cornerSplit,At);const x=t.map((t=>{I(t,!1);const n=function(t,n,i){const e=function(t,n){const{center:i,polygonRotation:e}=n,[r,s]=i,o=[];return t.forEach(((t,n)=>{const h=[];let a,c=0;for(let n=0,o=t.length;n<o;n++){const o=t[n],u=o[0],l=o[1],f=u-r,y=l-s;let x=0;if(n>0){const t=a[0]-u,n=a[1]-l;x=Math.sqrt(t*t+n*n)+c,c=x}h[n]={distance:x,radius:Math.sqrt(f*f+y*y),angle:-St(i,o)+e},a=o}o[n]={ring:h,ringLen:c}})),o}(n,i),r=[],s=[],o=[],h=[];let a=0,c=-1,u=-1,l=-1,f=-1;const y=[],x=[];function p(t,n,i,e,p){const d=t.dist/i,v=n.length;for(let h=0;h<v;h++){const f=n[h];if(!f)continue;const g=h===v-1,_=f.angle,z=f.radius,m=f.distance;Pt.copy(t.up).applyAxisAngle(t.dir,_).normalize();const w=kt.copy(t.up);w.applyAxisAngle(t.dir,_),w.x*=z,w.y*=z,w.z*=z;const M=t.pos.x+w.x,b=t.pos.y+w.y,A=t.pos.z+w.z;if(r[++c]=M,r[++c]=b,r[++c]=A,s[++u]=Pt.x,s[++u]=Pt.y,s[++u]=Pt.z,o[++l]=d,o[++l]=m/i,a++,e&&!g){let t=y.length-1;y[++t]=M,y[++t]=b,y[++t]=A}if(p&&!g){let t=x.length-1;x[++t]=M,x[++t]=b,x[++t]=A}}if(!e){const t=a-2*v,n=a-v;for(let i=0;i<v-1;i++)h[++f]=n+i,h[++f]=t+i,h[++f]=t+i+1,h[++f]=n+i,h[++f]=t+i+1,h[++f]=n+i+1}}const d=e[0].ringLen;return e.forEach((n=>{for(let i=0;i<t.count;i++){const e=t.array[i],{ring:r,ringLen:s}=n;p(e,r,s,0===i,i===t.count-1)}})),{points:r,normal:s,uv:o,indices:h,startPoints:y,endPoints:x,polygonLen:d}}(y,t,i);return s||function(t,n,i){const{openEndUV:r}=i;for(let t=0,i=n.length;t<i;t++){const i=n[t];O(i)&&i.splice(i.length-1,1)}const s=q(n),o=[],h=[];let a=-1;for(let t=0,i=n.length;t<i;t++){const i=n[t];t>0&&h.push(o.length/2);for(let t=0,n=i.length;t<n;t++){const n=i[t];o[++a]=n[0],o[++a]=n[1]}}const c=e(o,h,2),{points:u,normal:l,uv:f,indices:y,startPoints:x,endPoints:p,polygonLen:d}=t;a=0;let v=0;const g=[],_=[],z=[],m=[];for(let t=0;t<s;t++){const n=3*t,i=x[n],e=x[n+1],s=x[n+2];g[a]=i,g[a+1]=e,g[a+2]=s,r?(_[v]=e/d,_[v+1]=s/d):(_[v]=0,_[v+1]=0);const o=p[n],h=p[n+1],c=p[n+2];z[a]=o,z[a+1]=h,z[a+2]=c,r?(m[v]=h/d,m[v+1]=c/d):(m[v]=0,m[v+1]=0),a+=3,v+=2}const w=u.length/3,M=[];for(let t=0,n=c.length;t<n;t++)M[t]=c[t]+w,M[t+n]=c[t]+w+s;const b=R(c,g),A=R(c,z);V(u,g),V(u,z),V(f,_),V(f,m),V(l,b),V(l,A),V(y,M)}(n,t,i),n.polygon=t,n.position=new Float32Array(n.points),n.indices=new Uint32Array(n.indices),n.uv=new Float32Array(n.uv),n.normal=new Float32Array(n.normal),n})),p=T(x);return p.polygons=t,p},t.extrudePolylines=function(t,n){const i=Object.assign({},{depth:2,lineWidth:1,bottomStickGround:!1,pathUV:!1},n);Y(i);const e=t.map((t=>{const n=K(t,i);return n.line=t,D(n,i),G(n,i),n.position=new Float32Array(n.points),n.indices=new Uint32Array(n.indices),n.uv=new Float32Array(n.uv),n.normal=R(n.indices,n.position),n})),r=T(e);return r.lines=t,r},t.extrudeSlopes=function(t,n){const i=Object.assign({},{depth:2,lineWidth:1,side:"left",sideDepth:0,bottomStickGround:!1,pathUV:!1,isSlope:!0},n);Y(i);const{depth:e,side:r,sideDepth:s}=i,o=t.map((t=>{const n=K(t,i);n.line=t;const{leftPoints:o,rightPoints:h}=n,a={line:t};let c;for(let n=0,i=t.length;n<i;n++)t[n][2]=t[n][2]||0;return"left"===r?(a.leftPoints=o,a.rightPoints=t,c=[s,e]):(a.leftPoints=t,a.rightPoints=h,c=[e,s]),a.depths=c,D(a,i),G(a,i),a.position=new Float32Array(a.points),a.indices=new Uint32Array(a.indices),a.uv=new Float32Array(a.uv),a.normal=R(a.indices,a.position),a})),h=T(o);return h.lines=t,h},t.isClockwise=Z,t.leftOnLine=it,t.merge=T,t.plane=function(t,n,i,e){const r=t/(i=Math.max(1,i)),s=n/(e=Math.max(1,e)),o=-t/2,h=n/2,a=-n/2,c=(i+1)*(e+1),u=new Float32Array(3*c),l=new Float32Array(2*c),f=new Float32Array(3*c),y=new Uint32Array(10*c);let x=0,p=0,d=0;for(let c=0;c<=e;c++)for(let v=0;v<=i;v++){const g=o+r*v,_=h-s*c;u[x]=g,u[x+1]=_,u[x+2]=0,f[x]=0,f[x+1]=0,f[x+2]=1;const z=(g-o)/t,m=(_-a)/n;if(l[p]=z,l[p+1]=m,x+=3,p+=2,v<i&&c<e){const t=c*(i+1)+v,n=t+1,e=(i+1)*(c+1)+v,r=e+1;y[d]=t,y[d+1]=e,y[d+2]=n,y[d+3]=e,y[d+4]=r,y[d+5]=n,d+=6}}const v=new Uint32Array(d);for(let t=0,n=v.length;t<n;t++)v[t]=y[t];return{position:u,uv:l,normal:f,indices:v}},t.polygons=function(t,n={}){const i=Object.assign({},n),r=t.map((t=>{I(t,!0);const n=function(t,n={}){const i=[],r=[];let s=-1,o=-1,h=-1;const a=[],c=[];for(let n=0,e=t.length;n<e;n++){const e=t[n];n>0&&r.push(i.length/2);for(let t=0,n=e.length;t<n;t++){const n=e[t];i[++s]=n[0],i[++s]=n[1],a[++o]=n[0],a[++o]=n[1],a[++o]=n[2]||0,c[++h]=n[0],c[++h]=n[1]}}const u=e(i,r,2);return{normal:R(u,a),uv:c,points:a,indices:u}}(t,i);return n.polygon=t,n.position=new Float32Array(n.points),n.indices=new Uint32Array(n.indices),n.uv=new Float32Array(n.uv),n.normal=new Float32Array(n.normal),n})),s=T(r);return s.polygons=t,s},Object.defineProperty(t,"__esModule",{value:!0})}));
4
+ !function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((t="undefined"!=typeof globalThis?globalThis:t||self).polyextrude=t.polyextrude||{})}(this,(function(t){"use strict";function n(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function e(t,n){return e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},e(t,n)}function i(t,n,e){void 0===e&&(e=2);var i,s,h,a=n&&n.length,c=a?n[0]*e:t.length,u=r(t,0,c,e,!0),x=[];if(!u||u.next===u.prev)return x;if(a&&(u=function(t,n,e,i){for(var s=[],o=0,h=n.length;o<h;o++){var a=r(t,n[o]*i,o<h-1?n[o+1]*i:t.length,i,!1);a===a.next&&(a.steiner=!0),s.push(p(a))}s.sort(l);for(var c=0;c<s.length;c++)e=f(s[c],e);return e}(t,n,u,e)),t.length>80*e){i=1/0,s=1/0;for(var y=-1/0,d=-1/0,g=e;g<c;g+=e){var v=t[g],_=t[g+1];v<i&&(i=v),_<s&&(s=_),v>y&&(y=v),_>d&&(d=_)}h=0!==(h=Math.max(y-i,d-s))?32767/h:0}return o(u,x,e,i,s,h,0),x}function r(t,n,e,i,r){var s;if(r===function(t,n,e,i){for(var r=0,s=n,o=e-i;s<e;s+=i)r+=(t[o]-t[s])*(t[s+1]+t[o+1]),o=s;return r}(t,n,e,i)>0)for(var o=n;o<e;o+=i)s=P(o/i|0,t[o],t[o+1],s);else for(var h=e-i;h>=n;h-=i)s=P(h/i|0,t[h],t[h+1],s);return s&&z(s,s.next)&&(S(s),s=s.next),s}function s(t,n){if(!t)return t;n||(n=t);var e,i=t;do{if(e=!1,i.steiner||!z(i,i.next)&&0!==_(i.prev,i,i.next))i=i.next;else{if(S(i),(i=n=i.prev)===i.next)break;e=!0}}while(e||i!==n);return n}function o(t,n,e,i,r,l,f){if(t){!f&&l&&function(t,n,e,i){var r=t;do{0===r.z&&(r.z=y(r.x,r.y,n,e,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){var n,e=1;do{var i=t,r=void 0;t=null;var s=null;for(n=0;i;){n++;for(var o=i,h=0,a=0;a<e&&(h++,o=o.nextZ);a++);for(var c=e;h>0||c>0&&o;)0!==h&&(0===c||!o||i.z<=o.z)?(r=i,i=i.nextZ,h--):(r=o,o=o.nextZ,c--),s?s.nextZ=r:t=r,r.prevZ=s,s=r;i=o}s.nextZ=null,e*=2}while(n>1)}(r)}(t,i,r,l);for(var x=t;t.prev!==t.next;){var p=t.prev,d=t.next;if(l?a(t,i,r,l):h(t))n.push(p.i,t.i,d.i),S(t),t=d.next,x=d.next;else if((t=d)===x){f?1===f?o(t=c(s(t),n),n,e,i,r,l,2):2===f&&u(t,n,e,i,r,l):o(s(t),n,e,i,r,l,1);break}}}}function h(t){var n=t.prev,e=t,i=t.next;if(_(n,e,i)>=0)return!1;for(var r=n.x,s=e.x,o=i.x,h=n.y,a=e.y,c=i.y,u=Math.min(r,s,o),l=Math.min(h,a,c),f=Math.max(r,s,o),x=Math.max(h,a,c),y=i.next;y!==n;){if(y.x>=u&&y.x<=f&&y.y>=l&&y.y<=x&&g(r,h,s,a,o,c,y.x,y.y)&&_(y.prev,y,y.next)>=0)return!1;y=y.next}return!0}function a(t,n,e,i){var r=t.prev,s=t,o=t.next;if(_(r,s,o)>=0)return!1;for(var h=r.x,a=s.x,c=o.x,u=r.y,l=s.y,f=o.y,x=Math.min(h,a,c),p=Math.min(u,l,f),d=Math.max(h,a,c),v=Math.max(u,l,f),z=y(x,p,n,e,i),m=y(d,v,n,e,i),w=t.prevZ,M=t.nextZ;w&&w.z>=z&&M&&M.z<=m;){if(w.x>=x&&w.x<=d&&w.y>=p&&w.y<=v&&w!==r&&w!==o&&g(h,u,a,l,c,f,w.x,w.y)&&_(w.prev,w,w.next)>=0)return!1;if(w=w.prevZ,M.x>=x&&M.x<=d&&M.y>=p&&M.y<=v&&M!==r&&M!==o&&g(h,u,a,l,c,f,M.x,M.y)&&_(M.prev,M,M.next)>=0)return!1;M=M.nextZ}for(;w&&w.z>=z;){if(w.x>=x&&w.x<=d&&w.y>=p&&w.y<=v&&w!==r&&w!==o&&g(h,u,a,l,c,f,w.x,w.y)&&_(w.prev,w,w.next)>=0)return!1;w=w.prevZ}for(;M&&M.z<=m;){if(M.x>=x&&M.x<=d&&M.y>=p&&M.y<=v&&M!==r&&M!==o&&g(h,u,a,l,c,f,M.x,M.y)&&_(M.prev,M,M.next)>=0)return!1;M=M.nextZ}return!0}function c(t,n){var e=t;do{var i=e.prev,r=e.next.next;!z(i,r)&&m(i,e,e.next,r)&&b(i,r)&&b(r,i)&&(n.push(i.i,e.i,r.i),S(e),S(e.next),e=t=r),e=e.next}while(e!==t);return s(e)}function u(t,n,e,i,r,h){var a=t;do{for(var c=a.next.next;c!==a.prev;){if(a.i!==c.i&&v(a,c)){var u=A(a,c);return a=s(a,a.next),u=s(u,u.next),o(a,n,e,i,r,h,0),void o(u,n,e,i,r,h,0)}c=c.next}a=a.next}while(a!==t)}function l(t,n){var e=t.x-n.x;0===e&&(0===(e=t.y-n.y)&&(e=(t.next.y-t.y)/(t.next.x-t.x)-(n.next.y-n.y)/(n.next.x-n.x)));return e}function f(t,n){var e=function(t,n){var e,i=n,r=t.x,s=t.y,o=-1/0;if(z(t,i))return i;do{if(z(t,i.next))return i.next;if(s<=i.y&&s>=i.next.y&&i.next.y!==i.y){var h=i.x+(s-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(h<=r&&h>o&&(o=h,e=i.x<i.next.x?i:i.next,h===r))return e}i=i.next}while(i!==n);if(!e)return null;var a=e,c=e.x,u=e.y,l=1/0;i=e;do{if(r>=i.x&&i.x>=c&&r!==i.x&&d(s<u?r:o,s,c,u,s<u?o:r,s,i.x,i.y)){var f=Math.abs(s-i.y)/(r-i.x);b(i,t)&&(f<l||f===l&&(i.x>e.x||i.x===e.x&&x(e,i)))&&(e=i,l=f)}i=i.next}while(i!==a);return e}(t,n);if(!e)return n;var i=A(e,t);return s(i,i.next),s(e,e.next)}function x(t,n){return _(t.prev,t,n.prev)<0&&_(n.next,t,t.next)<0}function y(t,n,e,i,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-e)*r|0)|t<<8))|t<<4))|t<<2))|t<<1))|(n=1431655765&((n=858993459&((n=252645135&((n=16711935&((n=(n-i)*r|0)|n<<8))|n<<4))|n<<2))|n<<1))<<1}function p(t){var n=t,e=t;do{(n.x<e.x||n.x===e.x&&n.y<e.y)&&(e=n),n=n.next}while(n!==t);return e}function d(t,n,e,i,r,s,o,h){return(r-o)*(n-h)>=(t-o)*(s-h)&&(t-o)*(i-h)>=(e-o)*(n-h)&&(e-o)*(s-h)>=(r-o)*(i-h)}function g(t,n,e,i,r,s,o,h){return!(t===o&&n===h)&&d(t,n,e,i,r,s,o,h)}function v(t,n){return t.next.i!==n.i&&t.prev.i!==n.i&&!function(t,n){var e=t;do{if(e.i!==t.i&&e.next.i!==t.i&&e.i!==n.i&&e.next.i!==n.i&&m(e,e.next,t,n))return!0;e=e.next}while(e!==t);return!1}(t,n)&&(b(t,n)&&b(n,t)&&function(t,n){var e=t,i=!1,r=(t.x+n.x)/2,s=(t.y+n.y)/2;do{e.y>s!=e.next.y>s&&e.next.y!==e.y&&r<(e.next.x-e.x)*(s-e.y)/(e.next.y-e.y)+e.x&&(i=!i),e=e.next}while(e!==t);return i}(t,n)&&(_(t.prev,t,n.prev)||_(t,n.prev,n))||z(t,n)&&_(t.prev,t,t.next)>0&&_(n.prev,n,n.next)>0)}function _(t,n,e){return(n.y-t.y)*(e.x-n.x)-(n.x-t.x)*(e.y-n.y)}function z(t,n){return t.x===n.x&&t.y===n.y}function m(t,n,e,i){var r=M(_(t,n,e)),s=M(_(t,n,i)),o=M(_(e,i,t)),h=M(_(e,i,n));return r!==s&&o!==h||(!(0!==r||!w(t,e,n))||(!(0!==s||!w(t,i,n))||(!(0!==o||!w(e,t,i))||!(0!==h||!w(e,n,i)))))}function w(t,n,e){return n.x<=Math.max(t.x,e.x)&&n.x>=Math.min(t.x,e.x)&&n.y<=Math.max(t.y,e.y)&&n.y>=Math.min(t.y,e.y)}function M(t){return t>0?1:t<0?-1:0}function b(t,n){return _(t.prev,t,t.next)<0?_(t,n,t.next)>=0&&_(t,t.prev,n)>=0:_(t,n,t.prev)<0||_(t,t.next,n)<0}function A(t,n){var e=k(t.i,t.x,t.y),i=k(n.i,n.x,n.y),r=t.next,s=n.prev;return t.next=n,n.prev=t,e.next=r,r.prev=e,i.next=e,e.prev=i,s.next=i,i.prev=s,i}function P(t,n,e,i){var r=k(t,n,e);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function S(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function k(t,n,e){return{i:t,x:n,y:e,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}var C=new(function(){function t(t,n,e,i){void 0===t&&(t=0),void 0===n&&(n=0),void 0===e&&(e=0),void 0===i&&(i=1),this.isQuaternion=!0,this._x=t,this._y=n,this._z=e,this._w=i}t.slerpFlat=function(t,n,e,i,r,s,o){var h=e[i+0],a=e[i+1],c=e[i+2],u=e[i+3],l=r[s+0],f=r[s+1],x=r[s+2],y=r[s+3];if(0===o)return t[n+0]=h,t[n+1]=a,t[n+2]=c,void(t[n+3]=u);if(1===o)return t[n+0]=l,t[n+1]=f,t[n+2]=x,void(t[n+3]=y);if(u!==y||h!==l||a!==f||c!==x){var p=1-o,d=h*l+a*f+c*x+u*y,g=d>=0?1:-1,v=1-d*d;if(v>Number.EPSILON){var _=Math.sqrt(v),z=Math.atan2(_,d*g);p=Math.sin(p*z)/_,o=Math.sin(o*z)/_}var m=o*g;if(h=h*p+l*m,a=a*p+f*m,c=c*p+x*m,u=u*p+y*m,p===1-o){var w=1/Math.sqrt(h*h+a*a+c*c+u*u);h*=w,a*=w,c*=w,u*=w}}t[n]=h,t[n+1]=a,t[n+2]=c,t[n+3]=u},t.multiplyQuaternionsFlat=function(t,n,e,i,r,s){var o=e[i],h=e[i+1],a=e[i+2],c=e[i+3],u=r[s],l=r[s+1],f=r[s+2],x=r[s+3];return t[n]=o*x+c*u+h*f-a*l,t[n+1]=h*x+c*l+a*u-o*f,t[n+2]=a*x+c*f+o*l-h*u,t[n+3]=c*x-o*u-h*l-a*f,t};var e,i,r,s=t.prototype;return s.set=function(t,n,e,i){return this._x=t,this._y=n,this._z=e,this._w=i,this._onChangeCallback(),this},s.clone=function(){return new this.constructor(this._x,this._y,this._z,this._w)},s.copy=function(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this},s.setFromEuler=function(t,n){void 0===n&&(n=!0);var e=t._x,i=t._y,r=t._z,s=t._order,o=Math.cos,h=Math.sin,a=o(e/2),c=o(i/2),u=o(r/2),l=h(e/2),f=h(i/2),x=h(r/2);switch(s){case"XYZ":this._x=l*c*u+a*f*x,this._y=a*f*u-l*c*x,this._z=a*c*x+l*f*u,this._w=a*c*u-l*f*x;break;case"YXZ":this._x=l*c*u+a*f*x,this._y=a*f*u-l*c*x,this._z=a*c*x-l*f*u,this._w=a*c*u+l*f*x;break;case"ZXY":this._x=l*c*u-a*f*x,this._y=a*f*u+l*c*x,this._z=a*c*x+l*f*u,this._w=a*c*u-l*f*x;break;case"ZYX":this._x=l*c*u-a*f*x,this._y=a*f*u+l*c*x,this._z=a*c*x-l*f*u,this._w=a*c*u+l*f*x;break;case"YZX":this._x=l*c*u+a*f*x,this._y=a*f*u+l*c*x,this._z=a*c*x-l*f*u,this._w=a*c*u-l*f*x;break;case"XZY":this._x=l*c*u-a*f*x,this._y=a*f*u-l*c*x,this._z=a*c*x+l*f*u,this._w=a*c*u+l*f*x;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return!0===n&&this._onChangeCallback(),this},s.setFromAxisAngle=function(t,n){var e=n/2,i=Math.sin(e);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(e),this._onChangeCallback(),this},s.setFromRotationMatrix=function(t){var n=t.elements,e=n[0],i=n[4],r=n[8],s=n[1],o=n[5],h=n[9],a=n[2],c=n[6],u=n[10],l=e+o+u;if(l>0){var f=.5/Math.sqrt(l+1);this._w=.25/f,this._x=(c-h)*f,this._y=(r-a)*f,this._z=(s-i)*f}else if(e>o&&e>u){var x=2*Math.sqrt(1+e-o-u);this._w=(c-h)/x,this._x=.25*x,this._y=(i+s)/x,this._z=(r+a)/x}else if(o>u){var y=2*Math.sqrt(1+o-e-u);this._w=(r-a)/y,this._x=(i+s)/y,this._y=.25*y,this._z=(h+c)/y}else{var p=2*Math.sqrt(1+u-e-o);this._w=(s-i)/p,this._x=(r+a)/p,this._y=(h+c)/p,this._z=.25*p}return this._onChangeCallback(),this},s.setFromUnitVectors=function(t,n){var e=t.dot(n)+1;return e<Number.EPSILON?(e=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=e):(this._x=0,this._y=-t.z,this._z=t.y,this._w=e)):(this._x=t.y*n.z-t.z*n.y,this._y=t.z*n.x-t.x*n.z,this._z=t.x*n.y-t.y*n.x,this._w=e),this.normalize()},s.rotateTowards=function(t,n){var e=this.angleTo(t);if(0===e)return this;var i=Math.min(1,n/e);return this.slerp(t,i),this},s.identity=function(){return this.set(0,0,0,1)},s.invert=function(){return this.conjugate()},s.conjugate=function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this},s.dot=function(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w},s.lengthSq=function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},s.length=function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},s.normalize=function(){var t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this},s.multiply=function(t){return this.multiplyQuaternions(this,t)},s.premultiply=function(t){return this.multiplyQuaternions(t,this)},s.multiplyQuaternions=function(t,n){var e=t._x,i=t._y,r=t._z,s=t._w,o=n._x,h=n._y,a=n._z,c=n._w;return this._x=e*c+s*o+i*a-r*h,this._y=i*c+s*h+r*o-e*a,this._z=r*c+s*a+e*h-i*o,this._w=s*c-e*o-i*h-r*a,this._onChangeCallback(),this},s.slerp=function(t,n){if(0===n)return this;if(1===n)return this.copy(t);var e=this._x,i=this._y,r=this._z,s=this._w,o=s*t._w+e*t._x+i*t._y+r*t._z;if(o<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,o=-o):this.copy(t),o>=1)return this._w=s,this._x=e,this._y=i,this._z=r,this;var h=1-o*o;if(h<=Number.EPSILON){var a=1-n;return this._w=a*s+n*this._w,this._x=a*e+n*this._x,this._y=a*i+n*this._y,this._z=a*r+n*this._z,this.normalize(),this}var c=Math.sqrt(h),u=Math.atan2(c,o),l=Math.sin((1-n)*u)/c,f=Math.sin(n*u)/c;return this._w=s*l+this._w*f,this._x=e*l+this._x*f,this._y=i*l+this._y*f,this._z=r*l+this._z*f,this._onChangeCallback(),this},s.slerpQuaternions=function(t,n,e){return this.copy(t).slerp(n,e)},s.random=function(){var t=2*Math.PI*Math.random(),n=2*Math.PI*Math.random(),e=Math.random(),i=Math.sqrt(1-e),r=Math.sqrt(e);return this.set(i*Math.sin(t),i*Math.cos(t),r*Math.sin(n),r*Math.cos(n))},s.equals=function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w},s.fromArray=function(t,n){return void 0===n&&(n=0),this._x=t[n],this._y=t[n+1],this._z=t[n+2],this._w=t[n+3],this._onChangeCallback(),this},s.toArray=function(t,n){return void 0===t&&(t=[]),void 0===n&&(n=0),t[n]=this._x,t[n+1]=this._y,t[n+2]=this._z,t[n+3]=this._w,t},s.fromBufferAttribute=function(t,n){return this._x=t.getX(n),this._y=t.getY(n),this._z=t.getZ(n),this._w=t.getW(n),this._onChangeCallback(),this},s.toJSON=function(){return this.toArray()},s._onChange=function(t){return this._onChangeCallback=t,this},s._onChangeCallback=function(){},e=t,(i=[{key:"x",get:function(){return this._x},set:function(t){this._x=t,this._onChangeCallback()}},{key:"y",get:function(){return this._y},set:function(t){this._y=t,this._onChangeCallback()}},{key:"z",get:function(){return this._z},set:function(t){this._z=t,this._onChangeCallback()}},{key:"w",get:function(){return this._w},set:function(t){this._w=t,this._onChangeCallback()}}])&&n(e.prototype,i),r&&n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}()),F=function(){function t(t,n,e){void 0===t&&(t=0),void 0===n&&(n=0),void 0===e&&(e=0),this.x=t,this.y=n,this.z=e}var n=t.prototype;return n.set=function(t,n,e){return void 0===e&&(e=this.z),this.x=t,this.y=n,this.z=e,this},n.clone=function(){return new this.constructor(this.x,this.y,this.z)},n.copy=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},n.add=function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this},n.addScalar=function(t){return this.x+=t,this.y+=t,this.z+=t,this},n.addVectors=function(t,n){return this.x=t.x+n.x,this.y=t.y+n.y,this.z=t.z+n.z,this},n.addScaledVector=function(t,n){return this.x+=t.x*n,this.y+=t.y*n,this.z+=t.z*n,this},n.sub=function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this},n.subScalar=function(t){return this.x-=t,this.y-=t,this.z-=t,this},n.subVectors=function(t,n){return this.x=t.x-n.x,this.y=t.y-n.y,this.z=t.z-n.z,this},n.multiply=function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this},n.multiplyScalar=function(t){return this.x*=t,this.y*=t,this.z*=t,this},n.multiplyVectors=function(t,n){return this.x=t.x*n.x,this.y=t.y*n.y,this.z=t.z*n.z,this},n.applyAxisAngle=function(t,n){return this.applyQuaternion(C.setFromAxisAngle(t,n))},n.applyMatrix4=function(t){var n=this.x,e=this.y,i=this.z,r=t.elements,s=1/(r[3]*n+r[7]*e+r[11]*i+r[15]);return this.x=(r[0]*n+r[4]*e+r[8]*i+r[12])*s,this.y=(r[1]*n+r[5]*e+r[9]*i+r[13])*s,this.z=(r[2]*n+r[6]*e+r[10]*i+r[14])*s,this},n.applyQuaternion=function(t){var n=this.x,e=this.y,i=this.z,r=t.x,s=t.y,o=t.z,h=t.w,a=h*n+s*i-o*e,c=h*e+o*n-r*i,u=h*i+r*e-s*n,l=-r*n-s*e-o*i;return this.x=a*h+l*-r+c*-o-u*-s,this.y=c*h+l*-s+u*-r-a*-o,this.z=u*h+l*-o+a*-s-c*-r,this},n.divide=function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this},n.divideScalar=function(t){return this.multiplyScalar(1/t)},n.min=function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},n.max=function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},n.clamp=function(t,n){return this.x=Math.max(t.x,Math.min(n.x,this.x)),this.y=Math.max(t.y,Math.min(n.y,this.y)),this.z=Math.max(t.z,Math.min(n.z,this.z)),this},n.clampScalar=function(t,n){return this.x=Math.max(t,Math.min(n,this.x)),this.y=Math.max(t,Math.min(n,this.y)),this.z=Math.max(t,Math.min(n,this.z)),this},n.clampLength=function(t,n){var e=this.length();return this.divideScalar(e||1).multiplyScalar(Math.max(t,Math.min(n,e)))},n.dot=function(t){return this.x*t.x+this.y*t.y+this.z*t.z},n.lengthSq=function(){return this.x*this.x+this.y*this.y+this.z*this.z},n.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},n.normalize=function(){return this.divideScalar(this.length()||1)},n.setLength=function(t){return this.normalize().multiplyScalar(t)},n.lerp=function(t,n){return this.x+=(t.x-this.x)*n,this.y+=(t.y-this.y)*n,this.z+=(t.z-this.z)*n,this},n.lerpVectors=function(t,n,e){return this.x=t.x+(n.x-t.x)*e,this.y=t.y+(n.y-t.y)*e,this.z=t.z+(n.z-t.z)*e,this},n.cross=function(t){return this.crossVectors(this,t)},n.crossVectors=function(t,n){var e=t.x,i=t.y,r=t.z,s=n.x,o=n.y,h=n.z;return this.x=i*h-r*o,this.y=r*s-e*h,this.z=e*o-i*s,this},n.distanceTo=function(t){return Math.sqrt(this.distanceToSquared(t))},n.equals=function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z},n.fromArray=function(t,n){return void 0===n&&(n=0),this.x=t[n],this.y=t[n+1],this.z=t[n+2],this},n.random=function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this},t}();function V(t,n){let e=t.length-1;for(let i=0,r=n.length;i<r;i++)t[++e]=n[i]}function O(t){let n,e,i=0,r=1;const s=t.length;for(;r<s;)n=e||t[0],e=t[r],i+=(e[0]-n[0])*(e[1]+n[1]),r++;return i>0}function Z(t){L(t)||t.push(t[0])}function L(t){const n=t.length,[e,i]=t[0],[r,s]=t[n-1];return e===r&&i===s}function q(t){let n=0,e=0;const i=t.length;for(;e<i;)n+=t[e].length,e++;return n}function I(t,n){n=n||[1/0,1/0,-1/0,-1/0];for(let e=0,i=t.length;e<i;e++){const i=t[e];if(Array.isArray(i[0][0]))I(i,n);else for(let t=0,e=i.length;t<e;t++){const e=i[t],[r,s]=e;n[0]=Math.min(n[0],r),n[1]=Math.min(n[1],s),n[2]=Math.max(n[2],r),n[3]=Math.max(n[3],s)}}return n}function U(t,n){for(let e=0,i=t.length;e<i;e++){const i=t[e];Z(i),0===e?O(i)||(t[e]=i.reverse()):O(i)&&(t[e]=i.reverse()),n&&L(i)&&i.splice(i.length-1,1)}}function j(t,n,e){return t[0]=n[0]-e[0],t[1]=n[1]-e[1],t[2]=n[2]-e[2],t}function E(t,n){const e=n[0],i=n[1],r=n[2],s=Math.sqrt(e*e+i*i+r*r)||1;return t[0]=e/s,t[1]=i/s,t[2]=r/s,t}function N(t,n,e){const i=n[0],r=n[1],s=n[2],o=e[0],h=e[1],a=e[2];return t[0]=r*a-s*h,t[1]=s*o-i*a,t[2]=i*h-r*o,t}function R(t,n){function e(t,n,e,i){t[0]=n,t[1]=e,t[2]=i}const i=[],r=[],s=[],o=[],h=[],a=[],c=t.length,u=new Float32Array(n.length);let l=0;for(;l<c;){const c=3*t[l],f=3*t[l+1],x=3*t[l+2];e(i,n[c],n[c+1],n[c+2]),e(r,n[f],n[f+1],n[f+2]),e(s,n[x],n[x+1],n[x+2]),j(h,s,r),j(o,i,r),N(a,h,o);for(let t=0;t<3;t++)u[c+t]+=a[t],u[f+t]+=a[t],u[x+t]+=a[t];l+=3}let f=0;const x=u.length;for(;f<x;)e(a,u[f],u[f+1],u[f+2]),E(a,a),u[f]=a[0]||0,u[f+1]=a[1]||0,u[f+2]=a[2]||0,f+=3;return u}function T(t){if(1===t.length){return{position:t[0].position,normal:t[0].normal,uv:t[0].uv,indices:t[0].indices,results:t}}let n=0,e=0;for(let i=0,r=t.length;i<r;i++){const{position:r,indices:s}=t[i];n+=r.length,e+=s.length}const i={position:new Float32Array(n),normal:new Float32Array(n),uv:new Float32Array(n/3*2),indices:new Uint32Array(e),results:t};let r=0,s=0,o=0,h=0;for(let n=0,e=t.length;n<e;n++){const{position:e,indices:a,normal:c,uv:u}=t[n];i.position.set(e,r),i.normal.set(c,r),i.uv.set(u,h);let l=0;const f=a.length;for(;l<f;){const t=a[l]+s;i.indices[o]=t,o++,l++}h+=u.length,r+=e.length,s+=e.length/3}return i}function Q(t){return 180*t/Math.PI}function W(t){return t/180*Math.PI}function X(t,n,e,i,r,s){const o=3*e,h=3*i,a=3*r,c=3*s,u=n[o],l=n[o+1],f=n[o+2],x=n[h],y=n[h+1],p=n[h+2],d=n[a],g=n[a+1],v=n[a+2],_=n[c],z=n[c+1],m=n[c+2];let w=t.length-1;Math.abs(l-y)<Math.abs(u-x)?(t[++w]=u,t[++w]=1-f,t[++w]=x,t[++w]=1-p,t[++w]=d,t[++w]=1-v,t[++w]=_,t[++w]=1-m):(t[++w]=l,t[++w]=1-f,t[++w]=y,t[++w]=1-p,t[++w]=g,t[++w]=1-v,t[++w]=z,t[++w]=1-m)}function B(t){const n=[];for(let e=0,i=t.length;e<i;e++){const i=t[e],[r,s,o]=i,h=new F(r,s,o||0);n[e]=h}return n}function Y(t){t.lineWidth=Math.max(0,t.lineWidth),t.depth=Math.max(0,t.depth),t.sideDepth=Math.max(0,t.sideDepth)}function D(t,n){const e=n.bottomStickGround,i=n.depth,r=t.depths;let s=i,o=i;r&&(s=r[0],o=r[1]);const{leftPoints:h,rightPoints:a}=t,c=t.line,u=n.pathUV;let l=c;if(h.length>l.length&&(l=h),u){!function(t){let n=0;for(let e=0,i=t.length;e<i;e++){const i=t[e],r=t[e+1];if(0===e&&(i.distance=0),i&&r){const[t,e,s]=i,[o,h,a]=r,c=t-o,u=e-h,l=(s||0)-(a||0);n+=Math.sqrt(c*c+u*u+l*l),r.distance=n}}}(l);for(let t=0,n=l.length;t<n;t++)h[t].distance=a[t].distance=l[t].distance}let f=0,x=h.length;const y=[],p=[],d=[];for(;f<x;){const t=3*f,[n,i,r]=h[f];y[t]=n,y[t+1]=i,y[t+2]=s+r;const[c,p,g]=a[f],v=3*x+t;y[v]=c,y[v+1]=p,y[v+2]=o+g;const _=2*x*3+t;y[_]=n,y[_+1]=i,y[_+2]=r,e&&(y[_+2]=0);const z=2*x*3+3*x+t;if(y[z]=c,y[z+1]=p,y[z+2]=g,e&&(y[z+2]=0),u){let t=l[f].distance;const n=2*f;d[n]=t,d[n+1]=1;const e=2*x+n;d[e]=t,d[e+1]=0;const i=2*x*2+n;d[i]=t,d[i+1]=1;const r=2*x*2+2*x+n;d[r]=t,d[r+1]=0}f++}if(!u){f=0,x=y.length;let t=d.length-1;for(;f<x;){const n=y[f],e=y[f+1];d[++t]=n,d[++t]=e,f+=3}}f=0,x=h.length;let g=p.length-1;for(;f<x-1;){const t=f,n=f+1,e=t+x,i=n+x;p[++g]=t,p[++g]=e,p[++g]=n,p[++g]=e,p[++g]=i,p[++g]=n;const r=f+2*x,s=r+1,o=r+x,h=s+x;p[++g]=r,p[++g]=o,p[++g]=s,p[++g]=o,p[++g]=h,p[++g]=s,f++}if(t.indices=p,t.points=y,t.uv=d,r)for(x=h.length,f=0;f<x;)h[f].depth=s,a[f].depth=o,f++}function G(t,n){const{points:e,indices:i,leftPoints:r,rightPoints:s,uv:o}=t,h=n.depth,a=n.bottomStickGround,c=[r,s],u=t.depths,l=n.pathUV,f=n.lineWidth;let x=e.length-1,y=i.length-1,p=o.length-1;function d(t,n){const r=e.length/3,s=u?t.depth:h,c=u?n.depth:h;e[++x]=t[0],e[++x]=t[1],e[++x]=s+t[2],e[++x]=n[0],e[++x]=n[1],e[++x]=c+n[2],e[++x]=t[0],e[++x]=t[1],e[++x]=a?0:t[2],e[++x]=n[0],e[++x]=n[1],e[++x]=a?0:n[2];const d=r+2,g=r+3,v=r,_=r+1;i[++y]=d,i[++y]=v,i[++y]=g,i[++y]=v,i[++y]=_,i[++y]=g,l?(o[++p]=t.distance,o[++p]=s/f,o[++p]=n.distance,o[++p]=c/f,o[++p]=t.distance,o[++p]=0,o[++p]=n.distance,o[++p]=0):X(o,e,d,g,v,_)}for(let t=0,n=c.length;t<n;t++){let n=c[t];t>0&&(n=n.map((t=>t)),n=n.reverse());let e=0;const i=n.length-1;for(;e<i;){d(n[e],n[e+1]),e++}}const g=r.length,v=[s[0],r[0],r[g-1],s[g-1]];for(let t=0;t<v.length;t+=2){d(v[t],v[t+1])}}const H={x:0,y:0},J={x:0,y:0};function K(t,n){let e=(n=Object.assign({},{lineWidth:1,cutCorner:!1},n)).lineWidth/2;n.isSlope&&(e*=2);const{cutCorner:i}=n,r=[],s=[],o=[],h=t.length,a=()=>{const t=s.length;if(t){s.push(s[t-1]),o.push(o[t-1]);const n=r.length;r.push(r[n-2],r[n-1])}};let c,u,l,f=0;for(;f<h;){let n,x=t[f],y=t[f+1];const p=x;if(c&&$(c,p)){a(),f++;continue}let d=!1;if(f===h-1){if(x=t[h-2],y=t[h-1],$(x,y))for(let n=t.indexOf(x);n>=0;n--){const e=t[n];if(!$(e,p)){x=e;break}}}else{if($(x,y))for(let n=t.indexOf(y);n<h;n++){const e=t[n];if(!$(e,p)){y=e;break}}if($(x,y)){d=!0;for(let n=t.indexOf(x);n>=0;n--){const e=t[n];if(!$(e,p)){x=e;break}}}}if($(x,y)){console.error("not find next vertex:index:",f,t),a(),f++;continue}let g=y[1]-x[1],v=y[0]-x[0],_=0;const z=Q(Math.atan2(g,v));if(0===f||f===h-1||d)_=z-90;else{if(n=t[f-1],$(n,y)||$(n,x))for(let e=t.indexOf(y);e>=0;e--){const i=t[e];if(!$(i,y)&&!$(i,x)){n=i;break}}if($(n,y)||$(n,x)||$(x,y)){console.error("not find pre vertex:index:",f,t),a(),f++;continue}const e=x[1]-n[1],i=x[0]-n[0],r=Q(Math.atan2(e,i));if(Math.abs(Math.abs(r-z)-180)<=1e-4)_=z-90;else{H.x=n[0]-x[0],H.y=n[1]-x[1],J.x=y[0]-x[0],J.y=y[1]-x[1],(0===H.x&&0===H.y||0===J.x&&0===J.y)&&console.error("has repeat vertex,the index:",f);const t=tt(H,J);_=Math.abs(t)<=1?z-90:z-t/2}}const m=W(_),w=p,M=[Math.cos(m)+w[0],Math.sin(m)+w[1]],[b,A]=it(x,y,e);if(!b||!A){console.error("translateLine line eror,the index:",f,t),f++;continue}let P=rt(b[0],b[1],w,M),S=rt(A[0],A[1],w,M);if(!P||!S){console.error("not find Intersection,the index:",f,t);const n=r.length,e=r[n-2],i=r[n-1];if(!e||!i){f++;continue}P=[e[0],e[1]],S=[i[0],i[1]]}P[2]=p[2]||0,S[2]=p[2]||0,r.push(P,S);let k=!1;if(i){const t=2*e;(nt(p,P)>t||nt(p,S)>t)&&(k=!0)}if(k&&n&&u&&l){let t=P;nt(P,n)<nt(S,n)&&(t=S);const i=t[1]-p[1],r=t[0]-p[0],h=Math.atan2(i,r)/Math.PI*180,a=W(h),c=Math.cos(a)*e+p[0],f=Math.sin(a)*e+p[1],d=[c,f],g=W(h+90),v=[Math.cos(g)+c,Math.sin(g)+f];let _=u,z=b,m=s,w=o;et(t,x,y)||(_=l,z=A,m=o,w=s);let M=rt(_[0],_[1],d,v),k=rt(z[0],z[1],d,v);M[2]=p[2]||0,k[2]=p[2]||0;const C=t===P?S:P;m.push(M,k),w.push(C,[...C])}else et(P,x,y)?(s.push(P),o.push(S)):(s.push(S),o.push(P));u=b,l=A,c=p,f++}return{offsetPoints:r,leftPoints:s,rightPoints:o,line:t}}function $(t,n){return t[0]===n[0]&&t[1]===n[1]}const tt=({x:t,y:n},{x:e,y:i})=>{const r=t*e+n*i,s=t*i-n*e;return Math.atan2(s,r)/Math.PI*180};function nt(t,n){const e=n[0]-t[0],i=n[1]-t[1];return Math.sqrt(e*e+i*i)}function et(t,n,e){const[i,r]=n,[s,o]=e,[h,a]=t;return(r-o)*h+(s-i)*a+i*o-s*r>0}function it(t,n,e){const i=n[1]-t[1],r=n[0]-t[0];if(0===i&&0===r)return null;const s=Math.atan2(i,r),o=s+Math.PI/2;let h=Math.cos(o)*e,a=Math.sin(o)*e;const c=[t[0]+h,t[1]+a],u=[n[0]+h,n[1]+a],l=s-Math.PI/2;h=Math.cos(l)*e,a=Math.sin(l)*e;return[[c,u],[[t[0]+h,t[1]+a],[n[0]+h,n[1]+a]]]}function rt(t,n,e,i){const r=n[0]-t[0],s=n[1]-t[1],o=i[0]-e[0],h=i[1]-e[1];if(0===r&&0===o)return null;if(0===s&&0===h)return null;const a=s/r,c=h/o,u=t[1]-a*t[0],l=e[1]-c*e[0];let f,x;return 0===r?(f=t[0],x=c*f+l):0===o?(f=e[0],x=a*f+u):0===s?(x=t[1],f=(x-l)/c):0===h?(x=e[1],f=(x-u)/a):(f=(l-u)/(a-c),x=a*f+u),[f,x]}var st=function(){function t(){this.pos=new F,this.dir=new F,this.right=new F,this.up=new F,this.dist=0,this.widthScale=1,this.sharp=!1}var n=t.prototype;return n.lerpPathPoints=function(t,n,e){this.pos.lerpVectors(t.pos,n.pos,e),this.dir.lerpVectors(t.dir,n.dir,e),this.up.lerpVectors(t.up,n.up,e),this.right.lerpVectors(t.right,n.right,e),this.dist=(n.dist-t.dist)*e+t.dist,this.widthScale=(n.widthScale-t.widthScale)*e+t.widthScale},n.copy=function(t){this.pos.copy(t.pos),this.dir.copy(t.dir),this.up.copy(t.up),this.right.copy(t.right),this.dist=t.dist,this.widthScale=t.widthScale},t}(),ot=function(){function t(t,n,e,i,r,s,o,h,a,c,u,l,f,x,y,p){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==t&&this.set(t,n,e,i,r,s,o,h,a,c,u,l,f,x,y,p)}var n=t.prototype;return n.set=function(t,n,e,i,r,s,o,h,a,c,u,l,f,x,y,p){var d=this.elements;return d[0]=t,d[4]=n,d[8]=e,d[12]=i,d[1]=r,d[5]=s,d[9]=o,d[13]=h,d[2]=a,d[6]=c,d[10]=u,d[14]=l,d[3]=f,d[7]=x,d[11]=y,d[15]=p,this},n.multiply=function(t){return this.multiplyMatrices(this,t)},n.makeRotationAxis=function(t,n){var e=Math.cos(n),i=Math.sin(n),r=1-e,s=t.x,o=t.y,h=t.z,a=r*s,c=r*o;return this.set(a*s+e,a*o-i*h,a*h+i*o,0,a*o+i*h,c*o+e,c*h-i*s,0,a*h-i*o,c*h+i*s,r*h*h+e,0,0,0,0,1),this},n.equals=function(t){for(var n=this.elements,e=t.elements,i=0;i<16;i++)if(n[i]!==e[i])return!1;return!0},t}(),ht=function(){function t(){this.type="Curve",this.arcLengthDivisions=200}var n=t.prototype;return n.getPoint=function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},n.getPointAt=function(t,n){var e=this.getUtoTmapping(t);return this.getPoint(e,n)},n.getPoints=function(t){void 0===t&&(t=5);for(var n=[],e=0;e<=t;e++)n.push(this.getPoint(e/t));return n},n.getLength=function(){var t=this.getLengths();return t[t.length-1]},n.getLengths=function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var n,e=[],i=this.getPoint(0),r=0;e.push(0);for(var s=1;s<=t;s++)r+=(n=this.getPoint(s/t)).distanceTo(i),e.push(r),i=n;return this.cacheArcLengths=e,e},n.getUtoTmapping=function(t,n){var e,i=this.getLengths(),r=0,s=i.length;e=n||t*i[s-1];for(var o,h=0,a=s-1;h<=a;)if((o=i[r=Math.floor(h+(a-h)/2)]-e)<0)h=r+1;else{if(!(o>0)){a=r;break}a=r-1}if(i[r=a]===e)return r/(s-1);var c=i[r];return(r+(e-c)/(i[r+1]-c))/(s-1)},t}();function at(t,n,e,i){return function(t,n){var e=1-t;return e*e*n}(t,n)+function(t,n){return 2*(1-t)*t*n}(t,e)+function(t,n){return t*t*n}(t,i)}var ct=function(t){var n,i;function r(n,e,i){var r;return void 0===n&&(n=new F),void 0===e&&(e=new F),void 0===i&&(i=new F),(r=t.call(this)||this).isQuadraticBezierCurve3=!0,r.type="QuadraticBezierCurve3",r.v0=n,r.v1=e,r.v2=i,r}return i=t,(n=r).prototype=Object.create(i.prototype),n.prototype.constructor=n,e(n,i),r.prototype.getPoint=function(t,n){void 0===n&&(n=new F);var e=n,i=this.v0,r=this.v1,s=this.v2;return e.set(at(t,i.x,r.x,s.x),at(t,i.y,r.y,s.y),at(t,i.z,r.z,s.z)),e},r}(ht),ut=new F,lt=new F,ft=new F,xt=new ot,yt=new ct;var pt=function(){function t(){this.array=[],this.count=0}var n=t.prototype;return n.set=function(t,n,e,i,r){if(void 0===n&&(n=.1),void 0===e&&(e=10),void 0===i&&(i=null),void 0===r&&(r=!1),(t=t.slice(0)).length<2)return console.warn("PathPointList: points length less than 2."),void(this.count=0);r&&!t[0].equals(t[t.length-1])&&t.push((new F).copy(t[0]));for(var s=0,o=t.length;s<o;s++)if(0===s)this._start(t[s],t[s+1],i);else if(s===o-1)if(r){this._corner(t[s],t[1],n,e,i);var h=this.array[0].dist;this.array[0].copy(this.array[this.count-1]),this.array[0].dist=h}else this._end(t[s]);else this._corner(t[s],t[s+1],n,e,i)},n.distance=function(){return this.count>0?this.array[this.count-1].dist:0},n._getByIndex=function(t){return this.array[t]||(this.array[t]=new st),this.array[t]},n._start=function(t,n,e){this.count=0;var i=this._getByIndex(this.count);if(i.pos.copy(t),i.dir.subVectors(n,t),e)i.up.copy(e);else{var r=Number.MAX_VALUE,s=Math.abs(i.dir.x),o=Math.abs(i.dir.y),h=Math.abs(i.dir.z);s<r&&(r=s,i.up.set(1,0,0)),o<r&&(r=o,i.up.set(0,1,0)),h<r&&i.up.set(0,0,1)}i.right.crossVectors(i.dir,i.up).normalize(),i.up.crossVectors(i.right,i.dir).normalize(),i.dist=0,i.widthScale=1,i.sharp=!1,i.dir.normalize(),this.count++},n._end=function(t){var n=this.array[this.count-1],e=this._getByIndex(this.count);e.pos.copy(t),e.dir.subVectors(t,n.pos);var i=e.dir.length();e.dir.normalize(),e.up.copy(n.up);var r=ut.crossVectors(n.dir,e.dir);if(r.length()>Number.EPSILON){r.normalize();var s=Math.acos(Math.min(Math.max(n.dir.dot(e.dir),-1),1));e.up.applyMatrix4(xt.makeRotationAxis(r,s))}e.right.crossVectors(e.dir,e.up).normalize(),e.dist=n.dist+i,e.widthScale=1,e.sharp=!1,this.count++},n._corner=function(t,n,e,i,r){if(e>0&&i>0){for(var s=function(t,n,e,i,r,s){var o=ut.subVectors(n,t),h=lt.subVectors(e,n),a=o.length(),c=h.length();o.normalize(),h.normalize();var u=Math.min(.999999*(r?a/2:a),i);s.v0.copy(n).sub(o.multiplyScalar(u)),s.v1.copy(n);var l=Math.min(c/2*.999999,i);return s.v2.copy(n).add(h.multiplyScalar(l)),s}(this.array[this.count-1].pos,t,n,e,this.count-1==0,yt),o=s.getPoints(i),h=0;h<i;h++)this._sharpCorner(o[h],o[h+1],r,0===h?1:0);o[i].equals(n)||this._sharpCorner(o[i],n,r,2)}else this._sharpCorner(t,n,r,0,!0)},n._sharpCorner=function(t,n,e,i,r){void 0===i&&(i=0),void 0===r&&(r=!1);var s=this.array[this.count-1],o=this._getByIndex(this.count),h=ut.subVectors(t,s.pos),a=lt.subVectors(n,t),c=h.length();if(h.normalize(),a.normalize(),o.pos.copy(t),1===i?o.dir.copy(h):2===i?o.dir.copy(a):(o.dir.addVectors(h,a),o.dir.normalize()),e)1===o.dir.dot(e)?o.right.crossVectors(a,e).normalize():o.right.crossVectors(o.dir,e).normalize(),o.up.crossVectors(o.right,o.dir).normalize();else{o.up.copy(s.up);var u=ft.crossVectors(s.dir,o.dir);if(u.length()>Number.EPSILON){u.normalize();var l=Math.acos(Math.min(Math.max(s.dir.dot(o.dir),-1),1));o.up.applyMatrix4(xt.makeRotationAxis(u,l))}o.right.crossVectors(o.dir,o.up).normalize()}o.dist=s.dist+c;var f=h.dot(a);o.widthScale=Math.min(1/Math.sqrt((1+f)/2),1.415)||1,o.sharp=Math.abs(f-1)>.05&&r,this.count++},t}();const dt=new F(0,0,1),gt=new F,vt=new F,_t=new F,zt=new F,mt=new F,wt=new F;const Mt=new F(0,0,1),bt=new F;const At=new F(0,0,1),Pt=new F;function St(t,n){const[e,i]=t,[r,s]=n,o=s-i,h=r-e;return Math.atan2(o,h)}const kt=new F(0,0,0);function Ct(t,n){if(t.x===n.x)return t.y===n.y?null:{x:t.x};var e=(n.y-t.y)/(n.x-t.x);return{a:e,b:t.y-e*t.x}}function Ft(t,n,e){const i=n.x-t.x,r=n.y-t.y,s=Math.sqrt(i*i+r*r),o=e.x-t.x,h=e.y-t.y,a=Math.sqrt(o*o+h*h)/s,c=n.z-t.z;return t.z+c*a}function Vt(t,n,e,i){var r=Ct(t,n),s=Ct(e,i);if(null===r||null===s)return null;if(r.hasOwnProperty("x")){if(s.hasOwnProperty("x"))return null;const e={x:r.x,y:s.a*r.x+s.b,z:0};return e.z=Ft(t,n,e),e}if(s.hasOwnProperty("x")){const e={x:s.x,y:r.a*s.x+r.b,z:0};return e.z=Ft(t,n,e),e}if(r.a===s.a)return null;var o=(s.b-r.b)/(r.a-s.a);const h={x:o,y:r.a*o+r.b,z:0};return h.z=Ft(t,n,h),h}function Ot(t,n,e){return{x:t.x+n*Math.cos(e),y:t.y+n*Math.sin(e),z:t.z||0}}function Zt(t,n,e){return function(t,n,e){if(t.offsetAngle===n.offsetAngle)return[t.offset[1]];const i=qt(t.offset,n.offset);if(i*e>0&&i*qt(t.offset,[t.offset[0],n.offset[1]])>0)return[Vt(t.offset[0],t.offset[1],n.offset[0],n.offset[1])];var r=[],s=t.original[1],o=e>0,h=o?n.offsetAngle:t.offsetAngle,a=o?t.offsetAngle:n.offsetAngle;a<h&&(a+=2*Math.PI);for(var c=Math.PI/8,u=h;u<a;u+=c)r.push(Ot(s,e,u));return r.push(Ot(s,e,a)),o?r.reverse():r}(t,n,e).filter((function(t){return t}))}function Lt(t){return{x:t[1].x-t[0].x,y:t[1].y-t[0].y}}function qt(t,n){const e=Lt(t),i=Lt(n);return Math.atan2(e.x*i.y-e.y*i.x,e.x*i.x+e.y*i.y)}function It(t,n){var e=function(t,n){var e=[];for(let r=1,s=t.length;r<s;r++){let s=t[r-1],o=t[r];const[h,a,c]=s,[u,l,f]=o;if(h!==u||a!==l){s={x:h,y:a,z:c||0},o={x:u,y:l,z:f||0};var i=Math.atan2(s.y-o.y,s.x-o.x)-Math.PI/2;e.push({offsetAngle:i,original:[s,o],offset:[Ot(s,n,i),Ot(o,n,i)]})}}return e}(t,n.offset);return function(t,n){var e=[],i=t[0],r=t[t.length-1];if(i&&r){e.push(i.offset[0]);for(let i=1,r=t.length;i<r;i++)V(e,Zt(t[i-1],t[i],n));e.push(r.offset[1])}return e}(e,n.offset)}t.cylinder=function(t,n){const e=Object.assign({},{radius:1,height:2,radialSegments:6},n),i=Math.round(Math.max(4,e.radialSegments));let{radius:r,height:s}=e;const o=360/i/360*Math.PI*2,h=i+1,a=new Float32Array(3*h*2),[c,u]=t;let l=0,f=0;const x=3*h,y=2*h,p=[],d=[];let g=p.length-1;for(let t=-1;t<i;t++){const n=o*t,e=Math.cos(n)*r+c,i=Math.sin(n)*r+u;a[l]=e,a[l+1]=i,a[l+2]=0,a[l+x]=e,a[l+1+x]=i,a[l+2+x]=s;let h=0,v=0;h=.5+e/r/2,v=.5+i/r/2,d[f]=h,d[f+1]=v,d[f+y]=h,d[f+1+y]=v,l+=3,f+=2,t>1&&(p[++g]=0,p[++g]=t-1,p[++g]=t)}l-=3,a[l]=a[0],a[l+1]=a[1],a[l+2]=a[2];const v=a.length;a[v-3]=a[0],a[v-2]=a[1],a[v-1]=s;const _=p.length;g=p.length-1;for(let t=0;t<_;t++){const n=p[t];p[++g]=n+h}const z=new Float32Array(2*(3*h*2-6));let m=-1;l=2*h,f=0,g=p.length-1;let w=d.length-1;for(let t=0,n=a.length/2;t<n-3;t+=3){const n=a[t],e=a[t+1],i=a[t+3],o=a[t+4];z[++m]=n,z[++m]=e,z[++m]=s,z[++m]=i,z[++m]=o,z[++m]=s,z[++m]=n,z[++m]=e,z[++m]=0,z[++m]=i,z[++m]=o,z[++m]=0;const c=l+2,u=l+3,x=l,y=l+1;p[++g]=x,p[++g]=c,p[++g]=y,p[++g]=c,p[++g]=u,p[++g]=y,l+=4;const v=f/h,_=(f+1)/h;d[++w]=v,d[++w]=s/r/2,d[++w]=_,d[++w]=s/r/2,d[++w]=v,d[++w]=0,d[++w]=_,d[++w]=0,f++}const M=new Float32Array(a.length+z.length);M.set(a,0),M.set(z,a.length);const b=R(p,M);return{points:a,indices:new Uint32Array(p),position:M,normal:b,uv:new Float32Array(d)}},t.expandLine=K,t.expandPaths=function(t,n){const e=Object.assign({},{lineWidth:1,cornerRadius:0,cornerSplit:10},n),i=t.map((t=>{const n=B(t),i=new pt;i.set(n,e.cornerRadius,e.cornerSplit,dt);const r=function(t,n){const e=n.lineWidth||.1,i=1,r=e/2,s=e,o=t.distance(),h=i*o;let a=0;const c=[],u=[],l=[],f=[];let x=0;if(0===o)return{position:c,normal:u,uv:l,indices:f,count:a};const y=r/s;let p,d=c.length-1,g=u.length-1,v=l.length-1,_=f.length-1;function z(t){const n=0===c.length,e=t.sharp&&!n,i=t.dist/s,o=t.dir,h=t.up,p=t.right;if(gt.copy(p).multiplyScalar(r*t.widthScale),vt.copy(p).multiplyScalar(-r*t.widthScale),gt.add(t.pos),vt.add(t.pos),e){_t.fromArray(c,c.length-6).sub(vt),zt.fromArray(c,c.length-3).sub(gt);const t=_t.length()-zt.length();let n,e;t>0?(n=_t,e=vt):(n=zt,e=gt),mt.copy(n).setLength(Math.abs(t)).add(e);let r=wt.copy(e).sub(mt).normalize().dot(o)*wt.copy(e).sub(mt).length()*2;wt.copy(o).setLength(r).add(mt),t>0?(c[++d]=mt.x,c[++d]=mt.y,c[++d]=mt.z,c[++d]=gt.x,c[++d]=gt.y,c[++d]=gt.z,c[++d]=vt.x,c[++d]=vt.y,c[++d]=vt.z,c[++d]=gt.x,c[++d]=gt.y,c[++d]=gt.z,c[++d]=wt.x,c[++d]=wt.y,c[++d]=wt.z,c[++d]=gt.x,c[++d]=gt.y,c[++d]=gt.z,x+=6,f[++_]=x-6,f[++_]=x-8,f[++_]=x-7,f[++_]=x-6,f[++_]=x-7,f[++_]=x-5,f[++_]=x-4,f[++_]=x-6,f[++_]=x-5,f[++_]=x-2,f[++_]=x-4,f[++_]=x-1,a+=12):(c[++d]=vt.x,c[++d]=vt.y,c[++d]=vt.z,c[++d]=mt.x,c[++d]=mt.y,c[++d]=mt.z,c[++d]=vt.x,c[++d]=vt.y,c[++d]=vt.z,c[++d]=gt.x,c[++d]=gt.y,c[++d]=gt.z,c[++d]=vt.x,c[++d]=vt.y,c[++d]=vt.z,c[++d]=wt.x,c[++d]=wt.y,c[++d]=wt.z,x+=6,f[++_]=x-6,f[++_]=x-8,f[++_]=x-7,f[++_]=x-6,f[++_]=x-7,f[++_]=x-5,f[++_]=x-6,f[++_]=x-5,f[++_]=x-3,f[++_]=x-2,f[++_]=x-3,f[++_]=x-1,a+=12);for(let t=0;t<6;t++)u[++g]=h.x,u[++g]=h.y,u[++g]=h.z;l[++v]=i-y,l[++v]=0,l[++v]=i-y,l[++v]=1,l[++v]=i,l[++v]=0,l[++v]=i,l[++v]=1,l[++v]=i+y,l[++v]=0,l[++v]=i+y,l[++v]=1}else c[++d]=vt.x,c[++d]=vt.y,c[++d]=vt.z,c[++d]=gt.x,c[++d]=gt.y,c[++d]=gt.z,u[++g]=h.x,u[++g]=h.y,u[++g]=h.z,u[++g]=h.x,u[++g]=h.y,u[++g]=h.z,l[++v]=i,l[++v]=0,l[++v]=i,l[++v]=1,x+=2,n||(f[++_]=x-2,f[++_]=x-4,f[++_]=x-3,f[++_]=x-2,f[++_]=x-3,f[++_]=x-1,a+=6)}if(h>0)for(let n=0;n<t.count;n++){const e=t.array[n];if(e.dist>h){const i=t.array[n-1];p=new st;const r=(h-i.dist)/(e.dist-i.dist);p.lerpPathPoints(i,e,r),z(p);break}z(e)}else p=t.array[0];return{position:c,normal:u,uv:l,indices:f,count:a}}(i,e);return{position:new Float32Array(r.position),indices:new Uint32Array(r.indices),uv:new Float32Array(r.uv),normal:new Float32Array(r.normal),line:t,count:r.count}})),r=T(i);return r.lines=t,r},t.expandTubes=function(t,n){const e=Object.assign({},{radius:1,cornerSplit:0,radialSegments:8,startRad:-Math.PI/4},n),i=t.map((t=>{const n=B(t),i=new pt;i.set(n,0,e.cornerSplit,Mt);const r=function(t,n){const e=Math.max(n.radius||1,1e-8),i=void 0!==n.progress?n.progress:1,r=Math.max(3,n.radialSegments||8),s=n.startRad||0,o=2*e*Math.PI,h=t.distance(),a=i*h;if(0===a)return null;let c=0;const u=[],l=[],f=[],x=[];let y=0,p=-1,d=-1,g=-1,v=-1;function _(t,n,e){const i=0===u.length,r=t.dist/o;for(let i=0;i<=e;i++){let o=i;o===e&&(o=0),bt.copy(t.up).applyAxisAngle(t.dir,s+2*Math.PI*o/e).normalize();const h=n*t.widthScale;u[++p]=t.pos.x+bt.x*h,u[++p]=t.pos.y+bt.y*h,u[++p]=t.pos.z+bt.z*h,l[++d]=bt.x,l[++d]=bt.y,l[++d]=bt.z,f[++g]=r,f[++g]=i/e,y++}if(!i){const t=y-2*(e+1),n=y-(e+1);for(let i=0;i<e;i++)x[++v]=n+i,x[++v]=t+i,x[++v]=t+i+1,x[++v]=n+i,x[++v]=t+i+1,x[++v]=n+i+1,c+=6}}if(a>0)for(let n=0;n<t.count;n++){const i=t.array[n];if(i.dist>a){const s=t.array[n-1],o=new st,h=(a-s.dist)/(i.dist-s.dist);o.lerpPathPoints(s,i,h),_(o,e,r);break}_(i,e,r)}return{points:u,normal:l,uv:f,indices:x,count:c}}(i,e);return r.line=t,r.position=new Float32Array(r.points),r.indices=new Uint32Array(r.indices),r.uv=new Float32Array(r.uv),r.normal=new Float32Array(r.normal),r})),r=T(i);return r.lines=t,r},t.extrudePolygons=function(t,n){const e=Object.assign({},{depth:2,top:!0},n),r=t.map((t=>{U(t,!0);const n=function(t,n){const e=q(t),i=t.length,r=[],s=new Float32Array(2*e),o=[],h=[],a=3*e,c=2*e,u=n.depth;let l=0,f=0,x=0;for(let n=0;n<i;n++){const e=t[n];n>0&&r.push(l/2);let i=0;const y=e.length;for(;i<y;){const t=e[i],n=t[0],r=t[1],y=t[2]||0;s[l++]=n,s[l++]=r,o[f]=n,o[f+1]=r,o[f+2]=u+y,o[a+f]=n,o[a+f+1]=r,o[a+f+2]=y,h[x]=n,h[x+1]=r,h[c+x]=n,h[c+x+1]=r,f+=3,x+=2,i++}}return{flatVertices:s,holes:r,points:o,count:e,uv:h}}(t,e);n.polygon=t;return function(t,n,e){const i=[],{count:r}=t,s=e.top;for(let t=0,e=n.length;t<e;t+=3){const o=n[t],h=n[t+1],a=n[t+2];s&&(i[t]=o,i[t+1]=h,i[t+2]=a);let c=e+t;const u=r+o,l=r+h,f=r+a;s||(c=t),i[c]=u,i[c+1]=l,i[c+2]=f}t.indices=i}(n,i(n.flatVertices,n.holes,2),e),function(t,n){const{points:e,indices:i,polygon:r,uv:s}=t,o=n.depth;let h=e.length-1,a=i.length-1;for(let t=0,n=r.length;t<n;t++){const n=r[t];let c=0;const u=n.length;for(;c<u;){const t=n[c];let r=n[c+1];c===u-1&&(r=n[0]);const l=e.length/3,f=t[0],x=t[1],y=t[2]||0,p=r[0],d=r[1],g=r[2]||0;e[++h]=f,e[++h]=x,e[++h]=y+o,e[++h]=p,e[++h]=d,e[++h]=g+o,e[++h]=f,e[++h]=x,e[++h]=y,e[++h]=p,e[++h]=d,e[++h]=g;const v=l+2,_=l+3,z=l,m=l+1;i[++a]=v,i[++a]=z,i[++a]=_,i[++a]=z,i[++a]=m,i[++a]=_,X(s,e,v,_,z,m),c++}}}(n,e),n.position=new Float32Array(n.points),n.indices=new Uint32Array(n.indices),n.uv=new Float32Array(n.uv),n.normal=R(n.indices,n.position),n})),s=T(r);return s.polygons=t,s},t.extrudePolygonsOnPath=function(t,n){const e=Object.assign({},{openEnd:!1,openEndUV:!0,polygonRotation:0},n),{extrudePath:r,openEnd:s}=e;if(!r||!Array.isArray(r)||r.length<2)return console.error("extrudePath is error:",r),null;const o=I(t),[h,a,c,u]=o,l=[(h+c)/2,(a+u)/2];e.center=l,e.bbox=o;const f=B(r),x=new pt;x.set(f,0,e.cornerSplit,At);const y=t.map((t=>{U(t,!1);const n=function(t,n,e){const i=function(t,n){const{center:e,polygonRotation:i}=n,[r,s]=e,o=[];return t.forEach(((t,n)=>{const h=[];let a,c=0;for(let n=0,o=t.length;n<o;n++){const o=t[n],u=o[0],l=o[1],f=u-r,x=l-s;let y=0;if(n>0){const t=a[0]-u,n=a[1]-l;y=Math.sqrt(t*t+n*n)+c,c=y}h[n]={distance:y,radius:Math.sqrt(f*f+x*x),angle:-St(e,o)+i},a=o}o[n]={ring:h,ringLen:c}})),o}(n,e),r=[],s=[],o=[],h=[];let a=0,c=-1,u=-1,l=-1,f=-1;const x=[],y=[];function p(t,n,e,i,p){const d=t.dist/e,g=n.length;for(let h=0;h<g;h++){const f=n[h];if(!f)continue;const v=h===g-1,_=f.angle,z=f.radius,m=f.distance;Pt.copy(t.up).applyAxisAngle(t.dir,_).normalize();const w=kt.copy(t.up);w.applyAxisAngle(t.dir,_),w.x*=z,w.y*=z,w.z*=z;const M=t.pos.x+w.x,b=t.pos.y+w.y,A=t.pos.z+w.z;if(r[++c]=M,r[++c]=b,r[++c]=A,s[++u]=Pt.x,s[++u]=Pt.y,s[++u]=Pt.z,o[++l]=d,o[++l]=m/e,a++,i&&!v){let t=x.length-1;x[++t]=M,x[++t]=b,x[++t]=A}if(p&&!v){let t=y.length-1;y[++t]=M,y[++t]=b,y[++t]=A}}if(!i){const t=a-2*g,n=a-g;for(let e=0;e<g-1;e++)h[++f]=n+e,h[++f]=t+e,h[++f]=t+e+1,h[++f]=n+e,h[++f]=t+e+1,h[++f]=n+e+1}}const d=i[0].ringLen;return i.forEach((n=>{for(let e=0;e<t.count;e++){const i=t.array[e],{ring:r,ringLen:s}=n;p(i,r,s,0===e,e===t.count-1)}})),{points:r,normal:s,uv:o,indices:h,startPoints:x,endPoints:y,polygonLen:d}}(x,t,e);return s||function(t,n,e){const{openEndUV:r}=e;for(let t=0,e=n.length;t<e;t++){const e=n[t];L(e)&&e.splice(e.length-1,1)}const s=q(n),o=[],h=[];let a=-1;for(let t=0,e=n.length;t<e;t++){const e=n[t];t>0&&h.push(o.length/2);for(let t=0,n=e.length;t<n;t++){const n=e[t];o[++a]=n[0],o[++a]=n[1]}}const c=i(o,h,2),{points:u,normal:l,uv:f,indices:x,startPoints:y,endPoints:p,polygonLen:d}=t;a=0;let g=0;const v=[],_=[],z=[],m=[];for(let t=0;t<s;t++){const n=3*t,e=y[n],i=y[n+1],s=y[n+2];v[a]=e,v[a+1]=i,v[a+2]=s,r?(_[g]=i/d,_[g+1]=s/d):(_[g]=0,_[g+1]=0);const o=p[n],h=p[n+1],c=p[n+2];z[a]=o,z[a+1]=h,z[a+2]=c,r?(m[g]=h/d,m[g+1]=c/d):(m[g]=0,m[g+1]=0),a+=3,g+=2}const w=u.length/3,M=[];for(let t=0,n=c.length;t<n;t++)M[t]=c[t]+w,M[t+n]=c[t]+w+s;const b=R(c,v),A=R(c,z);V(u,v),V(u,z),V(f,_),V(f,m),V(l,b),V(l,A),V(x,M)}(n,t,e),n.polygon=t,n.position=new Float32Array(n.points),n.indices=new Uint32Array(n.indices),n.uv=new Float32Array(n.uv),n.normal=new Float32Array(n.normal),n})),p=T(y);return p.polygons=t,p},t.extrudePolylines=function(t,n){const e=Object.assign({},{depth:2,lineWidth:1,bottomStickGround:!1,pathUV:!1},n);Y(e);const i=t.map((t=>{const n=K(t,e);return n.line=t,D(n,e),G(n,e),n.position=new Float32Array(n.points),n.indices=new Uint32Array(n.indices),n.uv=new Float32Array(n.uv),n.normal=R(n.indices,n.position),n})),r=T(i);return r.lines=t,r},t.extrudeSlopes=function(t,n){const e=Object.assign({},{depth:2,lineWidth:1,side:"left",sideDepth:0,bottomStickGround:!1,pathUV:!1,isSlope:!0},n);Y(e);const{depth:i,side:r,sideDepth:s}=e,o=t.map((t=>{const n=K(t,e);n.line=t;const{leftPoints:o,rightPoints:h}=n,a={line:t};let c;for(let n=0,e=t.length;n<e;n++)t[n][2]=t[n][2]||0;return"left"===r?(a.leftPoints=o,a.rightPoints=t,c=[s,i]):(a.leftPoints=t,a.rightPoints=h,c=[i,s]),a.depths=c,D(a,e),G(a,e),a.position=new Float32Array(a.points),a.indices=new Uint32Array(a.indices),a.uv=new Float32Array(a.uv),a.normal=R(a.indices,a.position),a})),h=T(o);return h.lines=t,h},t.isClockwise=O,t.leftOnLine=et,t.merge=T,t.plane=function(t,n,e,i){const r=t/(e=Math.max(1,e)),s=n/(i=Math.max(1,i)),o=-t/2,h=n/2,a=-n/2,c=(e+1)*(i+1),u=new Float32Array(3*c),l=new Float32Array(2*c),f=new Float32Array(3*c),x=new Uint32Array(10*c);let y=0,p=0,d=0;for(let c=0;c<=i;c++)for(let g=0;g<=e;g++){const v=o+r*g,_=h-s*c;u[y]=v,u[y+1]=_,u[y+2]=0,f[y]=0,f[y+1]=0,f[y+2]=1;const z=(v-o)/t,m=(_-a)/n;if(l[p]=z,l[p+1]=m,y+=3,p+=2,g<e&&c<i){const t=c*(e+1)+g,n=t+1,i=(e+1)*(c+1)+g,r=i+1;x[d]=t,x[d+1]=i,x[d+2]=n,x[d+3]=i,x[d+4]=r,x[d+5]=n,d+=6}}const g=new Uint32Array(d);for(let t=0,n=g.length;t<n;t++)g[t]=x[t];return{position:u,uv:l,normal:f,indices:g}},t.polygons=function(t,n={}){const e=Object.assign({},n),r=t.map((t=>{U(t,!0);const n=function(t,n={}){const e=[],r=[];let s=-1,o=-1,h=-1;const a=[],c=[];for(let n=0,i=t.length;n<i;n++){const i=t[n];n>0&&r.push(e.length/2);for(let t=0,n=i.length;t<n;t++){const n=i[t];e[++s]=n[0],e[++s]=n[1],a[++o]=n[0],a[++o]=n[1],a[++o]=n[2]||0,c[++h]=n[0],c[++h]=n[1]}}const u=i(e,r,2);return{normal:R(u,a),uv:c,points:a,indices:u}}(t,e);return n.polygon=t,n.position=new Float32Array(n.points),n.indices=new Uint32Array(n.indices),n.uv=new Float32Array(n.uv),n.normal=new Float32Array(n.normal),n})),s=T(r);return s.polygons=t,s},t.polylineOffset=function(t,n){if(0===(n=Object.assign({offset:0},n)).offset)return t;const e=It(t,n),i=[];for(let t=0,n=e.length;t<n;t++){const n=e[t];if(!n)continue;const{x:r,y:s,z:o}=n;i.push([r,s,o])}return i},Object.defineProperty(t,"__esModule",{value:!0})}));
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * poly-extrude v0.20.6
2
+ * poly-extrude v0.21.0
3
3
  */
4
4
  function _defineProperties(target, props) {
5
5
  for (var i = 0; i < props.length; i++) {
@@ -4870,5 +4870,195 @@ function generateStartAndEnd(result, polygon, options) {
4870
4870
  mergeArray(indices, indexs);
4871
4871
  }
4872
4872
 
4873
- export { cylinder, expandLine, expandPaths, expandTubes, extrudePolygons, extrudePolygonsOnPath, extrudePolylines, extrudeSlopes, isClockwise, leftOnLine, merge, plane, polygons };
4873
+ function lineEquation(pt1, pt2) {
4874
+ if (pt1.x === pt2.x) {
4875
+ return pt1.y === pt2.y ? null : { x: pt1.x };
4876
+ }
4877
+ var a = (pt2.y - pt1.y) / (pt2.x - pt1.x);
4878
+ return {
4879
+ a: a,
4880
+ b: pt1.y - a * pt1.x,
4881
+ };
4882
+ }
4883
+ function calZ(p1, p2, p) {
4884
+ const dx = p2.x - p1.x, dy = p2.y - p1.y;
4885
+ const distance = Math.sqrt(dx * dx + dy * dy);
4886
+ const dx1 = p.x - p1.x, dy1 = p.y - p1.y;
4887
+ const dis = Math.sqrt(dx1 * dx1 + dy1 * dy1);
4888
+ const percent = dis / distance;
4889
+ const dz = p2.z - p1.z;
4890
+ return p1.z + dz * percent;
4891
+ }
4892
+ /**
4893
+ Return the intersection point of two lines defined by two points each
4894
+ Return null when there's no unique intersection
4895
+ */
4896
+ function intersection(l1a, l1b, l2a, l2b) {
4897
+ var line1 = lineEquation(l1a, l1b);
4898
+ var line2 = lineEquation(l2a, l2b);
4899
+ if (line1 === null || line2 === null) {
4900
+ return null;
4901
+ }
4902
+ if (line1.hasOwnProperty('x')) {
4903
+ if (line2.hasOwnProperty('x')) {
4904
+ return null;
4905
+ }
4906
+ const p = {
4907
+ x: line1.x,
4908
+ y: line2.a * line1.x + line2.b,
4909
+ z: 0
4910
+ };
4911
+ p.z = calZ(l1a, l1b, p);
4912
+ return p;
4913
+ }
4914
+ if (line2.hasOwnProperty('x')) {
4915
+ const p = {
4916
+ x: line2.x,
4917
+ y: line1.a * line2.x + line1.b,
4918
+ z: 0
4919
+ };
4920
+ p.z = calZ(l1a, l1b, p);
4921
+ return p;
4922
+ }
4923
+ if (line1.a === line2.a) {
4924
+ return null;
4925
+ }
4926
+ var x = (line2.b - line1.b) / (line1.a - line2.a);
4927
+ const p = {
4928
+ x: x,
4929
+ y: line1.a * x + line1.b,
4930
+ z: 0
4931
+ };
4932
+ p.z = calZ(l1a, l1b, p);
4933
+ return p;
4934
+ }
4935
+ function translatePoint(pt, dist, heading) {
4936
+ return {
4937
+ x: pt.x + dist * Math.cos(heading),
4938
+ y: pt.y + dist * Math.sin(heading),
4939
+ z: pt.z || 0
4940
+ };
4941
+ }
4942
+ function offsetPointLine(points, distance) {
4943
+ var offsetSegments = [];
4944
+ for (let i = 1, len = points.length; i < len; i++) {
4945
+ let a = points[i - 1], b = points[i];
4946
+ const [x1, y1, z1] = a;
4947
+ const [x2, y2, z2] = b;
4948
+ if (x1 === x2 && y1 === y2) {
4949
+ continue;
4950
+ }
4951
+ a = {
4952
+ x: x1,
4953
+ y: y1,
4954
+ z: z1 || 0
4955
+ };
4956
+ b = {
4957
+ x: x2,
4958
+ y: y2,
4959
+ z: z2 || 0
4960
+ };
4961
+ var segmentAngle = Math.atan2(a.y - b.y, a.x - b.x);
4962
+ var offsetAngle = segmentAngle - Math.PI / 2;
4963
+ offsetSegments.push({
4964
+ offsetAngle: offsetAngle,
4965
+ original: [a, b],
4966
+ offset: [
4967
+ translatePoint(a, distance, offsetAngle),
4968
+ translatePoint(b, distance, offsetAngle)
4969
+ ]
4970
+ });
4971
+ }
4972
+ return offsetSegments;
4973
+ }
4974
+ /**
4975
+ Join 2 line segments defined by 2 points each with a circular arc
4976
+ */
4977
+ function joinSegments(s1, s2, offset) {
4978
+ // TODO: different join styles
4979
+ return circularArc(s1, s2, offset)
4980
+ .filter(function (x) { return x; });
4981
+ }
4982
+ function joinLineSegments(segments, offset) {
4983
+ var joinedPoints = [];
4984
+ var first = segments[0];
4985
+ var last = segments[segments.length - 1];
4986
+ if (first && last) {
4987
+ joinedPoints.push(first.offset[0]);
4988
+ for (let i = 1, len = segments.length; i < len; i++) {
4989
+ let s1 = segments[i - 1], s2 = segments[i];
4990
+ const pts = joinSegments(s1, s2, offset);
4991
+ mergeArray(joinedPoints, pts);
4992
+ }
4993
+ joinedPoints.push(last.offset[1]);
4994
+ }
4995
+ return joinedPoints;
4996
+ }
4997
+ function segmentAsVector(s) {
4998
+ return {
4999
+ x: s[1].x - s[0].x,
5000
+ y: s[1].y - s[0].y,
5001
+ };
5002
+ }
5003
+ function getSignedAngle(s1, s2) {
5004
+ const a = segmentAsVector(s1);
5005
+ const b = segmentAsVector(s2);
5006
+ return Math.atan2(a.x * b.y - a.y * b.x, a.x * b.x + a.y * b.y);
5007
+ }
5008
+ /**
5009
+ Interpolates points between two offset segments in a circular form
5010
+ */
5011
+ function circularArc(s1, s2, distance) {
5012
+ // if the segments are the same angle,
5013
+ // there should be a single join point
5014
+ if (s1.offsetAngle === s2.offsetAngle) {
5015
+ return [s1.offset[1]];
5016
+ }
5017
+ const signedAngle = getSignedAngle(s1.offset, s2.offset);
5018
+ // for inner angles, just find the offset segments intersection
5019
+ if ((signedAngle * distance > 0) &&
5020
+ (signedAngle * getSignedAngle(s1.offset, [s1.offset[0], s2.offset[1]]) > 0)) {
5021
+ return [intersection(s1.offset[0], s1.offset[1], s2.offset[0], s2.offset[1])];
5022
+ }
5023
+ // draws a circular arc with R = offset distance, C = original meeting point
5024
+ var points = [];
5025
+ var center = s1.original[1];
5026
+ // ensure angles go in the anti-clockwise direction
5027
+ var rightOffset = distance > 0;
5028
+ var startAngle = rightOffset ? s2.offsetAngle : s1.offsetAngle;
5029
+ var endAngle = rightOffset ? s1.offsetAngle : s2.offsetAngle;
5030
+ // and that the end angle is bigger than the start angle
5031
+ if (endAngle < startAngle) {
5032
+ endAngle += Math.PI * 2;
5033
+ }
5034
+ var step = Math.PI / 8;
5035
+ for (var alpha = startAngle; alpha < endAngle; alpha += step) {
5036
+ points.push(translatePoint(center, distance, alpha));
5037
+ }
5038
+ points.push(translatePoint(center, distance, endAngle));
5039
+ return rightOffset ? points.reverse() : points;
5040
+ }
5041
+ function offsetPoints(pts, options) {
5042
+ var offsetSegments = offsetPointLine(pts, options.offset);
5043
+ return joinLineSegments(offsetSegments, options.offset);
5044
+ }
5045
+ function polylineOffset(line, options) {
5046
+ options = Object.assign({ offset: 0 }, options);
5047
+ if (options.offset === 0) {
5048
+ return line;
5049
+ }
5050
+ const pts = offsetPoints(line, options);
5051
+ const result = [];
5052
+ for (let i = 0, len = pts.length; i < len; i++) {
5053
+ const pt = pts[i];
5054
+ if (!pt) {
5055
+ continue;
5056
+ }
5057
+ const { x, y, z } = pt;
5058
+ result.push([x, y, z]);
5059
+ }
5060
+ return result;
5061
+ }
5062
+
5063
+ export { cylinder, expandLine, expandPaths, expandTubes, extrudePolygons, extrudePolygonsOnPath, extrudePolylines, extrudeSlopes, isClockwise, leftOnLine, merge, plane, polygons, polylineOffset };
4874
5064
  //# sourceMappingURL=poly-extrude.mjs.map