@mlightcad/geometry-engine 3.2.15 → 3.2.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +174 -174
- package/dist/geometry-engine.js +801 -652
- package/dist/geometry-engine.umd.cjs +1 -1
- package/lib/geometry/AcGeArea2d.d.ts +1 -1
- package/lib/geometry/AcGeArea2d.d.ts.map +1 -1
- package/lib/geometry/AcGeArea2d.js +4 -2
- package/lib/geometry/AcGeArea2d.js.map +1 -1
- package/lib/geometry/AcGeCircArc2d.d.ts.map +1 -1
- package/lib/geometry/AcGeCircArc2d.js +27 -1
- package/lib/geometry/AcGeCircArc2d.js.map +1 -1
- package/lib/geometry/AcGeCircArc3d.d.ts.map +1 -1
- package/lib/geometry/AcGeCircArc3d.js +26 -15
- package/lib/geometry/AcGeCircArc3d.js.map +1 -1
- package/lib/geometry/AcGeEllipseArc2d.d.ts +1 -0
- package/lib/geometry/AcGeEllipseArc2d.d.ts.map +1 -1
- package/lib/geometry/AcGeEllipseArc2d.js +38 -0
- package/lib/geometry/AcGeEllipseArc2d.js.map +1 -1
- package/lib/geometry/AcGeEllipseArc3d.d.ts.map +1 -1
- package/lib/geometry/AcGeEllipseArc3d.js +39 -0
- package/lib/geometry/AcGeEllipseArc3d.js.map +1 -1
- package/lib/geometry/AcGeLoop2d.d.ts +1 -1
- package/lib/geometry/AcGeLoop2d.d.ts.map +1 -1
- package/lib/geometry/AcGeLoop2d.js +11 -3
- package/lib/geometry/AcGeLoop2d.js.map +1 -1
- package/lib/geometry/AcGePolyline2d.d.ts +1 -1
- package/lib/geometry/AcGePolyline2d.d.ts.map +1 -1
- package/lib/geometry/AcGePolyline2d.js +10 -2
- package/lib/geometry/AcGePolyline2d.js.map +1 -1
- package/lib/geometry/AcGeSpline3d.d.ts +1 -1
- package/lib/geometry/AcGeSpline3d.d.ts.map +1 -1
- package/lib/geometry/AcGeSpline3d.js +21 -2
- package/lib/geometry/AcGeSpline3d.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(x,T){typeof exports=="object"&&typeof module<"u"?T(exports,require("@mlightcad/common")):typeof define=="function"&&define.amd?define(["exports","@mlightcad/common"],T):(x=typeof globalThis<"u"?globalThis:x||self,T(x["geometry-engine"]={},x.common))})(this,function(x,T){"use strict";const L=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let Zt=1234567;const Ct=Math.PI/180,Et=180/Math.PI;function Ot(){const u=Math.random()*4294967295|0,t=Math.random()*4294967295|0,s=Math.random()*4294967295|0,e=Math.random()*4294967295|0;return(L[u&255]+L[u>>8&255]+L[u>>16&255]+L[u>>24&255]+"-"+L[t&255]+L[t>>8&255]+"-"+L[t>>16&15|64]+L[t>>24&255]+"-"+L[s&63|128]+L[s>>8&255]+"-"+L[s>>16&255]+L[s>>24&255]+L[e&255]+L[e>>8&255]+L[e>>16&255]+L[e>>24&255]).toLowerCase()}function v(u,t,s){return Math.max(t,Math.min(s,u))}function It(u,t){return(u%t+t)%t}function Qt(u,t,s,e,n){return e+(u-t)*(n-e)/(s-t)}function Kt(u,t,s){return u!==t?(s-u)/(t-u):0}function Bt(u,t,s){return(1-s)*u+s*t}function $t(u,t,s,e){return Bt(u,t,1-Math.exp(-s*e))}function Ht(u,t=1){return t-Math.abs(It(u,t*2)-t)}function Wt(u,t,s){return u<=t?0:u>=s?1:(u=(u-t)/(s-t),u*u*(3-2*u))}function Jt(u,t,s){return u<=t?0:u>=s?1:(u=(u-t)/(s-t),u*u*u*(u*(u*6-15)+10))}function ts(u,t){return u+Math.floor(Math.random()*(t-u+1))}function ss(u,t){return u+Math.random()*(t-u)}function es(u){return u*(.5-Math.random())}function ns(u){u!==void 0&&(Zt=u);let t=Zt+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}function is(u){return u*Ct}function rs(u){return u*Et}function hs(u){return(u&u-1)===0&&u!==0}function os(u){return Math.pow(2,Math.ceil(Math.log(u)/Math.LN2))}function as(u){return Math.pow(2,Math.floor(Math.log(u)/Math.LN2))}function st(u){const t=Math.PI*2;return(u%t+t)%t}function cs(u,t,s){return u>t&&u<s||u>s&&u<t}function ls(u,t,s,e=!1){return u=st(u),t=st(t),s=st(s),e?t>s?u<=t&&u>=s:u<=t||u>=s:t<s?u>=t&&u<=s:u>=t||u<=s}function Nt(u){return u=Math.abs(u),u<1?0:Math.ceil(Math.log10(Math.abs(u)+1))}function us(u,t=1e-7){const s=Nt(u);return Math.max(Math.pow(10,s)*t,t)}const P={DEG2RAD:Ct,RAD2DEG:Et,generateUUID:Ot,clamp:v,euclideanModulo:It,mapLinear:Qt,inverseLerp:Kt,lerp:Bt,damp:$t,pingpong:Ht,smoothstep:Wt,smootherstep:Jt,randInt:ts,randFloat:ss,randFloatSpread:es,seededRandom:ns,degToRad:is,radToDeg:rs,isPowerOfTwo:hs,ceilPowerOfTwo:os,floorPowerOfTwo:as,normalizeAngle:st,isBetween:cs,isBetweenAngle:ls,intPartLength:Nt,relativeEps:us},dt=class dt{constructor(t,s){this.x=0,this.y=0;const e=+(t!==void 0)+ +(s!==void 0);if(e!==0){if(e===1&&t instanceof Array){this.x=t[0],this.y=t[1];return}if(e===1){const{x:n,y:i}=t;this.x=n,this.y=i;return}if(e===2){this.x=t,this.y=s;return}throw T.AcCmErrors.ILLEGAL_PARAMETERS}}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,s){return this.x=t,this.y=s,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,s){switch(t){case 0:this.x=s;break;case 1:this.y=s;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new dt(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,s){return this.x=t.x+s.x,this.y=t.y+s.y,this}addScaledVector(t,s){return this.x+=t.x*s,this.y+=t.y*s,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,s){return this.x=t.x-s.x,this.y=t.y-s.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix2d(t){const s=this.x,e=this.y,n=t.elements;return this.x=n[0]*s+n[3]*e+n[6],this.y=n[1]*s+n[4]*e+n[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,s){return this.x=Math.max(t.x,Math.min(s.x,this.x)),this.y=Math.max(t.y,Math.min(s.y,this.y)),this}clampScalar(t,s){return this.x=Math.max(t,Math.min(s,this.x)),this.y=Math.max(t,Math.min(s,this.y)),this}clampLength(t,s){const e=this.length();return this.divideScalar(e||1).multiplyScalar(Math.max(t,Math.min(s,e)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){const s=Math.sqrt(this.lengthSq()*t.lengthSq());if(s===0)return Math.PI/2;const e=this.dot(t)/s;return Math.acos(Math.max(-1,Math.min(1,e)))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const s=this.x-t.x,e=this.y-t.y;return s*s+e*e}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,s){return this.x+=(t.x-this.x)*s,this.y+=(t.y-this.y)*s,this}lerpVectors(t,s,e){return this.x=t.x+(s.x-t.x)*e,this.y=t.y+(s.y-t.y)*e,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,s=0){return this.x=t[s],this.y=t[s+1],this}toArray(t=[],s=0){return t[s]=this.x,t[s+1]=this.y,t}rotateAround(t,s){const e=Math.cos(s),n=Math.sin(s),i=this.x-t.x,r=this.y-t.y;return this.x=i*e-r*n+t.x,this.y=i*n+r*e+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}relativeEps(t=1e-7){return Math.min(P.relativeEps(this.x,t),P.relativeEps(this.y,t))}*[Symbol.iterator](){yield this.x,yield this.y}};dt.EMPTY=Object.freeze(new dt(0,0));let B=dt;const mt=class mt{constructor(t,s,e,n,i,r,h,a,o){this.elements=[1,0,0,0,1,0,0,0,1],t!=null&&s!=null&&e!=null&&n!=null&&i!=null&&r!=null&&h!=null&&a!=null&&o!=null&&this.set(t,s,e,n,i,r,h,a,o)}set(t,s,e,n,i,r,h,a,o){const c=this.elements;return c[0]=t,c[1]=n,c[2]=h,c[3]=s,c[4]=i,c[5]=a,c[6]=e,c[7]=r,c[8]=o,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const s=this.elements,e=t.elements;return s[0]=e[0],s[1]=e[1],s[2]=e[2],s[3]=e[3],s[4]=e[4],s[5]=e[5],s[6]=e[6],s[7]=e[7],s[8]=e[8],this}extractBasis(t,s,e){return t.setFromMatrix3Column(this,0),s.setFromMatrix3Column(this,1),e.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const s=t.elements;return this.set(s[0],s[4],s[8],s[1],s[5],s[9],s[2],s[6],s[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,s){const e=t.elements,n=s.elements,i=this.elements,r=e[0],h=e[3],a=e[6],o=e[1],c=e[4],l=e[7],m=e[2],d=e[5],g=e[8],y=n[0],_=n[3],A=n[6],M=n[1],p=n[4],C=n[7],w=n[2],N=n[5],z=n[8];return i[0]=r*y+h*M+a*w,i[3]=r*_+h*p+a*N,i[6]=r*A+h*C+a*z,i[1]=o*y+c*M+l*w,i[4]=o*_+c*p+l*N,i[7]=o*A+c*C+l*z,i[2]=m*y+d*M+g*w,i[5]=m*_+d*p+g*N,i[8]=m*A+d*C+g*z,this}multiplyScalar(t){const s=this.elements;return s[0]*=t,s[3]*=t,s[6]*=t,s[1]*=t,s[4]*=t,s[7]*=t,s[2]*=t,s[5]*=t,s[8]*=t,this}determinant(){const t=this.elements,s=t[0],e=t[1],n=t[2],i=t[3],r=t[4],h=t[5],a=t[6],o=t[7],c=t[8];return s*r*c-s*h*o-e*i*c+e*h*a+n*i*o-n*r*a}invert(){const t=this.elements,s=t[0],e=t[1],n=t[2],i=t[3],r=t[4],h=t[5],a=t[6],o=t[7],c=t[8],l=c*r-h*o,m=h*a-c*i,d=o*i-r*a,g=s*l+e*m+n*d;if(g===0)return this.set(0,0,0,0,0,0,0,0,0);const y=1/g;return t[0]=l*y,t[1]=(n*o-c*e)*y,t[2]=(h*e-n*r)*y,t[3]=m*y,t[4]=(c*s-n*a)*y,t[5]=(n*i-h*s)*y,t[6]=d*y,t[7]=(e*a-o*s)*y,t[8]=(r*s-e*i)*y,this}transpose(){let t;const s=this.elements;return t=s[1],s[1]=s[3],s[3]=t,t=s[2],s[2]=s[6],s[6]=t,t=s[5],s[5]=s[7],s[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const s=this.elements;return t.elements[0]=s[0],t.elements[1]=s[3],t.elements[2]=s[6],t.elements[3]=s[1],t.elements[4]=s[4],t.elements[5]=s[7],t.elements[6]=s[2],t.elements[7]=s[5],t.elements[8]=s[8],this}setUvTransform(t,s,e,n,i,r,h){const a=Math.cos(i),o=Math.sin(i);return this.set(e*a,e*o,-e*(a*r+o*h)+r+t,-n*o,n*a,-n*(-o*r+a*h)+h+s,0,0,1),this}scale(t,s){return this.premultiply(kt.makeScale(t,s)),this}rotate(t){return this.premultiply(kt.makeRotation(-t)),this}translate(t,s){return this.premultiply(kt.makeTranslation(t,s)),this}makeTranslation(t,s){return t instanceof B?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,s,0,0,1),this}makeRotation(t){const s=Math.cos(t),e=Math.sin(t);return this.set(s,-e,0,e,s,0,0,0,1),this}makeScale(t,s){return this.set(t,0,0,0,s,0,0,0,1),this}equals(t){const s=this.elements,e=t.elements;for(let n=0;n<9;n++)if(s[n]!==e[n])return!1;return!0}fromArray(t,s=0){for(let e=0;e<9;e++)this.elements[e]=t[e+s];return this}toArray(t=[],s=0){const e=this.elements;return t[s]=e[0],t[s+1]=e[1],t[s+2]=e[2],t[s+3]=e[3],t[s+4]=e[4],t[s+5]=e[5],t[s+6]=e[6],t[s+7]=e[7],t[s+8]=e[8],t}clone(){return new mt().fromArray(this.elements)}};mt.IDENTITY=Object.freeze(new mt);let $=mt;const kt=new $,O=1e-6,I=2*Math.PI,bs={x:0,y:0},Rt={x:0,y:0,z:0};class Tt{constructor(){this.equalPointTol=O,this.equalVectorTol=O}equalPoint2d(t,s){return new B(t).sub(s).length()<this.equalPointTol}equalPoint3d(t,s){return new f(t).sub(s).length()<this.equalPointTol}static equalToZero(t,s=O){return t<s&&t>-s}static equal(t,s,e=O){return Math.abs(t-s)<e}static great(t,s,e=O){return t-s>e}static less(t,s,e=O){return t-s<e}}const Lt=new Tt;function Ut(u,t,s=!1){const e=u.x,n=u.y;let i=!1;const r=t.length;for(let h=0,a=r-1;h<r;a=h++){const o=t[h].x,c=t[h].y,l=t[a].x,m=t[a].y;let d=c>n!=m>n;s&&(d=c>=n!=m>=n),d&&e<(l-o)*(n-c)/(m-c)+o&&(i=!i)}return i}function ds(u,t){if(u.length===0||t.length===0)return!1;const s=new j().setFromPoints(u),e=new j().setFromPoints(t);if(!s.intersectsBox(e))return!1;for(let n=0;n<u.length;){if(Ut(u[n],t,!0))return!0;n<u.length-1&&Lt.equalPoint2d(u[n+1],u[n])&&++n,++n}return!1}const ms={isPointInPolygon:Ut,isPolygonIntersect:ds};function Ss(u,t){const s=[],e=t-1,n=u;for(let i=0;i<=n;i++)s.push(0);for(let i=1;i<=e-n;i++)s.push(i);for(let i=0;i<=n;i++)s.push(e-n+1);return s}function Cs(u,t){const s=t.length-1,e=u,n=[0];let i=0;for(let h=1;h<=s;h++){const a=t[h][0]-t[h-1][0],o=t[h][1]-t[h-1][1],c=t[h][2]-t[h-1][2],l=Math.sqrt(a*a+o*o+c*c);i+=l,n.push(i)}const r=[];for(let h=0;h<=e;h++)r.push(0);for(let h=1;h<=s-e;h++){const a=n[h]/i;r.push(a*(s-e+1))}for(let h=0;h<=e;h++)r.push(s-e+1);return r}function gs(u,t="Uniform"){const s=u.length;if(s===0)return[];if(s===1)return[0];const e=s-1;if(t==="Uniform")return new Array(s).fill(0).map((r,h)=>h/e);const n=[0];let i=0;for(let r=1;r<=e;r++){const h=u[r][0]-u[r-1][0],a=u[r][1]-u[r-1][1],o=u[r][2]-u[r-1][2],c=Math.sqrt(h*h+a*a+o*o),l=t==="SqrtChord"?Math.sqrt(c):c;i+=l,n.push(i)}return i<1e-12?new Array(s).fill(0).map((r,h)=>h/e):n.map(r=>r/i)}function ys(u,t){const s=t.length-1,e=u,n=s+e+1,i=new Array(n+1).fill(0),r=t[t.length-1];for(let h=n-e;h<=n;h++)i[h]=r;for(let h=1;h<=s-e;h++){let a=0;for(let o=h;o<h+e;o++)a+=t[o];i[h+e]=a/e}return i}function Es(u,t){const s=t.length-1,e=u,n=[0];let i=0;for(let h=1;h<=s;h++){const a=t[h][0]-t[h-1][0],o=t[h][1]-t[h-1][1],c=t[h][2]-t[h-1][2],l=Math.sqrt(a*a+o*o+c*c),m=Math.sqrt(l);i+=m,n.push(i)}const r=[];for(let h=0;h<=e;h++)r.push(0);for(let h=1;h<=s-e;h++){const a=n[h]/i;r.push(a*(s-e+1))}for(let h=0;h<=e;h++)r.push(s-e+1);return r}function Vt(u,t){const s=u.length,e=u.map(r=>r.slice()),n=t.slice();for(let r=0;r<s;r++){let h=r,a=Math.abs(e[r][r]);for(let o=r+1;o<s;o++){const c=Math.abs(e[o][r]);c>a&&(a=c,h=o)}if(a<1e-12)throw new Error("Interpolation matrix is singular.");if(h!==r){const o=e[r];e[r]=e[h],e[h]=o;const c=n[r];n[r]=n[h],n[h]=c}for(let o=r+1;o<s;o++){const c=e[o][r]/e[r][r];if(!(Math.abs(c)<1e-14)){for(let l=r;l<s;l++)e[o][l]-=c*e[r][l];n[o]-=c*n[r]}}}const i=new Array(s).fill(0);for(let r=s-1;r>=0;r--){let h=n[r];for(let a=r+1;a<s;a++)h-=e[r][a]*i[a];i[r]=h/e[r][r]}return i}function qt(u,t,s="Uniform",e,n){if(u.length===0)return{controlPoints:[],knots:[],weights:[]};const i=u.map(S=>[S[0],S[1],S[2]??0]),r=!!e,h=!!n,a=(r?1:0)+(h?1:0),o=i.length-1,c=o+a;if(c<t)throw new Error("Not enough points to interpolate a curve of this degree.");const l=gs(i,s),m=l.slice();r&&m.unshift(l[0]),h&&m.push(l[l.length-1]);const d=ys(t,m),g=c+1,y=new Array(g),_=new Array(g),A=new Array(g),M=new Array(g);let p=0;y[p]=new Array(g).fill(0),y[p][0]=1,_[p]=i[0][0],A[p]=i[0][1],M[p]=i[0][2],p++;for(let S=1;S<=o-1;S++){const V=l[S];y[p]=new Array(g).fill(0);for(let F=0;F<=c;F++)y[p][F]=et(F,t,V,d);_[p]=i[S][0],A[p]=i[S][1],M[p]=i[S][2],p++}if(y[p]=new Array(g).fill(0),y[p][c]=1,_[p]=i[o][0],A[p]=i[o][1],M[p]=i[o][2],p++,r){const S=d[t+1]-d[0],V=S!==0?t/S:0;y[p]=new Array(g).fill(0),y[p][0]=-V,y[p][1]=V,_[p]=(e==null?void 0:e[0])??0,A[p]=(e==null?void 0:e[1])??0,M[p]=(e==null?void 0:e[2])??0,p++}if(h){const S=d[c+t+1]-d[c],V=S!==0?t/S:0;y[p]=new Array(g).fill(0),y[p][c-1]=-V,y[p][c]=V,_[p]=(n==null?void 0:n[0])??0,A[p]=(n==null?void 0:n[1])??0,M[p]=(n==null?void 0:n[2])??0,p++}const C=Vt(y,_),w=Vt(y,A),N=Vt(y,M),z=new Array(g);for(let S=0;S<g;S++)z[S]=[C[S],w[S],N[S]];const k=new Array(g).fill(1);return{controlPoints:z,knots:d,weights:k}}function et(u,t,s,e){if(t===0)return s>=e[u]&&s<e[u+1]?1:0;const n=e[u+t]-e[u],i=e[u+t+1]-e[u+1],r=n>1e-10?(s-e[u])/n:0,h=i>1e-10?(e[u+t+1]-s)/i:0;return r*et(u,t-1,s,e)+h*et(u+1,t-1,s,e)}function nt(u,t,s,e,n){const i=e.length-1,r=t;if(u=Math.max(s[r],Math.min(s[i+1],u)),Math.abs(u-s[i+1])<1e-8)return[...e[i]];if(Math.abs(u-s[r])<1e-8)return[...e[0]];const h=[0,0,0];let a=0;for(let o=0;o<=i;o++){const c=et(o,r,u,s),l=n[o]*c;h[0]+=e[o][0]*l,h[1]+=e[o][1]*l,h[2]+=e[o][2]*l,a+=l}if(Math.abs(a)<1e-10){const o=s[s.length-r-1];if(Math.abs(u-o)<1e-8)return[...e[i]];if(Math.abs(u-s[r])<1e-8)return[...e[0]]}return Math.abs(a)>=1e-10&&(h[0]/=a,h[1]/=a,h[2]/=a),h}function xs(u,t,s,e){const n=u,i=t[n],r=t[t.length-n-1];let h=0;const a=1e3,o=(r-i)/a;let c=nt(i,u,t,s,e);for(let y=1;y<=a;y++){const _=i+y*o,A=nt(_,u,t,s,e),M=A[0]-c[0],p=A[1]-c[1],C=A[2]-c[2];h+=Math.sqrt(M*M+p*p+C*C),c=A}const l=nt(r,u,t,s,e),m=l[0]-c[0],d=l[1]-c[1],g=l[2]-c[2];return h+=Math.sqrt(m*m+d*d+g*g),h}function Is(u,t=3,s="Uniform",e,n){return u.length===0?[]:qt(u,t,s,e,n).controlPoints}class it{constructor(t=0,s=0,e=0,n=1){this._x=t,this._y=s,this._z=e,this._w=n}static slerpFlat(t,s,e,n,i,r,h){let a=e[n+0],o=e[n+1],c=e[n+2],l=e[n+3];const m=i[r+0],d=i[r+1],g=i[r+2],y=i[r+3];if(h===0){t[s+0]=a,t[s+1]=o,t[s+2]=c,t[s+3]=l;return}if(h===1){t[s+0]=m,t[s+1]=d,t[s+2]=g,t[s+3]=y;return}if(l!==y||a!==m||o!==d||c!==g){let _=1-h;const A=a*m+o*d+c*g+l*y,M=A>=0?1:-1,p=1-A*A;if(p>Number.EPSILON){const w=Math.sqrt(p),N=Math.atan2(w,A*M);_=Math.sin(_*N)/w,h=Math.sin(h*N)/w}const C=h*M;if(a=a*_+m*C,o=o*_+d*C,c=c*_+g*C,l=l*_+y*C,_===1-h){const w=1/Math.sqrt(a*a+o*o+c*c+l*l);a*=w,o*=w,c*=w,l*=w}}t[s]=a,t[s+1]=o,t[s+2]=c,t[s+3]=l}static multiplyQuaternionsFlat(t,s,e,n,i,r){const h=e[n],a=e[n+1],o=e[n+2],c=e[n+3],l=i[r],m=i[r+1],d=i[r+2],g=i[r+3];return t[s]=h*g+c*l+a*d-o*m,t[s+1]=a*g+c*m+o*l-h*d,t[s+2]=o*g+c*d+h*m-a*l,t[s+3]=c*g-h*l-a*m-o*d,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,s,e,n){return this._x=t,this._y=s,this._z=e,this._w=n,this._onChangeCallback(),this}clone(){return new it(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,s=!0){const e=t.x,n=t.y,i=t.z,r=t.order,h=Math.cos,a=Math.sin,o=h(e/2),c=h(n/2),l=h(i/2),m=a(e/2),d=a(n/2),g=a(i/2);switch(r){case"XYZ":this._x=m*c*l+o*d*g,this._y=o*d*l-m*c*g,this._z=o*c*g+m*d*l,this._w=o*c*l-m*d*g;break;case"YXZ":this._x=m*c*l+o*d*g,this._y=o*d*l-m*c*g,this._z=o*c*g-m*d*l,this._w=o*c*l+m*d*g;break;case"ZXY":this._x=m*c*l-o*d*g,this._y=o*d*l+m*c*g,this._z=o*c*g+m*d*l,this._w=o*c*l-m*d*g;break;case"ZYX":this._x=m*c*l-o*d*g,this._y=o*d*l+m*c*g,this._z=o*c*g-m*d*l,this._w=o*c*l+m*d*g;break;case"YZX":this._x=m*c*l+o*d*g,this._y=o*d*l+m*c*g,this._z=o*c*g-m*d*l,this._w=o*c*l-m*d*g;break;case"XZY":this._x=m*c*l-o*d*g,this._y=o*d*l-m*c*g,this._z=o*c*g+m*d*l,this._w=o*c*l+m*d*g;break}return s===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,s){const e=s/2,n=Math.sin(e);return this._x=t.x*n,this._y=t.y*n,this._z=t.z*n,this._w=Math.cos(e),this._onChangeCallback(),this}setFromRotationMatrix(t){const s=t.elements,e=s[0],n=s[4],i=s[8],r=s[1],h=s[5],a=s[9],o=s[2],c=s[6],l=s[10],m=e+h+l;if(m>0){const d=.5/Math.sqrt(m+1);this._w=.25/d,this._x=(c-a)*d,this._y=(i-o)*d,this._z=(r-n)*d}else if(e>h&&e>l){const d=2*Math.sqrt(1+e-h-l);this._w=(c-a)/d,this._x=.25*d,this._y=(n+r)/d,this._z=(i+o)/d}else if(h>l){const d=2*Math.sqrt(1+h-e-l);this._w=(i-o)/d,this._x=(n+r)/d,this._y=.25*d,this._z=(a+c)/d}else{const d=2*Math.sqrt(1+l-e-h);this._w=(r-n)/d,this._x=(i+o)/d,this._y=(a+c)/d,this._z=.25*d}return this._onChangeCallback(),this}setFromUnitVectors(t,s){let e=t.dot(s)+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*s.z-t.z*s.y,this._y=t.z*s.x-t.x*s.z,this._z=t.x*s.y-t.y*s.x,this._w=e),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(v(this.dot(t),-1,1)))}rotateTowards(t,s){const e=this.angleTo(t);if(e===0)return this;const n=Math.min(1,s/e);return this.slerp(t,n),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return t===0?(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}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,s){const e=t._x,n=t._y,i=t._z,r=t._w,h=s._x,a=s._y,o=s._z,c=s._w;return this._x=e*c+r*h+n*o-i*a,this._y=n*c+r*a+i*h-e*o,this._z=i*c+r*o+e*a-n*h,this._w=r*c-e*h-n*a-i*o,this._onChangeCallback(),this}slerp(t,s){if(s===0)return this;if(s===1)return this.copy(t);const e=this._x,n=this._y,i=this._z,r=this._w;let h=r*t._w+e*t._x+n*t._y+i*t._z;if(h<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,h=-h):this.copy(t),h>=1)return this._w=r,this._x=e,this._y=n,this._z=i,this;const a=1-h*h;if(a<=Number.EPSILON){const d=1-s;return this._w=d*r+s*this._w,this._x=d*e+s*this._x,this._y=d*n+s*this._y,this._z=d*i+s*this._z,this.normalize(),this}const o=Math.sqrt(a),c=Math.atan2(o,h),l=Math.sin((1-s)*c)/o,m=Math.sin(s*c)/o;return this._w=r*l+this._w*m,this._x=e*l+this._x*m,this._y=n*l+this._y*m,this._z=i*l+this._z*m,this._onChangeCallback(),this}slerpQuaternions(t,s,e){return this.copy(t).slerp(s,e)}random(){const t=2*Math.PI*Math.random(),s=2*Math.PI*Math.random(),e=Math.random(),n=Math.sqrt(1-e),i=Math.sqrt(e);return this.set(n*Math.sin(t),n*Math.cos(t),i*Math.sin(s),i*Math.cos(s))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,s=0){return this._x=t[s],this._y=t[s+1],this._z=t[s+2],this._w=t[s+3],this._onChangeCallback(),this}toArray(t=[],s=0){return t[s]=this._x,t[s+1]=this._y,t[s+2]=this._z,t[s+3]=this._w,t}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}const R=class R{constructor(t,s,e){this.x=0,this.y=0,this.z=0;const n=+(t!==void 0)+ +(s!==void 0)+ +(e!==void 0);if(n!==0){if(n===1&&t instanceof Array){this.x=t[0],this.y=t[1],this.z=t[2];return}if(n===1){const{x:i,y:r,z:h}=t;this.x=i,this.y=r,this.z=h||0;return}if(n===3){this.x=t,this.y=s,this.z=e;return}throw T.AcCmErrors.ILLEGAL_PARAMETERS}}set(t,s,e){return e===void 0&&(e=this.z),this.x=t,this.y=s,this.z=e,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,s){switch(t){case 0:this.x=s;break;case 1:this.y=s;break;case 2:this.z=s;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new R(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,s){return this.x=t.x+s.x,this.y=t.y+s.y,this.z=t.z+s.z,this}addScaledVector(t,s){return this.x+=t.x*s,this.y+=t.y*s,this.z+=t.z*s,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,s){return this.x=t.x-s.x,this.y=t.y-s.y,this.z=t.z-s.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,s){return this.x=t.x*s.x,this.y=t.y*s.y,this.z=t.z*s.z,this}applyEuler(t){return this.applyQuaternion(_s.setFromEuler(t))}applyAxisAngle(t,s){return this.applyQuaternion(_s.setFromAxisAngle(t,s))}applyMatrix3(t){const s=this.x,e=this.y,n=this.z,i=t.elements;return this.x=i[0]*s+i[3]*e+i[6]*n,this.y=i[1]*s+i[4]*e+i[7]*n,this.z=i[2]*s+i[5]*e+i[8]*n,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const s=this.x,e=this.y,n=this.z,i=t.elements,r=1/(i[3]*s+i[7]*e+i[11]*n+i[15]);return this.x=(i[0]*s+i[4]*e+i[8]*n+i[12])*r,this.y=(i[1]*s+i[5]*e+i[9]*n+i[13])*r,this.z=(i[2]*s+i[6]*e+i[10]*n+i[14])*r,this}applyQuaternion(t){const s=this.x,e=this.y,n=this.z,i=t.x,r=t.y,h=t.z,a=t.w,o=2*(r*n-h*e),c=2*(h*s-i*n),l=2*(i*e-r*s);return this.x=s+a*o+r*l-h*c,this.y=e+a*c+h*o-i*l,this.z=n+a*l+i*c-r*o,this}transformDirection(t){const s=this.x,e=this.y,n=this.z,i=t.elements;return this.x=i[0]*s+i[4]*e+i[8]*n,this.y=i[1]*s+i[5]*e+i[9]*n,this.z=i[2]*s+i[6]*e+i[10]*n,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(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}max(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}clamp(t,s){return this.x=Math.max(t.x,Math.min(s.x,this.x)),this.y=Math.max(t.y,Math.min(s.y,this.y)),this.z=Math.max(t.z,Math.min(s.z,this.z)),this}clampScalar(t,s){return this.x=Math.max(t,Math.min(s,this.x)),this.y=Math.max(t,Math.min(s,this.y)),this.z=Math.max(t,Math.min(s,this.z)),this}clampLength(t,s){const e=this.length();return this.divideScalar(e||1).multiplyScalar(Math.max(t,Math.min(s,e)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}isParallelTo(t){const s=this.dot(t),e=this.length(),n=t.length();return Math.abs(s)===e*n}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,s){return this.x+=(t.x-this.x)*s,this.y+=(t.y-this.y)*s,this.z+=(t.z-this.z)*s,this}lerpVectors(t,s,e){return this.x=t.x+(s.x-t.x)*e,this.y=t.y+(s.y-t.y)*e,this.z=t.z+(s.z-t.z)*e,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,s){const e=t.x,n=t.y,i=t.z,r=s.x,h=s.y,a=s.z;return this.x=n*a-i*h,this.y=i*r-e*a,this.z=e*h-n*r,this}projectOnVector(t){const s=t.lengthSq();if(s===0)return this.set(0,0,0);const e=t.dot(this)/s;return this.copy(t).multiplyScalar(e)}projectOnPlane(t){return jt.copy(this).projectOnVector(t),this.sub(jt)}reflect(t){return this.sub(jt.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const s=Math.sqrt(this.lengthSq()*t.lengthSq());if(s===0)return Math.PI/2;const e=this.dot(t)/s;return Math.acos(Math.max(-1,Math.min(1,e)))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const s=this.x-t.x,e=this.y-t.y,n=this.z-t.z;return s*s+e*e+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromMatrixPosition(t){const s=t.elements;return this.x=s[12],this.y=s[13],this.z=s[14],this}setFromMatrixScale(t){const s=this.setFromMatrixColumn(t,0).length(),e=this.setFromMatrixColumn(t,1).length(),n=this.setFromMatrixColumn(t,2).length();return this.x=s,this.y=e,this.z=n,this}setFromMatrixColumn(t,s){return this.fromArray(t.elements,s*4)}setFromMatrix3Column(t,s){return this.fromArray(t.elements,s*3)}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,s=0){return this.x=t[s],this.y=t[s+1],this.z=t[s+2],this}toArray(t=[],s=0){return t[s]=this.x,t[s+1]=this.y,t[s+2]=this.z,t}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=Math.random()*Math.PI*2,s=Math.random()*2-1,e=Math.sqrt(1-s*s);return this.x=e*Math.cos(t),this.y=s,this.z=e*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}};R.ORIGIN=Object.freeze(new R(0,0,0)),R.X_AXIS=Object.freeze(new R(1,0,0)),R.NEGATIVE_X_AXIS=Object.freeze(new R(-1,0,0)),R.Y_AXIS=Object.freeze(new R(0,1,0)),R.NEGATIVE_Y_AXIS=Object.freeze(new R(0,-1,0)),R.Z_AXIS=Object.freeze(new R(0,0,1)),R.NEGATIVE_Z_AXIS=Object.freeze(new R(0,0,-1));let f=R;const jt=new f,_s=new it,gt=class gt{constructor(t,s,e,n,i,r,h,a,o,c,l,m,d,g,y,_){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!=null&&s!=null&&e!=null&&n!=null&&i!=null&&r!=null&&h!=null&&a!=null&&o!=null&&c!=null&&l!=null&&m!=null&&d!=null&&g!=null&&y!=null&&_!=null&&this.set(t,s,e,n,i,r,h,a,o,c,l,m,d,g,y,_)}set(t,s,e,n,i,r,h,a,o,c,l,m,d,g,y,_){const A=this.elements;return A[0]=t,A[4]=s,A[8]=e,A[12]=n,A[1]=i,A[5]=r,A[9]=h,A[13]=a,A[2]=o,A[6]=c,A[10]=l,A[14]=m,A[3]=d,A[7]=g,A[11]=y,A[15]=_,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new gt().fromArray(this.elements)}copy(t){const s=this.elements,e=t.elements;return s[0]=e[0],s[1]=e[1],s[2]=e[2],s[3]=e[3],s[4]=e[4],s[5]=e[5],s[6]=e[6],s[7]=e[7],s[8]=e[8],s[9]=e[9],s[10]=e[10],s[11]=e[11],s[12]=e[12],s[13]=e[13],s[14]=e[14],s[15]=e[15],this}copyPosition(t){const s=this.elements,e=t.elements;return s[12]=e[12],s[13]=e[13],s[14]=e[14],this}setFromMatrix3(t){const s=t.elements;return this.set(s[0],s[3],s[6],0,s[1],s[4],s[7],0,s[2],s[5],s[8],0,0,0,0,1),this}setFromExtrusionDirection(t){if(Lt.equalPoint3d(t,f.Z_AXIS))this.identity();else{const s=new f(1,0,0);Math.abs(t.x)<1/64&&Math.abs(t.y)<1/64?s.crossVectors(f.Y_AXIS,t).normalize():s.crossVectors(f.Z_AXIS,t).normalize();const e=t.clone().cross(s).normalize();this.set(s.x,s.y,s.z,0,e.x,e.y,e.z,0,t.x,t.y,t.z,0,0,0,0,1)}return this}extractBasis(t,s,e){return t.setFromMatrixColumn(this,0),s.setFromMatrixColumn(this,1),e.setFromMatrixColumn(this,2),this}makeBasis(t,s,e){return this.set(t.x,s.x,e.x,0,t.y,s.y,e.y,0,t.z,s.z,e.z,0,0,0,0,1),this}extractRotation(t){const s=this.elements,e=t.elements,n=1/W.setFromMatrixColumn(t,0).length(),i=1/W.setFromMatrixColumn(t,1).length(),r=1/W.setFromMatrixColumn(t,2).length();return s[0]=e[0]*n,s[1]=e[1]*n,s[2]=e[2]*n,s[3]=0,s[4]=e[4]*i,s[5]=e[5]*i,s[6]=e[6]*i,s[7]=0,s[8]=e[8]*r,s[9]=e[9]*r,s[10]=e[10]*r,s[11]=0,s[12]=0,s[13]=0,s[14]=0,s[15]=1,this}makeRotationFromQuaternion(t){return this.compose(Bs,t,Ns)}lookAt(t,s,e){const n=this.elements;return q.subVectors(t,s),q.lengthSq()===0&&(q.z=1),q.normalize(),Z.crossVectors(e,q),Z.lengthSq()===0&&(Math.abs(e.z)===1?q.x+=1e-4:q.z+=1e-4,q.normalize(),Z.crossVectors(e,q)),Z.normalize(),xt.crossVectors(q,Z),n[0]=Z.x,n[4]=xt.x,n[8]=q.x,n[1]=Z.y,n[5]=xt.y,n[9]=q.y,n[2]=Z.z,n[6]=xt.z,n[10]=q.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,s){const e=t.elements,n=s.elements,i=this.elements,r=e[0],h=e[4],a=e[8],o=e[12],c=e[1],l=e[5],m=e[9],d=e[13],g=e[2],y=e[6],_=e[10],A=e[14],M=e[3],p=e[7],C=e[11],w=e[15],N=n[0],z=n[4],k=n[8],S=n[12],V=n[1],F=n[5],tt=n[9],At=n[13],ft=n[2],pt=n[6],zt=n[10],wt=n[14],Mt=n[3],Pt=n[7],bt=n[11],St=n[15];return i[0]=r*N+h*V+a*ft+o*Mt,i[4]=r*z+h*F+a*pt+o*Pt,i[8]=r*k+h*tt+a*zt+o*bt,i[12]=r*S+h*At+a*wt+o*St,i[1]=c*N+l*V+m*ft+d*Mt,i[5]=c*z+l*F+m*pt+d*Pt,i[9]=c*k+l*tt+m*zt+d*bt,i[13]=c*S+l*At+m*wt+d*St,i[2]=g*N+y*V+_*ft+A*Mt,i[6]=g*z+y*F+_*pt+A*Pt,i[10]=g*k+y*tt+_*zt+A*bt,i[14]=g*S+y*At+_*wt+A*St,i[3]=M*N+p*V+C*ft+w*Mt,i[7]=M*z+p*F+C*pt+w*Pt,i[11]=M*k+p*tt+C*zt+w*bt,i[15]=M*S+p*At+C*wt+w*St,this}multiplyScalar(t){const s=this.elements;return s[0]*=t,s[4]*=t,s[8]*=t,s[12]*=t,s[1]*=t,s[5]*=t,s[9]*=t,s[13]*=t,s[2]*=t,s[6]*=t,s[10]*=t,s[14]*=t,s[3]*=t,s[7]*=t,s[11]*=t,s[15]*=t,this}determinant(){const t=this.elements,s=t[0],e=t[4],n=t[8],i=t[12],r=t[1],h=t[5],a=t[9],o=t[13],c=t[2],l=t[6],m=t[10],d=t[14],g=t[3],y=t[7],_=t[11],A=t[15];return g*(+i*a*l-n*o*l-i*h*m+e*o*m+n*h*d-e*a*d)+y*(+s*a*d-s*o*m+i*r*m-n*r*d+n*o*c-i*a*c)+_*(+s*o*l-s*h*d-i*r*l+e*r*d+i*h*c-e*o*c)+A*(-n*h*c-s*a*l+s*h*m+n*r*l-e*r*m+e*a*c)}transpose(){const t=this.elements;let s;return s=t[1],t[1]=t[4],t[4]=s,s=t[2],t[2]=t[8],t[8]=s,s=t[6],t[6]=t[9],t[9]=s,s=t[3],t[3]=t[12],t[12]=s,s=t[7],t[7]=t[13],t[13]=s,s=t[11],t[11]=t[14],t[14]=s,this}setPosition(t,s,e){const n=this.elements;return t instanceof f?(n[12]=t.x,n[13]=t.y,n[14]=t.z):(n[12]=t,n[13]=s,n[14]=e),this}invert(){const t=this.elements,s=t[0],e=t[1],n=t[2],i=t[3],r=t[4],h=t[5],a=t[6],o=t[7],c=t[8],l=t[9],m=t[10],d=t[11],g=t[12],y=t[13],_=t[14],A=t[15],M=l*_*o-y*m*o+y*a*d-h*_*d-l*a*A+h*m*A,p=g*m*o-c*_*o-g*a*d+r*_*d+c*a*A-r*m*A,C=c*y*o-g*l*o+g*h*d-r*y*d-c*h*A+r*l*A,w=g*l*a-c*y*a-g*h*m+r*y*m+c*h*_-r*l*_,N=s*M+e*p+n*C+i*w;if(N===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const z=1/N;return t[0]=M*z,t[1]=(y*m*i-l*_*i-y*n*d+e*_*d+l*n*A-e*m*A)*z,t[2]=(h*_*i-y*a*i+y*n*o-e*_*o-h*n*A+e*a*A)*z,t[3]=(l*a*i-h*m*i-l*n*o+e*m*o+h*n*d-e*a*d)*z,t[4]=p*z,t[5]=(c*_*i-g*m*i+g*n*d-s*_*d-c*n*A+s*m*A)*z,t[6]=(g*a*i-r*_*i-g*n*o+s*_*o+r*n*A-s*a*A)*z,t[7]=(r*m*i-c*a*i+c*n*o-s*m*o-r*n*d+s*a*d)*z,t[8]=C*z,t[9]=(g*l*i-c*y*i-g*e*d+s*y*d+c*e*A-s*l*A)*z,t[10]=(r*y*i-g*h*i+g*e*o-s*y*o-r*e*A+s*h*A)*z,t[11]=(c*h*i-r*l*i-c*e*o+s*l*o+r*e*d-s*h*d)*z,t[12]=w*z,t[13]=(c*y*n-g*l*n+g*e*m-s*y*m-c*e*_+s*l*_)*z,t[14]=(g*h*n-r*y*n-g*e*a+s*y*a+r*e*_-s*h*_)*z,t[15]=(r*l*n-c*h*n+c*e*a-s*l*a-r*e*m+s*h*m)*z,this}scale(t){const s=this.elements,e=t.x,n=t.y,i=t.z;return s[0]*=e,s[4]*=n,s[8]*=i,s[1]*=e,s[5]*=n,s[9]*=i,s[2]*=e,s[6]*=n,s[10]*=i,s[3]*=e,s[7]*=n,s[11]*=i,this}getMaxScaleOnAxis(){const t=this.elements,s=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],e=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],n=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(s,e,n))}makeTranslation(t,s,e){return t instanceof f?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,s,0,0,1,e,0,0,0,1),this}makeRotationX(t){const s=Math.cos(t),e=Math.sin(t);return this.set(1,0,0,0,0,s,-e,0,0,e,s,0,0,0,0,1),this}makeRotationY(t){const s=Math.cos(t),e=Math.sin(t);return this.set(s,0,e,0,0,1,0,0,-e,0,s,0,0,0,0,1),this}makeRotationZ(t){const s=Math.cos(t),e=Math.sin(t);return this.set(s,-e,0,0,e,s,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,s){const e=Math.cos(s),n=Math.sin(s),i=1-e,r=t.x,h=t.y,a=t.z,o=i*r,c=i*h;return this.set(o*r+e,o*h-n*a,o*a+n*h,0,o*h+n*a,c*h+e,c*a-n*r,0,o*a-n*h,c*a+n*r,i*a*a+e,0,0,0,0,1),this}makeScale(t,s,e){return this.set(t,0,0,0,0,s,0,0,0,0,e,0,0,0,0,1),this}makeShear(t,s,e,n,i,r){return this.set(1,e,i,0,t,1,r,0,s,n,1,0,0,0,0,1),this}compose(t,s,e){const n=this.elements,i=s.x,r=s.y,h=s.z,a=s.w,o=i+i,c=r+r,l=h+h,m=i*o,d=i*c,g=i*l,y=r*c,_=r*l,A=h*l,M=a*o,p=a*c,C=a*l,w=e.x,N=e.y,z=e.z;return n[0]=(1-(y+A))*w,n[1]=(d+C)*w,n[2]=(g-p)*w,n[3]=0,n[4]=(d-C)*N,n[5]=(1-(m+A))*N,n[6]=(_+M)*N,n[7]=0,n[8]=(g+p)*z,n[9]=(_-M)*z,n[10]=(1-(m+y))*z,n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,this}decompose(t,s,e){const n=this.elements;let i=W.set(n[0],n[1],n[2]).length();const r=W.set(n[4],n[5],n[6]).length(),h=W.set(n[8],n[9],n[10]).length();this.determinant()<0&&(i=-i),t.x=n[12],t.y=n[13],t.z=n[14],X.copy(this);const o=1/i,c=1/r,l=1/h;return X.elements[0]*=o,X.elements[1]*=o,X.elements[2]*=o,X.elements[4]*=c,X.elements[5]*=c,X.elements[6]*=c,X.elements[8]*=l,X.elements[9]*=l,X.elements[10]*=l,s.setFromRotationMatrix(X),e.x=i,e.y=r,e.z=h,this}equals(t){const s=this.elements,e=t.elements;for(let n=0;n<16;n++)if(s[n]!==e[n])return!1;return!0}fromArray(t,s=0){for(let e=0;e<16;e++)this.elements[e]=t[e+s];return this}toArray(t=[],s=0){const e=this.elements;return t[s]=e[0],t[s+1]=e[1],t[s+2]=e[2],t[s+3]=e[3],t[s+4]=e[4],t[s+5]=e[5],t[s+6]=e[6],t[s+7]=e[7],t[s+8]=e[8],t[s+9]=e[9],t[s+10]=e[10],t[s+11]=e[11],t[s+12]=e[12],t[s+13]=e[13],t[s+14]=e[14],t[s+15]=e[15],t}};gt.IDENTITY=Object.freeze(new gt);let H=gt;const W=new f,X=new H,Bs=new f(0,0,0),Ns=new f(1,1,1),Z=new f,xt=new f,q=new f;class D{constructor(t=void 0,s=void 0){this.min=t==null?new f(1/0,1/0,1/0):new f(t.x,t.y,t.z),this.max=s==null?new f(-1/0,-1/0,-1/0):new f(s.x,s.y,s.z)}set(t,s){return this.min.copy(t),this.max.copy(s),this}setFromArray(t){this.makeEmpty();for(let s=0,e=t.length;s<e;s+=3)this.expandByPoint(Ft.fromArray(t,s));return this}setFromPoints(t){this.makeEmpty();for(let s=0,e=t.length;s<e;s++)this.expandByPoint(t[s]);return this}setFromCenterAndSize(t,s){const e=Ft.copy(s).multiplyScalar(.5);return this.min.copy(t).sub(e),this.max.copy(t).add(e),this}clone(){return new D().copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}get center(){return this.isEmpty()?new f(0,0,0):new f(0,0,0).addVectors(this.min,this.max).multiplyScalar(.5)}get size(){return this.isEmpty()?new f(0,0,0):new f(0,0,0).subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}containsPoint(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,s){return s.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)}intersectsPlane(t){let s,e;return t.normal.x>0?(s=t.normal.x*this.min.x,e=t.normal.x*this.max.x):(s=t.normal.x*this.max.x,e=t.normal.x*this.min.x),t.normal.y>0?(s+=t.normal.y*this.min.y,e+=t.normal.y*this.max.y):(s+=t.normal.y*this.max.y,e+=t.normal.y*this.min.y),t.normal.z>0?(s+=t.normal.z*this.min.z,e+=t.normal.z*this.max.z):(s+=t.normal.z*this.max.z,e+=t.normal.z*this.min.z),s<=-t.constant&&e>=-t.constant}clampPoint(t,s){return s.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,Ft).distanceTo(t)}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()?this:(Y[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Y[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Y[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Y[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Y[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Y[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Y[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Y[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Y),this)}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}const Y=[new f,new f,new f,new f,new f,new f,new f,new f],Ft=new f,As=new B;class j{constructor(t=void 0,s=void 0){this.min=t==null?new B(1/0,1/0):new B(t.x,t.y),this.max=s==null?new B(-1/0,-1/0):new B(s.x,s.y)}set(t,s){return this.min.copy(t),this.max.copy(s),this}setFromPoints(t){this.makeEmpty();for(let s=0,e=t.length;s<e;s++)this.expandByPoint(t[s]);return this}setFromCenterAndSize(t,s){const e=As.copy(s).multiplyScalar(.5);return this.min.copy(t).sub(e),this.max.copy(t).add(e),this}clone(){return new j().copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(t){return this.isEmpty()?t.set(0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0):t.subVectors(this.max,this.min)}get center(){return this.isEmpty()?new B(0,0):new B(0,0).addVectors(this.min,this.max).multiplyScalar(.5)}get size(){return this.isEmpty()?new B(0,0):new B(0,0).subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}containsPoint(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y}getParameter(t,s){return s.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y)}clampPoint(t,s){return s.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,As).distanceTo(t)}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}const fs=new f,ks=new f,Rs=new $;class rt{constructor(t=new f(1,0,0),s=0){this.normal=t,this.constant=s}set(t,s){return this.normal.copy(t),this.constant=s,this}setComponents(t,s,e,n){return this.normal.set(t,s,e),this.constant=n,this}setFromNormalAndCoplanarPoint(t,s){return this.normal.copy(t),this.constant=-s.dot(this.normal),this}setFromCoplanarPoints(t,s,e){const n=fs.subVectors(e,s).cross(ks.subVectors(t,s)).normalize();return this.setFromNormalAndCoplanarPoint(n,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){const t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}projectPoint(t,s){return s.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}intersectsBox(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,s){const e=s||Rs.getNormalMatrix(t),n=this.coplanarPoint(fs).applyMatrix4(t),i=this.normal.applyMatrix3(e).normalize();return this.constant=-n.dot(i),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return new rt().copy(this)}}class E extends B{static pointArrayToNumberArray(t){const s=new Array(t.length*2);return t.forEach((e,n)=>{e.toArray(s,n*2)}),s}}class b extends f{static pointArrayToNumberArray(t,s=!0){const e=s?3:2,n=new Array(t.length*e);return t.forEach((i,r)=>{i.toArray(n,r*e)}),n}}const ps=new H,zs=new it,yt=class yt{constructor(t=0,s=0,e=0,n=yt.DEFAULT_ORDER){this._x=t,this._y=s,this._z=e,this._order=n}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,s,e,n=this._order){return this._x=t,this._y=s,this._z=e,this._order=n,this._onChangeCallback(),this}clone(){return new yt(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,s=this._order,e=!0){const n=t.elements,i=n[0],r=n[4],h=n[8],a=n[1],o=n[5],c=n[9],l=n[2],m=n[6],d=n[10];switch(s){case"XYZ":this._y=Math.asin(v(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(-c,d),this._z=Math.atan2(-r,i)):(this._x=Math.atan2(m,o),this._z=0);break;case"YXZ":this._x=Math.asin(-v(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(h,d),this._z=Math.atan2(a,o)):(this._y=Math.atan2(-l,i),this._z=0);break;case"ZXY":this._x=Math.asin(v(m,-1,1)),Math.abs(m)<.9999999?(this._y=Math.atan2(-l,d),this._z=Math.atan2(-r,o)):(this._y=0,this._z=Math.atan2(a,i));break;case"ZYX":this._y=Math.asin(-v(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(m,d),this._z=Math.atan2(a,i)):(this._x=0,this._z=Math.atan2(-r,o));break;case"YZX":this._z=Math.asin(v(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-c,o),this._y=Math.atan2(-l,i)):(this._x=0,this._y=Math.atan2(h,d));break;case"XZY":this._z=Math.asin(-v(r,-1,1)),Math.abs(r)<.9999999?(this._x=Math.atan2(m,o),this._y=Math.atan2(h,i)):(this._x=Math.atan2(-c,d),this._y=0);break}return this._order=s,e===!0&&this._onChangeCallback(),this}setFromQuaternion(t,s,e=!0){return ps.makeRotationFromQuaternion(t),this.setFromRotationMatrix(ps,s,e)}setFromVector3(t,s=this._order){return this.set(t.x,t.y,t.z,s)}reorder(t){return zs.setFromEuler(this),this.setFromQuaternion(zs,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],t[3]!==void 0&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],s=0){return t[s]=this._x,t[s+1]=this._y,t[s+2]=this._z,t[s+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}};yt.DEFAULT_ORDER="XYZ";let Xt=yt;class ws{constructor(){this._boundingBoxNeedsUpdate=!1}get boundingBoxNeedUpdate(){return this._boundingBoxNeedsUpdate}}class Gt extends ws{translate(t){return this.transform(new $().makeTranslation(t.x,t.y))}get box(){return(this._box==null||this._boundingBoxNeedsUpdate)&&(this._box=this.calculateBoundingBox(),this._boundingBoxNeedsUpdate=!1),this._box}}class Ts extends Gt{constructor(){super(),this._loops=[]}add(t){this._loops.push(t),this._boundingBoxNeedsUpdate=!0}get loops(){return this._loops}get outter(){if(this._loops.length>0)return this._loops[0]}calculateBoundingBox(){const t=this.outter;return t?t.box:new j}transform(t){return this._boundingBoxNeedsUpdate=!0,this}getPoints(t){const s=[];for(let e=0;e<this.loops.length;++e){const i=this.loops[e].getPoints(t);s.push(i)}return s}buildHierarchy(){var h;const t=this.getPoints(100),s=this.calculateBoundaryBoxes(t),e=this.sortBoundaryBoxesByAreas(s),n=new Map,i=e.length;for(let a=0;a<i;a++)n.set(e[a],{index:e[a],children:[]});const r={index:-1,children:[]};for(let a=0;a<i;a++){const o=e[a],c=t[o],l=s[o];let m=a+1;for(;m<i;m++){const d=e[m],g=t[d];if(s[d].containsBox(l)&&ms.isPointInPolygon(c[P.randInt(0,c.length-1)],g)){(h=n.get(d))==null||h.children.push(n.get(o));break}}m===i&&r.children.push(n.get(o))}return r}get area(){if(this._loops.length===0)return 0;let t=0;for(let s=0;s<this._loops.length;s++){const n=this._loops[s].getPoints(128),i=this.polygonArea(n);s===0?t+=Math.abs(i):t-=Math.abs(i)}return t}polygonArea(t){const s=t.length;if(s<3)return 0;let e=0;for(let n=0,i=s-1;n<s;i=n++){const r=t[i],h=t[n];e+=r.x*h.y-h.x*r.y}return e*.5}calculateBoundaryBoxes(t){const s=[];return t.forEach(e=>{s.push(new j().setFromPoints(e))}),s}sortBoundaryBoxesByAreas(t){const s=[];t.forEach((n,i)=>{const r=n.size,h=r.width*r.height;s.push({area:h,index:i})}),s.sort((n,i)=>n.area-i.area);const e=[];return s.forEach(n=>{e.push(n.index)}),e}}class J extends Gt{constructor(){super(),this.arcLengthDivisions=100}get startPoint(){return this.getPoint(0)}get endPoint(){return this.getPoint(1)}get length(){return this.getLength()}getPoint(t){throw new Error("AcGeCurve2d: .getPoint() not implemented.")}getPointAt(t){const s=this.getUtoTmapping(t);return this.getPoint(s)}getPoints(t=5){const s=[];for(let e=0;e<=t;e++)s.push(this.getPoint(e/t));return s}getSpacedPoints(t=5){const s=[];for(let e=0;e<=t;e++)s.push(this.getPointAt(e/t));return s}getLength(){const t=this.getLengths();return t[t.length-1]}getLengths(t=this.arcLengthDivisions){const s=[];let e,n=this.getPoint(0),i=0;s.push(0);for(let r=1;r<=t;r++)e=this.getPoint(r/t),i+=e.distanceTo(n),s.push(i),n=e;return s}getUtoTmapping(t,s){const e=this.getLengths();let n=0;const i=e.length;let r;s?r=s:r=t*e[i-1];let h=0,a=i-1,o;for(;h<=a;)if(n=Math.floor(h+(a-h)/2),o=e[n]-r,o<0)h=n+1;else if(o>0)a=n-1;else{a=n;break}if(n=a,e[n]===r)return n/(i-1);const c=e[n],m=e[n+1]-c,d=(r-c)/m;return(n+d)/(i-1)}getTangent(t){let e=t-1e-4,n=t+1e-4;e<0&&(e=0),n>1&&(n=1);const i=this.getPoint(e),r=this.getPoint(n),h=new E;return h.copy(r).sub(i).normalize(),h}getTangentAt(t){const s=this.getUtoTmapping(t);return this.getTangent(s)}}class Q extends J{constructor(t,s,e,n,i){super();const r=+(t!==void 0)+ +(s!==void 0)+ +(e!==void 0)+ +(n!==void 0)+ +(i!==void 0);if(r==3)typeof t=="object"&&typeof s=="object"&&typeof e=="object"?this.createByThreePoints(t,s,e):this.createByStartEndPointsAndBulge(t,s,e);else if(r==5){const h=t;this.center=new E(h.x,h.y),this.radius=s,this._clockwise=i,this._startAngle=this._clockwise?this._mirrorAngle(P.normalizeAngle(e)):P.normalizeAngle(e),this._endAngle=this._clockwise?this._mirrorAngle(P.normalizeAngle(n)):P.normalizeAngle(n)}else throw T.AcCmErrors.ILLEGAL_PARAMETERS}createByThreePoints(t,s,e){const n=(z,k)=>({x:(z.x+k.x)/2,y:(z.y+k.y)/2}),i=(z,k)=>(k.y-z.y)/(k.x-z.x),r=z=>-1/z,h=n(t,s),a=n(s,e),o=i(t,s),c=i(s,e),l=r(o),m=r(c),d=(z,k,S,V)=>{const F=(V-k)/(z-S),tt=z*F+k;return{x:F,y:tt}},g=h.y-l*h.x,y=a.y-m*a.x,_=d(l,g,m,y),A=Math.sqrt(Math.pow(t.x-_.x,2)+Math.pow(t.y-_.y,2)),M=(z,k)=>Math.atan2(z.y-k.y,z.x-k.x),p=M(t,_),C=M(s,_),w=M(e,_),N=w>p&&w<C||p>w&&p<C||C>w&&C<p;this.center=_,this.radius=A,this._clockwise=!N,this._startAngle=p,this._endAngle=w}createByStartEndPointsAndBulge(t,s,e){let n,i,r;e<0?(n=Math.atan(-e)*4,i=new B(t),r=new B(s)):(n=Math.atan(e)*4,i=new B(s),r=new B(t));const h=new B().subVectors(r,i),a=h.length(),o=new B().addVectors(i,h.multiplyScalar(.5)),c=Math.abs(a/2/Math.tan(n/2)),l=h.normalize(),m=e<0?-Math.PI/2:Math.PI/2,d=new B(l.x*Math.cos(m)-l.y*Math.sin(m),l.y*Math.cos(m)+l.x*Math.sin(m));let g;n<Math.PI?e<0?g=o.add(d.multiplyScalar(c)):g=o.add(d.multiplyScalar(-c)):e<0?g=o.add(d.multiplyScalar(-c)):g=o.add(d.multiplyScalar(c)),e<0?(this._startAngle=Math.atan2(i.y-g.y,i.x-g.x),this._endAngle=Math.atan2(r.y-g.y,r.x-g.x)):(this._startAngle=Math.atan2(r.y-g.y,r.x-g.x),this._endAngle=Math.atan2(i.y-g.y,i.x-g.x)),this._clockwise=e<0,this.center=g,this.radius=r.sub(g).length()}get center(){return this._center}set center(t){this._center=new E(t.x,t.y),this._boundingBoxNeedsUpdate=!0}get radius(){return this._radius}set radius(t){this._radius=t,this._boundingBoxNeedsUpdate=!0}get startAngle(){return this._clockwise?this._mirrorAngle(this._startAngle):this._startAngle}set startAngle(t){this._startAngle=this._clockwise?this._mirrorAngle(P.normalizeAngle(t)):P.normalizeAngle(t),this._boundingBoxNeedsUpdate=!0}get endAngle(){return this._clockwise?this._mirrorAngle(this._endAngle):this._endAngle}set endAngle(t){const s=this.startAngle==0&&t==I?t:P.normalizeAngle(t);this._endAngle=this._clockwise?this._mirrorAngle(s):s,this._boundingBoxNeedsUpdate=!0}_mirrorAngle(t){return(360-t*180/Math.PI)%360*Math.PI/180}_getInternalAngle(t){return this._clockwise?this._mirrorAngle(t):t}get deltaAngle(){const t=this._getInternalAngle(this.startAngle),s=this._getInternalAngle(this.endAngle);return this.clockwise?P.normalizeAngle(t-s):P.normalizeAngle(s-t)}get clockwise(){return this._clockwise}set clockwise(t){this._clockwise=t,this._boundingBoxNeedsUpdate=!0}get startPoint(){return this.getPointAtAngle(this.startAngle)}get endPoint(){return this.getPointAtAngle(this.endAngle)}get midPoint(){const t=this._getInternalAngle(this.startAngle),s=this._clockwise?P.normalizeAngle(t-this.deltaAngle/2):P.normalizeAngle(t+this.deltaAngle/2),e=this._clockwise?this._mirrorAngle(s):s;return this.getPointAtAngle(e)}get closed(){const t=this._getInternalAngle(this.startAngle),s=this._getInternalAngle(this.endAngle);return Math.abs(s-t)/Math.PI%2==0}calculateBoundingBox(){const t=[this.startPoint,this.endPoint],s=[0,Math.PI/2,Math.PI,3*Math.PI/2];for(const i of s){const r=this._getInternalAngle(i);P.isBetweenAngle(r,this._getInternalAngle(this.startAngle),this._getInternalAngle(this.endAngle),this.clockwise)&&t.push(this.getPointAtAngle(i))}const e=t.map(i=>i.x),n=t.map(i=>i.y);return new j(new E(Math.min(...e),Math.min(...n)),new E(Math.max(...e),Math.max(...n)))}get length(){return Math.abs(this.deltaAngle*this.radius)}transform(t){return this._boundingBoxNeedsUpdate=!0,this}clone(){return new Q(this.center.clone(),this.radius,this._startAngle,this._endAngle,this.clockwise)}getPointAtAngle(t){const s=this._getInternalAngle(t),e=this.center.x+this.radius*Math.cos(s),n=this.center.y+this.radius*Math.sin(s);return new E(e,n)}getPoints(t=100){const s=[];let e=this.deltaAngle,n=this._getInternalAngle(this.startAngle);if(this.closed&&(e=I,n=0),this.clockwise)for(let i=0;i<=t;i++){const r=n-e*(i/t),h=this._clockwise?this._mirrorAngle(r):r,a=this.getPointAtAngle(h);s.push(new E(a.x,a.y))}else for(let i=0;i<=t;i++){const r=n+e*(i/t),h=this._clockwise?this._mirrorAngle(r):r,a=this.getPointAtAngle(h);s.push(new E(a.x,a.y))}return s}}class Ls extends ws{translate(t){return this.transform(new H().makeTranslation(t.x,t.y,t.z))}get box(){return(this._box==null||this._boundingBoxNeedsUpdate)&&(this._box=this.calculateBoundingBox(),this._boundingBoxNeedsUpdate=!1),this._box}}class ht extends Ls{}class ot extends ht{constructor(t,s){super(),this._start=new b(t),this._end=new b(s)}get startPoint(){return this._start}set startPoint(t){this._start.copy(t),this._boundingBoxNeedsUpdate=!0}get endPoint(){return this._end}set endPoint(t){this._end.copy(t),this._boundingBoxNeedsUpdate=!0}get direction(){return new f().subVectors(this.endPoint,this.startPoint).normalize()}get midPoint(){return new b((this._start.x+this._end.x)/2,(this._start.y+this._end.y)/2,(this._start.z+this._end.z)/2)}nearestPoint(t){return this.project(t)}get length(){return this.startPoint.distanceTo(this.endPoint)}isPointOnLine(t){return this.project(t).distanceTo(t)<1e-6}at(t,s){return this.delta(s).multiplyScalar(t).add(this._start)}atLength(t,s=!1){if(s){const e=this.delta(K).normalize();return new b(this._start).addScaledVector(e,t)}else{const e=this.delta(K).normalize();return new b(this._end).addScaledVector(e,t)}}extend(t,s=!1){if(s){const e=K.subVectors(this._start,this._end).normalize();this._start=new b(this._start).addScaledVector(e,t)}else{const e=this.delta(K).normalize();this._end=new b(this._end).addScaledVector(e,t)}return this._boundingBoxNeedsUpdate=!0,this}closestPointToPointParameter(t,s){Ms.subVectors(t,this._start),_t.subVectors(this.endPoint,this.startPoint);const e=_t.dot(_t);let i=_t.dot(Ms)/e;return s&&(i=P.clamp(i,0,1)),i}closestPointToPoint(t,s,e){const n=this.closestPointToPointParameter(t,s);return this.delta(e).multiplyScalar(n).add(this._start)}delta(t){return t.subVectors(this._end,this._start)}distanceSq(){return this._start.distanceToSquared(this._end)}distance(){return this._start.distanceTo(this._end)}project(t){const s=this.direction,n=K.subVectors(t,this.startPoint).dot(s);return new b().copy(s).multiplyScalar(n).add(this.startPoint)}perpPoint(t){const s=this.direction,e=this.startPoint,i=K.subVectors(t,e).dot(s),r=K.copy(s).multiplyScalar(i);return new b().addVectors(e,r)}calculateBoundingBox(){const t=new b(Math.min(this._start.x,this._end.x),Math.min(this._start.y,this._end.y),Math.min(this._start.z,this._end.z)),s=new b(Math.max(this._start.x,this._end.x),Math.max(this._start.y,this._end.y),Math.max(this._start.z,this._end.z));return new D(t,s)}transform(t){return this._start.applyMatrix4(t),this._end.applyMatrix4(t),this._boundingBoxNeedsUpdate=!0,this}get closed(){return!1}copy(t){return this.startPoint=t.startPoint,this.endPoint=t.endPoint,this._boundingBoxNeedsUpdate=!0,this}clone(){return new ot(this._start.clone(),this._end.clone())}}const K=new f,Ms=new f,_t=new f;class at extends ht{static computeCenterPoint(t,s,e){const n=new f().addVectors(t,s).multiplyScalar(.5),i=new f().addVectors(t,e).multiplyScalar(.5),r=new f().subVectors(s,t),h=new f().subVectors(e,t),a=new f().crossVectors(r,h).normalize();if(a.lengthSq()===0)return null;const o=new f().crossVectors(r,a).normalize(),c=new f().crossVectors(h,a).normalize(),l=o.clone().multiplyScalar(Number.MAX_SAFE_INTEGER),m=c.clone().multiplyScalar(Number.MAX_SAFE_INTEGER),d=new ot(n,n.clone().add(l)),g=new ot(i,i.clone().add(m)),y=new f;return d.closestPointToPoint(g.startPoint,!0,y)?y:null}static createByThreePoints(t,s,e){const n=at.computeCenterPoint(t,s,e);if(n){const i=n.distanceTo(t),r=new f().subVectors(t,n),h=new f().subVectors(s,n),a=Math.atan2(r.y,r.x),o=Math.atan2(h.y,h.x);return new at(n,i,a,o,f.Z_AXIS)}}constructor(t,s,e,n,i,r=f.X_AXIS){super(),this.center=t,this.radius=s,this.startAngle=e,this.endAngle=n,this.normal=i,this.refVec=r,(n-e)%I==0?(this.startAngle=0,this.endAngle=I):(this.startAngle=e,this.endAngle=n)}get center(){return this._center}set center(t){this._center=new b(t.x,t.y,t.z||0),this._boundingBoxNeedsUpdate=!0}get radius(){return this._radius}set radius(t){if(t<0)throw T.AcCmErrors.ILLEGAL_PARAMETERS;this._radius=t,this._boundingBoxNeedsUpdate=!0}get startAngle(){return this._startAngle}set startAngle(t){this._startAngle=P.normalizeAngle(t),this._boundingBoxNeedsUpdate=!0}get endAngle(){return this._endAngle}set endAngle(t){this._endAngle=this.startAngle==0&&t==I?t:P.normalizeAngle(t),this._boundingBoxNeedsUpdate=!0}get deltaAngle(){return P.normalizeAngle(this.endAngle-this.startAngle)}get isLargeArc(){return Math.abs(this.deltaAngle)>Math.PI?1:0}get clockwise(){return this.deltaAngle<=0}get normal(){return this._normal}set normal(t){this._normal=new f(t.x,t.y,t.z),this._normal.normalize(),this._boundingBoxNeedsUpdate=!0}get refVec(){return this._refVec}set refVec(t){this._refVec=new f(t.x,t.y,t.z),this._refVec.normalize(),this._boundingBoxNeedsUpdate=!0}get startPoint(){return this.getPointAtAngle(this._startAngle)}get endPoint(){return this.getPointAtAngle(this._endAngle)}get midPoint(){let t=this.startAngle,s=this.deltaAngle;this.closed&&(t=0,s=I);const e=t+s*.5;return this.getPointAtAngle(e)}get length(){return this.closed?2*Math.PI*this.radius:Math.abs(this.deltaAngle*this.radius)}get area(){return this.closed?Math.PI*this.radius*this.radius:Math.abs(this.deltaAngle*this.radius*this.radius)}nearestPoint(t){const s=new f(t.x,t.y,t.z||0),e=this.center,n=this.normal,r=s.clone().sub(e).dot(n),a=s.clone().sub(n.clone().multiplyScalar(r)).clone().sub(e);if(a.lengthSq()===0)return this.startPoint.clone();a.normalize().multiplyScalar(this.radius);const o=e.clone().add(a),c=this.getAngle(o.clone()),l=this.startAngle,m=this.deltaAngle;let d=P.normalizeAngle(c-l);d<0&&(d=0),d>m&&(d=m);const g=this.getPointAtAngle(l+d),y=g.distanceTo(s),_=this.startPoint.distanceTo(s),A=this.endPoint.distanceTo(s);return _<y&&_<=A?this.startPoint.clone():A<y&&A<_?this.endPoint.clone():g}tangentPoints(t){const s=[],e=new f(t.x,t.y,t.z||0),n=this.center,i=this.normal,r=this.radius,a=e.clone().sub(n).dot(i),o=e.clone().sub(i.clone().multiplyScalar(a)),c=n.clone(),m=o.clone().sub(c).length();if(m<r)return s;const d=Math.acos(r/m),g=this.getAngle(o.clone()),y=[g+d,g-d];for(const _ of y){const A=P.normalizeAngle(_-this.startAngle);A>=0&&A<=this.deltaAngle&&s.push(this.getPointAtAngle(this.startAngle+A))}return s}nearestTangentPoint(t){const s=this.tangentPoints(t);if(s.length===0)return null;const e=new b(t.x,t.y,t.z||0);return s.length===1||s[0].distanceTo(e)<s[1].distanceTo(e)?s[0]:s[1]}calculateBoundingBox(){const t=[this.startAngle,this.endAngle];for(let a=0;a<2*Math.PI;a+=Math.PI/2)P.isBetweenAngle(a,this.startAngle,this.endAngle)&&t.push(a);let s=1/0,e=1/0,n=1/0,i=-1/0,r=-1/0,h=-1/0;for(const a of t){const o=this.getPointAtAngle(a);o.x<s&&(s=o.x),o.y<e&&(e=o.y),o.z<n&&(n=o.z),o.x>i&&(i=o.x),o.y>r&&(r=o.y),o.z>h&&(h=o.z)}return new D({x:s,y:e,z:n},{x:i,y:r,z:h})}get closed(){return Math.abs(this.endAngle-this.startAngle)/Math.PI%2==0}getPoints(t){const s=[];let e=this.deltaAngle,n=this.startAngle;this.closed&&(e=I,n=0);for(let i=0;i<=t;i++){const r=n+e*(i/t),h=this.getPointAtAngle(r);s.push(h)}return s}transform(t){const s=Dt.copy(this.refVec).applyAxisAngle(this.normal,this.startAngle).multiplyScalar(this.radius),e=Dt.copy(this.refVec).applyAxisAngle(this.normal,this.endAngle).multiplyScalar(this.radius);return this.center.applyMatrix4(t),s.applyMatrix4(t),e.applyMatrix4(t),this.normal.applyMatrix4(t).normalize(),this.refVec.applyMatrix4(t).normalize(),this.startAngle=this.getAngle(s),this.endAngle=this.getAngle(e),this._boundingBoxNeedsUpdate=!0,this}copy(t){return this.center=t.center,this.radius=t.radius,this.startAngle=t.startAngle,this.endAngle=t.endAngle,this.normal=t.normal,this.refVec=t.refVec,this._boundingBoxNeedsUpdate=!0,this}clone(){return new at(this.center.clone(),this.radius,this.startAngle,this.endAngle,this.normal,this.refVec)}getAngle(t){return t.sub(this.center),Math.atan2(t.dot(Dt.crossVectors(this.refVec,this.normal)),t.dot(this.refVec))}getPointAtAngle(t){const s=this.normal,e=this.refVec,n={x:s.y*e.z-s.z*e.y,y:s.z*e.x-s.x*e.z,z:s.x*e.y-s.y*e.x},i=this.center,r=this.radius;return new b(i.x+r*(e.x*Math.cos(t)+n.x*Math.sin(t)),i.y+r*(e.y*Math.cos(t)+n.y*Math.sin(t)),i.z+r*(e.z*Math.cos(t)+n.z*Math.sin(t)))}get plane(){const t=new f(this.center).distanceTo(Rt);return new rt(this.normal,t)}}const Dt=new f;class ct extends J{constructor(t,s,e,n=0,i=I,r=!1,h=0){super(),this.center=t,this.majorAxisRadius=s,this.minorAxisRadius=e,(i-n)%I==0?(this.startAngle=0,this.endAngle=I):(this.startAngle=n,this.endAngle=i),this.clockwise=r,this.rotation=h}get center(){return this._center}set center(t){this._center=new b(t.x,t.y,t.z||0),this._boundingBoxNeedsUpdate=!0}get majorAxisRadius(){return this._majorAxisRadius}set majorAxisRadius(t){if(t<0)throw T.AcCmErrors.ILLEGAL_PARAMETERS;this._majorAxisRadius=t,this._boundingBoxNeedsUpdate=!0}get minorAxisRadius(){return this._minorAxisRadius}set minorAxisRadius(t){if(t<0)throw T.AcCmErrors.ILLEGAL_PARAMETERS;this._minorAxisRadius=t,this._boundingBoxNeedsUpdate=!0}get startAngle(){return this._startAngle}set startAngle(t){this._startAngle=P.normalizeAngle(t),this._boundingBoxNeedsUpdate=!0}get endAngle(){return this._endAngle}set endAngle(t){this._endAngle=this.startAngle==0&&t==I?t:P.normalizeAngle(t),this._boundingBoxNeedsUpdate=!0}get clockwise(){return this._clockwise}set clockwise(t){this._clockwise=t,this._boundingBoxNeedsUpdate=!0}get rotation(){return this._rotation}set rotation(t){this._rotation=t,this._boundingBoxNeedsUpdate=!0}get deltaAngle(){return P.normalizeAngle(this.endAngle-this.startAngle)}get isLargeArc(){return Math.abs(this.deltaAngle)>Math.PI?1:0}calculateBoundingBox(){let s=1/0,e=1/0,n=-1/0,i=-1/0;for(let r=0;r<=100;r++){const h=this.getPoint(r/100);s=Math.min(s,h.x),e=Math.min(e,h.y),n=Math.max(n,h.x),i=Math.max(i,h.y)}return new j({x:s,y:e},{x:n,y:i})}get closed(){return this.deltaAngle==0}getPoint(t){const s=Math.PI*2;let e=this.endAngle-this.startAngle;const n=Math.abs(e)<Number.EPSILON;for(;e<0;)e+=s;for(;e>s;)e-=s;e<Number.EPSILON&&(n?e=0:e=s),this.clockwise===!0&&!n&&(e===s?e=-s:e=e-s);const i=this.startAngle+t*e;let r=this.center.x+this.majorAxisRadius*Math.cos(i),h=this.center.y+this.minorAxisRadius*Math.sin(i);if(this.rotation!==0){const a=Math.cos(this.rotation),o=Math.sin(this.rotation),c=r-this.center.x,l=h-this.center.y;r=c*a-l*o+this.center.x,h=c*o+l*a+this.center.y}return new E(r,h)}transform(t){return this._boundingBoxNeedsUpdate=!0,this}copy(t){return this.center=t.center,this.majorAxisRadius=t.majorAxisRadius,this.minorAxisRadius=t.minorAxisRadius,this.startAngle=t.startAngle,this.endAngle=t.endAngle,this.clockwise=t.clockwise,this.rotation=t.rotation,this}clone(){return new ct(this.center,this.majorAxisRadius,this.minorAxisRadius,this.startAngle,this.endAngle,this.clockwise,this.rotation)}}class vt extends ht{constructor(t,s,e,n,i,r=0,h=I){super(),this.center=t,this.normal=s,this.majorAxis=e,this.majorAxisRadius=n,this.minorAxisRadius=i;const a=Math.abs(h-r);Math.abs(a-I)<1e-10||Math.abs(a-2*I)<1e-10?(this.startAngle=0,this.endAngle=I):(this.startAngle=r,this.endAngle=h)}get center(){return this._center}set center(t){this._center=new b(t.x,t.y,t.z||0),this._boundingBoxNeedsUpdate=!0}get majorAxisRadius(){return this._majorAxisRadius}set majorAxisRadius(t){if(t<0)throw T.AcCmErrors.ILLEGAL_PARAMETERS;this._majorAxisRadius=t,this._boundingBoxNeedsUpdate=!0}get minorAxisRadius(){return this._minorAxisRadius}set minorAxisRadius(t){if(t<0)throw T.AcCmErrors.ILLEGAL_PARAMETERS;this._minorAxisRadius=t,this._boundingBoxNeedsUpdate=!0}get startAngle(){return this._startAngle}set startAngle(t){this._startAngle=P.normalizeAngle(t),this._boundingBoxNeedsUpdate=!0}get endAngle(){return this._endAngle}set endAngle(t){this._endAngle=this.startAngle==0&&t==I?t:P.normalizeAngle(t),this._boundingBoxNeedsUpdate=!0}get deltaAngle(){const t=this.endAngle-this.startAngle;return Math.abs(t-I)<1e-10?I:P.normalizeAngle(t)}get isLargeArc(){return Math.abs(this.deltaAngle)>Math.PI?1:0}get clockwise(){return this.deltaAngle<=0}get normal(){return this._normal}set normal(t){this._normal=new f(t.x,t.y,t.z),this._normal.normalize(),this._boundingBoxNeedsUpdate=!0}get majorAxis(){return this._majorAxis}set majorAxis(t){this._majorAxis=new f(t.x,t.y,t.z),this._majorAxis.normalize(),this._boundingBoxNeedsUpdate=!0}get minorAxis(){return new f().crossVectors(this.normal,this.majorAxis).normalize()}get startPoint(){return this.getPointAtAngle(this._startAngle)}get endPoint(){return this.getPointAtAngle(this._endAngle)}get midPoint(){let t=this.startAngle,s=this.deltaAngle;(this.closed||Math.abs(s-I)<1e-10)&&(t=0,s=I);const e=t+s/2;return this.getPointAtAngle(e)}get isCircular(){return Tt.equal(this.majorAxisRadius,this.minorAxisRadius)}get length(){if(this.isCircular)return this.majorAxisRadius*Math.abs(this.deltaAngle);const t=1e3,s=this.deltaAngle/t;let e=0,n=this.getPointAtAngle(this.startAngle);for(let i=1;i<=t;i++){const r=this.startAngle+i*s,h=this.getPointAtAngle(r),a=h.x-n.x,o=h.y-n.y,c=h.z-n.z;e+=Math.sqrt(a*a+o*o+c*c),n=h}return e}get area(){const t=this.majorAxisRadius,s=this.minorAxisRadius,e=this.startAngle,n=e+this.deltaAngle;if(Math.abs(this.deltaAngle-I)<1e-10)return Math.PI*t*s;const i=t*s/2*(n-e-(Math.sin(n)*Math.cos(n)-Math.sin(e)*Math.cos(e)));return Math.abs(i)}calculateBoundingBox(){if(this.majorAxis.equals(f.X_AXIS)||this.majorAxis.equals(f.Y_AXIS)||this.majorAxis.isParallelTo(f.X_AXIS)||this.majorAxis.isParallelTo(f.Y_AXIS)){const t=[this.startAngle,this.endAngle];for(let a=0;a<2*Math.PI;a+=Math.PI/2)P.isBetweenAngle(a,this.startAngle,this.endAngle)&&t.push(a);let s=1/0,e=1/0,n=1/0,i=-1/0,r=-1/0,h=-1/0;for(const a of t){const o=this.getPointAtAngle(a);o.x<s&&(s=o.x),o.y<e&&(e=o.y),o.z<n&&(n=o.z),o.x>i&&(i=o.x),o.y>r&&(r=o.y),o.z>h&&(h=o.z)}return new D({x:s,y:e,z:n},{x:i,y:r,z:h})}else{let s=1/0,e=1/0,n=1/0,i=-1/0,r=-1/0,h=-1/0;for(let a=0;a<=100;a++){const o=this.startAngle+this.deltaAngle*(a/100),c=this.getPointAtAngle(o);s=Math.min(s,c.x),e=Math.min(e,c.y),n=Math.min(n,c.z),i=Math.max(i,c.x),r=Math.max(r,c.y),h=Math.max(h,c.z)}return new D({x:s,y:e,z:n},{x:i,y:r,z:h})}}get closed(){return this.deltaAngle==0}getPoints(t=100){const s=[];let e=this.deltaAngle,n=this.startAngle;this.closed&&(e=I,n=0);for(let i=0;i<=t;i++){const r=n+e*(i/t),h=this.getPointAtAngle(r);s.push(h)}return s}getPointAtAngle(t){const s=Math.cos(t),e=Math.sin(t),n=this.minorAxis.clone().multiplyScalar(this.minorAxisRadius).multiplyScalar(e),i=this.majorAxis.clone().multiplyScalar(s*this.majorAxisRadius).add(n);return new b(this.center.x+i.x,this.center.y+i.y,this.center.z+i.z)}contains(t){const s=new f(t).sub(this.center),e=s.dot(this.majorAxis),n=s.dot(this.minorAxis),i=e/this.majorAxisRadius,r=n/this.minorAxisRadius;return i*i+r*r<=1}transform(t){return this._boundingBoxNeedsUpdate=!0,this}copy(t){return this.center=t.center,this.normal=t.normal,this.majorAxis=t.majorAxis,this.majorAxisRadius=t.majorAxisRadius,this.minorAxisRadius=t.minorAxisRadius,this.startAngle=t.startAngle,this.endAngle=t.endAngle,this._boundingBoxNeedsUpdate=!0,this}clone(){return new vt(this.center,this.normal,this.majorAxis,this.majorAxisRadius,this.minorAxisRadius,this.startAngle,this.endAngle)}get plane(){const t=new f(this.center).distanceTo(Rt);return new rt(this.normal,t)}}class Us extends J{constructor(t=null,s=!1){super(),this._vertices=t||new Array,this._closed=s}get vertices(){return this._vertices}get numberOfVertices(){return this._vertices.length}get closed(){return this._closed}get startPoint(){if(this.numberOfVertices>0){const t=this._vertices[0];return new E(t.x,t.y)}throw new Error("Start point does not exist in an empty polyline.")}get endPoint(){const t=this.numberOfVertices;if(t>0)if(this.closed){const s=this._vertices[0];return new E(s.x,s.y)}else{const s=this._vertices[t-1];return new E(s.x,s.y)}throw new Error("End point does not exist in an empty polyline.")}get length(){let t=0;const s=this._vertices.length;for(let e=0;e<s;++e){const n=this._vertices[e];let i=null;if(e<s-1?i=this._vertices[e+1]:e==s-1&&this.closed&&(i=this._vertices[0]),i)if(n.bulge){const r=new Q(n,i,n.bulge);t+=r.length}else t+=new E(n.x,n.y).distanceTo(i)}return t}set closed(t){this._closed=t,this._boundingBoxNeedsUpdate=!0}addVertexAt(t,s){t<=0?this._vertices.unshift(s):this._vertices.splice(t,0,s),this._boundingBoxNeedsUpdate=!0}removeVertexAt(t){if(t<0||t>=this._vertices.length)throw new Error(`Index ${t} is out of bounds. Valid range is 0 to ${this._vertices.length-1}.`);this._vertices.splice(t,1),this._boundingBoxNeedsUpdate=!0}reset(t,s){t?s!==void 0&&s>=0&&s<this._vertices.length&&(this._vertices=this._vertices.slice(0,s),this._boundingBoxNeedsUpdate=!0):(this._vertices=new Array,this._boundingBoxNeedsUpdate=!0)}getPointAt(t){const s=this._vertices[t];return new E(s.x,s.y)}calculateBoundingBox(){const t=this.getPoints(100);return new j().setFromPoints(t)}transform(t){return this._boundingBoxNeedsUpdate=!0,this}getPoints3d(t,s){const e=[];return this.getPoints(t).forEach(i=>e.push(new b().set(i.x,i.y,s))),e}getPoints(t){const s=[],e=this._vertices.length;for(let n=0;n<e;++n){const i=this._vertices[n];if(i.bulge){let r=null;if(n<e-1?r=this._vertices[n+1]:n==e-1&&this.closed&&(r=this._vertices[0]),r){const a=new Q(i,r,i.bulge).getPoints(t),o=a.length;for(let c=0;c<o;++c){const l=a[c];s.push(new E(l.x,l.y))}}}else s.push(new E(i.x,i.y)),n==e-1&&this.closed&&s.push(s[0])}return s}}class lt extends J{constructor(t,s){super(),this._start=new E(t),this._end=new E(s)}get startPoint(){return this._start}set startPoint(t){this._start.copy(t),this._boundingBoxNeedsUpdate=!0}get endPoint(){return this._end}set endPoint(t){this._end.copy(t),this._boundingBoxNeedsUpdate=!0}getPoints(){return[this.startPoint,this.endPoint]}get length(){return this.startPoint.distanceTo(this.endPoint)}calculateBoundingBox(){const t=new E(Math.min(this._start.x,this._end.x),Math.min(this._start.y,this._end.y)),s=new E(Math.max(this._start.x,this._end.x),Math.max(this._start.y,this._end.y));return new j(t,s)}transform(t){return this._start.applyMatrix2d(t),this._end.applyMatrix2d(t),this._boundingBoxNeedsUpdate=!0,this}get closed(){return!1}copy(t){return this.startPoint=t.startPoint,this.endPoint=t.endPoint,this._boundingBoxNeedsUpdate=!0,this}clone(){return new lt(this._start.clone(),this._end.clone())}}class G extends J{constructor(t=[]){super(),this._curves=t}get curves(){return this._curves}static buildFromEdges(t,s=.001){if(t.length===0)return[];const e=[...t],n=[],i=s*s,r=(h,a)=>{const o=h.x-a.x,c=h.y-a.y;return o*o+c*c<=i};for(;e.length>0;){const h=[],a=e.shift();h.push(a);const o=G.getEdgeStartPoint(a);let c=G.getEdgeEndPoint(a);if(!r(o,c))for(;e.length>0;){const l=G.findConnectingEdge(e,c,i);if(l.index<0)break;let m=e.splice(l.index,1)[0];if(l.reverse&&(m=G.reverseEdge(m)),h.push(m),c=G.getEdgeEndPoint(m),r(c,o))break}n.push(new G(h))}return n}add(t){this._curves.push(t),this._boundingBoxNeedsUpdate=!0}get numberOfEdges(){return this._curves.length}get startPoint(){if(this._curves.length>0){const t=this._curves[0].startPoint;return new E(t.x,t.y)}throw new Error("Start point does not exist in an empty loop.")}get endPoint(){return this.startPoint}get length(){let t=0;return this._curves.forEach(s=>{t+=s.length}),t}calculateBoundingBox(){const t=this.getPoints(100),s=new j;return s.setFromPoints(t),s}transform(t){return this._boundingBoxNeedsUpdate=!0,this}get closed(){return!0}getPoints(t){const s=[];return this.curves.forEach(e=>{e.getPoints(t).forEach(n=>{s.push(new E(n.x,n.y))})}),s}static findConnectingEdge(t,s,e){let n=-1,i=!1,r=Number.POSITIVE_INFINITY;for(let h=0;h<t.length;h++){const a=t[h],o=G.getEdgeStartPoint(a),c=G.getEdgeEndPoint(a),l=s.x-o.x,m=s.y-o.y,d=l*l+m*m;d<r&&(r=d,n=h,i=!1);const g=s.x-c.x,y=s.y-c.y,_=g*g+y*y;_<r&&(r=_,n=h,i=!0)}return r>e?{index:-1,reverse:!1}:{index:n,reverse:i}}static getEdgeStartPoint(t){const s=t.startPoint;return new E(s.x,s.y)}static getEdgeEndPoint(t){const s=t.endPoint;return new E(s.x,s.y)}static reverseEdge(t){return t instanceof lt?new lt(t.endPoint,t.startPoint):t instanceof Q?new Q(t.center,t.radius,t.endAngle,t.startAngle,!t.clockwise):t instanceof ct?new ct(t.center,t.majorAxisRadius,t.minorAxisRadius,t.endAngle,t.startAngle,!t.clockwise,t.rotation):t instanceof ut?G.reverseSplineEdge(t):t}static reverseSplineEdge(t){const s=[...t.controlPoints].reverse(),e=t.knots,n=e[0],i=e[e.length-1],r=e.map(o=>n+i-o).reverse(),h=t.weights,a=h.length>0?[...h].reverse():void 0;return new ut(s,r,a,t.degree,t.closed)}}class Yt{constructor(){this.c0=0,this.c1=0,this.c2=0,this.c3=0}init(t,s,e,n){this.c0=t,this.c1=e,this.c2=-3*t+3*s-2*e-n,this.c3=2*t-2*s+e+n}initCatmullRom(t,s,e,n,i){this.init(s,e,i*(e-t),i*(n-s))}initNonuniformCatmullRom(t,s,e,n,i,r,h){let a=(s-t)/i-(e-t)/(i+r)+(e-s)/r,o=(e-s)/r-(n-s)/(r+h)+(n-e)/h;a*=r,o*=r,this.init(s,e,a,o)}calc(t){const s=t*t,e=s*t;return this.c0+this.c1*t+this.c2*s+this.c3*e}}class Ps extends ht{constructor(t=[],s=!1,e="centripetal",n=.5){super(),this.isCatmullRomCurve3d=!0,this.type="CatmullRomCurve3d",this._tmp=new f,this._px=new Yt,this._py=new Yt,this._pz=new Yt,this._points=t.map(i=>new b(i)),this._closed=s,this._curveType=e,this._tension=n}get points(){return this._points}get closed(){return this._closed}get curveType(){return this._curveType}get tension(){return this._tension}get startPoint(){return this._points.length>0?this._points[0]:new b}get endPoint(){return this._points.length>0?this._points[this._points.length-1]:new b}get length(){if(this._points.length<2)return 0;let t=0;for(let s=1;s<this._points.length;s++)t+=this._points[s-1].distanceTo(this._points[s]);return this._closed&&this._points.length>2&&(t+=this._points[this._points.length-1].distanceTo(this._points[0])),t}getPoint(t,s=new b){const e=s,n=this._points,i=n.length;if(i===0)return e.set(0,0,0);if(i===1)return e.copy(n[0]);const r=(i-(this._closed?0:1))*t;let h=Math.floor(r),a=r-h;this._closed?h+=h>0?0:(Math.floor(Math.abs(h)/i)+1)*i:a===0&&h===i-1&&(h=i-2,a=1);let o,c;this._closed||h>0?o=n[(h-1)%i]:(this._tmp.subVectors(n[0],n[1]).add(n[0]),o=new b(this._tmp.x,this._tmp.y,this._tmp.z));const l=n[h%i],m=n[(h+1)%i];if(this._closed||h+2<i?c=n[(h+2)%i]:(this._tmp.subVectors(n[i-1],n[i-2]).add(n[i-1]),c=new b(this._tmp.x,this._tmp.y,this._tmp.z)),this._curveType==="centripetal"||this._curveType==="chordal"){const d=this._curveType==="chordal"?.5:.25;let g=Math.pow(o.distanceToSquared(l),d),y=Math.pow(l.distanceToSquared(m),d),_=Math.pow(m.distanceToSquared(c),d);y<1e-4&&(y=1),g<1e-4&&(g=y),_<1e-4&&(_=y),this._px.initNonuniformCatmullRom(o.x,l.x,m.x,c.x,g,y,_),this._py.initNonuniformCatmullRom(o.y,l.y,m.y,c.y,g,y,_),this._pz.initNonuniformCatmullRom(o.z,l.z,m.z,c.z,g,y,_)}else this._curveType==="catmullrom"&&(this._px.initCatmullRom(o.x,l.x,m.x,c.x,this._tension),this._py.initCatmullRom(o.y,l.y,m.y,c.y,this._tension),this._pz.initCatmullRom(o.z,l.z,m.z,c.z,this._tension));return e.set(this._px.calc(a),this._py.calc(a),this._pz.calc(a)),e}getPoints(t){const s=[];for(let e=0;e<=t;e++)s.push(this.getPoint(e/t));return s}setPoints(t){this._points=t.map(s=>new b(s)),this._boundingBoxNeedsUpdate=!0}setClosed(t){this._closed!==t&&(this._closed=t,this._boundingBoxNeedsUpdate=!0)}setCurveType(t){this._curveType=t}setTension(t){this._tension=t}transform(t){return this._points=this._points.map(s=>{const e=new b;return e.copy(s),e.applyMatrix4(t),e}),this._boundingBoxNeedsUpdate=!0,this}calculateBoundingBox(){if(this._points.length===0)return new D;const t=new D;return this._points.forEach(s=>{t.expandByPoint(s)}),t}}class U{constructor(t,s,e,n){this._degree=t,this._knots=[...s],this._controlPoints=e.map(i=>({x:i.x,y:i.y,z:i.z})),this._weights=n?[...n]:new Array(e.length).fill(1)}degree(){return this._degree}knots(){return[...this._knots]}controlPoints(){return this._controlPoints.map(t=>({x:t.x,y:t.y,z:t.z}))}weights(){return[...this._weights]}point(t){const s=this._controlPoints.map(e=>[e.x,e.y,e.z]);return nt(t,this._degree,this._knots,s,this._weights)}length(){const t=this._controlPoints.map(s=>[s.x,s.y,s.z]);return xs(this._degree,this._knots,t,this._weights)}static byKnotsControlPointsWeights(t,s,e,n){return new U(t,s,e,n)}static byPoints(t,s,e="Uniform",n,i){const r=qt(t,s,e,n,i),h=r.controlPoints.map(a=>({x:a[0],y:a[1],z:a[2]}));return new U(s,r.knots,h,r.weights)}getParameterRange(){const t=this._knots[this._degree],s=this._knots[this._knots.length-this._degree-1];return{start:t,end:s}}getPoints(t){const s=[],{start:e,end:n}=this.getParameterRange();for(let i=0;i<=t;i++){const r=e+(n-e)*(i/t);s.push(this.point(r))}return s}isClosed(t=1e-6){const{start:s,end:e}=this.getParameterRange(),n=this.point(s),i=this.point(e),r=n[0]-i[0],h=n[1]-i[1],a=n[2]-i[2];return Math.sqrt(r*r+h*h+a*a)<t}static createFitPointsForClosedCurve(t){if(t.length<4)throw new Error("At least 4 points are required for a closed NURBS curve");const s=new Ps(t,!0,"centripetal"),e=Math.max(50,t.length*2);return s.getPoints(e)}static createClosedCurve(t,s,e="Chord"){const i=this.createFitPointsForClosedCurve(t).map(r=>[r.x,r.y,r.z]);return U.byPoints(i,s,e)}}class ut extends ht{constructor(t,s,e,n,i,r){super();const h=arguments.length;if(this._degree=3,this._closed=!1,Array.isArray(s)){if(h<2||h>5)throw T.AcCmErrors.ILLEGAL_PARAMETERS;this._controlPoints=t;let a,o=3,c=!1;if(h>=3&&(Array.isArray(e)?(a=e,h>=4&&(o=n||3),h>=5&&(c=i)):e!==void 0&&(o=e||3,h>=4&&(c=n))),e===void 0&&h>=4&&(o=n||3,h>=5&&(c=i)),this._degree=o,this._closed=c,this._controlPoints.length<this._degree+1)throw T.AcCmErrors.ILLEGAL_PARAMETERS;this._nurbsCurve=U.byKnotsControlPointsWeights(this._degree,s,this._controlPoints,a)}else{if(h<2||h>6)throw T.AcCmErrors.ILLEGAL_PARAMETERS;this._fitPoints=t,this._knotParameterization=s,h>=3&&(this._degree=e||3);const a=typeof n=="boolean";h>=4&&a&&(this._closed=n),a?(h>=5&&(this._startTangent=i),h>=6&&(this._endTangent=r)):(h>=4&&(this._startTangent=n),h>=5&&(this._endTangent=i)),this._closed&&(this._startTangent=void 0,this._endTangent=void 0);const o=(this._startTangent?1:0)+(this._endTangent?1:0);if(this._fitPoints.length+o<this._degree+1)throw T.AcCmErrors.ILLEGAL_PARAMETERS;if(this._closed)this._nurbsCurve=U.createClosedCurve(this._fitPoints,this._degree,this._knotParameterization);else{const c=this.toNurbsPoints(this._fitPoints);this._nurbsCurve=U.byPoints(c,this._degree,this._knotParameterization,this._startTangent?this.toNurbsPoint(this._startTangent):void 0,this._endTangent?this.toNurbsPoint(this._endTangent):void 0)}this._controlPoints=this.toGePoints(this._nurbsCurve.controlPoints().map(c=>[c.x,c.y,c.z||0]))}}buildCurve(){if(this._fitPoints&&this._knotParameterization){if(this._closed){const t=U.createFitPointsForClosedCurve(this._fitPoints),s=this.toNurbsPoints(t);this._nurbsCurve=U.byPoints(s,this._degree,this._knotParameterization)}else{const t=this.toNurbsPoints(this._fitPoints);this._nurbsCurve=U.byPoints(t,this._degree,this._knotParameterization,this._startTangent?this.toNurbsPoint(this._startTangent):void 0,this._endTangent?this.toNurbsPoint(this._endTangent):void 0)}this._controlPoints=this.toGePoints(this._nurbsCurve.controlPoints().map(t=>[t.x,t.y,t.z||0]))}else if(this._controlPoints)if(this._closed){const t=U.createFitPointsForClosedCurve(this._controlPoints),s=this.toNurbsPoints(t);this._nurbsCurve=U.byPoints(s,this._degree,this._knotParameterization),this._controlPoints=this.toGePoints(this._nurbsCurve.controlPoints().map(e=>[e.x,e.y,e.z||0]))}else{const t=this._nurbsCurve.knots(),s=this._nurbsCurve.weights();this._nurbsCurve=U.byKnotsControlPointsWeights(this._degree,t,this._controlPoints,s)}}setClosed(t){this._closed!==t&&(this._closed=t,this._boundingBoxNeedsUpdate=!0,this.buildCurve())}get degree(){return this._degree}get knotParameterization(){return this._knotParameterization}get controlPoints(){return this._controlPoints.map(t=>({x:t.x,y:t.y,z:t.z||0}))}get fitPoints(){var t;return(t=this._fitPoints)==null?void 0:t.map(s=>({x:s.x,y:s.y,z:s.z||0}))}get knots(){return[...this._nurbsCurve.knots()]}get weights(){return[...this._nurbsCurve.weights()]}get startPoint(){const t=this._nurbsCurve.knots(),s=this._nurbsCurve.degree(),e=t[s],n=this._nurbsCurve.point(e);return new b(n[0],n[1],n[2])}get endPoint(){const t=this._nurbsCurve.knots(),s=this._nurbsCurve.degree(),e=t[t.length-s-1],n=this._nurbsCurve.point(e);return new b(n[0],n[1],n[2])}get length(){return this._nurbsCurve.length()}getFitPointAt(t){if(!this._fitPoints)throw new Error("No fit points in this spline");const s=this._fitPoints.length,e=t<0||t>=s?s-1:t,n=this._fitPoints[e];return{x:n.x,y:n.y,z:n.z||0}}getControlPointAt(t){const s=this._controlPoints.length,e=t<0||t>=s?s-1:t;return this._controlPoints[e]}getPoints(t=100){const s=this._nurbsCurve,e=[],n=s.knots(),i=this._nurbsCurve.degree(),r=n[i],h=n[n.length-i-1],a=(h-r)/(t-1);for(let o=0;o<t;o++){const c=o===t-1?h:r+o*a,l=s.point(c);e.push(new b(l[0],l[1],l[2]))}return e}getCurvePoints(t,s){const e=[],n=t.knots(),i=t.degree(),r=n[i],a=(n[n.length-i-1]-r)/(s-1);for(let o=0;o<s;o++){const c=r+o*a;e.push(t.point(c))}return e}calculateBoundingBox(){const t=this.getPoints(100);return new D().setFromPoints(t)}get closed(){return this._closed}set closed(t){this.setClosed(t)}transform(t){return this._boundingBoxNeedsUpdate=!0,this}toNurbsPoints(t){const s=new Array(t.length);return t.forEach((e,n)=>{s[n]=[e.x,e.y,e.z||0]}),s}toGePoints(t){const s=new Array(t.length);return t.forEach((e,n)=>{s[n]={x:e[0],y:e[1],z:e[2]}}),s}toNurbsPoint(t){return[t.x,t.y,t.z||0]}static createClosedSpline(t,s="Uniform",e=3){if(t.length<e+1)throw new Error(`At least ${e+1} points are required for a degree ${e} closed spline`);return new ut(t,s,e,!0)}}x.AcGeArea2d=Ts,x.AcGeBox2d=j,x.AcGeBox3d=D,x.AcGeCatmullRomCurve3d=Ps,x.AcGeCircArc2d=Q,x.AcGeCircArc3d=at,x.AcGeCurve2d=J,x.AcGeEllipseArc2d=ct,x.AcGeEllipseArc3d=vt,x.AcGeEuler=Xt,x.AcGeGeometryUtil=ms,x.AcGeLine2d=lt,x.AcGeLine3d=ot,x.AcGeLoop2d=G,x.AcGeMathUtil=P,x.AcGeMatrix2d=$,x.AcGeMatrix3d=H,x.AcGeNurbsCurve=U,x.AcGePlane=rt,x.AcGePoint2d=E,x.AcGePoint3d=b,x.AcGePolyline2d=Us,x.AcGeQuaternion=it,x.AcGeShape2d=Gt,x.AcGeSpline3d=ut,x.AcGeTol=Tt,x.AcGeVector2d=B,x.AcGeVector3d=f,x.DEFAULT_TOL=Lt,x.DEG2RAD=Ct,x.FLOAT_TOL=O,x.ORIGIN_POINT_2D=bs,x.ORIGIN_POINT_3D=Rt,x.RAD2DEG=Et,x.TAU=I,x.basisFunction=et,x.calculateCurveLength=xs,x.ceilPowerOfTwo=os,x.clamp=v,x.computeParameterValues=gs,x.damp=$t,x.degToRad=is,x.euclideanModulo=It,x.evaluateNurbsPoint=nt,x.floorPowerOfTwo=as,x.generateAveragedKnots=ys,x.generateChordKnots=Cs,x.generateSqrtChordKnots=Es,x.generateUUID=Ot,x.generateUniformKnots=Ss,x.intPartLength=Nt,x.interpolateControlPoints=Is,x.interpolateNurbsCurve=qt,x.inverseLerp=Kt,x.isBetween=cs,x.isBetweenAngle=ls,x.isPointInPolygon=Ut,x.isPolygonIntersect=ds,x.isPowerOfTwo=hs,x.lerp=Bt,x.mapLinear=Qt,x.normalizeAngle=st,x.pingpong=Ht,x.radToDeg=rs,x.randFloat=ss,x.randFloatSpread=es,x.randInt=ts,x.relativeEps=us,x.seededRandom=ns,x.smootherstep=Jt,x.smoothstep=Wt,Object.defineProperty(x,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(f,T){typeof exports=="object"&&typeof module<"u"?T(exports,require("@mlightcad/common")):typeof define=="function"&&define.amd?define(["exports","@mlightcad/common"],T):(f=typeof globalThis<"u"?globalThis:f||self,T(f["geometry-engine"]={},f.common))})(this,function(f,T){"use strict";const j=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let Yt=1234567;const Et=Math.PI/180,It=180/Math.PI;function Zt(){const d=Math.random()*4294967295|0,t=Math.random()*4294967295|0,s=Math.random()*4294967295|0,e=Math.random()*4294967295|0;return(j[d&255]+j[d>>8&255]+j[d>>16&255]+j[d>>24&255]+"-"+j[t&255]+j[t>>8&255]+"-"+j[t>>16&15|64]+j[t>>24&255]+"-"+j[s&63|128]+j[s>>8&255]+"-"+j[s>>16&255]+j[s>>24&255]+j[e&255]+j[e>>8&255]+j[e>>16&255]+j[e>>24&255]).toLowerCase()}function G(d,t,s){return Math.max(t,Math.min(s,d))}function Bt(d,t){return(d%t+t)%t}function Ot(d,t,s,e,n){return e+(d-t)*(n-e)/(s-t)}function Kt(d,t,s){return d!==t?(s-d)/(t-d):0}function kt(d,t,s){return(1-s)*d+s*t}function Qt(d,t,s,e){return kt(d,t,1-Math.exp(-s*e))}function $t(d,t=1){return t-Math.abs(Bt(d,t*2)-t)}function Wt(d,t,s){return d<=t?0:d>=s?1:(d=(d-t)/(s-t),d*d*(3-2*d))}function Ht(d,t,s){return d<=t?0:d>=s?1:(d=(d-t)/(s-t),d*d*d*(d*(d*6-15)+10))}function Jt(d,t){return d+Math.floor(Math.random()*(t-d+1))}function ts(d,t){return d+Math.random()*(t-d)}function ss(d){return d*(.5-Math.random())}function es(d){d!==void 0&&(Yt=d);let t=Yt+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}function ns(d){return d*Et}function is(d){return d*It}function rs(d){return(d&d-1)===0&&d!==0}function os(d){return Math.pow(2,Math.ceil(Math.log(d)/Math.LN2))}function hs(d){return Math.pow(2,Math.floor(Math.log(d)/Math.LN2))}function nt(d){const t=Math.PI*2;return(d%t+t)%t}function as(d,t,s){return d>t&&d<s||d>s&&d<t}function cs(d,t,s,e=!1){return d=nt(d),t=nt(t),s=nt(s),e?t>s?d<=t&&d>=s:d<=t||d>=s:t<s?d>=t&&d<=s:d>=t||d<=s}function Rt(d){return d=Math.abs(d),d<1?0:Math.ceil(Math.log10(Math.abs(d)+1))}function ls(d,t=1e-7){const s=Rt(d);return Math.max(Math.pow(10,s)*t,t)}const P={DEG2RAD:Et,RAD2DEG:It,generateUUID:Zt,clamp:G,euclideanModulo:Bt,mapLinear:Ot,inverseLerp:Kt,lerp:kt,damp:Qt,pingpong:$t,smoothstep:Wt,smootherstep:Ht,randInt:Jt,randFloat:ts,randFloatSpread:ss,seededRandom:es,degToRad:ns,radToDeg:is,isPowerOfTwo:rs,ceilPowerOfTwo:os,floorPowerOfTwo:hs,normalizeAngle:nt,isBetween:as,isBetweenAngle:cs,intPartLength:Rt,relativeEps:ls},mt=class mt{constructor(t,s){this.x=0,this.y=0;const e=+(t!==void 0)+ +(s!==void 0);if(e!==0){if(e===1&&t instanceof Array){this.x=t[0],this.y=t[1];return}if(e===1){const{x:n,y:i}=t;this.x=n,this.y=i;return}if(e===2){this.x=t,this.y=s;return}throw T.AcCmErrors.ILLEGAL_PARAMETERS}}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,s){return this.x=t,this.y=s,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,s){switch(t){case 0:this.x=s;break;case 1:this.y=s;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new mt(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,s){return this.x=t.x+s.x,this.y=t.y+s.y,this}addScaledVector(t,s){return this.x+=t.x*s,this.y+=t.y*s,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,s){return this.x=t.x-s.x,this.y=t.y-s.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix2d(t){const s=this.x,e=this.y,n=t.elements;return this.x=n[0]*s+n[3]*e+n[6],this.y=n[1]*s+n[4]*e+n[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,s){return this.x=Math.max(t.x,Math.min(s.x,this.x)),this.y=Math.max(t.y,Math.min(s.y,this.y)),this}clampScalar(t,s){return this.x=Math.max(t,Math.min(s,this.x)),this.y=Math.max(t,Math.min(s,this.y)),this}clampLength(t,s){const e=this.length();return this.divideScalar(e||1).multiplyScalar(Math.max(t,Math.min(s,e)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){const s=Math.sqrt(this.lengthSq()*t.lengthSq());if(s===0)return Math.PI/2;const e=this.dot(t)/s;return Math.acos(Math.max(-1,Math.min(1,e)))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const s=this.x-t.x,e=this.y-t.y;return s*s+e*e}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,s){return this.x+=(t.x-this.x)*s,this.y+=(t.y-this.y)*s,this}lerpVectors(t,s,e){return this.x=t.x+(s.x-t.x)*e,this.y=t.y+(s.y-t.y)*e,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,s=0){return this.x=t[s],this.y=t[s+1],this}toArray(t=[],s=0){return t[s]=this.x,t[s+1]=this.y,t}rotateAround(t,s){const e=Math.cos(s),n=Math.sin(s),i=this.x-t.x,r=this.y-t.y;return this.x=i*e-r*n+t.x,this.y=i*n+r*e+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}relativeEps(t=1e-7){return Math.min(P.relativeEps(this.x,t),P.relativeEps(this.y,t))}*[Symbol.iterator](){yield this.x,yield this.y}};mt.EMPTY=Object.freeze(new mt(0,0));let B=mt;const gt=class gt{constructor(t,s,e,n,i,r,o,a,h){this.elements=[1,0,0,0,1,0,0,0,1],t!=null&&s!=null&&e!=null&&n!=null&&i!=null&&r!=null&&o!=null&&a!=null&&h!=null&&this.set(t,s,e,n,i,r,o,a,h)}set(t,s,e,n,i,r,o,a,h){const c=this.elements;return c[0]=t,c[1]=n,c[2]=o,c[3]=s,c[4]=i,c[5]=a,c[6]=e,c[7]=r,c[8]=h,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const s=this.elements,e=t.elements;return s[0]=e[0],s[1]=e[1],s[2]=e[2],s[3]=e[3],s[4]=e[4],s[5]=e[5],s[6]=e[6],s[7]=e[7],s[8]=e[8],this}extractBasis(t,s,e){return t.setFromMatrix3Column(this,0),s.setFromMatrix3Column(this,1),e.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const s=t.elements;return this.set(s[0],s[4],s[8],s[1],s[5],s[9],s[2],s[6],s[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,s){const e=t.elements,n=s.elements,i=this.elements,r=e[0],o=e[3],a=e[6],h=e[1],c=e[4],l=e[7],m=e[2],u=e[5],g=e[8],y=n[0],x=n[3],A=n[6],z=n[1],p=n[4],C=n[7],b=n[2],k=n[5],w=n[8];return i[0]=r*y+o*z+a*b,i[3]=r*x+o*p+a*k,i[6]=r*A+o*C+a*w,i[1]=h*y+c*z+l*b,i[4]=h*x+c*p+l*k,i[7]=h*A+c*C+l*w,i[2]=m*y+u*z+g*b,i[5]=m*x+u*p+g*k,i[8]=m*A+u*C+g*w,this}multiplyScalar(t){const s=this.elements;return s[0]*=t,s[3]*=t,s[6]*=t,s[1]*=t,s[4]*=t,s[7]*=t,s[2]*=t,s[5]*=t,s[8]*=t,this}determinant(){const t=this.elements,s=t[0],e=t[1],n=t[2],i=t[3],r=t[4],o=t[5],a=t[6],h=t[7],c=t[8];return s*r*c-s*o*h-e*i*c+e*o*a+n*i*h-n*r*a}invert(){const t=this.elements,s=t[0],e=t[1],n=t[2],i=t[3],r=t[4],o=t[5],a=t[6],h=t[7],c=t[8],l=c*r-o*h,m=o*a-c*i,u=h*i-r*a,g=s*l+e*m+n*u;if(g===0)return this.set(0,0,0,0,0,0,0,0,0);const y=1/g;return t[0]=l*y,t[1]=(n*h-c*e)*y,t[2]=(o*e-n*r)*y,t[3]=m*y,t[4]=(c*s-n*a)*y,t[5]=(n*i-o*s)*y,t[6]=u*y,t[7]=(e*a-h*s)*y,t[8]=(r*s-e*i)*y,this}transpose(){let t;const s=this.elements;return t=s[1],s[1]=s[3],s[3]=t,t=s[2],s[2]=s[6],s[6]=t,t=s[5],s[5]=s[7],s[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const s=this.elements;return t.elements[0]=s[0],t.elements[1]=s[3],t.elements[2]=s[6],t.elements[3]=s[1],t.elements[4]=s[4],t.elements[5]=s[7],t.elements[6]=s[2],t.elements[7]=s[5],t.elements[8]=s[8],this}setUvTransform(t,s,e,n,i,r,o){const a=Math.cos(i),h=Math.sin(i);return this.set(e*a,e*h,-e*(a*r+h*o)+r+t,-n*h,n*a,-n*(-h*r+a*o)+o+s,0,0,1),this}scale(t,s){return this.premultiply(Nt.makeScale(t,s)),this}rotate(t){return this.premultiply(Nt.makeRotation(-t)),this}translate(t,s){return this.premultiply(Nt.makeTranslation(t,s)),this}makeTranslation(t,s){return t instanceof B?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,s,0,0,1),this}makeRotation(t){const s=Math.cos(t),e=Math.sin(t);return this.set(s,-e,0,e,s,0,0,0,1),this}makeScale(t,s){return this.set(t,0,0,0,s,0,0,0,1),this}equals(t){const s=this.elements,e=t.elements;for(let n=0;n<9;n++)if(s[n]!==e[n])return!1;return!0}fromArray(t,s=0){for(let e=0;e<9;e++)this.elements[e]=t[e+s];return this}toArray(t=[],s=0){const e=this.elements;return t[s]=e[0],t[s+1]=e[1],t[s+2]=e[2],t[s+3]=e[3],t[s+4]=e[4],t[s+5]=e[5],t[s+6]=e[6],t[s+7]=e[7],t[s+8]=e[8],t}clone(){return new gt().fromArray(this.elements)}};gt.IDENTITY=Object.freeze(new gt);let H=gt;const Nt=new H,K=1e-6,I=2*Math.PI,bs={x:0,y:0},Tt={x:0,y:0,z:0};class jt{constructor(){this.equalPointTol=K,this.equalVectorTol=K}equalPoint2d(t,s){return new B(t).sub(s).length()<this.equalPointTol}equalPoint3d(t,s){return new _(t).sub(s).length()<this.equalPointTol}static equalToZero(t,s=K){return t<s&&t>-s}static equal(t,s,e=K){return Math.abs(t-s)<e}static great(t,s,e=K){return t-s>e}static less(t,s,e=K){return t-s<e}}const Lt=new jt;function Ut(d,t,s=!1){const e=d.x,n=d.y;let i=!1;const r=t.length;for(let o=0,a=r-1;o<r;a=o++){const h=t[o].x,c=t[o].y,l=t[a].x,m=t[a].y;let u=c>n!=m>n;s&&(u=c>=n!=m>=n),u&&e<(l-h)*(n-c)/(m-c)+h&&(i=!i)}return i}function us(d,t){if(d.length===0||t.length===0)return!1;const s=new q().setFromPoints(d),e=new q().setFromPoints(t);if(!s.intersectsBox(e))return!1;for(let n=0;n<d.length;){if(Ut(d[n],t,!0))return!0;n<d.length-1&&Lt.equalPoint2d(d[n+1],d[n])&&++n,++n}return!1}const ds={isPointInPolygon:Ut,isPolygonIntersect:us};function Cs(d,t){const s=[],e=t-1,n=d;for(let i=0;i<=n;i++)s.push(0);for(let i=1;i<=e-n;i++)s.push(i);for(let i=0;i<=n;i++)s.push(e-n+1);return s}function Ss(d,t){const s=t.length-1,e=d,n=[0];let i=0;for(let o=1;o<=s;o++){const a=t[o][0]-t[o-1][0],h=t[o][1]-t[o-1][1],c=t[o][2]-t[o-1][2],l=Math.sqrt(a*a+h*h+c*c);i+=l,n.push(i)}const r=[];for(let o=0;o<=e;o++)r.push(0);for(let o=1;o<=s-e;o++){const a=n[o]/i;r.push(a*(s-e+1))}for(let o=0;o<=e;o++)r.push(s-e+1);return r}function ms(d,t="Uniform"){const s=d.length;if(s===0)return[];if(s===1)return[0];const e=s-1;if(t==="Uniform")return new Array(s).fill(0).map((r,o)=>o/e);const n=[0];let i=0;for(let r=1;r<=e;r++){const o=d[r][0]-d[r-1][0],a=d[r][1]-d[r-1][1],h=d[r][2]-d[r-1][2],c=Math.sqrt(o*o+a*a+h*h),l=t==="SqrtChord"?Math.sqrt(c):c;i+=l,n.push(i)}return i<1e-12?new Array(s).fill(0).map((r,o)=>o/e):n.map(r=>r/i)}function gs(d,t){const s=t.length-1,e=d,n=s+e+1,i=new Array(n+1).fill(0),r=t[t.length-1];for(let o=n-e;o<=n;o++)i[o]=r;for(let o=1;o<=s-e;o++){let a=0;for(let h=o;h<o+e;h++)a+=t[h];i[o+e]=a/e}return i}function Es(d,t){const s=t.length-1,e=d,n=[0];let i=0;for(let o=1;o<=s;o++){const a=t[o][0]-t[o-1][0],h=t[o][1]-t[o-1][1],c=t[o][2]-t[o-1][2],l=Math.sqrt(a*a+h*h+c*c),m=Math.sqrt(l);i+=m,n.push(i)}const r=[];for(let o=0;o<=e;o++)r.push(0);for(let o=1;o<=s-e;o++){const a=n[o]/i;r.push(a*(s-e+1))}for(let o=0;o<=e;o++)r.push(s-e+1);return r}function Vt(d,t){const s=d.length,e=d.map(r=>r.slice()),n=t.slice();for(let r=0;r<s;r++){let o=r,a=Math.abs(e[r][r]);for(let h=r+1;h<s;h++){const c=Math.abs(e[h][r]);c>a&&(a=c,o=h)}if(a<1e-12)throw new Error("Interpolation matrix is singular.");if(o!==r){const h=e[r];e[r]=e[o],e[o]=h;const c=n[r];n[r]=n[o],n[o]=c}for(let h=r+1;h<s;h++){const c=e[h][r]/e[r][r];if(!(Math.abs(c)<1e-14)){for(let l=r;l<s;l++)e[h][l]-=c*e[r][l];n[h]-=c*n[r]}}}const i=new Array(s).fill(0);for(let r=s-1;r>=0;r--){let o=n[r];for(let a=r+1;a<s;a++)o-=e[r][a]*i[a];i[r]=o/e[r][r]}return i}function qt(d,t,s="Uniform",e,n){if(d.length===0)return{controlPoints:[],knots:[],weights:[]};const i=d.map(E=>[E[0],E[1],E[2]??0]),r=!!e,o=!!n,a=(r?1:0)+(o?1:0),h=i.length-1,c=h+a;if(c<t)throw new Error("Not enough points to interpolate a curve of this degree.");const l=ms(i,s),m=l.slice();r&&m.unshift(l[0]),o&&m.push(l[l.length-1]);const u=gs(t,m),g=c+1,y=new Array(g),x=new Array(g),A=new Array(g),z=new Array(g);let p=0;y[p]=new Array(g).fill(0),y[p][0]=1,x[p]=i[0][0],A[p]=i[0][1],z[p]=i[0][2],p++;for(let E=1;E<=h-1;E++){const U=l[E];y[p]=new Array(g).fill(0);for(let F=0;F<=c;F++)y[p][F]=it(F,t,U,u);x[p]=i[E][0],A[p]=i[E][1],z[p]=i[E][2],p++}if(y[p]=new Array(g).fill(0),y[p][c]=1,x[p]=i[h][0],A[p]=i[h][1],z[p]=i[h][2],p++,r){const E=u[t+1]-u[0],U=E!==0?t/E:0;y[p]=new Array(g).fill(0),y[p][0]=-U,y[p][1]=U,x[p]=(e==null?void 0:e[0])??0,A[p]=(e==null?void 0:e[1])??0,z[p]=(e==null?void 0:e[2])??0,p++}if(o){const E=u[c+t+1]-u[c],U=E!==0?t/E:0;y[p]=new Array(g).fill(0),y[p][c-1]=-U,y[p][c]=U,x[p]=(n==null?void 0:n[0])??0,A[p]=(n==null?void 0:n[1])??0,z[p]=(n==null?void 0:n[2])??0,p++}const C=Vt(y,x),b=Vt(y,A),k=Vt(y,z),w=new Array(g);for(let E=0;E<g;E++)w[E]=[C[E],b[E],k[E]];const R=new Array(g).fill(1);return{controlPoints:w,knots:u,weights:R}}function it(d,t,s,e){if(t===0)return s>=e[d]&&s<e[d+1]?1:0;const n=e[d+t]-e[d],i=e[d+t+1]-e[d+1],r=n>1e-10?(s-e[d])/n:0,o=i>1e-10?(e[d+t+1]-s)/i:0;return r*it(d,t-1,s,e)+o*it(d+1,t-1,s,e)}function rt(d,t,s,e,n){const i=e.length-1,r=t;if(d=Math.max(s[r],Math.min(s[i+1],d)),Math.abs(d-s[i+1])<1e-8)return[...e[i]];if(Math.abs(d-s[r])<1e-8)return[...e[0]];const o=[0,0,0];let a=0;for(let h=0;h<=i;h++){const c=it(h,r,d,s),l=n[h]*c;o[0]+=e[h][0]*l,o[1]+=e[h][1]*l,o[2]+=e[h][2]*l,a+=l}if(Math.abs(a)<1e-10){const h=s[s.length-r-1];if(Math.abs(d-h)<1e-8)return[...e[i]];if(Math.abs(d-s[r])<1e-8)return[...e[0]]}return Math.abs(a)>=1e-10&&(o[0]/=a,o[1]/=a,o[2]/=a),o}function ys(d,t,s,e){const n=d,i=t[n],r=t[t.length-n-1];let o=0;const a=1e3,h=(r-i)/a;let c=rt(i,d,t,s,e);for(let y=1;y<=a;y++){const x=i+y*h,A=rt(x,d,t,s,e),z=A[0]-c[0],p=A[1]-c[1],C=A[2]-c[2];o+=Math.sqrt(z*z+p*p+C*C),c=A}const l=rt(r,d,t,s,e),m=l[0]-c[0],u=l[1]-c[1],g=l[2]-c[2];return o+=Math.sqrt(m*m+u*u+g*g),o}function Is(d,t=3,s="Uniform",e,n){return d.length===0?[]:qt(d,t,s,e,n).controlPoints}class ot{constructor(t=0,s=0,e=0,n=1){this._x=t,this._y=s,this._z=e,this._w=n}static slerpFlat(t,s,e,n,i,r,o){let a=e[n+0],h=e[n+1],c=e[n+2],l=e[n+3];const m=i[r+0],u=i[r+1],g=i[r+2],y=i[r+3];if(o===0){t[s+0]=a,t[s+1]=h,t[s+2]=c,t[s+3]=l;return}if(o===1){t[s+0]=m,t[s+1]=u,t[s+2]=g,t[s+3]=y;return}if(l!==y||a!==m||h!==u||c!==g){let x=1-o;const A=a*m+h*u+c*g+l*y,z=A>=0?1:-1,p=1-A*A;if(p>Number.EPSILON){const b=Math.sqrt(p),k=Math.atan2(b,A*z);x=Math.sin(x*k)/b,o=Math.sin(o*k)/b}const C=o*z;if(a=a*x+m*C,h=h*x+u*C,c=c*x+g*C,l=l*x+y*C,x===1-o){const b=1/Math.sqrt(a*a+h*h+c*c+l*l);a*=b,h*=b,c*=b,l*=b}}t[s]=a,t[s+1]=h,t[s+2]=c,t[s+3]=l}static multiplyQuaternionsFlat(t,s,e,n,i,r){const o=e[n],a=e[n+1],h=e[n+2],c=e[n+3],l=i[r],m=i[r+1],u=i[r+2],g=i[r+3];return t[s]=o*g+c*l+a*u-h*m,t[s+1]=a*g+c*m+h*l-o*u,t[s+2]=h*g+c*u+o*m-a*l,t[s+3]=c*g-o*l-a*m-h*u,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,s,e,n){return this._x=t,this._y=s,this._z=e,this._w=n,this._onChangeCallback(),this}clone(){return new ot(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,s=!0){const e=t.x,n=t.y,i=t.z,r=t.order,o=Math.cos,a=Math.sin,h=o(e/2),c=o(n/2),l=o(i/2),m=a(e/2),u=a(n/2),g=a(i/2);switch(r){case"XYZ":this._x=m*c*l+h*u*g,this._y=h*u*l-m*c*g,this._z=h*c*g+m*u*l,this._w=h*c*l-m*u*g;break;case"YXZ":this._x=m*c*l+h*u*g,this._y=h*u*l-m*c*g,this._z=h*c*g-m*u*l,this._w=h*c*l+m*u*g;break;case"ZXY":this._x=m*c*l-h*u*g,this._y=h*u*l+m*c*g,this._z=h*c*g+m*u*l,this._w=h*c*l-m*u*g;break;case"ZYX":this._x=m*c*l-h*u*g,this._y=h*u*l+m*c*g,this._z=h*c*g-m*u*l,this._w=h*c*l+m*u*g;break;case"YZX":this._x=m*c*l+h*u*g,this._y=h*u*l+m*c*g,this._z=h*c*g-m*u*l,this._w=h*c*l-m*u*g;break;case"XZY":this._x=m*c*l-h*u*g,this._y=h*u*l-m*c*g,this._z=h*c*g+m*u*l,this._w=h*c*l+m*u*g;break}return s===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,s){const e=s/2,n=Math.sin(e);return this._x=t.x*n,this._y=t.y*n,this._z=t.z*n,this._w=Math.cos(e),this._onChangeCallback(),this}setFromRotationMatrix(t){const s=t.elements,e=s[0],n=s[4],i=s[8],r=s[1],o=s[5],a=s[9],h=s[2],c=s[6],l=s[10],m=e+o+l;if(m>0){const u=.5/Math.sqrt(m+1);this._w=.25/u,this._x=(c-a)*u,this._y=(i-h)*u,this._z=(r-n)*u}else if(e>o&&e>l){const u=2*Math.sqrt(1+e-o-l);this._w=(c-a)/u,this._x=.25*u,this._y=(n+r)/u,this._z=(i+h)/u}else if(o>l){const u=2*Math.sqrt(1+o-e-l);this._w=(i-h)/u,this._x=(n+r)/u,this._y=.25*u,this._z=(a+c)/u}else{const u=2*Math.sqrt(1+l-e-o);this._w=(r-n)/u,this._x=(i+h)/u,this._y=(a+c)/u,this._z=.25*u}return this._onChangeCallback(),this}setFromUnitVectors(t,s){let e=t.dot(s)+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*s.z-t.z*s.y,this._y=t.z*s.x-t.x*s.z,this._z=t.x*s.y-t.y*s.x,this._w=e),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(G(this.dot(t),-1,1)))}rotateTowards(t,s){const e=this.angleTo(t);if(e===0)return this;const n=Math.min(1,s/e);return this.slerp(t,n),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return t===0?(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}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,s){const e=t._x,n=t._y,i=t._z,r=t._w,o=s._x,a=s._y,h=s._z,c=s._w;return this._x=e*c+r*o+n*h-i*a,this._y=n*c+r*a+i*o-e*h,this._z=i*c+r*h+e*a-n*o,this._w=r*c-e*o-n*a-i*h,this._onChangeCallback(),this}slerp(t,s){if(s===0)return this;if(s===1)return this.copy(t);const e=this._x,n=this._y,i=this._z,r=this._w;let o=r*t._w+e*t._x+n*t._y+i*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=r,this._x=e,this._y=n,this._z=i,this;const a=1-o*o;if(a<=Number.EPSILON){const u=1-s;return this._w=u*r+s*this._w,this._x=u*e+s*this._x,this._y=u*n+s*this._y,this._z=u*i+s*this._z,this.normalize(),this}const h=Math.sqrt(a),c=Math.atan2(h,o),l=Math.sin((1-s)*c)/h,m=Math.sin(s*c)/h;return this._w=r*l+this._w*m,this._x=e*l+this._x*m,this._y=n*l+this._y*m,this._z=i*l+this._z*m,this._onChangeCallback(),this}slerpQuaternions(t,s,e){return this.copy(t).slerp(s,e)}random(){const t=2*Math.PI*Math.random(),s=2*Math.PI*Math.random(),e=Math.random(),n=Math.sqrt(1-e),i=Math.sqrt(e);return this.set(n*Math.sin(t),n*Math.cos(t),i*Math.sin(s),i*Math.cos(s))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,s=0){return this._x=t[s],this._y=t[s+1],this._z=t[s+2],this._w=t[s+3],this._onChangeCallback(),this}toArray(t=[],s=0){return t[s]=this._x,t[s+1]=this._y,t[s+2]=this._z,t[s+3]=this._w,t}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}const N=class N{constructor(t,s,e){this.x=0,this.y=0,this.z=0;const n=+(t!==void 0)+ +(s!==void 0)+ +(e!==void 0);if(n!==0){if(n===1&&t instanceof Array){this.x=t[0],this.y=t[1],this.z=t[2];return}if(n===1){const{x:i,y:r,z:o}=t;this.x=i,this.y=r,this.z=o||0;return}if(n===3){this.x=t,this.y=s,this.z=e;return}throw T.AcCmErrors.ILLEGAL_PARAMETERS}}set(t,s,e){return e===void 0&&(e=this.z),this.x=t,this.y=s,this.z=e,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,s){switch(t){case 0:this.x=s;break;case 1:this.y=s;break;case 2:this.z=s;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new N(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,s){return this.x=t.x+s.x,this.y=t.y+s.y,this.z=t.z+s.z,this}addScaledVector(t,s){return this.x+=t.x*s,this.y+=t.y*s,this.z+=t.z*s,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,s){return this.x=t.x-s.x,this.y=t.y-s.y,this.z=t.z-s.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,s){return this.x=t.x*s.x,this.y=t.y*s.y,this.z=t.z*s.z,this}applyEuler(t){return this.applyQuaternion(xs.setFromEuler(t))}applyAxisAngle(t,s){return this.applyQuaternion(xs.setFromAxisAngle(t,s))}applyMatrix3(t){const s=this.x,e=this.y,n=this.z,i=t.elements;return this.x=i[0]*s+i[3]*e+i[6]*n,this.y=i[1]*s+i[4]*e+i[7]*n,this.z=i[2]*s+i[5]*e+i[8]*n,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const s=this.x,e=this.y,n=this.z,i=t.elements,r=1/(i[3]*s+i[7]*e+i[11]*n+i[15]);return this.x=(i[0]*s+i[4]*e+i[8]*n+i[12])*r,this.y=(i[1]*s+i[5]*e+i[9]*n+i[13])*r,this.z=(i[2]*s+i[6]*e+i[10]*n+i[14])*r,this}applyQuaternion(t){const s=this.x,e=this.y,n=this.z,i=t.x,r=t.y,o=t.z,a=t.w,h=2*(r*n-o*e),c=2*(o*s-i*n),l=2*(i*e-r*s);return this.x=s+a*h+r*l-o*c,this.y=e+a*c+o*h-i*l,this.z=n+a*l+i*c-r*h,this}transformDirection(t){const s=this.x,e=this.y,n=this.z,i=t.elements;return this.x=i[0]*s+i[4]*e+i[8]*n,this.y=i[1]*s+i[5]*e+i[9]*n,this.z=i[2]*s+i[6]*e+i[10]*n,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(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}max(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}clamp(t,s){return this.x=Math.max(t.x,Math.min(s.x,this.x)),this.y=Math.max(t.y,Math.min(s.y,this.y)),this.z=Math.max(t.z,Math.min(s.z,this.z)),this}clampScalar(t,s){return this.x=Math.max(t,Math.min(s,this.x)),this.y=Math.max(t,Math.min(s,this.y)),this.z=Math.max(t,Math.min(s,this.z)),this}clampLength(t,s){const e=this.length();return this.divideScalar(e||1).multiplyScalar(Math.max(t,Math.min(s,e)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}isParallelTo(t){const s=this.dot(t),e=this.length(),n=t.length();return Math.abs(s)===e*n}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,s){return this.x+=(t.x-this.x)*s,this.y+=(t.y-this.y)*s,this.z+=(t.z-this.z)*s,this}lerpVectors(t,s,e){return this.x=t.x+(s.x-t.x)*e,this.y=t.y+(s.y-t.y)*e,this.z=t.z+(s.z-t.z)*e,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,s){const e=t.x,n=t.y,i=t.z,r=s.x,o=s.y,a=s.z;return this.x=n*a-i*o,this.y=i*r-e*a,this.z=e*o-n*r,this}projectOnVector(t){const s=t.lengthSq();if(s===0)return this.set(0,0,0);const e=t.dot(this)/s;return this.copy(t).multiplyScalar(e)}projectOnPlane(t){return Ft.copy(this).projectOnVector(t),this.sub(Ft)}reflect(t){return this.sub(Ft.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const s=Math.sqrt(this.lengthSq()*t.lengthSq());if(s===0)return Math.PI/2;const e=this.dot(t)/s;return Math.acos(Math.max(-1,Math.min(1,e)))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const s=this.x-t.x,e=this.y-t.y,n=this.z-t.z;return s*s+e*e+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromMatrixPosition(t){const s=t.elements;return this.x=s[12],this.y=s[13],this.z=s[14],this}setFromMatrixScale(t){const s=this.setFromMatrixColumn(t,0).length(),e=this.setFromMatrixColumn(t,1).length(),n=this.setFromMatrixColumn(t,2).length();return this.x=s,this.y=e,this.z=n,this}setFromMatrixColumn(t,s){return this.fromArray(t.elements,s*4)}setFromMatrix3Column(t,s){return this.fromArray(t.elements,s*3)}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,s=0){return this.x=t[s],this.y=t[s+1],this.z=t[s+2],this}toArray(t=[],s=0){return t[s]=this.x,t[s+1]=this.y,t[s+2]=this.z,t}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=Math.random()*Math.PI*2,s=Math.random()*2-1,e=Math.sqrt(1-s*s);return this.x=e*Math.cos(t),this.y=s,this.z=e*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}};N.ORIGIN=Object.freeze(new N(0,0,0)),N.X_AXIS=Object.freeze(new N(1,0,0)),N.NEGATIVE_X_AXIS=Object.freeze(new N(-1,0,0)),N.Y_AXIS=Object.freeze(new N(0,1,0)),N.NEGATIVE_Y_AXIS=Object.freeze(new N(0,-1,0)),N.Z_AXIS=Object.freeze(new N(0,0,1)),N.NEGATIVE_Z_AXIS=Object.freeze(new N(0,0,-1));let _=N;const Ft=new _,xs=new ot,yt=class yt{constructor(t,s,e,n,i,r,o,a,h,c,l,m,u,g,y,x){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!=null&&s!=null&&e!=null&&n!=null&&i!=null&&r!=null&&o!=null&&a!=null&&h!=null&&c!=null&&l!=null&&m!=null&&u!=null&&g!=null&&y!=null&&x!=null&&this.set(t,s,e,n,i,r,o,a,h,c,l,m,u,g,y,x)}set(t,s,e,n,i,r,o,a,h,c,l,m,u,g,y,x){const A=this.elements;return A[0]=t,A[4]=s,A[8]=e,A[12]=n,A[1]=i,A[5]=r,A[9]=o,A[13]=a,A[2]=h,A[6]=c,A[10]=l,A[14]=m,A[3]=u,A[7]=g,A[11]=y,A[15]=x,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new yt().fromArray(this.elements)}copy(t){const s=this.elements,e=t.elements;return s[0]=e[0],s[1]=e[1],s[2]=e[2],s[3]=e[3],s[4]=e[4],s[5]=e[5],s[6]=e[6],s[7]=e[7],s[8]=e[8],s[9]=e[9],s[10]=e[10],s[11]=e[11],s[12]=e[12],s[13]=e[13],s[14]=e[14],s[15]=e[15],this}copyPosition(t){const s=this.elements,e=t.elements;return s[12]=e[12],s[13]=e[13],s[14]=e[14],this}setFromMatrix3(t){const s=t.elements;return this.set(s[0],s[3],s[6],0,s[1],s[4],s[7],0,s[2],s[5],s[8],0,0,0,0,1),this}setFromExtrusionDirection(t){if(Lt.equalPoint3d(t,_.Z_AXIS))this.identity();else{const s=new _(1,0,0);Math.abs(t.x)<1/64&&Math.abs(t.y)<1/64?s.crossVectors(_.Y_AXIS,t).normalize():s.crossVectors(_.Z_AXIS,t).normalize();const e=t.clone().cross(s).normalize();this.set(s.x,s.y,s.z,0,e.x,e.y,e.z,0,t.x,t.y,t.z,0,0,0,0,1)}return this}extractBasis(t,s,e){return t.setFromMatrixColumn(this,0),s.setFromMatrixColumn(this,1),e.setFromMatrixColumn(this,2),this}makeBasis(t,s,e){return this.set(t.x,s.x,e.x,0,t.y,s.y,e.y,0,t.z,s.z,e.z,0,0,0,0,1),this}extractRotation(t){const s=this.elements,e=t.elements,n=1/J.setFromMatrixColumn(t,0).length(),i=1/J.setFromMatrixColumn(t,1).length(),r=1/J.setFromMatrixColumn(t,2).length();return s[0]=e[0]*n,s[1]=e[1]*n,s[2]=e[2]*n,s[3]=0,s[4]=e[4]*i,s[5]=e[5]*i,s[6]=e[6]*i,s[7]=0,s[8]=e[8]*r,s[9]=e[9]*r,s[10]=e[10]*r,s[11]=0,s[12]=0,s[13]=0,s[14]=0,s[15]=1,this}makeRotationFromQuaternion(t){return this.compose(Bs,t,ks)}lookAt(t,s,e){const n=this.elements;return V.subVectors(t,s),V.lengthSq()===0&&(V.z=1),V.normalize(),Z.crossVectors(e,V),Z.lengthSq()===0&&(Math.abs(e.z)===1?V.x+=1e-4:V.z+=1e-4,V.normalize(),Z.crossVectors(e,V)),Z.normalize(),_t.crossVectors(V,Z),n[0]=Z.x,n[4]=_t.x,n[8]=V.x,n[1]=Z.y,n[5]=_t.y,n[9]=V.y,n[2]=Z.z,n[6]=_t.z,n[10]=V.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,s){const e=t.elements,n=s.elements,i=this.elements,r=e[0],o=e[4],a=e[8],h=e[12],c=e[1],l=e[5],m=e[9],u=e[13],g=e[2],y=e[6],x=e[10],A=e[14],z=e[3],p=e[7],C=e[11],b=e[15],k=n[0],w=n[4],R=n[8],E=n[12],U=n[1],F=n[5],et=n[9],ft=n[13],pt=n[2],wt=n[6],zt=n[10],Mt=n[14],Pt=n[3],bt=n[7],Ct=n[11],St=n[15];return i[0]=r*k+o*U+a*pt+h*Pt,i[4]=r*w+o*F+a*wt+h*bt,i[8]=r*R+o*et+a*zt+h*Ct,i[12]=r*E+o*ft+a*Mt+h*St,i[1]=c*k+l*U+m*pt+u*Pt,i[5]=c*w+l*F+m*wt+u*bt,i[9]=c*R+l*et+m*zt+u*Ct,i[13]=c*E+l*ft+m*Mt+u*St,i[2]=g*k+y*U+x*pt+A*Pt,i[6]=g*w+y*F+x*wt+A*bt,i[10]=g*R+y*et+x*zt+A*Ct,i[14]=g*E+y*ft+x*Mt+A*St,i[3]=z*k+p*U+C*pt+b*Pt,i[7]=z*w+p*F+C*wt+b*bt,i[11]=z*R+p*et+C*zt+b*Ct,i[15]=z*E+p*ft+C*Mt+b*St,this}multiplyScalar(t){const s=this.elements;return s[0]*=t,s[4]*=t,s[8]*=t,s[12]*=t,s[1]*=t,s[5]*=t,s[9]*=t,s[13]*=t,s[2]*=t,s[6]*=t,s[10]*=t,s[14]*=t,s[3]*=t,s[7]*=t,s[11]*=t,s[15]*=t,this}determinant(){const t=this.elements,s=t[0],e=t[4],n=t[8],i=t[12],r=t[1],o=t[5],a=t[9],h=t[13],c=t[2],l=t[6],m=t[10],u=t[14],g=t[3],y=t[7],x=t[11],A=t[15];return g*(+i*a*l-n*h*l-i*o*m+e*h*m+n*o*u-e*a*u)+y*(+s*a*u-s*h*m+i*r*m-n*r*u+n*h*c-i*a*c)+x*(+s*h*l-s*o*u-i*r*l+e*r*u+i*o*c-e*h*c)+A*(-n*o*c-s*a*l+s*o*m+n*r*l-e*r*m+e*a*c)}transpose(){const t=this.elements;let s;return s=t[1],t[1]=t[4],t[4]=s,s=t[2],t[2]=t[8],t[8]=s,s=t[6],t[6]=t[9],t[9]=s,s=t[3],t[3]=t[12],t[12]=s,s=t[7],t[7]=t[13],t[13]=s,s=t[11],t[11]=t[14],t[14]=s,this}setPosition(t,s,e){const n=this.elements;return t instanceof _?(n[12]=t.x,n[13]=t.y,n[14]=t.z):(n[12]=t,n[13]=s,n[14]=e),this}invert(){const t=this.elements,s=t[0],e=t[1],n=t[2],i=t[3],r=t[4],o=t[5],a=t[6],h=t[7],c=t[8],l=t[9],m=t[10],u=t[11],g=t[12],y=t[13],x=t[14],A=t[15],z=l*x*h-y*m*h+y*a*u-o*x*u-l*a*A+o*m*A,p=g*m*h-c*x*h-g*a*u+r*x*u+c*a*A-r*m*A,C=c*y*h-g*l*h+g*o*u-r*y*u-c*o*A+r*l*A,b=g*l*a-c*y*a-g*o*m+r*y*m+c*o*x-r*l*x,k=s*z+e*p+n*C+i*b;if(k===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const w=1/k;return t[0]=z*w,t[1]=(y*m*i-l*x*i-y*n*u+e*x*u+l*n*A-e*m*A)*w,t[2]=(o*x*i-y*a*i+y*n*h-e*x*h-o*n*A+e*a*A)*w,t[3]=(l*a*i-o*m*i-l*n*h+e*m*h+o*n*u-e*a*u)*w,t[4]=p*w,t[5]=(c*x*i-g*m*i+g*n*u-s*x*u-c*n*A+s*m*A)*w,t[6]=(g*a*i-r*x*i-g*n*h+s*x*h+r*n*A-s*a*A)*w,t[7]=(r*m*i-c*a*i+c*n*h-s*m*h-r*n*u+s*a*u)*w,t[8]=C*w,t[9]=(g*l*i-c*y*i-g*e*u+s*y*u+c*e*A-s*l*A)*w,t[10]=(r*y*i-g*o*i+g*e*h-s*y*h-r*e*A+s*o*A)*w,t[11]=(c*o*i-r*l*i-c*e*h+s*l*h+r*e*u-s*o*u)*w,t[12]=b*w,t[13]=(c*y*n-g*l*n+g*e*m-s*y*m-c*e*x+s*l*x)*w,t[14]=(g*o*n-r*y*n-g*e*a+s*y*a+r*e*x-s*o*x)*w,t[15]=(r*l*n-c*o*n+c*e*a-s*l*a-r*e*m+s*o*m)*w,this}scale(t){const s=this.elements,e=t.x,n=t.y,i=t.z;return s[0]*=e,s[4]*=n,s[8]*=i,s[1]*=e,s[5]*=n,s[9]*=i,s[2]*=e,s[6]*=n,s[10]*=i,s[3]*=e,s[7]*=n,s[11]*=i,this}getMaxScaleOnAxis(){const t=this.elements,s=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],e=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],n=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(s,e,n))}makeTranslation(t,s,e){return t instanceof _?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,s,0,0,1,e,0,0,0,1),this}makeRotationX(t){const s=Math.cos(t),e=Math.sin(t);return this.set(1,0,0,0,0,s,-e,0,0,e,s,0,0,0,0,1),this}makeRotationY(t){const s=Math.cos(t),e=Math.sin(t);return this.set(s,0,e,0,0,1,0,0,-e,0,s,0,0,0,0,1),this}makeRotationZ(t){const s=Math.cos(t),e=Math.sin(t);return this.set(s,-e,0,0,e,s,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,s){const e=Math.cos(s),n=Math.sin(s),i=1-e,r=t.x,o=t.y,a=t.z,h=i*r,c=i*o;return this.set(h*r+e,h*o-n*a,h*a+n*o,0,h*o+n*a,c*o+e,c*a-n*r,0,h*a-n*o,c*a+n*r,i*a*a+e,0,0,0,0,1),this}makeScale(t,s,e){return this.set(t,0,0,0,0,s,0,0,0,0,e,0,0,0,0,1),this}makeShear(t,s,e,n,i,r){return this.set(1,e,i,0,t,1,r,0,s,n,1,0,0,0,0,1),this}compose(t,s,e){const n=this.elements,i=s.x,r=s.y,o=s.z,a=s.w,h=i+i,c=r+r,l=o+o,m=i*h,u=i*c,g=i*l,y=r*c,x=r*l,A=o*l,z=a*h,p=a*c,C=a*l,b=e.x,k=e.y,w=e.z;return n[0]=(1-(y+A))*b,n[1]=(u+C)*b,n[2]=(g-p)*b,n[3]=0,n[4]=(u-C)*k,n[5]=(1-(m+A))*k,n[6]=(x+z)*k,n[7]=0,n[8]=(g+p)*w,n[9]=(x-z)*w,n[10]=(1-(m+y))*w,n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,this}decompose(t,s,e){const n=this.elements;let i=J.set(n[0],n[1],n[2]).length();const r=J.set(n[4],n[5],n[6]).length(),o=J.set(n[8],n[9],n[10]).length();this.determinant()<0&&(i=-i),t.x=n[12],t.y=n[13],t.z=n[14],X.copy(this);const h=1/i,c=1/r,l=1/o;return X.elements[0]*=h,X.elements[1]*=h,X.elements[2]*=h,X.elements[4]*=c,X.elements[5]*=c,X.elements[6]*=c,X.elements[8]*=l,X.elements[9]*=l,X.elements[10]*=l,s.setFromRotationMatrix(X),e.x=i,e.y=r,e.z=o,this}equals(t){const s=this.elements,e=t.elements;for(let n=0;n<16;n++)if(s[n]!==e[n])return!1;return!0}fromArray(t,s=0){for(let e=0;e<16;e++)this.elements[e]=t[e+s];return this}toArray(t=[],s=0){const e=this.elements;return t[s]=e[0],t[s+1]=e[1],t[s+2]=e[2],t[s+3]=e[3],t[s+4]=e[4],t[s+5]=e[5],t[s+6]=e[6],t[s+7]=e[7],t[s+8]=e[8],t[s+9]=e[9],t[s+10]=e[10],t[s+11]=e[11],t[s+12]=e[12],t[s+13]=e[13],t[s+14]=e[14],t[s+15]=e[15],t}};yt.IDENTITY=Object.freeze(new yt);let Q=yt;const J=new _,X=new Q,Bs=new _(0,0,0),ks=new _(1,1,1),Z=new _,_t=new _,V=new _;class v{constructor(t=void 0,s=void 0){this.min=t==null?new _(1/0,1/0,1/0):new _(t.x,t.y,t.z),this.max=s==null?new _(-1/0,-1/0,-1/0):new _(s.x,s.y,s.z)}set(t,s){return this.min.copy(t),this.max.copy(s),this}setFromArray(t){this.makeEmpty();for(let s=0,e=t.length;s<e;s+=3)this.expandByPoint(Xt.fromArray(t,s));return this}setFromPoints(t){this.makeEmpty();for(let s=0,e=t.length;s<e;s++)this.expandByPoint(t[s]);return this}setFromCenterAndSize(t,s){const e=Xt.copy(s).multiplyScalar(.5);return this.min.copy(t).sub(e),this.max.copy(t).add(e),this}clone(){return new v().copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}get center(){return this.isEmpty()?new _(0,0,0):new _(0,0,0).addVectors(this.min,this.max).multiplyScalar(.5)}get size(){return this.isEmpty()?new _(0,0,0):new _(0,0,0).subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}containsPoint(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,s){return s.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)}intersectsPlane(t){let s,e;return t.normal.x>0?(s=t.normal.x*this.min.x,e=t.normal.x*this.max.x):(s=t.normal.x*this.max.x,e=t.normal.x*this.min.x),t.normal.y>0?(s+=t.normal.y*this.min.y,e+=t.normal.y*this.max.y):(s+=t.normal.y*this.max.y,e+=t.normal.y*this.min.y),t.normal.z>0?(s+=t.normal.z*this.min.z,e+=t.normal.z*this.max.z):(s+=t.normal.z*this.max.z,e+=t.normal.z*this.min.z),s<=-t.constant&&e>=-t.constant}clampPoint(t,s){return s.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,Xt).distanceTo(t)}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()?this:(Y[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Y[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Y[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Y[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Y[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Y[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Y[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Y[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Y),this)}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}const Y=[new _,new _,new _,new _,new _,new _,new _,new _],Xt=new _,_s=new B;class q{constructor(t=void 0,s=void 0){this.min=t==null?new B(1/0,1/0):new B(t.x,t.y),this.max=s==null?new B(-1/0,-1/0):new B(s.x,s.y)}set(t,s){return this.min.copy(t),this.max.copy(s),this}setFromPoints(t){this.makeEmpty();for(let s=0,e=t.length;s<e;s++)this.expandByPoint(t[s]);return this}setFromCenterAndSize(t,s){const e=_s.copy(s).multiplyScalar(.5);return this.min.copy(t).sub(e),this.max.copy(t).add(e),this}clone(){return new q().copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(t){return this.isEmpty()?t.set(0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0):t.subVectors(this.max,this.min)}get center(){return this.isEmpty()?new B(0,0):new B(0,0).addVectors(this.min,this.max).multiplyScalar(.5)}get size(){return this.isEmpty()?new B(0,0):new B(0,0).subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}containsPoint(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y}getParameter(t,s){return s.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y)}clampPoint(t,s){return s.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,_s).distanceTo(t)}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}const As=new _,Rs=new _,Ns=new H;class ht{constructor(t=new _(1,0,0),s=0){this.normal=t,this.constant=s}set(t,s){return this.normal.copy(t),this.constant=s,this}setComponents(t,s,e,n){return this.normal.set(t,s,e),this.constant=n,this}setFromNormalAndCoplanarPoint(t,s){return this.normal.copy(t),this.constant=-s.dot(this.normal),this}setFromCoplanarPoints(t,s,e){const n=As.subVectors(e,s).cross(Rs.subVectors(t,s)).normalize();return this.setFromNormalAndCoplanarPoint(n,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){const t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}projectPoint(t,s){return s.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}intersectsBox(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,s){const e=s||Ns.getNormalMatrix(t),n=this.coplanarPoint(As).applyMatrix4(t),i=this.normal.applyMatrix3(e).normalize();return this.constant=-n.dot(i),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return new ht().copy(this)}}class S extends B{static pointArrayToNumberArray(t){const s=new Array(t.length*2);return t.forEach((e,n)=>{e.toArray(s,n*2)}),s}}class M extends _{static pointArrayToNumberArray(t,s=!0){const e=s?3:2,n=new Array(t.length*e);return t.forEach((i,r)=>{i.toArray(n,r*e)}),n}}const fs=new Q,ps=new ot,xt=class xt{constructor(t=0,s=0,e=0,n=xt.DEFAULT_ORDER){this._x=t,this._y=s,this._z=e,this._order=n}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,s,e,n=this._order){return this._x=t,this._y=s,this._z=e,this._order=n,this._onChangeCallback(),this}clone(){return new xt(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,s=this._order,e=!0){const n=t.elements,i=n[0],r=n[4],o=n[8],a=n[1],h=n[5],c=n[9],l=n[2],m=n[6],u=n[10];switch(s){case"XYZ":this._y=Math.asin(G(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-c,u),this._z=Math.atan2(-r,i)):(this._x=Math.atan2(m,h),this._z=0);break;case"YXZ":this._x=Math.asin(-G(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(o,u),this._z=Math.atan2(a,h)):(this._y=Math.atan2(-l,i),this._z=0);break;case"ZXY":this._x=Math.asin(G(m,-1,1)),Math.abs(m)<.9999999?(this._y=Math.atan2(-l,u),this._z=Math.atan2(-r,h)):(this._y=0,this._z=Math.atan2(a,i));break;case"ZYX":this._y=Math.asin(-G(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(m,u),this._z=Math.atan2(a,i)):(this._x=0,this._z=Math.atan2(-r,h));break;case"YZX":this._z=Math.asin(G(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-c,h),this._y=Math.atan2(-l,i)):(this._x=0,this._y=Math.atan2(o,u));break;case"XZY":this._z=Math.asin(-G(r,-1,1)),Math.abs(r)<.9999999?(this._x=Math.atan2(m,h),this._y=Math.atan2(o,i)):(this._x=Math.atan2(-c,u),this._y=0);break}return this._order=s,e===!0&&this._onChangeCallback(),this}setFromQuaternion(t,s,e=!0){return fs.makeRotationFromQuaternion(t),this.setFromRotationMatrix(fs,s,e)}setFromVector3(t,s=this._order){return this.set(t.x,t.y,t.z,s)}reorder(t){return ps.setFromEuler(this),this.setFromQuaternion(ps,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],t[3]!==void 0&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],s=0){return t[s]=this._x,t[s+1]=this._y,t[s+2]=this._z,t[s+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}};xt.DEFAULT_ORDER="XYZ";let Dt=xt;class ws{constructor(){this._boundingBoxNeedsUpdate=!1}get boundingBoxNeedUpdate(){return this._boundingBoxNeedsUpdate}}class vt extends ws{translate(t){return this.transform(new H().makeTranslation(t.x,t.y))}get box(){return(this._box==null||this._boundingBoxNeedsUpdate)&&(this._box=this.calculateBoundingBox(),this._boundingBoxNeedsUpdate=!1),this._box}}class Ts extends vt{constructor(){super(),this._loops=[]}add(t){this._loops.push(t),this._boundingBoxNeedsUpdate=!0}get loops(){return this._loops}get outter(){if(this._loops.length>0)return this._loops[0]}calculateBoundingBox(){const t=this.outter;return t?t.box:new q}transform(t){return this._loops.forEach(s=>{s.transform(t)}),this._boundingBoxNeedsUpdate=!0,this}getPoints(t){const s=[];for(let e=0;e<this.loops.length;++e){const i=this.loops[e].getPoints(t);s.push(i)}return s}buildHierarchy(){var o;const t=this.getPoints(100),s=this.calculateBoundaryBoxes(t),e=this.sortBoundaryBoxesByAreas(s),n=new Map,i=e.length;for(let a=0;a<i;a++)n.set(e[a],{index:e[a],children:[]});const r={index:-1,children:[]};for(let a=0;a<i;a++){const h=e[a],c=t[h],l=s[h];let m=a+1;for(;m<i;m++){const u=e[m],g=t[u];if(s[u].containsBox(l)&&ds.isPointInPolygon(c[P.randInt(0,c.length-1)],g)){(o=n.get(u))==null||o.children.push(n.get(h));break}}m===i&&r.children.push(n.get(h))}return r}get area(){if(this._loops.length===0)return 0;let t=0;for(let s=0;s<this._loops.length;s++){const n=this._loops[s].getPoints(128),i=this.polygonArea(n);s===0?t+=Math.abs(i):t-=Math.abs(i)}return t}polygonArea(t){const s=t.length;if(s<3)return 0;let e=0;for(let n=0,i=s-1;n<s;i=n++){const r=t[i],o=t[n];e+=r.x*o.y-o.x*r.y}return e*.5}calculateBoundaryBoxes(t){const s=[];return t.forEach(e=>{s.push(new q().setFromPoints(e))}),s}sortBoundaryBoxesByAreas(t){const s=[];t.forEach((n,i)=>{const r=n.size,o=r.width*r.height;s.push({area:o,index:i})}),s.sort((n,i)=>n.area-i.area);const e=[];return s.forEach(n=>{e.push(n.index)}),e}}class tt extends vt{constructor(){super(),this.arcLengthDivisions=100}get startPoint(){return this.getPoint(0)}get endPoint(){return this.getPoint(1)}get length(){return this.getLength()}getPoint(t){throw new Error("AcGeCurve2d: .getPoint() not implemented.")}getPointAt(t){const s=this.getUtoTmapping(t);return this.getPoint(s)}getPoints(t=5){const s=[];for(let e=0;e<=t;e++)s.push(this.getPoint(e/t));return s}getSpacedPoints(t=5){const s=[];for(let e=0;e<=t;e++)s.push(this.getPointAt(e/t));return s}getLength(){const t=this.getLengths();return t[t.length-1]}getLengths(t=this.arcLengthDivisions){const s=[];let e,n=this.getPoint(0),i=0;s.push(0);for(let r=1;r<=t;r++)e=this.getPoint(r/t),i+=e.distanceTo(n),s.push(i),n=e;return s}getUtoTmapping(t,s){const e=this.getLengths();let n=0;const i=e.length;let r;s?r=s:r=t*e[i-1];let o=0,a=i-1,h;for(;o<=a;)if(n=Math.floor(o+(a-o)/2),h=e[n]-r,h<0)o=n+1;else if(h>0)a=n-1;else{a=n;break}if(n=a,e[n]===r)return n/(i-1);const c=e[n],m=e[n+1]-c,u=(r-c)/m;return(n+u)/(i-1)}getTangent(t){let e=t-1e-4,n=t+1e-4;e<0&&(e=0),n>1&&(n=1);const i=this.getPoint(e),r=this.getPoint(n),o=new S;return o.copy(r).sub(i).normalize(),o}getTangentAt(t){const s=this.getUtoTmapping(t);return this.getTangent(s)}}class O extends tt{constructor(t,s,e,n,i){super();const r=+(t!==void 0)+ +(s!==void 0)+ +(e!==void 0)+ +(n!==void 0)+ +(i!==void 0);if(r==3)typeof t=="object"&&typeof s=="object"&&typeof e=="object"?this.createByThreePoints(t,s,e):this.createByStartEndPointsAndBulge(t,s,e);else if(r==5){const o=t;this.center=new S(o.x,o.y),this.radius=s,this._clockwise=i,this._startAngle=this._clockwise?this._mirrorAngle(P.normalizeAngle(e)):P.normalizeAngle(e),this._endAngle=this._clockwise?this._mirrorAngle(P.normalizeAngle(n)):P.normalizeAngle(n)}else throw T.AcCmErrors.ILLEGAL_PARAMETERS}createByThreePoints(t,s,e){const n=(w,R)=>({x:(w.x+R.x)/2,y:(w.y+R.y)/2}),i=(w,R)=>(R.y-w.y)/(R.x-w.x),r=w=>-1/w,o=n(t,s),a=n(s,e),h=i(t,s),c=i(s,e),l=r(h),m=r(c),u=(w,R,E,U)=>{const F=(U-R)/(w-E),et=w*F+R;return{x:F,y:et}},g=o.y-l*o.x,y=a.y-m*a.x,x=u(l,g,m,y),A=Math.sqrt(Math.pow(t.x-x.x,2)+Math.pow(t.y-x.y,2)),z=(w,R)=>Math.atan2(w.y-R.y,w.x-R.x),p=z(t,x),C=z(s,x),b=z(e,x),k=b>p&&b<C||p>b&&p<C||C>b&&C<p;this.center=x,this.radius=A,this._clockwise=!k,this._startAngle=p,this._endAngle=b}createByStartEndPointsAndBulge(t,s,e){let n,i,r;e<0?(n=Math.atan(-e)*4,i=new B(t),r=new B(s)):(n=Math.atan(e)*4,i=new B(s),r=new B(t));const o=new B().subVectors(r,i),a=o.length(),h=new B().addVectors(i,o.multiplyScalar(.5)),c=Math.abs(a/2/Math.tan(n/2)),l=o.normalize(),m=e<0?-Math.PI/2:Math.PI/2,u=new B(l.x*Math.cos(m)-l.y*Math.sin(m),l.y*Math.cos(m)+l.x*Math.sin(m));let g;n<Math.PI?e<0?g=h.add(u.multiplyScalar(c)):g=h.add(u.multiplyScalar(-c)):e<0?g=h.add(u.multiplyScalar(-c)):g=h.add(u.multiplyScalar(c)),e<0?(this._startAngle=Math.atan2(i.y-g.y,i.x-g.x),this._endAngle=Math.atan2(r.y-g.y,r.x-g.x)):(this._startAngle=Math.atan2(r.y-g.y,r.x-g.x),this._endAngle=Math.atan2(i.y-g.y,i.x-g.x)),this._clockwise=e<0,this.center=g,this.radius=r.sub(g).length()}get center(){return this._center}set center(t){this._center=new S(t.x,t.y),this._boundingBoxNeedsUpdate=!0}get radius(){return this._radius}set radius(t){this._radius=t,this._boundingBoxNeedsUpdate=!0}get startAngle(){return this._clockwise?this._mirrorAngle(this._startAngle):this._startAngle}set startAngle(t){this._startAngle=this._clockwise?this._mirrorAngle(P.normalizeAngle(t)):P.normalizeAngle(t),this._boundingBoxNeedsUpdate=!0}get endAngle(){return this._clockwise?this._mirrorAngle(this._endAngle):this._endAngle}set endAngle(t){const s=this.startAngle==0&&t==I?t:P.normalizeAngle(t);this._endAngle=this._clockwise?this._mirrorAngle(s):s,this._boundingBoxNeedsUpdate=!0}_mirrorAngle(t){return(360-t*180/Math.PI)%360*Math.PI/180}_getInternalAngle(t){return this._clockwise?this._mirrorAngle(t):t}get deltaAngle(){const t=this._getInternalAngle(this.startAngle),s=this._getInternalAngle(this.endAngle);return this.clockwise?P.normalizeAngle(t-s):P.normalizeAngle(s-t)}get clockwise(){return this._clockwise}set clockwise(t){this._clockwise=t,this._boundingBoxNeedsUpdate=!0}get startPoint(){return this.getPointAtAngle(this.startAngle)}get endPoint(){return this.getPointAtAngle(this.endAngle)}get midPoint(){const t=this._getInternalAngle(this.startAngle),s=this._clockwise?P.normalizeAngle(t-this.deltaAngle/2):P.normalizeAngle(t+this.deltaAngle/2),e=this._clockwise?this._mirrorAngle(s):s;return this.getPointAtAngle(e)}get closed(){const t=this._getInternalAngle(this.startAngle),s=this._getInternalAngle(this.endAngle);return Math.abs(s-t)/Math.PI%2==0}calculateBoundingBox(){const t=[this.startPoint,this.endPoint],s=[0,Math.PI/2,Math.PI,3*Math.PI/2];for(const i of s){const r=this._getInternalAngle(i);P.isBetweenAngle(r,this._getInternalAngle(this.startAngle),this._getInternalAngle(this.endAngle),this.clockwise)&&t.push(this.getPointAtAngle(i))}const e=t.map(i=>i.x),n=t.map(i=>i.y);return new q(new S(Math.min(...e),Math.min(...n)),new S(Math.max(...e),Math.max(...n)))}get length(){return Math.abs(this.deltaAngle*this.radius)}transform(t){const s=t,e=this.center.clone().applyMatrix2d(s),n=this.startPoint.clone().applyMatrix2d(s);if(this.closed)return this.center=e,this.radius=e.distanceTo(n),this._startAngle=Math.atan2(n.y-e.y,n.x-e.x),this._endAngle=this._startAngle,this._clockwise=s.determinant()<0?!this._clockwise:this._clockwise,this._boundingBoxNeedsUpdate=!0,this;const i=this.midPoint.clone().applyMatrix2d(s),r=this.endPoint.clone().applyMatrix2d(s),o=new O(n,i,r),a=s.determinant()<0?!this.clockwise:this.clockwise,h=c=>{const l=P.normalizeAngle(c);return a?this._mirrorAngle(l):l};return this.center=o.center,this.radius=o.radius,this.clockwise=a,this.startAngle=h(Math.atan2(n.y-o.center.y,n.x-o.center.x)),this.endAngle=h(Math.atan2(r.y-o.center.y,r.x-o.center.x)),this._boundingBoxNeedsUpdate=!0,this}clone(){return new O(this.center.clone(),this.radius,this._startAngle,this._endAngle,this.clockwise)}getPointAtAngle(t){const s=this._getInternalAngle(t),e=this.center.x+this.radius*Math.cos(s),n=this.center.y+this.radius*Math.sin(s);return new S(e,n)}getPoints(t=100){const s=[];let e=this.deltaAngle,n=this._getInternalAngle(this.startAngle);if(this.closed&&(e=I,n=0),this.clockwise)for(let i=0;i<=t;i++){const r=n-e*(i/t),o=this._clockwise?this._mirrorAngle(r):r,a=this.getPointAtAngle(o);s.push(new S(a.x,a.y))}else for(let i=0;i<=t;i++){const r=n+e*(i/t),o=this._clockwise?this._mirrorAngle(r):r,a=this.getPointAtAngle(o);s.push(new S(a.x,a.y))}return s}}class js extends ws{translate(t){return this.transform(new Q().makeTranslation(t.x,t.y,t.z))}get box(){return(this._box==null||this._boundingBoxNeedsUpdate)&&(this._box=this.calculateBoundingBox(),this._boundingBoxNeedsUpdate=!1),this._box}}class at extends js{}class ct extends at{constructor(t,s){super(),this._start=new M(t),this._end=new M(s)}get startPoint(){return this._start}set startPoint(t){this._start.copy(t),this._boundingBoxNeedsUpdate=!0}get endPoint(){return this._end}set endPoint(t){this._end.copy(t),this._boundingBoxNeedsUpdate=!0}get direction(){return new _().subVectors(this.endPoint,this.startPoint).normalize()}get midPoint(){return new M((this._start.x+this._end.x)/2,(this._start.y+this._end.y)/2,(this._start.z+this._end.z)/2)}nearestPoint(t){return this.project(t)}get length(){return this.startPoint.distanceTo(this.endPoint)}isPointOnLine(t){return this.project(t).distanceTo(t)<1e-6}at(t,s){return this.delta(s).multiplyScalar(t).add(this._start)}atLength(t,s=!1){if(s){const e=this.delta($).normalize();return new M(this._start).addScaledVector(e,t)}else{const e=this.delta($).normalize();return new M(this._end).addScaledVector(e,t)}}extend(t,s=!1){if(s){const e=$.subVectors(this._start,this._end).normalize();this._start=new M(this._start).addScaledVector(e,t)}else{const e=this.delta($).normalize();this._end=new M(this._end).addScaledVector(e,t)}return this._boundingBoxNeedsUpdate=!0,this}closestPointToPointParameter(t,s){zs.subVectors(t,this._start),At.subVectors(this.endPoint,this.startPoint);const e=At.dot(At);let i=At.dot(zs)/e;return s&&(i=P.clamp(i,0,1)),i}closestPointToPoint(t,s,e){const n=this.closestPointToPointParameter(t,s);return this.delta(e).multiplyScalar(n).add(this._start)}delta(t){return t.subVectors(this._end,this._start)}distanceSq(){return this._start.distanceToSquared(this._end)}distance(){return this._start.distanceTo(this._end)}project(t){const s=this.direction,n=$.subVectors(t,this.startPoint).dot(s);return new M().copy(s).multiplyScalar(n).add(this.startPoint)}perpPoint(t){const s=this.direction,e=this.startPoint,i=$.subVectors(t,e).dot(s),r=$.copy(s).multiplyScalar(i);return new M().addVectors(e,r)}calculateBoundingBox(){const t=new M(Math.min(this._start.x,this._end.x),Math.min(this._start.y,this._end.y),Math.min(this._start.z,this._end.z)),s=new M(Math.max(this._start.x,this._end.x),Math.max(this._start.y,this._end.y),Math.max(this._start.z,this._end.z));return new v(t,s)}transform(t){return this._start.applyMatrix4(t),this._end.applyMatrix4(t),this._boundingBoxNeedsUpdate=!0,this}get closed(){return!1}copy(t){return this.startPoint=t.startPoint,this.endPoint=t.endPoint,this._boundingBoxNeedsUpdate=!0,this}clone(){return new ct(this._start.clone(),this._end.clone())}}const $=new _,zs=new _,At=new _;class lt extends at{static computeCenterPoint(t,s,e){const n=new _().addVectors(t,s).multiplyScalar(.5),i=new _().addVectors(t,e).multiplyScalar(.5),r=new _().subVectors(s,t),o=new _().subVectors(e,t),a=new _().crossVectors(r,o).normalize();if(a.lengthSq()===0)return null;const h=new _().crossVectors(r,a).normalize(),c=new _().crossVectors(o,a).normalize(),l=h.clone().multiplyScalar(Number.MAX_SAFE_INTEGER),m=c.clone().multiplyScalar(Number.MAX_SAFE_INTEGER),u=new ct(n,n.clone().add(l)),g=new ct(i,i.clone().add(m)),y=new _;return u.closestPointToPoint(g.startPoint,!0,y)?y:null}static createByThreePoints(t,s,e){const n=lt.computeCenterPoint(t,s,e);if(n){const i=n.distanceTo(t),r=new _().subVectors(t,n),o=new _().subVectors(s,n),a=Math.atan2(r.y,r.x),h=Math.atan2(o.y,o.x);return new lt(n,i,a,h,_.Z_AXIS)}}constructor(t,s,e,n,i,r=_.X_AXIS){super(),this.center=t,this.radius=s,this.startAngle=e,this.endAngle=n,this.normal=i,this.refVec=r,(n-e)%I==0?(this.startAngle=0,this.endAngle=I):(this.startAngle=e,this.endAngle=n)}get center(){return this._center}set center(t){this._center=new M(t.x,t.y,t.z||0),this._boundingBoxNeedsUpdate=!0}get radius(){return this._radius}set radius(t){if(t<0)throw T.AcCmErrors.ILLEGAL_PARAMETERS;this._radius=t,this._boundingBoxNeedsUpdate=!0}get startAngle(){return this._startAngle}set startAngle(t){this._startAngle=P.normalizeAngle(t),this._boundingBoxNeedsUpdate=!0}get endAngle(){return this._endAngle}set endAngle(t){this._endAngle=this.startAngle==0&&t==I?t:P.normalizeAngle(t),this._boundingBoxNeedsUpdate=!0}get deltaAngle(){return P.normalizeAngle(this.endAngle-this.startAngle)}get isLargeArc(){return Math.abs(this.deltaAngle)>Math.PI?1:0}get clockwise(){return this.deltaAngle<=0}get normal(){return this._normal}set normal(t){this._normal=new _(t.x,t.y,t.z),this._normal.normalize(),this._boundingBoxNeedsUpdate=!0}get refVec(){return this._refVec}set refVec(t){this._refVec=new _(t.x,t.y,t.z),this._refVec.normalize(),this._boundingBoxNeedsUpdate=!0}get startPoint(){return this.getPointAtAngle(this._startAngle)}get endPoint(){return this.getPointAtAngle(this._endAngle)}get midPoint(){let t=this.startAngle,s=this.deltaAngle;this.closed&&(t=0,s=I);const e=t+s*.5;return this.getPointAtAngle(e)}get length(){return this.closed?2*Math.PI*this.radius:Math.abs(this.deltaAngle*this.radius)}get area(){return this.closed?Math.PI*this.radius*this.radius:Math.abs(this.deltaAngle*this.radius*this.radius)}nearestPoint(t){const s=new _(t.x,t.y,t.z||0),e=this.center,n=this.normal,r=s.clone().sub(e).dot(n),a=s.clone().sub(n.clone().multiplyScalar(r)).clone().sub(e);if(a.lengthSq()===0)return this.startPoint.clone();a.normalize().multiplyScalar(this.radius);const h=e.clone().add(a),c=this.getAngle(h.clone()),l=this.startAngle,m=this.deltaAngle;let u=P.normalizeAngle(c-l);u<0&&(u=0),u>m&&(u=m);const g=this.getPointAtAngle(l+u),y=g.distanceTo(s),x=this.startPoint.distanceTo(s),A=this.endPoint.distanceTo(s);return x<y&&x<=A?this.startPoint.clone():A<y&&A<x?this.endPoint.clone():g}tangentPoints(t){const s=[],e=new _(t.x,t.y,t.z||0),n=this.center,i=this.normal,r=this.radius,a=e.clone().sub(n).dot(i),h=e.clone().sub(i.clone().multiplyScalar(a)),c=n.clone(),m=h.clone().sub(c).length();if(m<r)return s;const u=Math.acos(r/m),g=this.getAngle(h.clone()),y=[g+u,g-u];for(const x of y){const A=P.normalizeAngle(x-this.startAngle);A>=0&&A<=this.deltaAngle&&s.push(this.getPointAtAngle(this.startAngle+A))}return s}nearestTangentPoint(t){const s=this.tangentPoints(t);if(s.length===0)return null;const e=new M(t.x,t.y,t.z||0);return s.length===1||s[0].distanceTo(e)<s[1].distanceTo(e)?s[0]:s[1]}calculateBoundingBox(){const t=[this.startAngle,this.endAngle];for(let a=0;a<2*Math.PI;a+=Math.PI/2)P.isBetweenAngle(a,this.startAngle,this.endAngle)&&t.push(a);let s=1/0,e=1/0,n=1/0,i=-1/0,r=-1/0,o=-1/0;for(const a of t){const h=this.getPointAtAngle(a);h.x<s&&(s=h.x),h.y<e&&(e=h.y),h.z<n&&(n=h.z),h.x>i&&(i=h.x),h.y>r&&(r=h.y),h.z>o&&(o=h.z)}return new v({x:s,y:e,z:n},{x:i,y:r,z:o})}get closed(){return Math.abs(this.endAngle-this.startAngle)/Math.PI%2==0}getPoints(t){const s=[];let e=this.deltaAngle,n=this.startAngle;this.closed&&(e=I,n=0);for(let i=0;i<=t;i++){const r=n+e*(i/t),o=this.getPointAtAngle(r);s.push(o)}return s}transform(t){const s=this.center.clone().applyMatrix4(t),e=this.startPoint.clone().applyMatrix4(t),n=this.endPoint.clone().applyMatrix4(t),i=this.getPointAtAngle(this.closed?Math.PI/2:this.startAngle+this.deltaAngle/2).clone().applyMatrix4(t),r=new _(e).sub(s).normalize(),o=s.distanceTo(e);let a=new _().crossVectors(new _(e).sub(s),new _(i).sub(s)).normalize();a.lengthSq()===0&&(a=this.normal.clone().transformDirection(t));const h=c=>{const l=new _(c).sub(s);return Math.atan2(l.dot(Ms.crossVectors(a,r)),l.dot(r))};return this.center=s,this.radius=o,this.normal=a,this.refVec=r,this.startAngle=0,this.endAngle=this.closed?I:h(n),this._boundingBoxNeedsUpdate=!0,this}copy(t){return this.center=t.center,this.radius=t.radius,this.startAngle=t.startAngle,this.endAngle=t.endAngle,this.normal=t.normal,this.refVec=t.refVec,this._boundingBoxNeedsUpdate=!0,this}clone(){return new lt(this.center.clone(),this.radius,this.startAngle,this.endAngle,this.normal,this.refVec)}getAngle(t){return t.sub(this.center),Math.atan2(t.dot(Ms.crossVectors(this.refVec,this.normal)),t.dot(this.refVec))}getPointAtAngle(t){const s=this.normal,e=this.refVec,n={x:s.y*e.z-s.z*e.y,y:s.z*e.x-s.x*e.z,z:s.x*e.y-s.y*e.x},i=this.center,r=this.radius;return new M(i.x+r*(e.x*Math.cos(t)+n.x*Math.sin(t)),i.y+r*(e.y*Math.cos(t)+n.y*Math.sin(t)),i.z+r*(e.z*Math.cos(t)+n.z*Math.sin(t)))}get plane(){const t=new _(this.center).distanceTo(Tt);return new ht(this.normal,t)}}const Ms=new _;class W extends tt{constructor(t,s,e,n=0,i=I,r=!1,o=0){super(),this.center=t,this.majorAxisRadius=s,this.minorAxisRadius=e,(i-n)%I==0?(this.startAngle=0,this.endAngle=I):(this.startAngle=n,this.endAngle=i),this.clockwise=r,this.rotation=o}get center(){return this._center}set center(t){this._center=new M(t.x,t.y,t.z||0),this._boundingBoxNeedsUpdate=!0}get majorAxisRadius(){return this._majorAxisRadius}set majorAxisRadius(t){if(t<0)throw T.AcCmErrors.ILLEGAL_PARAMETERS;this._majorAxisRadius=t,this._boundingBoxNeedsUpdate=!0}get minorAxisRadius(){return this._minorAxisRadius}set minorAxisRadius(t){if(t<0)throw T.AcCmErrors.ILLEGAL_PARAMETERS;this._minorAxisRadius=t,this._boundingBoxNeedsUpdate=!0}get startAngle(){return this._startAngle}set startAngle(t){this._startAngle=P.normalizeAngle(t),this._boundingBoxNeedsUpdate=!0}get endAngle(){return this._endAngle}set endAngle(t){this._endAngle=this.startAngle==0&&t==I?t:P.normalizeAngle(t),this._boundingBoxNeedsUpdate=!0}get clockwise(){return this._clockwise}set clockwise(t){this._clockwise=t,this._boundingBoxNeedsUpdate=!0}get rotation(){return this._rotation}set rotation(t){this._rotation=t,this._boundingBoxNeedsUpdate=!0}get deltaAngle(){return P.normalizeAngle(this.endAngle-this.startAngle)}get isLargeArc(){return Math.abs(this.deltaAngle)>Math.PI?1:0}calculateBoundingBox(){let s=1/0,e=1/0,n=-1/0,i=-1/0;for(let r=0;r<=100;r++){const o=this.getPoint(r/100);s=Math.min(s,o.x),e=Math.min(e,o.y),n=Math.max(n,o.x),i=Math.max(i,o.y)}return new q({x:s,y:e},{x:n,y:i})}get closed(){return this.deltaAngle==0}getPoint(t){const s=Math.PI*2;let e=this.endAngle-this.startAngle;const n=Math.abs(e)<Number.EPSILON;for(;e<0;)e+=s;for(;e>s;)e-=s;e<Number.EPSILON&&(n?e=0:e=s),this.clockwise===!0&&!n&&(e===s?e=-s:e=e-s);const i=this.startAngle+t*e;let r=this.center.x+this.majorAxisRadius*Math.cos(i),o=this.center.y+this.minorAxisRadius*Math.sin(i);if(this.rotation!==0){const a=Math.cos(this.rotation),h=Math.sin(this.rotation),c=r-this.center.x,l=o-this.center.y;r=c*a-l*h+this.center.x,o=c*h+l*a+this.center.y}return new S(r,o)}transform(t){const s=t,e=new S(this.center).applyMatrix2d(s),n=new M(e.x,e.y,this.center.z),i=this.getPointAtAngle(0).clone().applyMatrix2d(s),r=this.getPointAtAngle(Math.PI/2).clone().applyMatrix2d(s),o=new S(i).sub(e),a=new S(r).sub(e),h=o.length(),c=a.length(),l=Math.atan2(o.y,o.x),m=o.clone().normalize(),u=a.clone().normalize(),g=A=>{const z=new S(A).sub(e),p=z.dot(m),C=z.dot(u);return P.normalizeAngle(Math.atan2(C/c,p/h))},y=s.determinant()<0?!this.clockwise:this.clockwise,x=this.closed?new W(n,h,c,0,I,y,l):new W(n,h,c,g(this.startPoint.clone().applyMatrix2d(s)),g(this.endPoint.clone().applyMatrix2d(s)),y,l);return this.center=x.center,this.majorAxisRadius=x.majorAxisRadius,this.minorAxisRadius=x.minorAxisRadius,this._startAngle=x._startAngle,this._endAngle=x._endAngle,this._clockwise=x._clockwise,this.rotation=x.rotation,this._boundingBoxNeedsUpdate=!0,this}getPointAtAngle(t){return this.getPoint(this.closed?t/I:P.normalizeAngle(t-this.startAngle)/this.deltaAngle)}copy(t){return this.center=t.center,this.majorAxisRadius=t.majorAxisRadius,this.minorAxisRadius=t.minorAxisRadius,this.startAngle=t.startAngle,this.endAngle=t.endAngle,this.clockwise=t.clockwise,this.rotation=t.rotation,this}clone(){return new W(this.center,this.majorAxisRadius,this.minorAxisRadius,this.startAngle,this.endAngle,this.clockwise,this.rotation)}}class ut extends at{constructor(t,s,e,n,i,r=0,o=I){super(),this.center=t,this.normal=s,this.majorAxis=e,this.majorAxisRadius=n,this.minorAxisRadius=i;const a=Math.abs(o-r);Math.abs(a-I)<1e-10||Math.abs(a-2*I)<1e-10?(this.startAngle=0,this.endAngle=I):(this.startAngle=r,this.endAngle=o)}get center(){return this._center}set center(t){this._center=new M(t.x,t.y,t.z||0),this._boundingBoxNeedsUpdate=!0}get majorAxisRadius(){return this._majorAxisRadius}set majorAxisRadius(t){if(t<0)throw T.AcCmErrors.ILLEGAL_PARAMETERS;this._majorAxisRadius=t,this._boundingBoxNeedsUpdate=!0}get minorAxisRadius(){return this._minorAxisRadius}set minorAxisRadius(t){if(t<0)throw T.AcCmErrors.ILLEGAL_PARAMETERS;this._minorAxisRadius=t,this._boundingBoxNeedsUpdate=!0}get startAngle(){return this._startAngle}set startAngle(t){this._startAngle=P.normalizeAngle(t),this._boundingBoxNeedsUpdate=!0}get endAngle(){return this._endAngle}set endAngle(t){this._endAngle=this.startAngle==0&&t==I?t:P.normalizeAngle(t),this._boundingBoxNeedsUpdate=!0}get deltaAngle(){const t=this.endAngle-this.startAngle;return Math.abs(t-I)<1e-10?I:P.normalizeAngle(t)}get isLargeArc(){return Math.abs(this.deltaAngle)>Math.PI?1:0}get clockwise(){return this.deltaAngle<=0}get normal(){return this._normal}set normal(t){this._normal=new _(t.x,t.y,t.z),this._normal.normalize(),this._boundingBoxNeedsUpdate=!0}get majorAxis(){return this._majorAxis}set majorAxis(t){this._majorAxis=new _(t.x,t.y,t.z),this._majorAxis.normalize(),this._boundingBoxNeedsUpdate=!0}get minorAxis(){return new _().crossVectors(this.normal,this.majorAxis).normalize()}get startPoint(){return this.getPointAtAngle(this._startAngle)}get endPoint(){return this.getPointAtAngle(this._endAngle)}get midPoint(){let t=this.startAngle,s=this.deltaAngle;(this.closed||Math.abs(s-I)<1e-10)&&(t=0,s=I);const e=t+s/2;return this.getPointAtAngle(e)}get isCircular(){return jt.equal(this.majorAxisRadius,this.minorAxisRadius)}get length(){if(this.isCircular)return this.majorAxisRadius*Math.abs(this.deltaAngle);const t=1e3,s=this.deltaAngle/t;let e=0,n=this.getPointAtAngle(this.startAngle);for(let i=1;i<=t;i++){const r=this.startAngle+i*s,o=this.getPointAtAngle(r),a=o.x-n.x,h=o.y-n.y,c=o.z-n.z;e+=Math.sqrt(a*a+h*h+c*c),n=o}return e}get area(){const t=this.majorAxisRadius,s=this.minorAxisRadius,e=this.startAngle,n=e+this.deltaAngle;if(Math.abs(this.deltaAngle-I)<1e-10)return Math.PI*t*s;const i=t*s/2*(n-e-(Math.sin(n)*Math.cos(n)-Math.sin(e)*Math.cos(e)));return Math.abs(i)}calculateBoundingBox(){if(this.majorAxis.equals(_.X_AXIS)||this.majorAxis.equals(_.Y_AXIS)||this.majorAxis.isParallelTo(_.X_AXIS)||this.majorAxis.isParallelTo(_.Y_AXIS)){const t=[this.startAngle,this.endAngle];for(let a=0;a<2*Math.PI;a+=Math.PI/2)P.isBetweenAngle(a,this.startAngle,this.endAngle)&&t.push(a);let s=1/0,e=1/0,n=1/0,i=-1/0,r=-1/0,o=-1/0;for(const a of t){const h=this.getPointAtAngle(a);h.x<s&&(s=h.x),h.y<e&&(e=h.y),h.z<n&&(n=h.z),h.x>i&&(i=h.x),h.y>r&&(r=h.y),h.z>o&&(o=h.z)}return new v({x:s,y:e,z:n},{x:i,y:r,z:o})}else{let s=1/0,e=1/0,n=1/0,i=-1/0,r=-1/0,o=-1/0;for(let a=0;a<=100;a++){const h=this.startAngle+this.deltaAngle*(a/100),c=this.getPointAtAngle(h);s=Math.min(s,c.x),e=Math.min(e,c.y),n=Math.min(n,c.z),i=Math.max(i,c.x),r=Math.max(r,c.y),o=Math.max(o,c.z)}return new v({x:s,y:e,z:n},{x:i,y:r,z:o})}}get closed(){return this.deltaAngle==0}getPoints(t=100){const s=[];let e=this.deltaAngle,n=this.startAngle;this.closed&&(e=I,n=0);for(let i=0;i<=t;i++){const r=n+e*(i/t),o=this.getPointAtAngle(r);s.push(o)}return s}getPointAtAngle(t){const s=Math.cos(t),e=Math.sin(t),n=this.minorAxis.clone().multiplyScalar(this.minorAxisRadius).multiplyScalar(e),i=this.majorAxis.clone().multiplyScalar(s*this.majorAxisRadius).add(n);return new M(this.center.x+i.x,this.center.y+i.y,this.center.z+i.z)}contains(t){const s=new _(t).sub(this.center),e=s.dot(this.majorAxis),n=s.dot(this.minorAxis),i=e/this.majorAxisRadius,r=n/this.minorAxisRadius;return i*i+r*r<=1}transform(t){const s=t,e=this.center.clone().applyMatrix4(s),n=this.getPointAtAngle(0).clone().applyMatrix4(s),i=this.getPointAtAngle(Math.PI/2).clone().applyMatrix4(s),r=new _(n).sub(e),o=new _(i).sub(e),a=r.length(),h=o.length(),c=r.clone().normalize(),l=new _().crossVectors(r,o).normalize();let m=new _().crossVectors(l,c).normalize();m.dot(o)<0&&(l.negate(),m=new _().crossVectors(l,c).normalize());const u=y=>{const x=new _(y).sub(e),A=x.dot(c),z=x.dot(m);return P.normalizeAngle(Math.atan2(z/h,A/a))},g=this.closed?new ut(e,l,c,a,h,0,I):new ut(e,l,c,a,h,u(this.startPoint.clone().applyMatrix4(s)),u(this.endPoint.clone().applyMatrix4(s)));return this.center=g.center,this.normal=g.normal,this.majorAxis=g.majorAxis,this.majorAxisRadius=g.majorAxisRadius,this.minorAxisRadius=g.minorAxisRadius,this._startAngle=g._startAngle,this._endAngle=g._endAngle,this._boundingBoxNeedsUpdate=!0,this}copy(t){return this.center=t.center,this.normal=t.normal,this.majorAxis=t.majorAxis,this.majorAxisRadius=t.majorAxisRadius,this.minorAxisRadius=t.minorAxisRadius,this.startAngle=t.startAngle,this.endAngle=t.endAngle,this._boundingBoxNeedsUpdate=!0,this}clone(){return new ut(this.center,this.normal,this.majorAxis,this.majorAxisRadius,this.minorAxisRadius,this.startAngle,this.endAngle)}get plane(){const t=new _(this.center).distanceTo(Tt);return new ht(this.normal,t)}}class Ls extends tt{constructor(t=null,s=!1){super(),this._vertices=t||new Array,this._closed=s}get vertices(){return this._vertices}get numberOfVertices(){return this._vertices.length}get closed(){return this._closed}get startPoint(){if(this.numberOfVertices>0){const t=this._vertices[0];return new S(t.x,t.y)}throw new Error("Start point does not exist in an empty polyline.")}get endPoint(){const t=this.numberOfVertices;if(t>0)if(this.closed){const s=this._vertices[0];return new S(s.x,s.y)}else{const s=this._vertices[t-1];return new S(s.x,s.y)}throw new Error("End point does not exist in an empty polyline.")}get length(){let t=0;const s=this._vertices.length;for(let e=0;e<s;++e){const n=this._vertices[e];let i=null;if(e<s-1?i=this._vertices[e+1]:e==s-1&&this.closed&&(i=this._vertices[0]),i)if(n.bulge){const r=new O(n,i,n.bulge);t+=r.length}else t+=new S(n.x,n.y).distanceTo(i)}return t}set closed(t){this._closed=t,this._boundingBoxNeedsUpdate=!0}addVertexAt(t,s){t<=0?this._vertices.unshift(s):this._vertices.splice(t,0,s),this._boundingBoxNeedsUpdate=!0}removeVertexAt(t){if(t<0||t>=this._vertices.length)throw new Error(`Index ${t} is out of bounds. Valid range is 0 to ${this._vertices.length-1}.`);this._vertices.splice(t,1),this._boundingBoxNeedsUpdate=!0}reset(t,s){t?s!==void 0&&s>=0&&s<this._vertices.length&&(this._vertices=this._vertices.slice(0,s),this._boundingBoxNeedsUpdate=!0):(this._vertices=new Array,this._boundingBoxNeedsUpdate=!0)}getPointAt(t){const s=this._vertices[t];return new S(s.x,s.y)}calculateBoundingBox(){const t=this.getPoints(100);return new q().setFromPoints(t)}transform(t){const s=t.determinant()<0;return this._vertices.forEach(e=>{const n=new S(e).applyMatrix2d(t);e.x=n.x,e.y=n.y,s&&e.bulge!=null&&(e.bulge=-e.bulge)}),this._boundingBoxNeedsUpdate=!0,this}getPoints3d(t,s){const e=[];return this.getPoints(t).forEach(i=>e.push(new M().set(i.x,i.y,s))),e}getPoints(t){const s=[],e=this._vertices.length;for(let n=0;n<e;++n){const i=this._vertices[n];if(i.bulge){let r=null;if(n<e-1?r=this._vertices[n+1]:n==e-1&&this.closed&&(r=this._vertices[0]),r){const a=new O(i,r,i.bulge).getPoints(t),h=a.length;for(let c=0;c<h;++c){const l=a[c];s.push(new S(l.x,l.y))}}}else s.push(new S(i.x,i.y)),n==e-1&&this.closed&&s.push(s[0])}return s}}class dt extends tt{constructor(t,s){super(),this._start=new S(t),this._end=new S(s)}get startPoint(){return this._start}set startPoint(t){this._start.copy(t),this._boundingBoxNeedsUpdate=!0}get endPoint(){return this._end}set endPoint(t){this._end.copy(t),this._boundingBoxNeedsUpdate=!0}getPoints(){return[this.startPoint,this.endPoint]}get length(){return this.startPoint.distanceTo(this.endPoint)}calculateBoundingBox(){const t=new S(Math.min(this._start.x,this._end.x),Math.min(this._start.y,this._end.y)),s=new S(Math.max(this._start.x,this._end.x),Math.max(this._start.y,this._end.y));return new q(t,s)}transform(t){return this._start.applyMatrix2d(t),this._end.applyMatrix2d(t),this._boundingBoxNeedsUpdate=!0,this}get closed(){return!1}copy(t){return this.startPoint=t.startPoint,this.endPoint=t.endPoint,this._boundingBoxNeedsUpdate=!0,this}clone(){return new dt(this._start.clone(),this._end.clone())}}class D extends tt{constructor(t=[]){super(),this._curves=t}get curves(){return this._curves}static buildFromEdges(t,s=.001){if(t.length===0)return[];const e=[...t],n=[],i=s*s,r=(o,a)=>{const h=o.x-a.x,c=o.y-a.y;return h*h+c*c<=i};for(;e.length>0;){const o=[],a=e.shift();o.push(a);const h=D.getEdgeStartPoint(a);let c=D.getEdgeEndPoint(a);if(!r(h,c))for(;e.length>0;){const l=D.findConnectingEdge(e,c,i);if(l.index<0)break;let m=e.splice(l.index,1)[0];if(l.reverse&&(m=D.reverseEdge(m)),o.push(m),c=D.getEdgeEndPoint(m),r(c,h))break}n.push(new D(o))}return n}add(t){this._curves.push(t),this._boundingBoxNeedsUpdate=!0}get numberOfEdges(){return this._curves.length}get startPoint(){if(this._curves.length>0){const t=this._curves[0].startPoint;return new S(t.x,t.y)}throw new Error("Start point does not exist in an empty loop.")}get endPoint(){return this.startPoint}get length(){let t=0;return this._curves.forEach(s=>{t+=s.length}),t}calculateBoundingBox(){const t=this.getPoints(100),s=new q;return s.setFromPoints(t),s}transform(t){const s=new Q().set(t.elements[0],t.elements[3],0,t.elements[6],t.elements[1],t.elements[4],0,t.elements[7],0,0,1,0,0,0,0,1);return this._curves.forEach(e=>{e instanceof st?e.transform(s):e.transform(t)}),this._boundingBoxNeedsUpdate=!0,this}get closed(){return!0}getPoints(t){const s=[];return this.curves.forEach(e=>{e.getPoints(t).forEach(n=>{s.push(new S(n.x,n.y))})}),s}static findConnectingEdge(t,s,e){let n=-1,i=!1,r=Number.POSITIVE_INFINITY;for(let o=0;o<t.length;o++){const a=t[o],h=D.getEdgeStartPoint(a),c=D.getEdgeEndPoint(a),l=s.x-h.x,m=s.y-h.y,u=l*l+m*m;u<r&&(r=u,n=o,i=!1);const g=s.x-c.x,y=s.y-c.y,x=g*g+y*y;x<r&&(r=x,n=o,i=!0)}return r>e?{index:-1,reverse:!1}:{index:n,reverse:i}}static getEdgeStartPoint(t){const s=t.startPoint;return new S(s.x,s.y)}static getEdgeEndPoint(t){const s=t.endPoint;return new S(s.x,s.y)}static reverseEdge(t){return t instanceof dt?new dt(t.endPoint,t.startPoint):t instanceof O?new O(t.center,t.radius,t.endAngle,t.startAngle,!t.clockwise):t instanceof W?new W(t.center,t.majorAxisRadius,t.minorAxisRadius,t.endAngle,t.startAngle,!t.clockwise,t.rotation):t instanceof st?D.reverseSplineEdge(t):t}static reverseSplineEdge(t){const s=[...t.controlPoints].reverse(),e=t.knots,n=e[0],i=e[e.length-1],r=e.map(h=>n+i-h).reverse(),o=t.weights,a=o.length>0?[...o].reverse():void 0;return new st(s,r,a,t.degree,t.closed)}}class Gt{constructor(){this.c0=0,this.c1=0,this.c2=0,this.c3=0}init(t,s,e,n){this.c0=t,this.c1=e,this.c2=-3*t+3*s-2*e-n,this.c3=2*t-2*s+e+n}initCatmullRom(t,s,e,n,i){this.init(s,e,i*(e-t),i*(n-s))}initNonuniformCatmullRom(t,s,e,n,i,r,o){let a=(s-t)/i-(e-t)/(i+r)+(e-s)/r,h=(e-s)/r-(n-s)/(r+o)+(n-e)/o;a*=r,h*=r,this.init(s,e,a,h)}calc(t){const s=t*t,e=s*t;return this.c0+this.c1*t+this.c2*s+this.c3*e}}class Ps extends at{constructor(t=[],s=!1,e="centripetal",n=.5){super(),this.isCatmullRomCurve3d=!0,this.type="CatmullRomCurve3d",this._tmp=new _,this._px=new Gt,this._py=new Gt,this._pz=new Gt,this._points=t.map(i=>new M(i)),this._closed=s,this._curveType=e,this._tension=n}get points(){return this._points}get closed(){return this._closed}get curveType(){return this._curveType}get tension(){return this._tension}get startPoint(){return this._points.length>0?this._points[0]:new M}get endPoint(){return this._points.length>0?this._points[this._points.length-1]:new M}get length(){if(this._points.length<2)return 0;let t=0;for(let s=1;s<this._points.length;s++)t+=this._points[s-1].distanceTo(this._points[s]);return this._closed&&this._points.length>2&&(t+=this._points[this._points.length-1].distanceTo(this._points[0])),t}getPoint(t,s=new M){const e=s,n=this._points,i=n.length;if(i===0)return e.set(0,0,0);if(i===1)return e.copy(n[0]);const r=(i-(this._closed?0:1))*t;let o=Math.floor(r),a=r-o;this._closed?o+=o>0?0:(Math.floor(Math.abs(o)/i)+1)*i:a===0&&o===i-1&&(o=i-2,a=1);let h,c;this._closed||o>0?h=n[(o-1)%i]:(this._tmp.subVectors(n[0],n[1]).add(n[0]),h=new M(this._tmp.x,this._tmp.y,this._tmp.z));const l=n[o%i],m=n[(o+1)%i];if(this._closed||o+2<i?c=n[(o+2)%i]:(this._tmp.subVectors(n[i-1],n[i-2]).add(n[i-1]),c=new M(this._tmp.x,this._tmp.y,this._tmp.z)),this._curveType==="centripetal"||this._curveType==="chordal"){const u=this._curveType==="chordal"?.5:.25;let g=Math.pow(h.distanceToSquared(l),u),y=Math.pow(l.distanceToSquared(m),u),x=Math.pow(m.distanceToSquared(c),u);y<1e-4&&(y=1),g<1e-4&&(g=y),x<1e-4&&(x=y),this._px.initNonuniformCatmullRom(h.x,l.x,m.x,c.x,g,y,x),this._py.initNonuniformCatmullRom(h.y,l.y,m.y,c.y,g,y,x),this._pz.initNonuniformCatmullRom(h.z,l.z,m.z,c.z,g,y,x)}else this._curveType==="catmullrom"&&(this._px.initCatmullRom(h.x,l.x,m.x,c.x,this._tension),this._py.initCatmullRom(h.y,l.y,m.y,c.y,this._tension),this._pz.initCatmullRom(h.z,l.z,m.z,c.z,this._tension));return e.set(this._px.calc(a),this._py.calc(a),this._pz.calc(a)),e}getPoints(t){const s=[];for(let e=0;e<=t;e++)s.push(this.getPoint(e/t));return s}setPoints(t){this._points=t.map(s=>new M(s)),this._boundingBoxNeedsUpdate=!0}setClosed(t){this._closed!==t&&(this._closed=t,this._boundingBoxNeedsUpdate=!0)}setCurveType(t){this._curveType=t}setTension(t){this._tension=t}transform(t){return this._points=this._points.map(s=>{const e=new M;return e.copy(s),e.applyMatrix4(t),e}),this._boundingBoxNeedsUpdate=!0,this}calculateBoundingBox(){if(this._points.length===0)return new v;const t=new v;return this._points.forEach(s=>{t.expandByPoint(s)}),t}}class L{constructor(t,s,e,n){this._degree=t,this._knots=[...s],this._controlPoints=e.map(i=>({x:i.x,y:i.y,z:i.z})),this._weights=n?[...n]:new Array(e.length).fill(1)}degree(){return this._degree}knots(){return[...this._knots]}controlPoints(){return this._controlPoints.map(t=>({x:t.x,y:t.y,z:t.z}))}weights(){return[...this._weights]}point(t){const s=this._controlPoints.map(e=>[e.x,e.y,e.z]);return rt(t,this._degree,this._knots,s,this._weights)}length(){const t=this._controlPoints.map(s=>[s.x,s.y,s.z]);return ys(this._degree,this._knots,t,this._weights)}static byKnotsControlPointsWeights(t,s,e,n){return new L(t,s,e,n)}static byPoints(t,s,e="Uniform",n,i){const r=qt(t,s,e,n,i),o=r.controlPoints.map(a=>({x:a[0],y:a[1],z:a[2]}));return new L(s,r.knots,o,r.weights)}getParameterRange(){const t=this._knots[this._degree],s=this._knots[this._knots.length-this._degree-1];return{start:t,end:s}}getPoints(t){const s=[],{start:e,end:n}=this.getParameterRange();for(let i=0;i<=t;i++){const r=e+(n-e)*(i/t);s.push(this.point(r))}return s}isClosed(t=1e-6){const{start:s,end:e}=this.getParameterRange(),n=this.point(s),i=this.point(e),r=n[0]-i[0],o=n[1]-i[1],a=n[2]-i[2];return Math.sqrt(r*r+o*o+a*a)<t}static createFitPointsForClosedCurve(t){if(t.length<4)throw new Error("At least 4 points are required for a closed NURBS curve");const s=new Ps(t,!0,"centripetal"),e=Math.max(50,t.length*2);return s.getPoints(e)}static createClosedCurve(t,s,e="Chord"){const i=this.createFitPointsForClosedCurve(t).map(r=>[r.x,r.y,r.z]);return L.byPoints(i,s,e)}}class st extends at{constructor(t,s,e,n,i,r){super();const o=arguments.length;if(this._degree=3,this._closed=!1,Array.isArray(s)){if(o<2||o>5)throw T.AcCmErrors.ILLEGAL_PARAMETERS;this._controlPoints=t;let a,h=3,c=!1;if(o>=3&&(Array.isArray(e)?(a=e,o>=4&&(h=n||3),o>=5&&(c=i)):e!==void 0&&(h=e||3,o>=4&&(c=n))),e===void 0&&o>=4&&(h=n||3,o>=5&&(c=i)),this._degree=h,this._closed=c,this._controlPoints.length<this._degree+1)throw T.AcCmErrors.ILLEGAL_PARAMETERS;this._nurbsCurve=L.byKnotsControlPointsWeights(this._degree,s,this._controlPoints,a)}else{if(o<2||o>6)throw T.AcCmErrors.ILLEGAL_PARAMETERS;this._fitPoints=t,this._knotParameterization=s,o>=3&&(this._degree=e||3);const a=typeof n=="boolean";o>=4&&a&&(this._closed=n),a?(o>=5&&(this._startTangent=i),o>=6&&(this._endTangent=r)):(o>=4&&(this._startTangent=n),o>=5&&(this._endTangent=i)),this._closed&&(this._startTangent=void 0,this._endTangent=void 0);const h=(this._startTangent?1:0)+(this._endTangent?1:0);if(this._fitPoints.length+h<this._degree+1)throw T.AcCmErrors.ILLEGAL_PARAMETERS;if(this._closed)this._nurbsCurve=L.createClosedCurve(this._fitPoints,this._degree,this._knotParameterization);else{const c=this.toNurbsPoints(this._fitPoints);this._nurbsCurve=L.byPoints(c,this._degree,this._knotParameterization,this._startTangent?this.toNurbsPoint(this._startTangent):void 0,this._endTangent?this.toNurbsPoint(this._endTangent):void 0)}this._controlPoints=this.toGePoints(this._nurbsCurve.controlPoints().map(c=>[c.x,c.y,c.z||0]))}}buildCurve(){if(this._fitPoints&&this._knotParameterization){if(this._closed){const t=L.createFitPointsForClosedCurve(this._fitPoints),s=this.toNurbsPoints(t);this._nurbsCurve=L.byPoints(s,this._degree,this._knotParameterization)}else{const t=this.toNurbsPoints(this._fitPoints);this._nurbsCurve=L.byPoints(t,this._degree,this._knotParameterization,this._startTangent?this.toNurbsPoint(this._startTangent):void 0,this._endTangent?this.toNurbsPoint(this._endTangent):void 0)}this._controlPoints=this.toGePoints(this._nurbsCurve.controlPoints().map(t=>[t.x,t.y,t.z||0]))}else if(this._controlPoints)if(this._closed){const t=L.createFitPointsForClosedCurve(this._controlPoints),s=this.toNurbsPoints(t);this._nurbsCurve=L.byPoints(s,this._degree,this._knotParameterization),this._controlPoints=this.toGePoints(this._nurbsCurve.controlPoints().map(e=>[e.x,e.y,e.z||0]))}else{const t=this._nurbsCurve.knots(),s=this._nurbsCurve.weights();this._nurbsCurve=L.byKnotsControlPointsWeights(this._degree,t,this._controlPoints,s)}}setClosed(t){this._closed!==t&&(this._closed=t,this._boundingBoxNeedsUpdate=!0,this.buildCurve())}get degree(){return this._degree}get knotParameterization(){return this._knotParameterization}get controlPoints(){return this._controlPoints.map(t=>({x:t.x,y:t.y,z:t.z||0}))}get fitPoints(){var t;return(t=this._fitPoints)==null?void 0:t.map(s=>({x:s.x,y:s.y,z:s.z||0}))}get knots(){return[...this._nurbsCurve.knots()]}get weights(){return[...this._nurbsCurve.weights()]}get startPoint(){const t=this._nurbsCurve.knots(),s=this._nurbsCurve.degree(),e=t[s],n=this._nurbsCurve.point(e);return new M(n[0],n[1],n[2])}get endPoint(){const t=this._nurbsCurve.knots(),s=this._nurbsCurve.degree(),e=t[t.length-s-1],n=this._nurbsCurve.point(e);return new M(n[0],n[1],n[2])}get length(){return this._nurbsCurve.length()}getFitPointAt(t){if(!this._fitPoints)throw new Error("No fit points in this spline");const s=this._fitPoints.length,e=t<0||t>=s?s-1:t,n=this._fitPoints[e];return{x:n.x,y:n.y,z:n.z||0}}getControlPointAt(t){const s=this._controlPoints.length,e=t<0||t>=s?s-1:t;return this._controlPoints[e]}getPoints(t=100){const s=this._nurbsCurve,e=[],n=s.knots(),i=this._nurbsCurve.degree(),r=n[i],o=n[n.length-i-1],a=(o-r)/(t-1);for(let h=0;h<t;h++){const c=h===t-1?o:r+h*a,l=s.point(c);e.push(new M(l[0],l[1],l[2]))}return e}getCurvePoints(t,s){const e=[],n=t.knots(),i=t.degree(),r=n[i],a=(n[n.length-i-1]-r)/(s-1);for(let h=0;h<s;h++){const c=r+h*a;e.push(t.point(c))}return e}calculateBoundingBox(){const t=this.getPoints(100);return new v().setFromPoints(t)}get closed(){return this._closed}set closed(t){this.setClosed(t)}transform(t){if(this._fitPoints&&this._knotParameterization)this._fitPoints=this._fitPoints.map(s=>new M(s).applyMatrix4(t)),this._startTangent&&(this._startTangent=new M(this._startTangent).transformDirection(t)),this._endTangent&&(this._endTangent=new M(this._endTangent).transformDirection(t)),this.buildCurve();else{const s=this._nurbsCurve.knots(),e=this._nurbsCurve.weights();this._controlPoints=this._controlPoints.map(n=>new M(n).applyMatrix4(t)),this._nurbsCurve=L.byKnotsControlPointsWeights(this._degree,s,this._controlPoints,e.length>0?e:void 0)}return this._boundingBoxNeedsUpdate=!0,this}toNurbsPoints(t){const s=new Array(t.length);return t.forEach((e,n)=>{s[n]=[e.x,e.y,e.z||0]}),s}toGePoints(t){const s=new Array(t.length);return t.forEach((e,n)=>{s[n]={x:e[0],y:e[1],z:e[2]}}),s}toNurbsPoint(t){return[t.x,t.y,t.z||0]}static createClosedSpline(t,s="Uniform",e=3){if(t.length<e+1)throw new Error(`At least ${e+1} points are required for a degree ${e} closed spline`);return new st(t,s,e,!0)}}f.AcGeArea2d=Ts,f.AcGeBox2d=q,f.AcGeBox3d=v,f.AcGeCatmullRomCurve3d=Ps,f.AcGeCircArc2d=O,f.AcGeCircArc3d=lt,f.AcGeCurve2d=tt,f.AcGeEllipseArc2d=W,f.AcGeEllipseArc3d=ut,f.AcGeEuler=Dt,f.AcGeGeometryUtil=ds,f.AcGeLine2d=dt,f.AcGeLine3d=ct,f.AcGeLoop2d=D,f.AcGeMathUtil=P,f.AcGeMatrix2d=H,f.AcGeMatrix3d=Q,f.AcGeNurbsCurve=L,f.AcGePlane=ht,f.AcGePoint2d=S,f.AcGePoint3d=M,f.AcGePolyline2d=Ls,f.AcGeQuaternion=ot,f.AcGeShape2d=vt,f.AcGeSpline3d=st,f.AcGeTol=jt,f.AcGeVector2d=B,f.AcGeVector3d=_,f.DEFAULT_TOL=Lt,f.DEG2RAD=Et,f.FLOAT_TOL=K,f.ORIGIN_POINT_2D=bs,f.ORIGIN_POINT_3D=Tt,f.RAD2DEG=It,f.TAU=I,f.basisFunction=it,f.calculateCurveLength=ys,f.ceilPowerOfTwo=os,f.clamp=G,f.computeParameterValues=ms,f.damp=Qt,f.degToRad=ns,f.euclideanModulo=Bt,f.evaluateNurbsPoint=rt,f.floorPowerOfTwo=hs,f.generateAveragedKnots=gs,f.generateChordKnots=Ss,f.generateSqrtChordKnots=Es,f.generateUUID=Zt,f.generateUniformKnots=Cs,f.intPartLength=Rt,f.interpolateControlPoints=Is,f.interpolateNurbsCurve=qt,f.inverseLerp=Kt,f.isBetween=as,f.isBetweenAngle=cs,f.isPointInPolygon=Ut,f.isPolygonIntersect=us,f.isPowerOfTwo=rs,f.lerp=kt,f.mapLinear=Ot,f.normalizeAngle=nt,f.pingpong=$t,f.radToDeg=is,f.randFloat=ts,f.randFloatSpread=ss,f.randInt=Jt,f.relativeEps=ls,f.seededRandom=es,f.smootherstep=Ht,f.smoothstep=Wt,Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -37,7 +37,7 @@ export declare class AcGeArea2d extends AcGeShape2d {
|
|
|
37
37
|
/**
|
|
38
38
|
* @inheritdoc
|
|
39
39
|
*/
|
|
40
|
-
transform(
|
|
40
|
+
transform(matrix: AcGeMatrix2d): this;
|
|
41
41
|
/**
|
|
42
42
|
* Return boundary points of this area
|
|
43
43
|
* @param numPoints Input the nubmer of points returned for arc segmentation
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcGeArea2d.d.ts","sourceRoot":"","sources":["../../src/geometry/AcGeArea2d.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAmB,MAAM,SAAS,CAAA;AAE/E,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAE3C,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,aAAa,EAAE,CAAA;CAC1B;AAED,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG,cAAc,CAAA;AAExD;;GAEG;AACH,qBAAa,UAAW,SAAQ,WAAW;IACzC,OAAO,CAAC,MAAM,CAAuB;IAErC;;OAEG;;IAMH;;;;OAIG;IACH,GAAG,CAAC,IAAI,EAAE,cAAc;IAKxB;;OAEG;IACH,IAAI,KAAK,IACe,aAAa,CAAC,cAAc,CAAC,CACpD;IAED;;OAEG;IACH,IAAI,MAAM,+BAKT;IAED;;OAEG;IACH,oBAAoB,IAAI,SAAS;IASjC;;OAEG;IACH,SAAS,CAAC,
|
|
1
|
+
{"version":3,"file":"AcGeArea2d.d.ts","sourceRoot":"","sources":["../../src/geometry/AcGeArea2d.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAmB,MAAM,SAAS,CAAA;AAE/E,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAE3C,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,aAAa,EAAE,CAAA;CAC1B;AAED,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG,cAAc,CAAA;AAExD;;GAEG;AACH,qBAAa,UAAW,SAAQ,WAAW;IACzC,OAAO,CAAC,MAAM,CAAuB;IAErC;;OAEG;;IAMH;;;;OAIG;IACH,GAAG,CAAC,IAAI,EAAE,cAAc;IAKxB;;OAEG;IACH,IAAI,KAAK,IACe,aAAa,CAAC,cAAc,CAAC,CACpD;IAED;;OAEG;IACH,IAAI,MAAM,+BAKT;IAED;;OAEG;IACH,oBAAoB,IAAI,SAAS;IASjC;;OAEG;IACH,SAAS,CAAC,MAAM,EAAE,YAAY;IAQ9B;;;;OAIG;IACH,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,WAAW,EAAE,EAAE;IAU7C,cAAc;IA8Cd;;;OAGG;IACH,IAAI,IAAI,IAAI,MAAM,CAsBjB;IAED;;OAEG;IACH,OAAO,CAAC,WAAW;IAcnB;;;;OAIG;IACH,OAAO,CAAC,sBAAsB;IAQ9B;;;;OAIG;IACH,OAAO,CAAC,wBAAwB;CAmBjC"}
|
|
@@ -76,8 +76,10 @@ var AcGeArea2d = /** @class */ (function (_super) {
|
|
|
76
76
|
/**
|
|
77
77
|
* @inheritdoc
|
|
78
78
|
*/
|
|
79
|
-
AcGeArea2d.prototype.transform = function (
|
|
80
|
-
|
|
79
|
+
AcGeArea2d.prototype.transform = function (matrix) {
|
|
80
|
+
this._loops.forEach(function (loop) {
|
|
81
|
+
loop.transform(matrix);
|
|
82
|
+
});
|
|
81
83
|
this._boundingBoxNeedsUpdate = true;
|
|
82
84
|
return this;
|
|
83
85
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcGeArea2d.js","sourceRoot":"","sources":["../../src/geometry/AcGeArea2d.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAA8C,MAAM,SAAS,CAAA;AAC/E,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAGxD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAS3C;;GAEG;AACH;IAAgC,8BAAW;IAGzC;;OAEG;IACH;QACE,YAAA,MAAK,WAAE,SAAA;QACP,KAAI,CAAC,MAAM,GAAG,EAAE,CAAA;;IAClB,CAAC;IAED;;;;OAIG;IACH,wBAAG,GAAH,UAAI,IAAoB;QACtB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QACtB,IAAI,CAAC,uBAAuB,GAAG,IAAI,CAAA;IACrC,CAAC;IAKD,sBAAI,6BAAK;QAHT;;WAEG;aACH;YACE,OAAO,IAAI,CAAC,MAAuC,CAAA;QACrD,CAAC;;;OAAA;IAKD,sBAAI,8BAAM;QAHV;;WAEG;aACH;YACE,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC3B,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;YACvB,CAAC;YACD,OAAO,SAAS,CAAA;QAClB,CAAC;;;OAAA;IAED;;OAEG;IACH,yCAAoB,GAApB;QACE,IAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CAAA;QAC9B,IAAI,UAAU,EAAE,CAAC;YACf,OAAO,UAAU,CAAC,GAAG,CAAA;QACvB,CAAC;aAAM,CAAC;YACN,OAAO,IAAI,SAAS,EAAE,CAAA;QACxB,CAAC;IACH,CAAC;IAED;;OAEG;IACH,8BAAS,GAAT,UAAU,
|
|
1
|
+
{"version":3,"file":"AcGeArea2d.js","sourceRoot":"","sources":["../../src/geometry/AcGeArea2d.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAA8C,MAAM,SAAS,CAAA;AAC/E,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAGxD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAS3C;;GAEG;AACH;IAAgC,8BAAW;IAGzC;;OAEG;IACH;QACE,YAAA,MAAK,WAAE,SAAA;QACP,KAAI,CAAC,MAAM,GAAG,EAAE,CAAA;;IAClB,CAAC;IAED;;;;OAIG;IACH,wBAAG,GAAH,UAAI,IAAoB;QACtB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QACtB,IAAI,CAAC,uBAAuB,GAAG,IAAI,CAAA;IACrC,CAAC;IAKD,sBAAI,6BAAK;QAHT;;WAEG;aACH;YACE,OAAO,IAAI,CAAC,MAAuC,CAAA;QACrD,CAAC;;;OAAA;IAKD,sBAAI,8BAAM;QAHV;;WAEG;aACH;YACE,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC3B,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;YACvB,CAAC;YACD,OAAO,SAAS,CAAA;QAClB,CAAC;;;OAAA;IAED;;OAEG;IACH,yCAAoB,GAApB;QACE,IAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CAAA;QAC9B,IAAI,UAAU,EAAE,CAAC;YACf,OAAO,UAAU,CAAC,GAAG,CAAA;QACvB,CAAC;aAAM,CAAC;YACN,OAAO,IAAI,SAAS,EAAE,CAAA;QACxB,CAAC;IACH,CAAC;IAED;;OAEG;IACH,8BAAS,GAAT,UAAU,MAAoB;QAC5B,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,UAAA,IAAI;YACtB,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;QACxB,CAAC,CAAC,CAAA;QACF,IAAI,CAAC,uBAAuB,GAAG,IAAI,CAAA;QACnC,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;;;OAIG;IACH,8BAAS,GAAT,UAAU,SAAiB;QACzB,IAAM,eAAe,GAAoB,EAAE,CAAA;QAC3C,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,CAAC;YACvD,IAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;YAC9B,IAAM,MAAM,GAAkB,IAAI,CAAC,SAAS,CAAC,SAAS,CAAkB,CAAA;YACxE,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QAC9B,CAAC;QACD,OAAO,eAAe,CAAA;IACxB,CAAC;IAED,mCAAc,GAAd;;QACE,IAAM,eAAe,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAA;QAC3C,IAAM,aAAa,GAAG,IAAI,CAAC,sBAAsB,CAAC,eAAe,CAAC,CAAA;QAClE,IAAM,aAAa,GAAa,IAAI,CAAC,wBAAwB,CAAC,aAAa,CAAC,CAAA;QAE5E,IAAM,YAAY,GAAG,IAAI,GAAG,EAAyB,CAAA,CAAC,qBAAqB;QAC3E,IAAM,KAAK,GAAG,aAAa,CAAC,MAAM,CAAA;QAClC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC;YAC/B,YAAY,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE;gBACjC,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC;gBACvB,QAAQ,EAAE,EAAE;aACb,CAAC,CAAA;QACJ,CAAC;QAED,IAAM,QAAQ,GAAkB,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAA;QAC3D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC;YAC/B,IAAM,KAAK,GAAG,aAAa,CAAC,CAAC,CAAC,CAAA;YAC9B,IAAM,QAAQ,GAAG,eAAe,CAAC,KAAK,CAAC,CAAA;YACvC,IAAM,GAAG,GAAG,aAAa,CAAC,KAAK,CAAC,CAAA;YAChC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;YACb,OAAO,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC;gBACtB,IAAM,MAAM,GAAG,aAAa,CAAC,CAAC,CAAC,CAAA;gBAC/B,IAAM,SAAS,GAAG,eAAe,CAAC,MAAM,CAAC,CAAA;gBACzC,IAAM,IAAI,GAAG,aAAa,CAAC,MAAM,CAAC,CAAA;gBAClC,yDAAyD;gBACzD,IACE,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC;oBACrB,gBAAgB,CAAC,gBAAgB,CAC/B,QAAQ,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,EAAE,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,EACtD,SAAS,CACV,EACD,CAAC;oBACD,MAAA,YAAY;yBACT,GAAG,CAAC,MAAM,CAAC,0CACV,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,KAAK,CAAkB,CAAC,CAAA;oBAC3D,MAAK;gBACP,CAAC;YACH,CAAC;YACD,IAAI,CAAC,KAAK,KAAK,EAAE,CAAC;gBAChB,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,KAAK,CAAkB,CAAC,CAAA;YAClE,CAAC;QACH,CAAC;QAED,OAAO,QAAQ,CAAA;IACjB,CAAC;IAMD,sBAAI,4BAAI;QAJR;;;WAGG;aACH;YACE,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC;gBAAE,OAAO,CAAC,CAAA;YAEtC,IAAI,SAAS,GAAG,CAAC,CAAA;YAEjB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBAC5C,IAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;gBAC3B,+DAA+D;gBAC/D,IAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAkB,CAAA;gBAEnD,IAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAA;gBAEzC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;oBACZ,cAAc;oBACd,SAAS,IAAI,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;gBACjC,CAAC;qBAAM,CAAC;oBACN,oBAAoB;oBACpB,SAAS,IAAI,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;gBACjC,CAAC;YACH,CAAC;YAED,OAAO,SAAS,CAAA;QAClB,CAAC;;;OAAA;IAED;;OAEG;IACK,gCAAW,GAAnB,UAAoB,MAAqB;QACvC,IAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAA;QAC3B,IAAI,KAAK,GAAG,CAAC;YAAE,OAAO,CAAC,CAAA;QAEvB,IAAI,IAAI,GAAG,CAAC,CAAA;QACZ,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;YAClD,IAAM,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC,CAAA;YACpB,IAAM,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC,CAAA;YACpB,IAAI,IAAI,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAA;QACnC,CAAC;QAED,OAAO,IAAI,GAAG,GAAG,CAAA;IACnB,CAAC;IAED;;;;OAIG;IACK,2CAAsB,GAA9B,UAA+B,eAAoC;QACjE,IAAM,aAAa,GAAgB,EAAE,CAAA;QACrC,eAAe,CAAC,OAAO,CAAC,UAAA,MAAM;YAC5B,aAAa,CAAC,IAAI,CAAC,IAAI,SAAS,EAAE,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAA;QAC3D,CAAC,CAAC,CAAA;QACF,OAAO,aAAa,CAAA;IACtB,CAAC;IAED;;;;OAIG;IACK,6CAAwB,GAAhC,UAAiC,aAA0B;QACzD,IAAM,aAAa,GAAsC,EAAE,CAAA;QAC3D,aAAa,CAAC,OAAO,CAAC,UAAC,GAAG,EAAE,KAAK;YAC/B,IAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAA;YACrB,IAAM,IAAI,GAAG,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAA;YACrC,aAAa,CAAC,IAAI,CAAC;gBACjB,IAAI,MAAA;gBACJ,KAAK,OAAA;aACN,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;QACF,aAAa,CAAC,IAAI,CAAC,UAAC,CAAC,EAAE,CAAC;YACtB,OAAO,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,IAAI,CAAA;QACxB,CAAC,CAAC,CAAA;QACF,IAAM,OAAO,GAAa,EAAE,CAAA;QAC5B,aAAa,CAAC,OAAO,CAAC,UAAA,CAAC;YACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAA;QACvB,CAAC,CAAC,CAAA;QACF,OAAO,OAAO,CAAA;IAChB,CAAC;IACH,iBAAC;AAAD,CAAC,AA5MD,CAAgC,WAAW,GA4M1C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcGeCircArc2d.d.ts","sourceRoot":"","sources":["../../src/geometry/AcGeCircArc2d.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,SAAS,EACT,YAAY,EACZ,WAAW,EACX,eAAe,EAEhB,MAAM,SAAS,CAAA;AAEhB,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAE3C;;;;;;;;;;GAUG;AACH,qBAAa,aAAc,SAAQ,WAAW;IAC5C,OAAO,CAAC,OAAO,CAAc;IAC7B,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,UAAU,CAAU;gBAEhB,EAAE,EAAE,eAAe,EAAE,EAAE,EAAE,eAAe,EAAE,EAAE,EAAE,eAAe;gBAC7D,KAAK,EAAE,eAAe,EAAE,GAAG,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM;gBAErE,MAAM,EAAE,eAAe,EACvB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,OAAO;IA6CpB;;;;;OAKG;IACH,OAAO,CAAC,mBAAmB;IAmE3B;;;;;;;;;;OAUG;IACH,OAAO,CAAC,8BAA8B;IAkEtC;;OAEG;IACH,IAAI,MAAM,IAAI,WAAW,CAExB;IACD,IAAI,MAAM,CAAC,KAAK,EAAE,eAAe,EAGhC;IAED;;OAEG;IACH,IAAI,MAAM,IAAI,MAAM,CAEnB;IACD,IAAI,MAAM,CAAC,KAAK,EAAE,MAAM,EAGvB;IAED;;;;OAIG;IACH,IAAI,UAAU,IAAI,MAAM,CAIvB;IACD,IAAI,UAAU,CAAC,KAAK,EAAE,MAAM,EAK3B;IAED;;;;OAIG;IACH,IAAI,QAAQ,IAAI,MAAM,CAErB;IACD,IAAI,QAAQ,CAAC,KAAK,EAAE,MAAM,EASzB;IAED;;;;OAIG;IACH,OAAO,CAAC,YAAY;IAQpB;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;IAIzB;;OAEG;IACH,IAAI,UAAU,WAMb;IAED;;OAEG;IACH,IAAI,SAAS,IAGQ,OAAO,CAD3B;IACD,IAAI,SAAS,CAAC,KAAK,EAAE,OAAO,EAG3B;IAED;;OAEG;IACH,IAAI,UAAU,IAAI,WAAW,CAE5B;IAED;;OAEG;IACH,IAAI,QAAQ,IAAI,WAAW,CAE1B;IAED;;OAEG;IACH,IAAI,QAAQ,IAAI,WAAW,CAS1B;IAED;;OAEG;IACH,IAAI,MAAM,YAIT;IAED;;OAEG;IACH,oBAAoB,IAAI,SAAS;IA2BjC;;OAEG;IACH,IAAI,MAAM,WAET;IAED;;OAEG;IACH,SAAS,CAAC,OAAO,EAAE,YAAY;
|
|
1
|
+
{"version":3,"file":"AcGeCircArc2d.d.ts","sourceRoot":"","sources":["../../src/geometry/AcGeCircArc2d.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,SAAS,EACT,YAAY,EACZ,WAAW,EACX,eAAe,EAEhB,MAAM,SAAS,CAAA;AAEhB,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAE3C;;;;;;;;;;GAUG;AACH,qBAAa,aAAc,SAAQ,WAAW;IAC5C,OAAO,CAAC,OAAO,CAAc;IAC7B,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,UAAU,CAAU;gBAEhB,EAAE,EAAE,eAAe,EAAE,EAAE,EAAE,eAAe,EAAE,EAAE,EAAE,eAAe;gBAC7D,KAAK,EAAE,eAAe,EAAE,GAAG,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM;gBAErE,MAAM,EAAE,eAAe,EACvB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,OAAO;IA6CpB;;;;;OAKG;IACH,OAAO,CAAC,mBAAmB;IAmE3B;;;;;;;;;;OAUG;IACH,OAAO,CAAC,8BAA8B;IAkEtC;;OAEG;IACH,IAAI,MAAM,IAAI,WAAW,CAExB;IACD,IAAI,MAAM,CAAC,KAAK,EAAE,eAAe,EAGhC;IAED;;OAEG;IACH,IAAI,MAAM,IAAI,MAAM,CAEnB;IACD,IAAI,MAAM,CAAC,KAAK,EAAE,MAAM,EAGvB;IAED;;;;OAIG;IACH,IAAI,UAAU,IAAI,MAAM,CAIvB;IACD,IAAI,UAAU,CAAC,KAAK,EAAE,MAAM,EAK3B;IAED;;;;OAIG;IACH,IAAI,QAAQ,IAAI,MAAM,CAErB;IACD,IAAI,QAAQ,CAAC,KAAK,EAAE,MAAM,EASzB;IAED;;;;OAIG;IACH,OAAO,CAAC,YAAY;IAQpB;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;IAIzB;;OAEG;IACH,IAAI,UAAU,WAMb;IAED;;OAEG;IACH,IAAI,SAAS,IAGQ,OAAO,CAD3B;IACD,IAAI,SAAS,CAAC,KAAK,EAAE,OAAO,EAG3B;IAED;;OAEG;IACH,IAAI,UAAU,IAAI,WAAW,CAE5B;IAED;;OAEG;IACH,IAAI,QAAQ,IAAI,WAAW,CAE1B;IAED;;OAEG;IACH,IAAI,QAAQ,IAAI,WAAW,CAS1B;IAED;;OAEG;IACH,IAAI,MAAM,YAIT;IAED;;OAEG;IACH,oBAAoB,IAAI,SAAS;IA2BjC;;OAEG;IACH,IAAI,MAAM,WAET;IAED;;OAEG;IACH,SAAS,CAAC,OAAO,EAAE,YAAY;IAoD/B;;OAEG;IACH,KAAK;IAUL;;;;OAIG;IACH,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW;IAO3C;;;;OAIG;IACH,SAAS,CAAC,SAAS,GAAE,MAAY,GAAG,WAAW,EAAE;CA6BlD"}
|
|
@@ -422,7 +422,33 @@ var AcGeCircArc2d = /** @class */ (function (_super) {
|
|
|
422
422
|
* @inheritdoc
|
|
423
423
|
*/
|
|
424
424
|
AcGeCircArc2d.prototype.transform = function (_matrix) {
|
|
425
|
-
|
|
425
|
+
var _this = this;
|
|
426
|
+
var matrix = _matrix;
|
|
427
|
+
var transformedCenter = this.center.clone().applyMatrix2d(matrix);
|
|
428
|
+
var transformedStart = this.startPoint.clone().applyMatrix2d(matrix);
|
|
429
|
+
if (this.closed) {
|
|
430
|
+
this.center = transformedCenter;
|
|
431
|
+
this.radius = transformedCenter.distanceTo(transformedStart);
|
|
432
|
+
this._startAngle = Math.atan2(transformedStart.y - transformedCenter.y, transformedStart.x - transformedCenter.x);
|
|
433
|
+
this._endAngle = this._startAngle;
|
|
434
|
+
this._clockwise =
|
|
435
|
+
matrix.determinant() < 0 ? !this._clockwise : this._clockwise;
|
|
436
|
+
this._boundingBoxNeedsUpdate = true;
|
|
437
|
+
return this;
|
|
438
|
+
}
|
|
439
|
+
var transformedMid = this.midPoint.clone().applyMatrix2d(matrix);
|
|
440
|
+
var transformedEnd = this.endPoint.clone().applyMatrix2d(matrix);
|
|
441
|
+
var transformedArc = new AcGeCircArc2d(transformedStart, transformedMid, transformedEnd);
|
|
442
|
+
var clockwise = matrix.determinant() < 0 ? !this.clockwise : this.clockwise;
|
|
443
|
+
var toPublicAngle = function (angle) {
|
|
444
|
+
var normalized = AcGeMathUtil.normalizeAngle(angle);
|
|
445
|
+
return clockwise ? _this._mirrorAngle(normalized) : normalized;
|
|
446
|
+
};
|
|
447
|
+
this.center = transformedArc.center;
|
|
448
|
+
this.radius = transformedArc.radius;
|
|
449
|
+
this.clockwise = clockwise;
|
|
450
|
+
this.startAngle = toPublicAngle(Math.atan2(transformedStart.y - transformedArc.center.y, transformedStart.x - transformedArc.center.x));
|
|
451
|
+
this.endAngle = toPublicAngle(Math.atan2(transformedEnd.y - transformedArc.center.y, transformedEnd.x - transformedArc.center.x));
|
|
426
452
|
this._boundingBoxNeedsUpdate = true;
|
|
427
453
|
return this;
|
|
428
454
|
};
|