@mlightcad/geometry-engine 3.2.18 → 3.2.19
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/dist/geometry-engine.js +510 -437
- package/dist/geometry-engine.umd.cjs +1 -1
- package/lib/geometry/AcGeArea2d.d.ts +4 -0
- package/lib/geometry/AcGeArea2d.d.ts.map +1 -1
- package/lib/geometry/AcGeArea2d.js +10 -0
- package/lib/geometry/AcGeArea2d.js.map +1 -1
- package/lib/geometry/AcGeCatmullRomCurve3d.d.ts +4 -0
- package/lib/geometry/AcGeCatmullRomCurve3d.d.ts.map +1 -1
- package/lib/geometry/AcGeCatmullRomCurve3d.js +6 -0
- package/lib/geometry/AcGeCatmullRomCurve3d.js.map +1 -1
- package/lib/geometry/AcGeCurve2d.d.ts +4 -0
- package/lib/geometry/AcGeCurve2d.d.ts.map +1 -1
- package/lib/geometry/AcGeCurve2d.js.map +1 -1
- package/lib/geometry/AcGeCurve3d.d.ts +4 -0
- package/lib/geometry/AcGeCurve3d.d.ts.map +1 -1
- package/lib/geometry/AcGeCurve3d.js.map +1 -1
- package/lib/geometry/AcGeLoop2d.d.ts +4 -0
- package/lib/geometry/AcGeLoop2d.d.ts.map +1 -1
- package/lib/geometry/AcGeLoop2d.js +6 -0
- package/lib/geometry/AcGeLoop2d.js.map +1 -1
- package/lib/geometry/AcGeNurbsCurve.d.ts +4 -0
- package/lib/geometry/AcGeNurbsCurve.d.ts.map +1 -1
- package/lib/geometry/AcGeNurbsCurve.js +6 -0
- package/lib/geometry/AcGeNurbsCurve.js.map +1 -1
- package/lib/geometry/AcGePolyline2d.d.ts +4 -0
- package/lib/geometry/AcGePolyline2d.d.ts.map +1 -1
- package/lib/geometry/AcGePolyline2d.js +17 -0
- package/lib/geometry/AcGePolyline2d.js.map +1 -1
- package/lib/geometry/AcGeShape.d.ts +4 -0
- package/lib/geometry/AcGeShape.d.ts.map +1 -1
- package/lib/geometry/AcGeShape.js.map +1 -1
- package/lib/geometry/AcGeShape2d.d.ts +4 -0
- package/lib/geometry/AcGeShape2d.d.ts.map +1 -1
- package/lib/geometry/AcGeShape2d.js.map +1 -1
- package/lib/geometry/AcGeShape3d.d.ts +4 -0
- package/lib/geometry/AcGeShape3d.d.ts.map +1 -1
- package/lib/geometry/AcGeShape3d.js.map +1 -1
- package/lib/geometry/AcGeSpline3d.d.ts +4 -0
- package/lib/geometry/AcGeSpline3d.d.ts.map +1 -1
- package/lib/geometry/AcGeSpline3d.js +29 -0
- package/lib/geometry/AcGeSpline3d.js.map +1 -1
- package/lib/math/AcGePoint2d.d.ts +4 -0
- package/lib/math/AcGePoint2d.d.ts.map +1 -1
- package/lib/math/AcGePoint2d.js +6 -0
- package/lib/math/AcGePoint2d.js.map +1 -1
- package/lib/math/AcGePoint3d.d.ts +4 -0
- package/lib/math/AcGePoint3d.d.ts.map +1 -1
- package/lib/math/AcGePoint3d.js +6 -0
- package/lib/math/AcGePoint3d.js.map +1 -1
- package/lib/util/AcGeTol.d.ts +4 -0
- package/lib/util/AcGeTol.d.ts.map +1 -1
- package/lib/util/AcGeTol.js +9 -0
- package/lib/util/AcGeTol.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
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"})});
|
|
1
|
+
(function(f,N){typeof exports=="object"&&typeof module<"u"?N(exports,require("@mlightcad/common")):typeof define=="function"&&define.amd?define(["exports","@mlightcad/common"],N):(f=typeof globalThis<"u"?globalThis:f||self,N(f["geometry-engine"]={},f.common))})(this,function(f,N){"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 Kt=1234567;const Bt=Math.PI/180,kt=180/Math.PI;function Qt(){const m=Math.random()*4294967295|0,t=Math.random()*4294967295|0,s=Math.random()*4294967295|0,e=Math.random()*4294967295|0;return(j[m&255]+j[m>>8&255]+j[m>>16&255]+j[m>>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 Y(m,t,s){return Math.max(t,Math.min(s,m))}function Rt(m,t){return(m%t+t)%t}function $t(m,t,s,e,n){return e+(m-t)*(n-e)/(s-t)}function Wt(m,t,s){return m!==t?(s-m)/(t-m):0}function Tt(m,t,s){return(1-s)*m+s*t}function Ht(m,t,s,e){return Tt(m,t,1-Math.exp(-s*e))}function Jt(m,t=1){return t-Math.abs(Rt(m,t*2)-t)}function ts(m,t,s){return m<=t?0:m>=s?1:(m=(m-t)/(s-t),m*m*(3-2*m))}function ss(m,t,s){return m<=t?0:m>=s?1:(m=(m-t)/(s-t),m*m*m*(m*(m*6-15)+10))}function es(m,t){return m+Math.floor(Math.random()*(t-m+1))}function ns(m,t){return m+Math.random()*(t-m)}function is(m){return m*(.5-Math.random())}function rs(m){m!==void 0&&(Kt=m);let t=Kt+=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 os(m){return m*Bt}function hs(m){return m*kt}function as(m){return(m&m-1)===0&&m!==0}function cs(m){return Math.pow(2,Math.ceil(Math.log(m)/Math.LN2))}function ls(m){return Math.pow(2,Math.floor(Math.log(m)/Math.LN2))}function nt(m){const t=Math.PI*2;return(m%t+t)%t}function us(m,t,s){return m>t&&m<s||m>s&&m<t}function ds(m,t,s,e=!1){return m=nt(m),t=nt(t),s=nt(s),e?t>s?m<=t&&m>=s:m<=t||m>=s:t<s?m>=t&&m<=s:m>=t||m<=s}function Nt(m){return m=Math.abs(m),m<1?0:Math.ceil(Math.log10(Math.abs(m)+1))}function ms(m,t=1e-7){const s=Nt(m);return Math.max(Math.pow(10,s)*t,t)}const P={DEG2RAD:Bt,RAD2DEG:kt,generateUUID:Qt,clamp:Y,euclideanModulo:Rt,mapLinear:$t,inverseLerp:Wt,lerp:Tt,damp:Ht,pingpong:Jt,smoothstep:ts,smootherstep:ss,randInt:es,randFloat:ns,randFloatSpread:is,seededRandom:rs,degToRad:os,radToDeg:hs,isPowerOfTwo:as,ceilPowerOfTwo:cs,floorPowerOfTwo:ls,normalizeAngle:nt,isBetween:us,isBetweenAngle:ds,intPartLength:Nt,relativeEps:ms},gt=class gt{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 N.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 gt(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}};gt.EMPTY=Object.freeze(new gt(0,0));let B=gt;const yt=class yt{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],d=e[2],u=e[5],g=e[8],y=n[0],x=n[3],A=n[6],M=n[1],p=n[4],S=n[7],C=n[2],k=n[5],w=n[8];return i[0]=r*y+o*M+a*C,i[3]=r*x+o*p+a*k,i[6]=r*A+o*S+a*w,i[1]=h*y+c*M+l*C,i[4]=h*x+c*p+l*k,i[7]=h*A+c*S+l*w,i[2]=d*y+u*M+g*C,i[5]=d*x+u*p+g*k,i[8]=d*A+u*S+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,d=o*a-c*i,u=h*i-r*a,g=s*l+e*d+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]=d*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(jt.makeScale(t,s)),this}rotate(t){return this.premultiply(jt.makeRotation(-t)),this}translate(t,s){return this.premultiply(jt.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 yt().fromArray(this.elements)}};yt.IDENTITY=Object.freeze(new yt);let J=yt;const jt=new J,Q=1e-6,I=2*Math.PI,Ss={x:0,y:0},Lt={x:0,y:0,z:0};class it{constructor(){this.equalPointTol=Q,this.equalVectorTol=Q}clone(){const t=new it;return t.equalPointTol=this.equalPointTol,t.equalVectorTol=this.equalVectorTol,t}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=Q){return t<s&&t>-s}static equal(t,s,e=Q){return Math.abs(t-s)<e}static great(t,s,e=Q){return t-s>e}static less(t,s,e=Q){return t-s<e}}const Vt=new it;function Ut(m,t,s=!1){const e=m.x,n=m.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,d=t[a].y;let u=c>n!=d>n;s&&(u=c>=n!=d>=n),u&&e<(l-h)*(n-c)/(d-c)+h&&(i=!i)}return i}function gs(m,t){if(m.length===0||t.length===0)return!1;const s=new q().setFromPoints(m),e=new q().setFromPoints(t);if(!s.intersectsBox(e))return!1;for(let n=0;n<m.length;){if(Ut(m[n],t,!0))return!0;n<m.length-1&&Vt.equalPoint2d(m[n+1],m[n])&&++n,++n}return!1}const ys={isPointInPolygon:Ut,isPolygonIntersect:gs};function Es(m,t){const s=[],e=t-1,n=m;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 Is(m,t){const s=t.length-1,e=m,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 xs(m,t="Uniform"){const s=m.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=m[r][0]-m[r-1][0],a=m[r][1]-m[r-1][1],h=m[r][2]-m[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 _s(m,t){const s=t.length-1,e=m,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 Bs(m,t){const s=t.length-1,e=m,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),d=Math.sqrt(l);i+=d,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 qt(m,t){const s=m.length,e=m.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 Ft(m,t,s="Uniform",e,n){if(m.length===0)return{controlPoints:[],knots:[],weights:[]};const i=m.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=xs(i,s),d=l.slice();r&&d.unshift(l[0]),o&&d.push(l[l.length-1]);const u=_s(t,d),g=c+1,y=new Array(g),x=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,x[p]=i[0][0],A[p]=i[0][1],M[p]=i[0][2],p++;for(let E=1;E<=h-1;E++){const V=l[E];y[p]=new Array(g).fill(0);for(let v=0;v<=c;v++)y[p][v]=rt(v,t,V,u);x[p]=i[E][0],A[p]=i[E][1],M[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],M[p]=i[h][2],p++,r){const E=u[t+1]-u[0],V=E!==0?t/E:0;y[p]=new Array(g).fill(0),y[p][0]=-V,y[p][1]=V,x[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(o){const E=u[c+t+1]-u[c],V=E!==0?t/E:0;y[p]=new Array(g).fill(0),y[p][c-1]=-V,y[p][c]=V,x[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 S=qt(y,x),C=qt(y,A),k=qt(y,M),w=new Array(g);for(let E=0;E<g;E++)w[E]=[S[E],C[E],k[E]];const R=new Array(g).fill(1);return{controlPoints:w,knots:u,weights:R}}function rt(m,t,s,e){if(t===0)return s>=e[m]&&s<e[m+1]?1:0;const n=e[m+t]-e[m],i=e[m+t+1]-e[m+1],r=n>1e-10?(s-e[m])/n:0,o=i>1e-10?(e[m+t+1]-s)/i:0;return r*rt(m,t-1,s,e)+o*rt(m+1,t-1,s,e)}function ot(m,t,s,e,n){const i=e.length-1,r=t;if(m=Math.max(s[r],Math.min(s[i+1],m)),Math.abs(m-s[i+1])<1e-8)return[...e[i]];if(Math.abs(m-s[r])<1e-8)return[...e[0]];const o=[0,0,0];let a=0;for(let h=0;h<=i;h++){const c=rt(h,r,m,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(m-h)<1e-8)return[...e[i]];if(Math.abs(m-s[r])<1e-8)return[...e[0]]}return Math.abs(a)>=1e-10&&(o[0]/=a,o[1]/=a,o[2]/=a),o}function As(m,t,s,e){const n=m,i=t[n],r=t[t.length-n-1];let o=0;const a=1e3,h=(r-i)/a;let c=ot(i,m,t,s,e);for(let y=1;y<=a;y++){const x=i+y*h,A=ot(x,m,t,s,e),M=A[0]-c[0],p=A[1]-c[1],S=A[2]-c[2];o+=Math.sqrt(M*M+p*p+S*S),c=A}const l=ot(r,m,t,s,e),d=l[0]-c[0],u=l[1]-c[1],g=l[2]-c[2];return o+=Math.sqrt(d*d+u*u+g*g),o}function ks(m,t=3,s="Uniform",e,n){return m.length===0?[]:Ft(m,t,s,e,n).controlPoints}class ht{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 d=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]=d,t[s+1]=u,t[s+2]=g,t[s+3]=y;return}if(l!==y||a!==d||h!==u||c!==g){let x=1-o;const A=a*d+h*u+c*g+l*y,M=A>=0?1:-1,p=1-A*A;if(p>Number.EPSILON){const C=Math.sqrt(p),k=Math.atan2(C,A*M);x=Math.sin(x*k)/C,o=Math.sin(o*k)/C}const S=o*M;if(a=a*x+d*S,h=h*x+u*S,c=c*x+g*S,l=l*x+y*S,x===1-o){const C=1/Math.sqrt(a*a+h*h+c*c+l*l);a*=C,h*=C,c*=C,l*=C}}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],d=i[r+1],u=i[r+2],g=i[r+3];return t[s]=o*g+c*l+a*u-h*d,t[s+1]=a*g+c*d+h*l-o*u,t[s+2]=h*g+c*u+o*d-a*l,t[s+3]=c*g-o*l-a*d-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 ht(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),d=a(e/2),u=a(n/2),g=a(i/2);switch(r){case"XYZ":this._x=d*c*l+h*u*g,this._y=h*u*l-d*c*g,this._z=h*c*g+d*u*l,this._w=h*c*l-d*u*g;break;case"YXZ":this._x=d*c*l+h*u*g,this._y=h*u*l-d*c*g,this._z=h*c*g-d*u*l,this._w=h*c*l+d*u*g;break;case"ZXY":this._x=d*c*l-h*u*g,this._y=h*u*l+d*c*g,this._z=h*c*g+d*u*l,this._w=h*c*l-d*u*g;break;case"ZYX":this._x=d*c*l-h*u*g,this._y=h*u*l+d*c*g,this._z=h*c*g-d*u*l,this._w=h*c*l+d*u*g;break;case"YZX":this._x=d*c*l+h*u*g,this._y=h*u*l+d*c*g,this._z=h*c*g-d*u*l,this._w=h*c*l-d*u*g;break;case"XZY":this._x=d*c*l-h*u*g,this._y=h*u*l-d*c*g,this._z=h*c*g+d*u*l,this._w=h*c*l+d*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],d=e+o+l;if(d>0){const u=.5/Math.sqrt(d+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(Y(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,d=Math.sin(s*c)/h;return this._w=r*l+this._w*d,this._x=e*l+this._x*d,this._y=n*l+this._y*d,this._z=i*l+this._z*d,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 T=class T{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 N.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 T(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(fs.setFromEuler(t))}applyAxisAngle(t,s){return this.applyQuaternion(fs.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 vt.copy(this).projectOnVector(t),this.sub(vt)}reflect(t){return this.sub(vt.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}};T.ORIGIN=Object.freeze(new T(0,0,0)),T.X_AXIS=Object.freeze(new T(1,0,0)),T.NEGATIVE_X_AXIS=Object.freeze(new T(-1,0,0)),T.Y_AXIS=Object.freeze(new T(0,1,0)),T.NEGATIVE_Y_AXIS=Object.freeze(new T(0,-1,0)),T.Z_AXIS=Object.freeze(new T(0,0,1)),T.NEGATIVE_Z_AXIS=Object.freeze(new T(0,0,-1));let _=T;const vt=new _,fs=new ht,xt=class xt{constructor(t,s,e,n,i,r,o,a,h,c,l,d,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&&d!=null&&u!=null&&g!=null&&y!=null&&x!=null&&this.set(t,s,e,n,i,r,o,a,h,c,l,d,u,g,y,x)}set(t,s,e,n,i,r,o,a,h,c,l,d,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]=d,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 xt().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(Vt.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/tt.setFromMatrixColumn(t,0).length(),i=1/tt.setFromMatrixColumn(t,1).length(),r=1/tt.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(Rs,t,Ts)}lookAt(t,s,e){const n=this.elements;return U.subVectors(t,s),U.lengthSq()===0&&(U.z=1),U.normalize(),G.crossVectors(e,U),G.lengthSq()===0&&(Math.abs(e.z)===1?U.x+=1e-4:U.z+=1e-4,U.normalize(),G.crossVectors(e,U)),G.normalize(),At.crossVectors(U,G),n[0]=G.x,n[4]=At.x,n[8]=U.x,n[1]=G.y,n[5]=At.y,n[9]=U.y,n[2]=G.z,n[6]=At.z,n[10]=U.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],d=e[9],u=e[13],g=e[2],y=e[6],x=e[10],A=e[14],M=e[3],p=e[7],S=e[11],C=e[15],k=n[0],w=n[4],R=n[8],E=n[12],V=n[1],v=n[5],et=n[9],wt=n[13],zt=n[2],Mt=n[6],Pt=n[10],bt=n[14],Ct=n[3],St=n[7],Et=n[11],It=n[15];return i[0]=r*k+o*V+a*zt+h*Ct,i[4]=r*w+o*v+a*Mt+h*St,i[8]=r*R+o*et+a*Pt+h*Et,i[12]=r*E+o*wt+a*bt+h*It,i[1]=c*k+l*V+d*zt+u*Ct,i[5]=c*w+l*v+d*Mt+u*St,i[9]=c*R+l*et+d*Pt+u*Et,i[13]=c*E+l*wt+d*bt+u*It,i[2]=g*k+y*V+x*zt+A*Ct,i[6]=g*w+y*v+x*Mt+A*St,i[10]=g*R+y*et+x*Pt+A*Et,i[14]=g*E+y*wt+x*bt+A*It,i[3]=M*k+p*V+S*zt+C*Ct,i[7]=M*w+p*v+S*Mt+C*St,i[11]=M*R+p*et+S*Pt+C*Et,i[15]=M*E+p*wt+S*bt+C*It,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],d=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*d+e*h*d+n*o*u-e*a*u)+y*(+s*a*u-s*h*d+i*r*d-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*d+n*r*l-e*r*d+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],d=t[10],u=t[11],g=t[12],y=t[13],x=t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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,d=i*h,u=i*c,g=i*l,y=r*c,x=r*l,A=o*l,M=a*h,p=a*c,S=a*l,C=e.x,k=e.y,w=e.z;return n[0]=(1-(y+A))*C,n[1]=(u+S)*C,n[2]=(g-p)*C,n[3]=0,n[4]=(u-S)*k,n[5]=(1-(d+A))*k,n[6]=(x+M)*k,n[7]=0,n[8]=(g+p)*w,n[9]=(x-M)*w,n[10]=(1-(d+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=tt.set(n[0],n[1],n[2]).length();const r=tt.set(n[4],n[5],n[6]).length(),o=tt.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}};xt.IDENTITY=Object.freeze(new xt);let $=xt;const tt=new _,X=new $,Rs=new _(0,0,0),Ts=new _(1,1,1),G=new _,At=new _,U=new _;class D{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 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 _(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:(Z[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Z[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Z[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Z[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Z[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Z[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Z[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Z[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Z),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 Z=[new _,new _,new _,new _,new _,new _,new _,new _],Xt=new _,ps=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=ps.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,ps).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 ws=new _,Ns=new _,js=new J;class at{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=ws.subVectors(e,s).cross(Ns.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||js.getNormalMatrix(t),n=this.coplanarPoint(ws).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 at().copy(this)}}class b extends B{clone(){return new b(this.x,this.y)}static pointArrayToNumberArray(t){const s=new Array(t.length*2);return t.forEach((e,n)=>{e.toArray(s,n*2)}),s}}class z extends _{clone(){return new z(this.x,this.y,this.z)}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 zs=new $,Ms=new ht,_t=class _t{constructor(t=0,s=0,e=0,n=_t.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 _t(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],d=n[6],u=n[10];switch(s){case"XYZ":this._y=Math.asin(Y(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-c,u),this._z=Math.atan2(-r,i)):(this._x=Math.atan2(d,h),this._z=0);break;case"YXZ":this._x=Math.asin(-Y(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(Y(d,-1,1)),Math.abs(d)<.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(-Y(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(d,u),this._z=Math.atan2(a,i)):(this._x=0,this._z=Math.atan2(-r,h));break;case"YZX":this._z=Math.asin(Y(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(-Y(r,-1,1)),Math.abs(r)<.9999999?(this._x=Math.atan2(d,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 zs.makeRotationFromQuaternion(t),this.setFromRotationMatrix(zs,s,e)}setFromVector3(t,s=this._order){return this.set(t.x,t.y,t.z,s)}reorder(t){return Ms.setFromEuler(this),this.setFromQuaternion(Ms,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}};_t.DEFAULT_ORDER="XYZ";let Dt=_t;class Ps{constructor(){this._boundingBoxNeedsUpdate=!1}get boundingBoxNeedUpdate(){return this._boundingBoxNeedsUpdate}}class Yt extends Ps{translate(t){return this.transform(new J().makeTranslation(t.x,t.y))}get box(){return(this._box==null||this._boundingBoxNeedsUpdate)&&(this._box=this.calculateBoundingBox(),this._boundingBoxNeedsUpdate=!1),this._box}}class Zt extends Yt{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}clone(){const t=new Zt;return this._loops.forEach(s=>{t.add(s.clone())}),t}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 d=a+1;for(;d<i;d++){const u=e[d],g=t[u];if(s[u].containsBox(l)&&ys.isPointInPolygon(c[P.randInt(0,c.length-1)],g)){(o=n.get(u))==null||o.children.push(n.get(h));break}}d===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 st extends Yt{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],d=e[n+1]-c,u=(r-c)/d;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 b;return o.copy(r).sub(i).normalize(),o}getTangentAt(t){const s=this.getUtoTmapping(t);return this.getTangent(s)}}class O extends st{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 b(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 N.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),d=r(c),u=(w,R,E,V)=>{const v=(V-R)/(w-E),et=w*v+R;return{x:v,y:et}},g=o.y-l*o.x,y=a.y-d*a.x,x=u(l,g,d,y),A=Math.sqrt(Math.pow(t.x-x.x,2)+Math.pow(t.y-x.y,2)),M=(w,R)=>Math.atan2(w.y-R.y,w.x-R.x),p=M(t,x),S=M(s,x),C=M(e,x),k=C>p&&C<S||p>C&&p<S||S>C&&S<p;this.center=x,this.radius=A,this._clockwise=!k,this._startAngle=p,this._endAngle=C}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(),d=e<0?-Math.PI/2:Math.PI/2,u=new B(l.x*Math.cos(d)-l.y*Math.sin(d),l.y*Math.cos(d)+l.x*Math.sin(d));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 b(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 b(Math.min(...e),Math.min(...n)),new b(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 b(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 b(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 b(a.x,a.y))}return s}}class Ls extends Ps{translate(t){return this.transform(new $().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 ct extends Ls{}class lt extends ct{constructor(t,s){super(),this._start=new z(t),this._end=new z(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 z((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(W).normalize();return new z(this._start).addScaledVector(e,t)}else{const e=this.delta(W).normalize();return new z(this._end).addScaledVector(e,t)}}extend(t,s=!1){if(s){const e=W.subVectors(this._start,this._end).normalize();this._start=new z(this._start).addScaledVector(e,t)}else{const e=this.delta(W).normalize();this._end=new z(this._end).addScaledVector(e,t)}return this._boundingBoxNeedsUpdate=!0,this}closestPointToPointParameter(t,s){bs.subVectors(t,this._start),ft.subVectors(this.endPoint,this.startPoint);const e=ft.dot(ft);let i=ft.dot(bs)/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=W.subVectors(t,this.startPoint).dot(s);return new z().copy(s).multiplyScalar(n).add(this.startPoint)}perpPoint(t){const s=this.direction,e=this.startPoint,i=W.subVectors(t,e).dot(s),r=W.copy(s).multiplyScalar(i);return new z().addVectors(e,r)}calculateBoundingBox(){const t=new z(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 z(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 lt(this._start.clone(),this._end.clone())}}const W=new _,bs=new _,ft=new _;class ut extends ct{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),d=c.clone().multiplyScalar(Number.MAX_SAFE_INTEGER),u=new lt(n,n.clone().add(l)),g=new lt(i,i.clone().add(d)),y=new _;return u.closestPointToPoint(g.startPoint,!0,y)?y:null}static createByThreePoints(t,s,e){const n=ut.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 ut(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 z(t.x,t.y,t.z||0),this._boundingBoxNeedsUpdate=!0}get radius(){return this._radius}set radius(t){if(t<0)throw N.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,d=this.deltaAngle;let u=P.normalizeAngle(c-l);u<0&&(u=0),u>d&&(u=d);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(),d=h.clone().sub(c).length();if(d<r)return s;const u=Math.acos(r/d),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 z(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 D({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(Cs.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 ut(this.center.clone(),this.radius,this.startAngle,this.endAngle,this.normal,this.refVec)}getAngle(t){return t.sub(this.center),Math.atan2(t.dot(Cs.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 z(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(Lt);return new at(this.normal,t)}}const Cs=new _;class H extends st{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 z(t.x,t.y,t.z||0),this._boundingBoxNeedsUpdate=!0}get majorAxisRadius(){return this._majorAxisRadius}set majorAxisRadius(t){if(t<0)throw N.AcCmErrors.ILLEGAL_PARAMETERS;this._majorAxisRadius=t,this._boundingBoxNeedsUpdate=!0}get minorAxisRadius(){return this._minorAxisRadius}set minorAxisRadius(t){if(t<0)throw N.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 b(r,o)}transform(t){const s=t,e=new b(this.center).applyMatrix2d(s),n=new z(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 b(i).sub(e),a=new b(r).sub(e),h=o.length(),c=a.length(),l=Math.atan2(o.y,o.x),d=o.clone().normalize(),u=a.clone().normalize(),g=A=>{const M=new b(A).sub(e),p=M.dot(d),S=M.dot(u);return P.normalizeAngle(Math.atan2(S/c,p/h))},y=s.determinant()<0?!this.clockwise:this.clockwise,x=this.closed?new H(n,h,c,0,I,y,l):new H(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 H(this.center,this.majorAxisRadius,this.minorAxisRadius,this.startAngle,this.endAngle,this.clockwise,this.rotation)}}class dt extends ct{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 z(t.x,t.y,t.z||0),this._boundingBoxNeedsUpdate=!0}get majorAxisRadius(){return this._majorAxisRadius}set majorAxisRadius(t){if(t<0)throw N.AcCmErrors.ILLEGAL_PARAMETERS;this._majorAxisRadius=t,this._boundingBoxNeedsUpdate=!0}get minorAxisRadius(){return this._minorAxisRadius}set minorAxisRadius(t){if(t<0)throw N.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 it.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 D({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 D({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 z(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 d=new _().crossVectors(l,c).normalize();d.dot(o)<0&&(l.negate(),d=new _().crossVectors(l,c).normalize());const u=y=>{const x=new _(y).sub(e),A=x.dot(c),M=x.dot(d);return P.normalizeAngle(Math.atan2(M/h,A/a))},g=this.closed?new dt(e,l,c,a,h,0,I):new dt(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 dt(this.center,this.normal,this.majorAxis,this.majorAxisRadius,this.minorAxisRadius,this.startAngle,this.endAngle)}get plane(){const t=new _(this.center).distanceTo(Lt);return new at(this.normal,t)}}class Gt extends st{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 b(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 b(s.x,s.y)}else{const s=this._vertices[t-1];return new b(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 b(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 b(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 b(e).applyMatrix2d(t);e.x=n.x,e.y=n.y,s&&e.bulge!=null&&(e.bulge=-e.bulge)}),this._boundingBoxNeedsUpdate=!0,this}clone(){return new Gt(this._vertices.map(t=>({...t})),this._closed)}getPoints3d(t,s){const e=[];return this.getPoints(t).forEach(i=>e.push(new z().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 b(l.x,l.y))}}}else s.push(new b(i.x,i.y)),n==e-1&&this.closed&&s.push(s[0])}return s}}class mt extends st{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}getPoints(){return[this.startPoint,this.endPoint]}get length(){return this.startPoint.distanceTo(this.endPoint)}calculateBoundingBox(){const t=new b(Math.min(this._start.x,this._end.x),Math.min(this._start.y,this._end.y)),s=new b(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 mt(this._start.clone(),this._end.clone())}}class F extends st{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=F.getEdgeStartPoint(a);let c=F.getEdgeEndPoint(a);if(!r(h,c))for(;e.length>0;){const l=F.findConnectingEdge(e,c,i);if(l.index<0)break;let d=e.splice(l.index,1)[0];if(l.reverse&&(d=F.reverseEdge(d)),o.push(d),c=F.getEdgeEndPoint(d),r(c,h))break}n.push(new F(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 b(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 $().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 K?e.transform(s):e.transform(t)}),this._boundingBoxNeedsUpdate=!0,this}clone(){return new F(this._curves.map(t=>t.clone()))}get closed(){return!0}getPoints(t){const s=[];return this.curves.forEach(e=>{e.getPoints(t).forEach(n=>{s.push(new b(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=F.getEdgeStartPoint(a),c=F.getEdgeEndPoint(a),l=s.x-h.x,d=s.y-h.y,u=l*l+d*d;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 b(s.x,s.y)}static getEdgeEndPoint(t){const s=t.endPoint;return new b(s.x,s.y)}static reverseEdge(t){return t instanceof mt?new mt(t.endPoint,t.startPoint):t instanceof O?new O(t.center,t.radius,t.endAngle,t.startAngle,!t.clockwise):t instanceof H?new H(t.center,t.majorAxisRadius,t.minorAxisRadius,t.endAngle,t.startAngle,!t.clockwise,t.rotation):t instanceof K?F.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 K(s,r,a,t.degree,t.closed)}}class Ot{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 pt extends ct{constructor(t=[],s=!1,e="centripetal",n=.5){super(),this.isCatmullRomCurve3d=!0,this.type="CatmullRomCurve3d",this._tmp=new _,this._px=new Ot,this._py=new Ot,this._pz=new Ot,this._points=t.map(i=>new z(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 z}get endPoint(){return this._points.length>0?this._points[this._points.length-1]:new z}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 z){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 z(this._tmp.x,this._tmp.y,this._tmp.z));const l=n[o%i],d=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 z(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(d),u),x=Math.pow(d.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,d.x,c.x,g,y,x),this._py.initNonuniformCatmullRom(h.y,l.y,d.y,c.y,g,y,x),this._pz.initNonuniformCatmullRom(h.z,l.z,d.z,c.z,g,y,x)}else this._curveType==="catmullrom"&&(this._px.initCatmullRom(h.x,l.x,d.x,c.x,this._tension),this._py.initCatmullRom(h.y,l.y,d.y,c.y,this._tension),this._pz.initCatmullRom(h.z,l.z,d.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 z(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}clone(){return new pt(this._points.map(t=>t.clone()),this._closed,this._curveType,this._tension)}transform(t){return this._points=this._points.map(s=>{const e=new z;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 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]}clone(){return new L(this._degree,this._knots,this._controlPoints,this._weights)}point(t){const s=this._controlPoints.map(e=>[e.x,e.y,e.z]);return ot(t,this._degree,this._knots,s,this._weights)}length(){const t=this._controlPoints.map(s=>[s.x,s.y,s.z]);return As(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=Ft(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 pt(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 K extends ct{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 N.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 N.AcCmErrors.ILLEGAL_PARAMETERS;this._nurbsCurve=L.byKnotsControlPointsWeights(this._degree,s,this._controlPoints,a)}else{if(o<2||o>6)throw N.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 N.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 z(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 z(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 z(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 D().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 z(s).applyMatrix4(t)),this._startTangent&&(this._startTangent=new z(this._startTangent).transformDirection(t)),this._endTangent&&(this._endTangent=new z(this._endTangent).transformDirection(t)),this.buildCurve();else{const s=this._nurbsCurve.knots(),e=this._nurbsCurve.weights();this._controlPoints=this._controlPoints.map(n=>new z(n).applyMatrix4(t)),this._nurbsCurve=L.byKnotsControlPointsWeights(this._degree,s,this._controlPoints,e.length>0?e:void 0)}return this._boundingBoxNeedsUpdate=!0,this}clone(){return this._fitPoints&&this._knotParameterization?new K(this._fitPoints.map(t=>({x:t.x,y:t.y,z:t.z||0})),this._knotParameterization,this._degree,this._closed,this._startTangent?{x:this._startTangent.x,y:this._startTangent.y,z:this._startTangent.z||0}:void 0,this._endTangent?{x:this._endTangent.x,y:this._endTangent.y,z:this._endTangent.z||0}:void 0):new K(this._controlPoints.map(t=>({x:t.x,y:t.y,z:t.z||0})),this._nurbsCurve.knots(),this._nurbsCurve.weights(),this._degree,this._closed)}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 K(t,s,e,!0)}}f.AcGeArea2d=Zt,f.AcGeBox2d=q,f.AcGeBox3d=D,f.AcGeCatmullRomCurve3d=pt,f.AcGeCircArc2d=O,f.AcGeCircArc3d=ut,f.AcGeCurve2d=st,f.AcGeEllipseArc2d=H,f.AcGeEllipseArc3d=dt,f.AcGeEuler=Dt,f.AcGeGeometryUtil=ys,f.AcGeLine2d=mt,f.AcGeLine3d=lt,f.AcGeLoop2d=F,f.AcGeMathUtil=P,f.AcGeMatrix2d=J,f.AcGeMatrix3d=$,f.AcGeNurbsCurve=L,f.AcGePlane=at,f.AcGePoint2d=b,f.AcGePoint3d=z,f.AcGePolyline2d=Gt,f.AcGeQuaternion=ht,f.AcGeShape2d=Yt,f.AcGeSpline3d=K,f.AcGeTol=it,f.AcGeVector2d=B,f.AcGeVector3d=_,f.DEFAULT_TOL=Vt,f.DEG2RAD=Bt,f.FLOAT_TOL=Q,f.ORIGIN_POINT_2D=Ss,f.ORIGIN_POINT_3D=Lt,f.RAD2DEG=kt,f.TAU=I,f.basisFunction=rt,f.calculateCurveLength=As,f.ceilPowerOfTwo=cs,f.clamp=Y,f.computeParameterValues=xs,f.damp=Ht,f.degToRad=os,f.euclideanModulo=Rt,f.evaluateNurbsPoint=ot,f.floorPowerOfTwo=ls,f.generateAveragedKnots=_s,f.generateChordKnots=Is,f.generateSqrtChordKnots=Bs,f.generateUUID=Qt,f.generateUniformKnots=Es,f.intPartLength=Nt,f.interpolateControlPoints=ks,f.interpolateNurbsCurve=Ft,f.inverseLerp=Wt,f.isBetween=us,f.isBetweenAngle=ds,f.isPointInPolygon=Ut,f.isPolygonIntersect=gs,f.isPowerOfTwo=as,f.lerp=Tt,f.mapLinear=$t,f.normalizeAngle=nt,f.pingpong=Jt,f.radToDeg=hs,f.randFloat=ns,f.randFloatSpread=is,f.randInt=es,f.relativeEps=ms,f.seededRandom=rs,f.smootherstep=ss,f.smoothstep=ts,Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -38,6 +38,10 @@ export declare class AcGeArea2d extends AcGeShape2d {
|
|
|
38
38
|
* @inheritdoc
|
|
39
39
|
*/
|
|
40
40
|
transform(matrix: AcGeMatrix2d): this;
|
|
41
|
+
/**
|
|
42
|
+
* Return a deep-cloned copy of this area.
|
|
43
|
+
*/
|
|
44
|
+
clone(): AcGeArea2d;
|
|
41
45
|
/**
|
|
42
46
|
* Return boundary points of this area
|
|
43
47
|
* @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,MAAM,EAAE,YAAY;IAQ9B;;;;OAIG;IACH,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,WAAW,EAAE,EAAE;IAU7C,cAAc;IA8Cd;;;OA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;IACH,OAAO,CAAC,wBAAwB;CAmBjC"}
|
|
@@ -83,6 +83,16 @@ var AcGeArea2d = /** @class */ (function (_super) {
|
|
|
83
83
|
this._boundingBoxNeedsUpdate = true;
|
|
84
84
|
return this;
|
|
85
85
|
};
|
|
86
|
+
/**
|
|
87
|
+
* Return a deep-cloned copy of this area.
|
|
88
|
+
*/
|
|
89
|
+
AcGeArea2d.prototype.clone = function () {
|
|
90
|
+
var area = new AcGeArea2d();
|
|
91
|
+
this._loops.forEach(function (loop) {
|
|
92
|
+
area.add(loop.clone());
|
|
93
|
+
});
|
|
94
|
+
return area;
|
|
95
|
+
};
|
|
86
96
|
/**
|
|
87
97
|
* Return boundary points of this area
|
|
88
98
|
* @param numPoints Input the nubmer of points returned for arc segmentation
|
|
@@ -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,CAA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;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,AAvND,CAAgC,WAAW,GAuN1C"}
|
|
@@ -131,6 +131,10 @@ export declare class AcGeCatmullRomCurve3d extends AcGeCurve3d {
|
|
|
131
131
|
* @param tension - The tension value
|
|
132
132
|
*/
|
|
133
133
|
setTension(tension: number): void;
|
|
134
|
+
/**
|
|
135
|
+
* Return a deep-cloned copy of this curve.
|
|
136
|
+
*/
|
|
137
|
+
clone(): AcGeCatmullRomCurve3d;
|
|
134
138
|
/**
|
|
135
139
|
* Transforms the curve by applying the input matrix.
|
|
136
140
|
* @param matrix Input transformation matrix
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcGeCatmullRomCurve3d.d.ts","sourceRoot":"","sources":["../../src/geometry/AcGeCatmullRomCurve3d.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,YAAY,EACZ,WAAW,EACX,eAAe,EAEhB,MAAM,SAAS,CAAA;AAChB,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAE3C;;;;;;;GAOG;AAEH;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,aAAa,GAAG,SAAS,GAAG,YAAY,CAAA;AA2E1E;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,qBAAsB,SAAQ,WAAW;IACpD;;OAEG;IACH,QAAQ,CAAC,mBAAmB,QAAO;IAEnC;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AO,CAEpB;IAED;;OAEG;IACH,IAAI,SAAS,IAAI,mBAAmB,CAEnC;IAED;;OAEG;IACH,IAAI,OAAO,IAAI,MAAM,CAEpB;IAED;;OAEG;IACH,IAAI,UAAU,IAAI,WAAW,CAE5B;IAED;;OAEG;IACH,IAAI,QAAQ,IAAI,WAAW,CAI1B;IAED;;OAEG;IACH,IAAI,MAAM,IAAI,MAAM,CAenB;IAED;;;;;;OAMG;IACH,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,cAAc,cAAoB,GAAG,WAAW;IA6EpE;;;;OAIG;IACH,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,WAAW,EAAE;IAU3C;;;OAGG;IACH,SAAS,CAAC,MAAM,EAAE,eAAe,EAAE,GAAG,IAAI;IAK1C;;;OAGG;IACH,SAAS,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI;IAShC;;;OAGG;IACH,YAAY,CAAC,SAAS,EAAE,mBAAmB,GAAG,IAAI;IAIlD;;;OAGG;IACH,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAIjC;;OAEG;IACH,KAAK;IASL;;;;OAIG;IACH,SAAS,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI;IAWrC;;;OAGG;IACH,SAAS,CAAC,oBAAoB,IAAI,SAAS;CAW5C"}
|
|
@@ -323,6 +323,12 @@ var AcGeCatmullRomCurve3d = /** @class */ (function (_super) {
|
|
|
323
323
|
AcGeCatmullRomCurve3d.prototype.setTension = function (tension) {
|
|
324
324
|
this._tension = tension;
|
|
325
325
|
};
|
|
326
|
+
/**
|
|
327
|
+
* Return a deep-cloned copy of this curve.
|
|
328
|
+
*/
|
|
329
|
+
AcGeCatmullRomCurve3d.prototype.clone = function () {
|
|
330
|
+
return new AcGeCatmullRomCurve3d(this._points.map(function (point) { return point.clone(); }), this._closed, this._curveType, this._tension);
|
|
331
|
+
};
|
|
326
332
|
/**
|
|
327
333
|
* Transforms the curve by applying the input matrix.
|
|
328
334
|
* @param matrix Input transformation matrix
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcGeCatmullRomCurve3d.js","sourceRoot":"","sources":["../../src/geometry/AcGeCatmullRomCurve3d.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EACL,SAAS,EAET,WAAW,EAEX,YAAY,EACb,MAAM,SAAS,CAAA;AAChB,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAgB3C;;;;;GAKG;AACH;IAAA;QACU,OAAE,GAAG,CAAC,CAAA;QACN,OAAE,GAAG,CAAC,CAAA;QACN,OAAE,GAAG,CAAC,CAAA;QACN,OAAE,GAAG,CAAC,CAAA;IA6DhB,CAAC;IA3DC;;;;;;;OAOG;IACK,wBAAI,GAAZ,UAAa,EAAU,EAAE,EAAU,EAAE,EAAU,EAAE,EAAU;QACzD,IAAI,CAAC,EAAE,GAAG,EAAE,CAAA;QACZ,IAAI,CAAC,EAAE,GAAG,EAAE,CAAA;QACZ,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,CAAA;QACxC,IAAI,CAAC,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAA;IACrC,CAAC;IAED;;OAEG;IACH,kCAAc,GAAd,UACE,EAAU,EACV,EAAU,EACV,EAAU,EACV,EAAU,EACV,OAAe;QAEf,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,EAAE,OAAO,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,OAAO,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAA;IAC7D,CAAC;IAED;;OAEG;IACH,4CAAwB,GAAxB,UACE,EAAU,EACV,EAAU,EACV,EAAU,EACV,EAAU,EACV,GAAW,EACX,GAAW,EACX,GAAW;QAEX,iDAAiD;QACjD,IAA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AC,KAAK,EAAE,EAAb,CAAa,CAAC,EACxC,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,UAAU,EACf,IAAI,CAAC,QAAQ,CACd,CAAA;IACH,CAAC;IAED;;;;OAIG;IACH,yCAAS,GAAT,UAAU,MAAoB;QAC5B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,UAAA,KAAK;YACnC,IAAM,gBAAgB,GAAG,IAAI,WAAW,EAAE,CAAA;YAC1C,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;YAC5B,gBAAgB,CAAC,YAAY,CAAC,MAAM,CAAC,CAAA;YACrC,OAAO,gBAAgB,CAAA;QACzB,CAAC,CAAC,CAAA;QACF,IAAI,CAAC,uBAAuB,GAAG,IAAI,CAAA;QACnC,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;;OAGG;IACO,oDAAoB,GAA9B;QACE,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC9B,OAAO,IAAI,SAAS,EAAE,CAAA;QACxB,CAAC;QAED,IAAM,GAAG,GAAG,IAAI,SAAS,EAAE,CAAA;QAC3B,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,UAAA,KAAK;YACxB,GAAG,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;QAC1B,CAAC,CAAC,CAAA;QACF,OAAO,GAAG,CAAA;IACZ,CAAC;IACH,4BAAC;AAAD,CAAC,AA9SD,CAA2C,WAAW,GA8SrD"}
|
|
@@ -81,5 +81,9 @@ export declare abstract class AcGeCurve2d extends AcGeShape2d {
|
|
|
81
81
|
* given in `getTangent`.
|
|
82
82
|
*/
|
|
83
83
|
getTangentAt(u: number): AcGePoint2d;
|
|
84
|
+
/**
|
|
85
|
+
* Return a deep-cloned copy of this curve.
|
|
86
|
+
*/
|
|
87
|
+
abstract clone(): AcGeCurve2d;
|
|
84
88
|
}
|
|
85
89
|
//# sourceMappingURL=AcGeCurve2d.d.ts.map
|