@mlightcad/geometry-engine 3.16.0 → 3.16.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- (function(A,V){typeof exports=="object"&&typeof module<"u"?V(exports,require("@mlightcad/common")):typeof define=="function"&&define.amd?define(["exports","@mlightcad/common"],V):(A=typeof globalThis<"u"?globalThis:A||self,V(A["geometry-engine"]={},A.common))})(this,(function(A,V){"use strict";const O=["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 Ln=1234567;const on=Math.PI/180,an=180/Math.PI;function jn(){const i=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0,e=Math.random()*4294967295|0;return(O[i&255]+O[i>>8&255]+O[i>>16&255]+O[i>>24&255]+"-"+O[t&255]+O[t>>8&255]+"-"+O[t>>16&15|64]+O[t>>24&255]+"-"+O[n&63|128]+O[n>>8&255]+"-"+O[n>>16&255]+O[n>>24&255]+O[e&255]+O[e>>8&255]+O[e>>16&255]+O[e>>24&255]).toLowerCase()}function G(i,t,n){return Math.max(t,Math.min(n,i))}function cn(i,t){return(i%t+t)%t}function Fn(i,t,n,e,s){return e+(i-t)*(s-e)/(n-t)}function On(i,t,n){return i!==t?(n-i)/(t-i):0}function hn(i,t,n){return(1-n)*i+n*t}function Un(i,t,n,e){return hn(i,t,1-Math.exp(-n*e))}function Dn(i,t=1){return t-Math.abs(cn(i,t*2)-t)}function Xn(i,t,n){return i<=t?0:i>=n?1:(i=(i-t)/(n-t),i*i*(3-2*i))}function Yn(i,t,n){return i<=t?0:i>=n?1:(i=(i-t)/(n-t),i*i*i*(i*(i*6-15)+10))}function Zn(i,t){return i+Math.floor(Math.random()*(t-i+1))}function Gn(i,t){return i+Math.random()*(t-i)}function Wn(i){return i*(.5-Math.random())}function Kn(i){i!==void 0&&(Ln=i);let t=Ln+=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 Qn(i){return i*on}function $n(i){return i*an}function Hn(i){return(i&i-1)===0&&i!==0}function Jn(i){return Math.pow(2,Math.ceil(Math.log(i)/Math.LN2))}function te(i){return Math.pow(2,Math.floor(Math.log(i)/Math.LN2))}function mt(i){const t=Math.PI*2;return(i%t+t)%t}function ne(i,t,n){return i>t&&i<n||i>n&&i<t}function ee(i,t,n,e=!1){return i=mt(i),t=mt(t),n=mt(n),e?t>n?i<=t&&i>=n:i<=t||i>=n:t<n?i>=t&&i<=n:i>=t||i<=n}function se(i,t,n){const e=mt(n-i);return mt(t-i)<=e+1e-7}function ln(i){return i=Math.abs(i),i<1?0:Math.ceil(Math.log10(Math.abs(i)+1))}function ie(i,t=1e-7){const n=ln(i);return Math.max(Math.pow(10,n)*t,t)}const p={DEG2RAD:on,RAD2DEG:an,generateUUID:jn,clamp:G,euclideanModulo:cn,mapLinear:Fn,inverseLerp:On,lerp:hn,damp:Un,pingpong:Dn,smoothstep:Xn,smootherstep:Yn,randInt:Zn,randFloat:Gn,randFloatSpread:Wn,seededRandom:Kn,degToRad:Qn,radToDeg:$n,isPowerOfTwo:Hn,ceilPowerOfTwo:Jn,floorPowerOfTwo:te,normalizeAngle:mt,isBetween:ne,isBetweenAngle:ee,isAngleOnCcwSweep:se,intPartLength:ln,relativeEps:ie},Lt=class Lt{constructor(t,n){this.x=0,this.y=0;const e=+(t!==void 0)+ +(n!==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:s,y:r}=t;this.x=s,this.y=r;return}if(e===2){this.x=t,this.y=n;return}throw V.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,n){return this.x=t,this.y=n,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,n){switch(t){case 0:this.x=n;break;case 1:this.y=n;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 Lt(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,n){return this.x=t.x+n.x,this.y=t.y+n.y,this}addScaledVector(t,n){return this.x+=t.x*n,this.y+=t.y*n,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,n){return this.x=t.x-n.x,this.y=t.y-n.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 n=this.x,e=this.y,s=t.elements;return this.x=s[0]*n+s[3]*e+s[6],this.y=s[1]*n+s[4]*e+s[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,n){return this.x=Math.max(t.x,Math.min(n.x,this.x)),this.y=Math.max(t.y,Math.min(n.y,this.y)),this}clampScalar(t,n){return this.x=Math.max(t,Math.min(n,this.x)),this.y=Math.max(t,Math.min(n,this.y)),this}clampLength(t,n){const e=this.length();return this.divideScalar(e||1).multiplyScalar(Math.max(t,Math.min(n,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 n=Math.sqrt(this.lengthSq()*t.lengthSq());if(n===0)return Math.PI/2;const e=this.dot(t)/n;return Math.acos(Math.max(-1,Math.min(1,e)))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const n=this.x-t.x,e=this.y-t.y;return n*n+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,n){return this.x+=(t.x-this.x)*n,this.y+=(t.y-this.y)*n,this}lerpVectors(t,n,e){return this.x=t.x+(n.x-t.x)*e,this.y=t.y+(n.y-t.y)*e,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,n=0){return this.x=t[n],this.y=t[n+1],this}toArray(t=[],n=0){return t[n]=this.x,t[n+1]=this.y,t}rotateAround(t,n){const e=Math.cos(n),s=Math.sin(n),r=this.x-t.x,o=this.y-t.y;return this.x=r*e-o*s+t.x,this.y=r*s+o*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}};Lt.EMPTY=Object.freeze(new Lt(0,0));let B=Lt;const jt=class jt{constructor(t,n,e,s,r,o,a,c,h){this.elements=[1,0,0,0,1,0,0,0,1],t!=null&&n!=null&&e!=null&&s!=null&&r!=null&&o!=null&&a!=null&&c!=null&&h!=null&&this.set(t,n,e,s,r,o,a,c,h)}set(t,n,e,s,r,o,a,c,h){const l=this.elements;return l[0]=t,l[1]=s,l[2]=a,l[3]=n,l[4]=r,l[5]=c,l[6]=e,l[7]=o,l[8]=h,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const n=this.elements,e=t.elements;return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],this}extractBasis(t,n,e){return t.setFromMatrix3Column(this,0),n.setFromMatrix3Column(this,1),e.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const n=t.elements;return this.set(n[0],n[4],n[8],n[1],n[5],n[9],n[2],n[6],n[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,n){const e=t.elements,s=n.elements,r=this.elements,o=e[0],a=e[3],c=e[6],h=e[1],l=e[4],u=e[7],d=e[2],g=e[5],m=e[8],f=s[0],x=s[3],y=s[6],S=s[1],k=s[4],N=s[7],R=s[2],I=s[5],E=s[8];return r[0]=o*f+a*S+c*R,r[3]=o*x+a*k+c*I,r[6]=o*y+a*N+c*E,r[1]=h*f+l*S+u*R,r[4]=h*x+l*k+u*I,r[7]=h*y+l*N+u*E,r[2]=d*f+g*S+m*R,r[5]=d*x+g*k+m*I,r[8]=d*y+g*N+m*E,this}multiplyScalar(t){const n=this.elements;return n[0]*=t,n[3]*=t,n[6]*=t,n[1]*=t,n[4]*=t,n[7]*=t,n[2]*=t,n[5]*=t,n[8]*=t,this}determinant(){const t=this.elements,n=t[0],e=t[1],s=t[2],r=t[3],o=t[4],a=t[5],c=t[6],h=t[7],l=t[8];return n*o*l-n*a*h-e*r*l+e*a*c+s*r*h-s*o*c}invert(){const t=this.elements,n=t[0],e=t[1],s=t[2],r=t[3],o=t[4],a=t[5],c=t[6],h=t[7],l=t[8],u=l*o-a*h,d=a*c-l*r,g=h*r-o*c,m=n*u+e*d+s*g;if(m===0)return this.set(0,0,0,0,0,0,0,0,0);const f=1/m;return t[0]=u*f,t[1]=(s*h-l*e)*f,t[2]=(a*e-s*o)*f,t[3]=d*f,t[4]=(l*n-s*c)*f,t[5]=(s*r-a*n)*f,t[6]=g*f,t[7]=(e*c-h*n)*f,t[8]=(o*n-e*r)*f,this}transpose(){let t;const n=this.elements;return t=n[1],n[1]=n[3],n[3]=t,t=n[2],n[2]=n[6],n[6]=t,t=n[5],n[5]=n[7],n[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const n=this.elements;return t.elements[0]=n[0],t.elements[1]=n[3],t.elements[2]=n[6],t.elements[3]=n[1],t.elements[4]=n[4],t.elements[5]=n[7],t.elements[6]=n[2],t.elements[7]=n[5],t.elements[8]=n[8],this}setUvTransform(t,n,e,s,r,o,a){const c=Math.cos(r),h=Math.sin(r);return this.set(e*c,e*h,-e*(c*o+h*a)+o+t,-s*h,s*c,-s*(-h*o+c*a)+a+n,0,0,1),this}scale(t,n){return this.premultiply(un.makeScale(t,n)),this}rotate(t){return this.premultiply(un.makeRotation(-t)),this}translate(t,n){return this.premultiply(un.makeTranslation(t,n)),this}makeTranslation(t,n){return t instanceof B?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,n,0,0,1),this}makeRotation(t){const n=Math.cos(t),e=Math.sin(t);return this.set(n,-e,0,e,n,0,0,0,1),this}makeScale(t,n){return this.set(t,0,0,0,n,0,0,0,1),this}equals(t){const n=this.elements,e=t.elements;for(let s=0;s<9;s++)if(n[s]!==e[s])return!1;return!0}fromArray(t,n=0){for(let e=0;e<9;e++)this.elements[e]=t[e+n];return this}toArray(t=[],n=0){const e=this.elements;return t[n]=e[0],t[n+1]=e[1],t[n+2]=e[2],t[n+3]=e[3],t[n+4]=e[4],t[n+5]=e[5],t[n+6]=e[6],t[n+7]=e[7],t[n+8]=e[8],t}clone(){return new jt().fromArray(this.elements)}};jt.IDENTITY=Object.freeze(new jt);let pt=jt;const un=new pt,C=1e-6,b=2*Math.PI,os={x:0,y:0},dn={x:0,y:0,z:0};class M{constructor(){this.equalPointTol=C,this.equalVectorTol=C}clone(){const t=new M;return t.equalPointTol=this.equalPointTol,t.equalVectorTol=this.equalVectorTol,t}equalPoint2d(t,n){return new B(t).sub(n).length()<this.equalPointTol}equalPoint3d(t,n){return new _(t).sub(n).length()<this.equalPointTol}static equalToZero(t,n=C){return t<n&&t>-n}static equal(t,n,e=C){return Math.abs(t-n)<e}static great(t,n,e=C){return t-n>e}static less(t,n,e=C){return t-n<e}static isPositive(t,n=C){return t>n}static isNonPositive(t,n=C){return t<=n}}const Nt=new M;class Rt{constructor(t=0,n=0,e=0,s=1){this._x=t,this._y=n,this._z=e,this._w=s}static slerpFlat(t,n,e,s,r,o,a){let c=e[s+0],h=e[s+1],l=e[s+2],u=e[s+3];const d=r[o+0],g=r[o+1],m=r[o+2],f=r[o+3];if(a===0){t[n+0]=c,t[n+1]=h,t[n+2]=l,t[n+3]=u;return}if(a===1){t[n+0]=d,t[n+1]=g,t[n+2]=m,t[n+3]=f;return}if(u!==f||c!==d||h!==g||l!==m){let x=1-a;const y=c*d+h*g+l*m+u*f,S=y>=0?1:-1,k=1-y*y;if(k>Number.EPSILON){const R=Math.sqrt(k),I=Math.atan2(R,y*S);x=Math.sin(x*I)/R,a=Math.sin(a*I)/R}const N=a*S;if(c=c*x+d*N,h=h*x+g*N,l=l*x+m*N,u=u*x+f*N,x===1-a){const R=1/Math.sqrt(c*c+h*h+l*l+u*u);c*=R,h*=R,l*=R,u*=R}}t[n]=c,t[n+1]=h,t[n+2]=l,t[n+3]=u}static multiplyQuaternionsFlat(t,n,e,s,r,o){const a=e[s],c=e[s+1],h=e[s+2],l=e[s+3],u=r[o],d=r[o+1],g=r[o+2],m=r[o+3];return t[n]=a*m+l*u+c*g-h*d,t[n+1]=c*m+l*d+h*u-a*g,t[n+2]=h*m+l*g+a*d-c*u,t[n+3]=l*m-a*u-c*d-h*g,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,n,e,s){return this._x=t,this._y=n,this._z=e,this._w=s,this._onChangeCallback(),this}clone(){return new Rt(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,n=!0){const e=t.x,s=t.y,r=t.z,o=t.order,a=Math.cos,c=Math.sin,h=a(e/2),l=a(s/2),u=a(r/2),d=c(e/2),g=c(s/2),m=c(r/2);switch(o){case"XYZ":this._x=d*l*u+h*g*m,this._y=h*g*u-d*l*m,this._z=h*l*m+d*g*u,this._w=h*l*u-d*g*m;break;case"YXZ":this._x=d*l*u+h*g*m,this._y=h*g*u-d*l*m,this._z=h*l*m-d*g*u,this._w=h*l*u+d*g*m;break;case"ZXY":this._x=d*l*u-h*g*m,this._y=h*g*u+d*l*m,this._z=h*l*m+d*g*u,this._w=h*l*u-d*g*m;break;case"ZYX":this._x=d*l*u-h*g*m,this._y=h*g*u+d*l*m,this._z=h*l*m-d*g*u,this._w=h*l*u+d*g*m;break;case"YZX":this._x=d*l*u+h*g*m,this._y=h*g*u+d*l*m,this._z=h*l*m-d*g*u,this._w=h*l*u-d*g*m;break;case"XZY":this._x=d*l*u-h*g*m,this._y=h*g*u-d*l*m,this._z=h*l*m+d*g*u,this._w=h*l*u+d*g*m;break}return n===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,n){const e=n/2,s=Math.sin(e);return this._x=t.x*s,this._y=t.y*s,this._z=t.z*s,this._w=Math.cos(e),this._onChangeCallback(),this}setFromRotationMatrix(t){const n=t.elements,e=n[0],s=n[4],r=n[8],o=n[1],a=n[5],c=n[9],h=n[2],l=n[6],u=n[10],d=e+a+u;if(d>0){const g=.5/Math.sqrt(d+1);this._w=.25/g,this._x=(l-c)*g,this._y=(r-h)*g,this._z=(o-s)*g}else if(e>a&&e>u){const g=2*Math.sqrt(1+e-a-u);this._w=(l-c)/g,this._x=.25*g,this._y=(s+o)/g,this._z=(r+h)/g}else if(a>u){const g=2*Math.sqrt(1+a-e-u);this._w=(r-h)/g,this._x=(s+o)/g,this._y=.25*g,this._z=(c+l)/g}else{const g=2*Math.sqrt(1+u-e-a);this._w=(o-s)/g,this._x=(r+h)/g,this._y=(c+l)/g,this._z=.25*g}return this._onChangeCallback(),this}setFromUnitVectors(t,n){let e=t.dot(n)+1;return e<Number.EPSILON?(e=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=e):(this._x=0,this._y=-t.z,this._z=t.y,this._w=e)):(this._x=t.y*n.z-t.z*n.y,this._y=t.z*n.x-t.x*n.z,this._z=t.x*n.y-t.y*n.x,this._w=e),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(G(this.dot(t),-1,1)))}rotateTowards(t,n){const e=this.angleTo(t);if(e===0)return this;const s=Math.min(1,n/e);return this.slerp(t,s),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,n){const e=t._x,s=t._y,r=t._z,o=t._w,a=n._x,c=n._y,h=n._z,l=n._w;return this._x=e*l+o*a+s*h-r*c,this._y=s*l+o*c+r*a-e*h,this._z=r*l+o*h+e*c-s*a,this._w=o*l-e*a-s*c-r*h,this._onChangeCallback(),this}slerp(t,n){if(n===0)return this;if(n===1)return this.copy(t);const e=this._x,s=this._y,r=this._z,o=this._w;let a=o*t._w+e*t._x+s*t._y+r*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=o,this._x=e,this._y=s,this._z=r,this;const c=1-a*a;if(c<=Number.EPSILON){const g=1-n;return this._w=g*o+n*this._w,this._x=g*e+n*this._x,this._y=g*s+n*this._y,this._z=g*r+n*this._z,this.normalize(),this}const h=Math.sqrt(c),l=Math.atan2(h,a),u=Math.sin((1-n)*l)/h,d=Math.sin(n*l)/h;return this._w=o*u+this._w*d,this._x=e*u+this._x*d,this._y=s*u+this._y*d,this._z=r*u+this._z*d,this._onChangeCallback(),this}slerpQuaternions(t,n,e){return this.copy(t).slerp(n,e)}random(){const t=2*Math.PI*Math.random(),n=2*Math.PI*Math.random(),e=Math.random(),s=Math.sqrt(1-e),r=Math.sqrt(e);return this.set(s*Math.sin(t),s*Math.cos(t),r*Math.sin(n),r*Math.cos(n))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,n=0){return this._x=t[n],this._y=t[n+1],this._z=t[n+2],this._w=t[n+3],this._onChangeCallback(),this}toArray(t=[],n=0){return t[n]=this._x,t[n+1]=this._y,t[n+2]=this._z,t[n+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 j=class j{constructor(t,n,e){this.x=0,this.y=0,this.z=0;const s=+(t!==void 0)+ +(n!==void 0)+ +(e!==void 0);if(s!==0){if(s===1&&t instanceof Array){this.x=t[0],this.y=t[1],this.z=t[2];return}if(s===1){const{x:r,y:o,z:a}=t;this.x=r,this.y=o,this.z=a||0;return}if(s===3){this.x=t,this.y=n,this.z=e;return}throw V.AcCmErrors.ILLEGAL_PARAMETERS}}set(t,n,e){return e===void 0&&(e=this.z),this.x=t,this.y=n,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,n){switch(t){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;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 j(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,n){return this.x=t.x+n.x,this.y=t.y+n.y,this.z=t.z+n.z,this}addScaledVector(t,n){return this.x+=t.x*n,this.y+=t.y*n,this.z+=t.z*n,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,n){return this.x=t.x-n.x,this.y=t.y-n.y,this.z=t.z-n.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,n){return this.x=t.x*n.x,this.y=t.y*n.y,this.z=t.z*n.z,this}applyEuler(t){return this.applyQuaternion(re.setFromEuler(t))}applyAxisAngle(t,n){return this.applyQuaternion(re.setFromAxisAngle(t,n))}applyMatrix3(t){const n=this.x,e=this.y,s=this.z,r=t.elements;return this.x=r[0]*n+r[3]*e+r[6]*s,this.y=r[1]*n+r[4]*e+r[7]*s,this.z=r[2]*n+r[5]*e+r[8]*s,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const n=this.x,e=this.y,s=this.z,r=t.elements,o=1/(r[3]*n+r[7]*e+r[11]*s+r[15]);return this.x=(r[0]*n+r[4]*e+r[8]*s+r[12])*o,this.y=(r[1]*n+r[5]*e+r[9]*s+r[13])*o,this.z=(r[2]*n+r[6]*e+r[10]*s+r[14])*o,this}applyQuaternion(t){const n=this.x,e=this.y,s=this.z,r=t.x,o=t.y,a=t.z,c=t.w,h=2*(o*s-a*e),l=2*(a*n-r*s),u=2*(r*e-o*n);return this.x=n+c*h+o*u-a*l,this.y=e+c*l+a*h-r*u,this.z=s+c*u+r*l-o*h,this}transformDirection(t){const n=this.x,e=this.y,s=this.z,r=t.elements;return this.x=r[0]*n+r[4]*e+r[8]*s,this.y=r[1]*n+r[5]*e+r[9]*s,this.z=r[2]*n+r[6]*e+r[10]*s,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,n){return this.x=Math.max(t.x,Math.min(n.x,this.x)),this.y=Math.max(t.y,Math.min(n.y,this.y)),this.z=Math.max(t.z,Math.min(n.z,this.z)),this}clampScalar(t,n){return this.x=Math.max(t,Math.min(n,this.x)),this.y=Math.max(t,Math.min(n,this.y)),this.z=Math.max(t,Math.min(n,this.z)),this}clampLength(t,n){const e=this.length();return this.divideScalar(e||1).multiplyScalar(Math.max(t,Math.min(n,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 n=this.dot(t),e=this.length(),s=t.length();return Math.abs(n)===e*s}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,n){return this.x+=(t.x-this.x)*n,this.y+=(t.y-this.y)*n,this.z+=(t.z-this.z)*n,this}lerpVectors(t,n,e){return this.x=t.x+(n.x-t.x)*e,this.y=t.y+(n.y-t.y)*e,this.z=t.z+(n.z-t.z)*e,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,n){const e=t.x,s=t.y,r=t.z,o=n.x,a=n.y,c=n.z;return this.x=s*c-r*a,this.y=r*o-e*c,this.z=e*a-s*o,this}projectOnVector(t){const n=t.lengthSq();if(n===0)return this.set(0,0,0);const e=t.dot(this)/n;return this.copy(t).multiplyScalar(e)}projectOnPlane(t){return gn.copy(this).projectOnVector(t),this.sub(gn)}reflect(t){return this.sub(gn.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const n=Math.sqrt(this.lengthSq()*t.lengthSq());if(n===0)return Math.PI/2;const e=this.dot(t)/n;return Math.acos(Math.max(-1,Math.min(1,e)))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const n=this.x-t.x,e=this.y-t.y,s=this.z-t.z;return n*n+e*e+s*s}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromMatrixPosition(t){const n=t.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this}setFromMatrixScale(t){const n=this.setFromMatrixColumn(t,0).length(),e=this.setFromMatrixColumn(t,1).length(),s=this.setFromMatrixColumn(t,2).length();return this.x=n,this.y=e,this.z=s,this}setFromMatrixColumn(t,n){return this.fromArray(t.elements,n*4)}setFromMatrix3Column(t,n){return this.fromArray(t.elements,n*3)}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,n=0){return this.x=t[n],this.y=t[n+1],this.z=t[n+2],this}toArray(t=[],n=0){return t[n]=this.x,t[n+1]=this.y,t[n+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,n=Math.random()*2-1,e=Math.sqrt(1-n*n);return this.x=e*Math.cos(t),this.y=n,this.z=e*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}};j.ORIGIN=Object.freeze(new j(0,0,0)),j.X_AXIS=Object.freeze(new j(1,0,0)),j.NEGATIVE_X_AXIS=Object.freeze(new j(-1,0,0)),j.Y_AXIS=Object.freeze(new j(0,1,0)),j.NEGATIVE_Y_AXIS=Object.freeze(new j(0,-1,0)),j.Z_AXIS=Object.freeze(new j(0,0,1)),j.NEGATIVE_Z_AXIS=Object.freeze(new j(0,0,-1));let _=j;const gn=new _,re=new Rt,kt=class kt{static makeTranslation(t,n,e){return new kt().makeTranslation(t,n,e)}constructor(t,n,e,s,r,o,a,c,h,l,u,d,g,m,f,x){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!=null&&n!=null&&e!=null&&s!=null&&r!=null&&o!=null&&a!=null&&c!=null&&h!=null&&l!=null&&u!=null&&d!=null&&g!=null&&m!=null&&f!=null&&x!=null&&this.set(t,n,e,s,r,o,a,c,h,l,u,d,g,m,f,x)}set(t,n,e,s,r,o,a,c,h,l,u,d,g,m,f,x){const y=this.elements;return y[0]=t,y[4]=n,y[8]=e,y[12]=s,y[1]=r,y[5]=o,y[9]=a,y[13]=c,y[2]=h,y[6]=l,y[10]=u,y[14]=d,y[3]=g,y[7]=m,y[11]=f,y[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 kt().fromArray(this.elements)}copy(t){const n=this.elements,e=t.elements;return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],this}copyPosition(t){const n=this.elements,e=t.elements;return n[12]=e[12],n[13]=e[13],n[14]=e[14],this}setFromMatrix3(t){const n=t.elements;return this.set(n[0],n[3],n[6],0,n[1],n[4],n[7],0,n[2],n[5],n[8],0,0,0,0,1),this}setFromExtrusionDirection(t){const n=Math.hypot(t.x,t.y,t.z);if(!Number.isFinite(n)||n<1e-12)return this.identity(),this;const e=Math.abs(n-1)>1e-6?t.clone().multiplyScalar(1/n):t;if(Nt.equalPoint3d(e,_.Z_AXIS))this.identity();else{const s=new _(1,0,0);Math.abs(e.x)<1/64&&Math.abs(e.y)<1/64?s.crossVectors(_.Y_AXIS,e).normalize():s.crossVectors(_.Z_AXIS,e).normalize();const r=e.clone().cross(s).normalize();this.makeBasis(s,r,e)}return this}extractBasis(t,n,e){return t.setFromMatrixColumn(this,0),n.setFromMatrixColumn(this,1),e.setFromMatrixColumn(this,2),this}makeBasis(t,n,e){return this.set(t.x,n.x,e.x,0,t.y,n.y,e.y,0,t.z,n.z,e.z,0,0,0,0,1),this}extractRotation(t){const n=this.elements,e=t.elements,s=1/wt.setFromMatrixColumn(t,0).length(),r=1/wt.setFromMatrixColumn(t,1).length(),o=1/wt.setFromMatrixColumn(t,2).length();return n[0]=e[0]*s,n[1]=e[1]*s,n[2]=e[2]*s,n[3]=0,n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*r,n[7]=0,n[8]=e[8]*o,n[9]=e[9]*o,n[10]=e[10]*o,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromQuaternion(t){return this.compose(as,t,cs)}lookAt(t,n,e){const s=this.elements;return Y.subVectors(t,n),Y.lengthSq()===0&&(Y.z=1),Y.normalize(),lt.crossVectors(e,Y),lt.lengthSq()===0&&(Math.abs(e.z)===1?Y.x+=1e-4:Y.z+=1e-4,Y.normalize(),lt.crossVectors(e,Y)),lt.normalize(),Ot.crossVectors(Y,lt),s[0]=lt.x,s[4]=Ot.x,s[8]=Y.x,s[1]=lt.y,s[5]=Ot.y,s[9]=Y.y,s[2]=lt.z,s[6]=Ot.z,s[10]=Y.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,n){const e=t.elements,s=n.elements,r=this.elements,o=e[0],a=e[4],c=e[8],h=e[12],l=e[1],u=e[5],d=e[9],g=e[13],m=e[2],f=e[6],x=e[10],y=e[14],S=e[3],k=e[7],N=e[11],R=e[15],I=s[0],E=s[4],T=s[8],D=s[12],nt=s[1],H=s[5],et=s[9],st=s[13],v=s[2],Pt=s[6],Jt=s[10],tn=s[14],nn=s[3],en=s[7],sn=s[11],rn=s[15];return r[0]=o*I+a*nt+c*v+h*nn,r[4]=o*E+a*H+c*Pt+h*en,r[8]=o*T+a*et+c*Jt+h*sn,r[12]=o*D+a*st+c*tn+h*rn,r[1]=l*I+u*nt+d*v+g*nn,r[5]=l*E+u*H+d*Pt+g*en,r[9]=l*T+u*et+d*Jt+g*sn,r[13]=l*D+u*st+d*tn+g*rn,r[2]=m*I+f*nt+x*v+y*nn,r[6]=m*E+f*H+x*Pt+y*en,r[10]=m*T+f*et+x*Jt+y*sn,r[14]=m*D+f*st+x*tn+y*rn,r[3]=S*I+k*nt+N*v+R*nn,r[7]=S*E+k*H+N*Pt+R*en,r[11]=S*T+k*et+N*Jt+R*sn,r[15]=S*D+k*st+N*tn+R*rn,this}multiplyScalar(t){const n=this.elements;return n[0]*=t,n[4]*=t,n[8]*=t,n[12]*=t,n[1]*=t,n[5]*=t,n[9]*=t,n[13]*=t,n[2]*=t,n[6]*=t,n[10]*=t,n[14]*=t,n[3]*=t,n[7]*=t,n[11]*=t,n[15]*=t,this}determinant(){const t=this.elements,n=t[0],e=t[4],s=t[8],r=t[12],o=t[1],a=t[5],c=t[9],h=t[13],l=t[2],u=t[6],d=t[10],g=t[14],m=t[3],f=t[7],x=t[11],y=t[15];return m*(+r*c*u-s*h*u-r*a*d+e*h*d+s*a*g-e*c*g)+f*(+n*c*g-n*h*d+r*o*d-s*o*g+s*h*l-r*c*l)+x*(+n*h*u-n*a*g-r*o*u+e*o*g+r*a*l-e*h*l)+y*(-s*a*l-n*c*u+n*a*d+s*o*u-e*o*d+e*c*l)}transpose(){const t=this.elements;let n;return n=t[1],t[1]=t[4],t[4]=n,n=t[2],t[2]=t[8],t[8]=n,n=t[6],t[6]=t[9],t[9]=n,n=t[3],t[3]=t[12],t[12]=n,n=t[7],t[7]=t[13],t[13]=n,n=t[11],t[11]=t[14],t[14]=n,this}setPosition(t,n,e){const s=this.elements;return t instanceof _?(s[12]=t.x,s[13]=t.y,s[14]=t.z):(s[12]=t,s[13]=n,s[14]=e),this}invert(){const t=this.elements,n=t[0],e=t[1],s=t[2],r=t[3],o=t[4],a=t[5],c=t[6],h=t[7],l=t[8],u=t[9],d=t[10],g=t[11],m=t[12],f=t[13],x=t[14],y=t[15],S=u*x*h-f*d*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[10]*t[10];return Math.sqrt(Math.max(n,e,s))}makeTranslation(t,n,e){return typeof t=="object"?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z??0,0,0,0,1):this.set(1,0,0,t,0,1,0,n,0,0,1,e,0,0,0,1),this}makeRotationX(t){const n=Math.cos(t),e=Math.sin(t);return this.set(1,0,0,0,0,n,-e,0,0,e,n,0,0,0,0,1),this}makeRotationY(t){const n=Math.cos(t),e=Math.sin(t);return this.set(n,0,e,0,0,1,0,0,-e,0,n,0,0,0,0,1),this}makeRotationZ(t){const n=Math.cos(t),e=Math.sin(t);return this.set(n,-e,0,0,e,n,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,n){const e=Math.cos(n),s=Math.sin(n),r=1-e,o=t.x,a=t.y,c=t.z,h=r*o,l=r*a;return this.set(h*o+e,h*a-s*c,h*c+s*a,0,h*a+s*c,l*a+e,l*c-s*o,0,h*c-s*a,l*c+s*o,r*c*c+e,0,0,0,0,1),this}makeScale(t,n,e){return this.set(t,0,0,0,0,n,0,0,0,0,e,0,0,0,0,1),this}makeShear(t,n,e,s,r,o){return this.set(1,e,r,0,t,1,o,0,n,s,1,0,0,0,0,1),this}compose(t,n,e){const s=this.elements,r=n.x,o=n.y,a=n.z,c=n.w,h=r+r,l=o+o,u=a+a,d=r*h,g=r*l,m=r*u,f=o*l,x=o*u,y=a*u,S=c*h,k=c*l,N=c*u,R=e.x,I=e.y,E=e.z;return s[0]=(1-(f+y))*R,s[1]=(g+N)*R,s[2]=(m-k)*R,s[3]=0,s[4]=(g-N)*I,s[5]=(1-(d+y))*I,s[6]=(x+S)*I,s[7]=0,s[8]=(m+k)*E,s[9]=(x-S)*E,s[10]=(1-(d+f))*E,s[11]=0,s[12]=t.x,s[13]=t.y,s[14]=t.z,s[15]=1,this}decompose(t,n,e){const s=this.elements;let r=wt.set(s[0],s[1],s[2]).length();const o=wt.set(s[4],s[5],s[6]).length(),a=wt.set(s[8],s[9],s[10]).length();this.determinant()<0&&(r=-r),t.x=s[12],t.y=s[13],t.z=s[14],J.copy(this);const h=1/r,l=1/o,u=1/a;return J.elements[0]*=h,J.elements[1]*=h,J.elements[2]*=h,J.elements[4]*=l,J.elements[5]*=l,J.elements[6]*=l,J.elements[8]*=u,J.elements[9]*=u,J.elements[10]*=u,n.setFromRotationMatrix(J),e.x=r,e.y=o,e.z=a,this}equals(t){const n=this.elements,e=t.elements;for(let s=0;s<16;s++)if(n[s]!==e[s])return!1;return!0}fromArray(t,n=0){for(let e=0;e<16;e++)this.elements[e]=t[e+n];return this}toArray(t=[],n=0){const e=this.elements;return t[n]=e[0],t[n+1]=e[1],t[n+2]=e[2],t[n+3]=e[3],t[n+4]=e[4],t[n+5]=e[5],t[n+6]=e[6],t[n+7]=e[7],t[n+8]=e[8],t[n+9]=e[9],t[n+10]=e[10],t[n+11]=e[11],t[n+12]=e[12],t[n+13]=e[13],t[n+14]=e[14],t[n+15]=e[15],t}};kt.IDENTITY=Object.freeze(new kt);let ot=kt;const wt=new _,J=new ot,as=new _(0,0,0),cs=new _(1,1,1),lt=new _,Ot=new _,Y=new _;class W{constructor(t=void 0,n=void 0){this.min=t==null?new _(1/0,1/0,1/0):new _(t.x,t.y,t.z),this.max=n==null?new _(-1/0,-1/0,-1/0):new _(n.x,n.y,n.z)}set(t,n){return this.min.copy(t),this.max.copy(n),this}setFromArray(t){this.makeEmpty();for(let n=0,e=t.length;n<e;n+=3)this.expandByPoint(mn.fromArray(t,n));return this}setFromPoints(t){this.makeEmpty();for(let n=0,e=t.length;n<e;n++)this.expandByPoint(t[n]);return this}setFromCenterAndSize(t,n){const e=mn.copy(n).multiplyScalar(.5);return this.min.copy(t).sub(e),this.max.copy(t).add(e),this}clone(){return new W().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!Number.isFinite(t.x)||!Number.isFinite(t.y)||!Number.isFinite(t.z)?this:(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,n){return n.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 n,e;return t.normal.x>0?(n=t.normal.x*this.min.x,e=t.normal.x*this.max.x):(n=t.normal.x*this.max.x,e=t.normal.x*this.min.x),t.normal.y>0?(n+=t.normal.y*this.min.y,e+=t.normal.y*this.max.y):(n+=t.normal.y*this.max.y,e+=t.normal.y*this.min.y),t.normal.z>0?(n+=t.normal.z*this.min.z,e+=t.normal.z*this.max.z):(n+=t.normal.z*this.max.z,e+=t.normal.z*this.min.z),n<=-t.constant&&e>=-t.constant}clampPoint(t,n){return n.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,mn).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:(at[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),at[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),at[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),at[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),at[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),at[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),at[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),at[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(at),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 at=[new _,new _,new _,new _,new _,new _,new _,new _],mn=new _,oe=new B;class K{constructor(t=void 0,n=void 0){this.min=t==null?new B(1/0,1/0):new B(t.x,t.y),this.max=n==null?new B(-1/0,-1/0):new B(n.x,n.y)}set(t,n){return this.min.copy(t),this.max.copy(n),this}setFromPoints(t){this.makeEmpty();for(let n=0,e=t.length;n<e;n++)this.expandByPoint(t[n]);return this}setFromCenterAndSize(t,n){const e=oe.copy(n).multiplyScalar(.5);return this.min.copy(t).sub(e),this.max.copy(t).add(e),this}clone(){return new K().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!Number.isFinite(t.x)||!Number.isFinite(t.y)?this:(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,n){return n.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,n){return n.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,oe).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 ae=new _,hs=new _,ls=new pt;class Mt{constructor(t=new _(1,0,0),n=0){this.normal=t,this.constant=n}set(t,n){return this.normal.copy(t),this.constant=n,this}setComponents(t,n,e,s){return this.normal.set(t,n,e),this.constant=s,this}setFromNormalAndCoplanarPoint(t,n){return this.normal.copy(t),this.constant=-n.dot(this.normal),this}setFromCoplanarPoints(t,n,e){const s=ae.subVectors(e,n).cross(hs.subVectors(t,n)).normalize();return this.setFromNormalAndCoplanarPoint(s,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,n){return n.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,n){const e=n||ls.getNormalMatrix(t),s=this.coplanarPoint(ae).applyMatrix4(t),r=this.normal.applyMatrix3(e).normalize();return this.constant=-s.dot(r),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 Mt().copy(this)}}class P extends B{clone(){return new P(this.x,this.y)}static pointArrayToNumberArray(t){const n=new Array(t.length*2);return t.forEach((e,s)=>{e.toArray(n,s*2)}),n}}class w extends _{clone(){return new w(this.x,this.y,this.z)}static pointArrayToNumberArray(t,n=!0){const e=n?3:2,s=new Array(t.length*e);return t.forEach((r,o)=>{r.toArray(s,o*e)}),s}}const ce=new ot,he=new Rt,Ft=class Ft{constructor(t=0,n=0,e=0,s=Ft.DEFAULT_ORDER){this._x=t,this._y=n,this._z=e,this._order=s}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,n,e,s=this._order){return this._x=t,this._y=n,this._z=e,this._order=s,this._onChangeCallback(),this}clone(){return new Ft(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,n=this._order,e=!0){const s=t.elements,r=s[0],o=s[4],a=s[8],c=s[1],h=s[5],l=s[9],u=s[2],d=s[6],g=s[10];switch(n){case"XYZ":this._y=Math.asin(G(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-l,g),this._z=Math.atan2(-o,r)):(this._x=Math.atan2(d,h),this._z=0);break;case"YXZ":this._x=Math.asin(-G(l,-1,1)),Math.abs(l)<.9999999?(this._y=Math.atan2(a,g),this._z=Math.atan2(c,h)):(this._y=Math.atan2(-u,r),this._z=0);break;case"ZXY":this._x=Math.asin(G(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-u,g),this._z=Math.atan2(-o,h)):(this._y=0,this._z=Math.atan2(c,r));break;case"ZYX":this._y=Math.asin(-G(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(d,g),this._z=Math.atan2(c,r)):(this._x=0,this._z=Math.atan2(-o,h));break;case"YZX":this._z=Math.asin(G(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-l,h),this._y=Math.atan2(-u,r)):(this._x=0,this._y=Math.atan2(a,g));break;case"XZY":this._z=Math.asin(-G(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(d,h),this._y=Math.atan2(a,r)):(this._x=Math.atan2(-l,g),this._y=0);break}return this._order=n,e===!0&&this._onChangeCallback(),this}setFromQuaternion(t,n,e=!0){return ce.makeRotationFromQuaternion(t),this.setFromRotationMatrix(ce,n,e)}setFromVector3(t,n=this._order){return this.set(t.x,t.y,t.z,n)}reorder(t){return he.setFromEuler(this),this.setFromQuaternion(he,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=[],n=0){return t[n]=this._x,t[n+1]=this._y,t[n+2]=this._z,t[n+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}};Ft.DEFAULT_ORDER="XYZ";let fn=Ft;function xn(i){const t=i.length;if(t<3)return 0;let n=0;for(let e=0,s=t-1;e<t;s=e++){const r=i[s],o=i[e];n+=r.x*o.y-o.x*r.y}return n*.5}function le(i){return Math.abs(xn(i))}function ue(i){const t=i.length;if(t<3)return 0;let n=0,e=0,s=0;for(let r=0,o=t-1;r<t;o=r++){const a=i[o],c=i[r],h=a.x,l=a.y,u=a.z??0,d=c.x,g=c.y,m=c.z??0;n+=(u+m)*(l-g),e+=(h+d)*(u-m),s+=(l+g)*(h-d)}return .5*Math.hypot(n,e,s)}function us(i){return i.length<3?0:le(i)}function de(i){return i.length<3?0:ue(i)}function ds(i){const t=i;return{x:i.x,y:i.y,z:t.z??0}}function gs(i,t){i.x+=t.x,i.y+=t.y,i.z=(i.z??0)+(t.z??0)}function ms(i,t,n=!1){const e=i.x,s=i.y;let r=!1;const o=t.length;for(let a=0,c=o-1;a<o;c=a++){const h=t[a].x,l=t[a].y,u=t[c].x,d=t[c].y;let g=l>s!=d>s;n&&(g=l>=s!=d>=s),g&&e<(u-h)*(s-l)/(d-l)+h&&(r=!r)}return r}function fs(i,t){if(i.length===0||t.length===0)return!1;const n=new K().setFromPoints(i),e=new K().setFromPoints(t);if(!n.intersectsBox(e))return!1;for(let s=0;s<i.length;){if(U.isPointInPolygon(i[s],t,!0))return!0;s<i.length-1&&Nt.equalPoint2d(i[s+1],i[s])&&++s,++s}return!1}const U={applyOffsetToPoint3d:gs,isPointInPolygon:ms,isPolygonIntersect:fs,point2dToPoint3d:ds};function xs(i,t){const n=[],e=t-1,s=i;for(let r=0;r<=s;r++)n.push(0);for(let r=1;r<=e-s;r++)n.push(r);for(let r=0;r<=s;r++)n.push(e-s+1);return n}function ys(i,t){const n=t.length-1,e=i,s=[0];let r=0;for(let a=1;a<=n;a++){const c=t[a][0]-t[a-1][0],h=t[a][1]-t[a-1][1],l=t[a][2]-t[a-1][2],u=Math.sqrt(c*c+h*h+l*l);r+=u,s.push(r)}const o=[];for(let a=0;a<=e;a++)o.push(0);for(let a=1;a<=n-e;a++){const c=s[a]/r;o.push(c*(n-e+1))}for(let a=0;a<=e;a++)o.push(n-e+1);return o}function ge(i,t="Uniform"){const n=i.length;if(n===0)return[];if(n===1)return[0];const e=n-1;if(t==="Uniform")return new Array(n).fill(0).map((o,a)=>a/e);const s=[0];let r=0;for(let o=1;o<=e;o++){const a=i[o][0]-i[o-1][0],c=i[o][1]-i[o-1][1],h=i[o][2]-i[o-1][2],l=Math.sqrt(a*a+c*c+h*h),u=t==="SqrtChord"?Math.sqrt(l):l;r+=u,s.push(r)}return r<1e-12?new Array(n).fill(0).map((o,a)=>a/e):s.map(o=>o/r)}function me(i,t){const n=t.length-1,e=i,s=n+e+1,r=new Array(s+1).fill(0),o=t[t.length-1];for(let a=s-e;a<=s;a++)r[a]=o;for(let a=1;a<=n-e;a++){let c=0;for(let h=a;h<a+e;h++)c+=t[h];r[a+e]=c/e}return r}function _s(i,t){const n=t.length-1,e=i,s=[0];let r=0;for(let a=1;a<=n;a++){const c=t[a][0]-t[a-1][0],h=t[a][1]-t[a-1][1],l=t[a][2]-t[a-1][2],u=Math.sqrt(c*c+h*h+l*l),d=Math.sqrt(u);r+=d,s.push(r)}const o=[];for(let a=0;a<=e;a++)o.push(0);for(let a=1;a<=n-e;a++){const c=s[a]/r;o.push(c*(n-e+1))}for(let a=0;a<=e;a++)o.push(n-e+1);return o}function Ut(i,t){for(const n of i)if(n.col===t)return n.value;return 0}function fe(i,t){for(let n=0;n<i.length;n++)if(i[n].col===t)return n;return-1}function As(i,t){const n=i.length,e=i.map(o=>o.map(a=>({col:a.col,value:a.value}))),s=t.map(o=>o.slice());for(let o=0;o<n;o++){let a=-1,c=1e-12;for(let l=o;l<n;l++){const u=Math.abs(Ut(e[l],o));u>c&&(c=u,a=l)}if(a<0)throw new Error("Interpolation matrix is singular.");if(a!==o){const l=e[o];e[o]=e[a],e[a]=l;for(const u of s){const d=u[o];u[o]=u[a],u[a]=d}}const h=Ut(e[o],o);for(let l=o+1;l<n;l++){const u=fe(e[l],o);if(u<0)continue;const d=e[l][u].value/h;if(!(Math.abs(d)<1e-14)){for(const g of e[l])g.col>o&&(g.value-=d*Ut(e[o],g.col));for(const g of e[o])g.col<=o||g.value===0||fe(e[l],g.col)<0&&e[l].push({col:g.col,value:-d*g.value});e[l][u].value=0;for(const g of s)g[l]-=d*g[o]}}}const r=s.map(()=>new Array(n).fill(0));for(let o=n-1;o>=0;o--){const a=Ut(e[o],o);for(let c=0;c<s.length;c++){let h=s[c][o];for(const l of e[o])l.col>o&&(h-=l.value*r[c][l.col]);r[c][o]=h/a}}return r}function Ps(i,t,n){const e=n.length-t-2;if(i>=n[e+1])return e;let s=t,r=n.length-t-2;for(;s<=r;){const o=s+r>>1;if(i<n[o])r=o-1;else if(i>=n[o+1])s=o+1;else return o}return t}function yn(i,t,n="Uniform",e,s){if(i.length===0)return{controlPoints:[],knots:[],weights:[]};const r=i.map(T=>[T[0],T[1],T[2]??0]),o=!!e,a=!!s,c=(o?1:0)+(a?1:0),h=r.length-1,l=h+c;if(l<t)throw new Error("Not enough points to interpolate a curve of this degree.");const u=ge(r,n),d=u.slice();o&&d.unshift(u[0]),a&&d.push(u[u.length-1]);const g=me(t,d),m=l+1,f=[],x=[],y=[],S=[];if(o){const T=g[t+1]-g[0],D=T!==0?t/T:0;f.push([{col:0,value:-D},{col:1,value:D}]),x.push((e==null?void 0:e[0])??0),y.push((e==null?void 0:e[1])??0),S.push((e==null?void 0:e[2])??0)}f.push([{col:0,value:1}]),x.push(r[0][0]),y.push(r[0][1]),S.push(r[0][2]);for(let T=1;T<=h-1;T++){const D=u[T],nt=[],H=Ps(D,t,g),et=Math.max(0,H-t),st=Math.min(l,H);for(let v=et;v<=st;v++){const Pt=ut(v,t,D,g);Pt!==0&&nt.push({col:v,value:Pt})}f.push(nt),x.push(r[T][0]),y.push(r[T][1]),S.push(r[T][2])}if(f.push([{col:l,value:1}]),x.push(r[h][0]),y.push(r[h][1]),S.push(r[h][2]),a){const T=g[l+t+1]-g[l],D=T!==0?t/T:0;f.push([{col:l-1,value:-D},{col:l,value:D}]),x.push((s==null?void 0:s[0])??0),y.push((s==null?void 0:s[1])??0),S.push((s==null?void 0:s[2])??0)}const[k,N,R]=As(f,[x,y,S]),I=new Array(m);for(let T=0;T<m;T++)I[T]=[k[T],N[T],R[T]];const E=new Array(m).fill(1);return{controlPoints:I,knots:g,weights:E}}function ut(i,t,n,e){if(t===0)return n>=e[i]&&n<e[i+1]?1:0;const s=e[i+t]-e[i],r=e[i+t+1]-e[i+1],o=s>1e-10?(n-e[i])/s:0,a=r>1e-10?(e[i+t+1]-n)/r:0;return o*ut(i,t-1,n,e)+a*ut(i+1,t-1,n,e)}function Bt(i,t,n,e,s){const r=e.length-1,o=t;if(i=Math.max(n[o],Math.min(n[r+1],i)),Math.abs(i-n[r+1])<1e-8)return[...e[r]];if(Math.abs(i-n[o])<1e-8)return[...e[0]];const a=[0,0,0];let c=0;for(let h=0;h<=r;h++){const l=ut(h,o,i,n),u=s[h]*l;a[0]+=e[h][0]*u,a[1]+=e[h][1]*u,a[2]+=e[h][2]*u,c+=u}if(Math.abs(c)<1e-10){const h=n[n.length-o-1];if(Math.abs(i-h)<1e-8)return[...e[r]];if(Math.abs(i-n[o])<1e-8)return[...e[0]]}return Math.abs(c)>=1e-10&&(a[0]/=c,a[1]/=c,a[2]/=c),a}function _n(i,t,n,e){if(t===0)return 0;const s=e[i+t]-e[i],r=e[i+t+1]-e[i+1];let o=0;return s>1e-10&&(o+=t/s*ut(i,t-1,n,e)),r>1e-10&&(o-=t/r*ut(i+1,t-1,n,e)),o}function ps(i,t,n,e){if(t<=1)return 0;const s=e[i+t]-e[i],r=e[i+t+1]-e[i+1];let o=0;return s>1e-10&&(o+=t/s*_n(i,t-1,n,e)),r>1e-10&&(o-=t/r*_n(i+1,t-1,n,e)),o}function xe(i,t,n,e,s){const r=e.length-1,o=t,a=n[o],c=n[r+1];i=Math.max(a,Math.min(c,i));const h=[0,0,0],l=[0,0,0],u=[0,0,0];let d=0,g=0,m=0;for(let I=0;I<=r;I++){const E=ut(I,o,i,n),T=_n(I,o,i,n),D=ps(I,o,i,n),nt=s[I],H=nt*E,et=nt*T,st=nt*D,v=e[I];h[0]+=H*v[0],h[1]+=H*v[1],h[2]+=H*v[2],l[0]+=et*v[0],l[1]+=et*v[1],l[2]+=et*v[2],u[0]+=st*v[0],u[1]+=st*v[1],u[2]+=st*v[2],d+=H,g+=et,m+=st}if(Math.abs(d)<1e-10)return{point:Bt(i,t,n,e,s),deriv1:[0,0,0],deriv2:[0,0,0]};const f=d*d,x=[h[0]/d,h[1]/d,h[2]/d],y=[(l[0]*d-h[0]*g)/f,(l[1]*d-h[1]*g)/f,(l[2]*d-h[2]*g)/f],S=u[0]*d-h[0]*m,k=u[1]*d-h[1]*m,N=u[2]*d-h[2]*m,R=[S/f-2*g*y[0]/d,k/f-2*g*y[1]/d,N/f-2*g*y[2]/d];return{point:x,deriv1:y,deriv2:R}}function ye(i,t){const n=i[0],e=i[1],s=t[0],r=t[1],o=n*n+e*e;return o<1e-20?0:(n*r-e*s)/Math.pow(o,1.5)}function _e(i,t,n,e){const s=i,r=t[s],o=t[t.length-s-1];let a=0;const c=1e3,h=(o-r)/c;let l=Bt(r,i,t,n,e);for(let f=1;f<=c;f++){const x=r+f*h,y=Bt(x,i,t,n,e),S=y[0]-l[0],k=y[1]-l[1],N=y[2]-l[2];a+=Math.sqrt(S*S+k*k+N*N),l=y}const u=Bt(o,i,t,n,e),d=u[0]-l[0],g=u[1]-l[1],m=u[2]-l[2];return a+=Math.sqrt(d*d+g*g+m*m),a}function ws(i,t=3,n="Uniform",e,s){return i.length===0?[]:yn(i,t,n,e,s).controlPoints}const Dt=new ot,Ae=new _,Ms=new _,zs=new _,An=new w,Pe=new _;function bs(i){return new ot().setFromExtrusionDirection(new _(i.x,i.y,i.z))}function Ss(i){return pe(new _,i)}function pe(i,t){return Dt.setFromExtrusionDirection(Pe.set(t.x,t.y,t.z)),Dt.extractBasis(Ae,Ms,zs),i.copy(Ae),i}function Cs(i,t){return we(new w,i,t)}function we(i,t,n){return n.x===0&&n.y===0&&n.z===1?(i.set(t.x,t.y,t.z??0),i):(Dt.setFromExtrusionDirection(Pe.set(n.x,n.y,n.z)),i.set(t.x,t.y,t.z??0),i.applyMatrix4(Dt),i)}function Pn(i,t){return new w(i.x,i.y,i.z??0).applyMatrix4(bs(t).invert())}function Es(i,t,n){const e=Pn(i,n),s=Pn(t,n);return An.set(s.x-e.x,s.y-e.y,(s.z??0)-(e.z??0)),p.normalizeAngle(Math.atan2(An.y,An.x))}function pn(i,t,n){const e=i.x,s=i.y,r=t.x,o=t.y,a=n.x,c=n.y,h=2*(e*(o-c)+r*(c-s)+a*(s-o));if(M.equalToZero(h))return null;const l=((e*e+s*s)*(o-c)+(r*r+o*o)*(c-s)+(a*a+c*c)*(s-o))/h,u=((e*e+s*s)*(a-r)+(r*r+o*o)*(e-a)+(a*a+c*c)*(r-e))/h,d=Math.hypot(l-e,u-s);return!Number.isFinite(d)||M.isNonPositive(d)?null:{center:new P(l,u),radius:d}}function Me(i,t,n){const e=i.x,s=i.y,r=i.z??0,o=new _(t.x-e,t.y-s,(t.z??0)-r),a=new _(n.x-e,n.y-s,(n.z??0)-r),c=new _().crossVectors(o,a),h=c.lengthSq();if(h<C*C)return null;const l=o.lengthSq(),u=a.lengthSq(),d=new _().crossVectors(c,o).multiplyScalar(u).add(new _().crossVectors(a,c).multiplyScalar(l)).multiplyScalar(1/(2*h)),g=new w(e+d.x,s+d.y,r+d.z),m=Math.hypot(g.x-e,g.y-s,g.z-r);return!Number.isFinite(m)||M.isNonPositive(m)?null:{center:g,radius:m}}function dt(i,t){return Math.atan2(t.y-i.y,t.x-i.x)}function it(i,t){return Math.hypot(t.x-i.x,t.y-i.y)}function ze(i,t,n){if(M.isNonPositive(t))return null;const e=n.x-i.x,s=n.y-i.y,r=Math.hypot(e,s);if(M.isNonPositive(r))return null;const o=t/r;return new P(i.x+e*o,i.y+s*o)}const Is=1e-8;function be(i,t,n,e){return Math.abs(it(i,t)-n)<=(e??Math.max(C,n*1e-5))}function Se(i,t,n,e,s=Is){return Math.abs(i.x-n.x)<=s&&Math.abs(i.y-n.y)<=s&&Math.abs(t-e)<=s}function Ce(i,t,n,e){const s=Math.max(1e-18,Math.abs(n)*1e-9);return i<n-s?!0:i>n+s?!1:t>e}function Ee(i,t,n,e=!1){const s=pn(i,t,n);if(!s)return null;const r=dt(s.center,i),o=dt(s.center,t),a=dt(s.center,n);let c=!p.isAngleOnCcwSweep(r,o,a);return e&&(c=!c),q.fromMathAngles(s.center,s.radius,r,a,c)}function wn(i,t){return!Number.isFinite(t)||M.isNonPositive(t)?null:new q(i,t,0,b,!1)}function Ts(i,t){const n=it(i,t);return M.isNonPositive(n)?null:wn({x:(i.x+t.x)/2,y:(i.y+t.y)/2},n/2)}function ks(i,t,n){const e=pn(i,t,n);return e?wn(e.center,e.radius):null}function Ns(i,t,n){const e=it(n,i);if(M.isNonPositive(e))return null;const s=dt(n,i),r=dt(n,t),o=p.normalizeAngle(r-s);return q.fromMathAngles(n,e,s,r,o>Math.PI)}function qt(i,t,n,e){const s=it(i,t),r=it(i,n);if(M.isNonPositive(s)||M.isNonPositive(r))return null;const o=Math.max(C,s*C);return Math.abs(s-r)>o?null:q.fromMathAngles(i,s,dt(i,t),dt(i,n),e)}function Rs(i,t,n,e){const s=it(i,t);if(M.isNonPositive(s))return null;const r=ze(i,s,n);return r?qt(i,t,r,e):null}function Ie(i,t,n){const e=it(i,t),s=Math.abs(n);if(M.isNonPositive(e)||M.isNonPositive(s)||!M.great(b-s,0))return null;const r=n<0,o=dt(i,t),a=r?o-s:o+s;return q.fromMathAngles(i,e,o,a,r)}function Bs(i,t,n){const e=it(i,t),s=Math.abs(n);if(M.isNonPositive(e)||M.isNonPositive(s)||M.great(s,2*e))return null;const r=Math.max(-1,Math.min(1,s/(2*e))),o=2*Math.asin(r);return Ie(i,t,n>=0?o:-o)}function qs(i,t,n){const e=it(i,t),s=Math.abs(n);if(M.isNonPositive(e)||M.isNonPositive(s)||!M.great(b-s,0))return null;const r=Math.sin(s/2);if(M.equalToZero(r))return null;const o=e/(2*r),a=o*o-e*e/4;if(M.less(a,0))return null;const c=Math.sqrt(Math.max(0,a)),h=(i.x+t.x)/2,l=(i.y+t.y)/2,u=t.x-i.x,g=-(t.y-i.y)/e,m=u/e,f=n>=0,y=f&&s<=Math.PI||!f&&s>Math.PI?1:-1,S={x:h+g*c*y,y:l+m*c*y};return qt(S,i,t,!f)}function vs(i,t,n){const e=Math.cos(n),s=Math.sin(n),r=t.x-i.x,o=t.y-i.y,a=-s,c=e,h=2*(r*a+o*c);if(M.equalToZero(h))return null;const l=(r*r+o*o)/h;if(!Number.isFinite(l))return null;const u={x:i.x+a*l,y:i.y+c*l},d=i.x-u.x,g=i.y-u.y,m=d*s-g*e;return M.equalToZero(m)?null:qt(u,i,t,m<0)}function Vs(i,t,n){const e=Math.abs(n),s=it(i,t);if(M.isNonPositive(e)||M.isNonPositive(s)||M.great(s,2*e))return null;const r=(i.x+t.x)/2,o=(i.y+t.y)/2,a=t.x-i.x,h=-(t.y-i.y)/s,l=a/s,u=Math.sqrt(Math.max(0,e*e-s*s/4)),d=n>=0?1:-1,g={x:r+h*u*d,y:o+l*u*d};return qt(g,i,t,n<0)}class Te{constructor(){this._boundingBoxNeedsUpdate=!1}get boundingBoxNeedUpdate(){return this._boundingBoxNeedsUpdate}}class Mn extends Te{translate(t){return this.transform(new pt().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 Mn{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 n=this.getUtoTmapping(t);return this.getPoint(n)}getPoints(t=5){const n=[];for(let e=0;e<=t;e++)n.push(this.getPoint(e/t));return n}getSpacedPoints(t=5){const n=[];for(let e=0;e<=t;e++)n.push(this.getPointAt(e/t));return n}getLength(){const t=this.getLengths();return t[t.length-1]}getLengths(t=this.arcLengthDivisions){const n=[];let e,s=this.getPoint(0),r=0;n.push(0);for(let o=1;o<=t;o++)e=this.getPoint(o/t),r+=e.distanceTo(s),n.push(r),s=e;return n}getUtoTmapping(t,n){const e=this.getLengths();let s=0;const r=e.length;let o;n?o=n:o=t*e[r-1];let a=0,c=r-1,h;for(;a<=c;)if(s=Math.floor(a+(c-a)/2),h=e[s]-o,h<0)a=s+1;else if(h>0)c=s-1;else{c=s;break}if(s=c,e[s]===o)return s/(r-1);const l=e[s],d=e[s+1]-l,g=(o-l)/d;return(s+g)/(r-1)}getTangent(t){let e=t-1e-4,s=t+1e-4;e<0&&(e=0),s>1&&(s=1);const r=this.getPoint(e),o=this.getPoint(s),a=new P;return a.copy(o).sub(r).normalize(),a}getTangentAt(t){const n=this.getUtoTmapping(t);return this.getTangent(n)}}const F=class F extends zt{constructor(t,n,e,s,r){super();const o=+(t!==void 0)+ +(n!==void 0)+ +(e!==void 0)+ +(s!==void 0)+ +(r!==void 0);if(o==3)typeof t=="object"&&typeof n=="object"&&typeof e=="object"?this.createByThreePoints(t,n,e):this.createByStartEndPointsAndBulge(t,n,e);else if(o==5){const a=t;this.center=new P(a.x,a.y),this.radius=n,this._clockwise=r,this._startAngle=this._clockwise?this._mirrorAngle(p.normalizeAngle(e)):p.normalizeAngle(e),this._endAngle=this._clockwise?this._mirrorAngle(p.normalizeAngle(s)):p.normalizeAngle(s)}else throw V.AcCmErrors.ILLEGAL_PARAMETERS}static fromMathAngles(t,n,e,s,r){const o=new F(t,n,p.normalizeAngle(e),p.normalizeAngle(s),!1);return o._clockwise=r,o._boundingBoxNeedsUpdate=!0,o}static computeCircumcircle(t,n,e){return pn(t,n,e)}static projectPoint(t,n,e){return ze(t,n,e)}static pointLiesOnCircle(t,n,e,s){return be(t,n,e,s)}static sameCircle(t,n,e,s,r){return Se(t,n,e,s,r)}static isBetterDistanceAlign(t,n,e,s){return Ce(t,n,e,s)}static tryCreateByThreePoints(t,n,e,s=!1){return Ee(t,n,e,s)}static tryCreateCircle(t,n){return wn(t,n)}static tryCreateCircleByDiameter(t,n){return Ts(t,n)}static tryCreateCircleByThreePoints(t,n,e){return ks(t,n,e)}static tryCreateShorterArc(t,n,e){return Ns(t,n,e)}static tryCreateByCenterStartEnd(t,n,e,s){return qt(t,n,e,s)}static tryCreateByCenterStartProjectedEnd(t,n,e,s){return Rs(t,n,e,s)}static tryCreateByCenterStartSweep(t,n,e){return Ie(t,n,e)}static tryCreateByCenterStartChord(t,n,e){return Bs(t,n,e)}static tryCreateByStartEndAngle(t,n,e){return qs(t,n,e)}static tryCreateByStartEndDirection(t,n,e){return vs(t,n,e)}static tryCreateByStartEndRadius(t,n,e){return Vs(t,n,e)}createByThreePoints(t,n,e){const s=Ee(t,n,e);if(!s)throw V.AcCmErrors.ILLEGAL_PARAMETERS;this.center=s.center,this.radius=s.radius,this._clockwise=s._clockwise,this._startAngle=s._startAngle,this._endAngle=s._endAngle,this._boundingBoxNeedsUpdate=!0}createByStartEndPointsAndBulge(t,n,e){let s,r,o;e<0?(s=Math.atan(-e)*4,r=new B(t),o=new B(n)):(s=Math.atan(e)*4,r=new B(n),o=new B(t));const a=new B().subVectors(o,r),c=a.length(),h=new B().addVectors(r,a.multiplyScalar(.5)),l=Math.abs(c/2/Math.tan(s/2)),u=a.normalize(),d=e<0?-Math.PI/2:Math.PI/2,g=new B(u.x*Math.cos(d)-u.y*Math.sin(d),u.y*Math.cos(d)+u.x*Math.sin(d));let m;s<Math.PI?e<0?m=h.add(g.multiplyScalar(l)):m=h.add(g.multiplyScalar(-l)):e<0?m=h.add(g.multiplyScalar(-l)):m=h.add(g.multiplyScalar(l)),e<0?(this._startAngle=Math.atan2(r.y-m.y,r.x-m.x),this._endAngle=Math.atan2(o.y-m.y,o.x-m.x)):(this._startAngle=Math.atan2(o.y-m.y,o.x-m.x),this._endAngle=Math.atan2(r.y-m.y,r.x-m.x)),this._clockwise=e<0,this.center=m,this.radius=o.sub(m).length()}get center(){return this._center}set center(t){this._center=new P(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 n=this.startAngle==0&&t==b?t:p.normalizeAngle(t);this._endAngle=this._clockwise?this._mirrorAngle(n):n,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),n=this._getInternalAngle(this.endAngle);return this.clockwise?p.normalizeAngle(t-n):p.normalizeAngle(n-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),n=this._clockwise?p.normalizeAngle(t-this.deltaAngle/2):p.normalizeAngle(t+this.deltaAngle/2),e=this._clockwise?this._mirrorAngle(n):n;return this.getPointAtAngle(e)}get closed(){const t=this._getInternalAngle(this.startAngle),n=this._getInternalAngle(this.endAngle);return Math.abs(n-t)/Math.PI%2==0}calculateBoundingBox(){const t=[this.startPoint,this.endPoint],n=[0,Math.PI/2,Math.PI,3*Math.PI/2];for(const r of n){const o=this._getInternalAngle(r);p.isBetweenAngle(o,this._getInternalAngle(this.startAngle),this._getInternalAngle(this.endAngle),this.clockwise)&&t.push(this.getPointAtAngle(r))}const e=t.map(r=>r.x),s=t.map(r=>r.y);return new K(new P(Math.min(...e),Math.min(...s)),new P(Math.max(...e),Math.max(...s)))}get length(){return Math.abs(this.deltaAngle*this.radius)}transform(t){const n=t,e=this.center.clone().applyMatrix2d(n),s=this.startPoint.clone().applyMatrix2d(n);if(this.closed)return this.center=e,this.radius=e.distanceTo(s),this._startAngle=Math.atan2(s.y-e.y,s.x-e.x),this._endAngle=this._startAngle,this._clockwise=n.determinant()<0?!this._clockwise:this._clockwise,this._boundingBoxNeedsUpdate=!0,this;const r=this.midPoint.clone().applyMatrix2d(n),o=this.endPoint.clone().applyMatrix2d(n),a=new F(s,r,o),c=n.determinant()<0?!this.clockwise:this.clockwise,h=l=>{const u=p.normalizeAngle(l);return c?this._mirrorAngle(u):u};return this.center=a.center,this.radius=a.radius,this.clockwise=c,this.startAngle=h(Math.atan2(s.y-a.center.y,s.x-a.center.x)),this.endAngle=h(Math.atan2(o.y-a.center.y,o.x-a.center.x)),this._boundingBoxNeedsUpdate=!0,this}clone(){return new F(this.center.clone(),this.radius,this._startAngle,this._endAngle,this.clockwise)}getPointAtAngle(t){const n=this._getInternalAngle(t),e=this.center.x+this.radius*Math.cos(n),s=this.center.y+this.radius*Math.sin(n);return new P(e,s)}getQuadrantPoints(){const t=[],n=this._getInternalAngle(this.startAngle),e=this._getInternalAngle(this.endAngle),s=[0,Math.PI/2,Math.PI,3*Math.PI/2];for(const r of s){const o=this._getInternalAngle(r);p.isBetweenAngle(o,n,e,this.clockwise)&&t.push(this.getPointAtAngle(r))}return t}nearestPoint(t){const n=new P(t.x,t.y),e=n.x-this.center.x,s=n.y-this.center.y;if(Math.hypot(e,s)<1e-12)return this.startPoint.clone();const o=Math.atan2(s,e),a=this.clockwise?this._mirrorAngle(p.normalizeAngle(o)):p.normalizeAngle(o),c=this._getInternalAngle(a),h=this._getInternalAngle(this.startAngle),l=this._getInternalAngle(this.endAngle);if(p.isBetweenAngle(c,h,l,this.clockwise))return this.getPointAtAngle(a);const u=n.distanceToSquared(this.startPoint),d=n.distanceToSquared(this.endPoint);return u<=d?this.startPoint.clone():this.endPoint.clone()}inwardAlignment(t,n){const e=n.x-t.x,s=n.y-t.y;if(e*e+s*s<1e-24)return 0;const r=this.radius>0?this.radius:1,o=Math.max(1e-16,1e-12*r*r),a=this.startPoint.distanceToSquared(t)<=o,c=this.endPoint.distanceToSquared(t)<=o;if(!a&&!c)return 0;const h=this.getPoints(8);if(h.length<3)return 0;const l=a&&!c?h[1]:h[h.length-2],u=l.x-t.x,d=l.y-t.y,g=Math.hypot(u,d);return g>1e-18?(e*u+s*d)/g:0}perpendicularPoints(t){const n=new P(t.x,t.y),e=n.x-this.center.x,s=n.y-this.center.y,r=Math.hypot(e,s);if(r<1e-12)return[];const o=e/r,a=s/r,c=[new P(this.center.x+o*this.radius,this.center.y+a*this.radius),new P(this.center.x-o*this.radius,this.center.y-a*this.radius)],h=[],l=this._getInternalAngle(this.startAngle),u=this._getInternalAngle(this.endAngle);for(const d of c){const g=Math.atan2(d.y-this.center.y,d.x-this.center.x),m=this.clockwise?this._mirrorAngle(p.normalizeAngle(g)):p.normalizeAngle(g),f=this._getInternalAngle(m);(this.closed||p.isBetweenAngle(f,l,u,this.clockwise))&&h.push(d)}return h}tangentPoints(t){const n=[],e=t.x-this.center.x,s=t.y-this.center.y,r=Math.hypot(e,s),o=this.radius;if(r<o)return n;const a=Math.acos(o/r),c=Math.atan2(s,e),h=[c+a,c-a],l=this._getInternalAngle(this.startAngle),u=this._getInternalAngle(this.endAngle);for(const d of h){const g=this.clockwise?this._mirrorAngle(p.normalizeAngle(d)):p.normalizeAngle(d),m=this._getInternalAngle(g);(this.closed||p.isBetweenAngle(m,l,u,this.clockwise))&&n.push(this.getPointAtAngle(g))}return n}getPoints(t=100){const n=[];let e=this.deltaAngle,s=this._getInternalAngle(this.startAngle);if(this.closed&&(e=b,s=0),this.clockwise)for(let r=0;r<=t;r++){const o=s-e*(r/t),a=this._clockwise?this._mirrorAngle(o):o,c=this.getPointAtAngle(a);n.push(new P(c.x,c.y))}else for(let r=0;r<=t;r++){const o=s+e*(r/t),a=this._clockwise?this._mirrorAngle(o):o,c=this.getPointAtAngle(a);n.push(new P(c.x,c.y))}return n}tessellate(t){const n=this.closed?b:this.deltaAngle,e=F.segmentCount(this.radius,n,{...t,minSegments:(t==null?void 0:t.minSegments)??(this.closed?8:3)});return this.getPoints(e)}static resolveCircleSides(t){return t==null||!Number.isFinite(t)?F.DEFAULT_CIRCLE_SIDES:G(Math.round(t),F.MIN_CIRCLE_SIDES,F.MAX_CIRCLE_SIDES)}static resolveTessellateOptions(t){const n=F.resolveCircleSides(t==null?void 0:t.circleSides),e=Math.max(1,Math.round((t==null?void 0:t.maxSegments)??n));return{deviation:t==null?void 0:t.deviation,circleSides:n,minSegments:t==null?void 0:t.minSegments,maxSegments:e}}static chordDeviationFromRadius(t,n=F.DEFAULT_CIRCLE_SIDES){const e=Math.abs(t),s=F.resolveCircleSides(n);return e<=C?C:Math.max(C,e*(1-Math.cos(Math.PI/s)))}static segmentCount(t,n,e){const s=F.resolveTessellateOptions(e),r=Math.abs(n),o=r>=b-1e-8,a=Math.max(1,Math.round(s.minSegments??(o?8:3))),c=Math.max(a,s.maxSegments),h=Math.abs(t);if(h<=C||r<=C)return a;const u=1-(s.deviation??F.chordDeviationFromRadius(h,s.circleSides))/h;if(!Number.isFinite(u)||u>=1)return c;if(u<=-1)return a;const d=2*Math.acos(u);return d<=C?c:G(Math.ceil(r/d),a,c)}};F.DEFAULT_CIRCLE_SIDES=100,F.MIN_CIRCLE_SIDES=8,F.MAX_CIRCLE_SIDES=2e4;let q=F;function Ls(i){const t=Math.abs(i);if(t<.1){const n=t*t,e=1-n/20*(1-n/42*(1-n/72*(1-n/110))),s=t*n/6*e;return i<0?-s:s}return i-Math.sin(i)}function js(i,t){const n=i.length;if(!t||n<2)return 0;const e=i[0].x,s=i[0].y;let r=0;for(let o=0;o<n;++o){const a=i[o],c=i[(o+1)%n],h=a.x-e,l=a.y-s,u=c.x-e,d=c.y-s;r+=.5*(h*d-u*l);const g=a.bulge??0,m=u-h,f=d-l,x=m*m+f*f;if(g===0||!(x>0))continue;const y=4*Math.atan(g),S=Math.sin(y/2),k=x/(4*S*S);r+=.5*k*Ls(y)}return Math.abs(r)}const Xt=1e-6;function ke(i,t){if(ai(i)){const r=Os(i,t);return r?[r]:[]}const n=Ve(i);if(n.numberOfVertices<2)return[];const s=hi(n,t);return s?[s]:[]}function Fs(i){return Ve(i)}function Os(i,t){const n=Us(i);if(n.length===0)return null;const e=[];for(const a of n){const c=Xs(a,t);if(!c)return null;e.push(c)}const s=Ds(i),r=Ws(e,s,i.closed,t);if(r.length<2)return null;const o=new gt;return r.forEach((a,c)=>{o.addVertexAt(c,{x:a.x,y:a.y})}),o.closed=i.closed,o}function Us(i){const t=[],n=i.numberOfVertices,e=i.closed?n:n-1;for(let s=0;s<e;s++){const r=i.vertices[s],o=i.vertices[(s+1)%n];M.isPositive(Math.abs(r.bulge??0))?t.push({kind:"arc",arc:new q(r,o,r.bulge)}):t.push({kind:"line",start:new P(r.x,r.y),end:new P(o.x,o.y)})}return t}function Ds(i){const t=[];for(let n=0;n<i.numberOfVertices;n++)t.push(i.getPointAt(n));return t}function Xs(i,t){if(i.kind==="line"){const e=Gs(i.start,i.end,t);return e?{kind:"line",...e}:null}const n=Ys(i.arc,i.arc.startPoint,i.arc.endPoint,t);return n?{kind:"arc",arc:n}:null}function Ys(i,t,n,e){const s=Zs(i,t,n,e),r=i.radius+s;return M.isNonPositive(r)?null:new q(i.center,r,i.startAngle,i.endAngle,i.clockwise)}function Zs(i,t,n,e){const s=n.x-t.x,r=n.y-t.y,o=Math.hypot(s,r);if(M.isNonPositive(o))return i.clockwise?-e:e;const a=-r/o,c=s/o,h=i.center.x-(t.x+n.x)/2,l=i.center.y-(t.y+n.y)/2;return h*a+l*c>0?-e:e}function Gs(i,t,n){const e=t.x-i.x,s=t.y-i.y,r=Math.hypot(e,s);if(M.isNonPositive(r))return null;const o=-s/r*n,a=e/r*n;return{start:new P(i.x+o,i.y+a),end:new P(t.x+o,t.y+a),dx:e,dy:s}}function Ws(i,t,n,e){var a;const s=i.length;if(s===0)return[];const r=Ks(i,t,n,e),o=[((a=r[0].nextSegmentStart)==null?void 0:a.clone())??r[0].point.clone()];for(let c=0;c<s;c++){const h=i[c],l=c===s-1&&!n?{point:ti(h)}:r[(c+1)%s];if(c>0&&r[c].filletPoints&&r[c].filletPoints.forEach(u=>o.push(u.clone())),h.kind==="arc"){const u=r[c].nextSegmentStart??r[c].point,d=l.point,g=Qs(h.arc,u,d,Math.max(16,32));for(let m=1;m<g.length;m++)o.push(g[m])}else o.push(l.point.clone())}return Le(o)}function Ks(i,t,n,e){const s=i.length,r=[];for(let o=0;o<s;o++)o===0?r.push(n?Ne(i[s-1],i[0],t[0],e):{point:Js(i[0])}):r.push(Ne(i[o-1],i[o],t[o],e));return r}function Qs(i,t,n,e){const s=i.nearestPoint(t),r=i.nearestPoint(n),o=zn(i,s),a=zn(i,r),c=Hs(i,o,a),h=[];for(let l=0;l<=e;l++){const u=l/e,d=i.clockwise?o-c*u:o+c*u;h.push(i.getPointAtAngle($s(i,d)))}return h}function zn(i,t){return Math.atan2(t.y-i.center.y,t.x-i.center.x)}function $s(i,t){const n=p.normalizeAngle(t);return i.clockwise?bn(n):n}function bn(i){return(360-i*180/Math.PI)%360*(Math.PI/180)}function Hs(i,t,n){if(i.clockwise){let s=t-n;return M.isNonPositive(s)&&(s+=b),s}let e=n-t;return M.isNonPositive(e)&&(e+=b),e}function Js(i){return i.kind==="line"?i.start.clone():i.arc.startPoint.clone()}function ti(i){return i.kind==="line"?i.end.clone():i.arc.endPoint.clone()}function Ne(i,t,n,e){return i.kind==="line"&&t.kind==="line"?{point:Sn({start:i.start,end:i.end,dx:i.dx,dy:i.dy},{start:t.start,end:t.end,dx:t.dx,dy:t.dy})}:i.kind==="line"&&t.kind==="arc"?Re(i,t.arc,n,e,!0):i.kind==="arc"&&t.kind==="line"?Re(t,i.arc,n,e,!1):i.kind==="arc"&&t.kind==="arc"?ni(i.arc,t.arc,n,e):{point:n.clone()}}function ni(i,t,n,e){const s=ve(i.endPoint,t.startPoint),o=oi(i,t).filter(l=>Yt(i,l)&&Yt(t,l));if(o.length>0)return{point:qe(o,s)};const a=i.endPoint.clone(),c=t.startPoint.clone(),h=Be(n,Math.abs(e),a,c);return{point:a,filletPoints:h,nextSegmentStart:c}}function Re(i,t,n,e,s){const r=ve(s?i.end:i.start,s?t.startPoint:t.endPoint),o=ri(i,t,r);if(si(i,o)&&Yt(t,o))return{point:o};const a=ei(i,n,e),c=s?t.startPoint.clone():t.endPoint.clone(),h=Be(n,Math.abs(e),s?a:c,s?c:a);return s?{point:a,filletPoints:h,nextSegmentStart:c}:{point:c,filletPoints:h,nextSegmentStart:a}}function ei(i,t,n){const e=Math.hypot(i.dx,i.dy),s=-i.dy/e*n,r=i.dx/e*n;return new P(t.x+s,t.y+r)}function si(i,t){const n=Math.hypot(i.dx,i.dy);if(M.isNonPositive(n))return!1;const e=i.dx/n,s=i.dy/n,r=t.x-i.start.x,o=t.y-i.start.y,a=Math.abs(r*s-o*e);return M.equalToZero(a)}function Be(i,t,n,e){const s=Math.atan2(n.y-i.y,n.x-i.x),r=Math.atan2(e.y-i.y,e.x-i.x),o=ii(s,r);if(M.equalToZero(Math.abs(o)))return[];const a=[],c=Math.max(2,Math.ceil(Math.abs(o)/Math.PI*16));for(let h=1;h<c;h++){const l=h/c,u=s+o*l;a.push(new P(i.x+t*Math.cos(u),i.y+t*Math.sin(u)))}return a}function ii(i,t){let n=t-i;for(;n>Math.PI;)n-=b;for(;n<=-Math.PI;)n+=b;return n}function ri(i,t,n){const e=Math.hypot(i.dx,i.dy);if(M.isNonPositive(e))return n.clone();const s=i.dx/e,r=i.dy/e,o=i.start.x-t.center.x,a=i.start.y-t.center.y,c=2*(o*s+a*r),h=o*o+a*a-t.radius*t.radius,l=c*c-4*h;if(l<0)return n.clone();const u=Math.sqrt(l),d=[(-c-u)/2,(-c+u)/2].map(m=>new P(i.start.x+s*m,i.start.y+r*m)),g=d.filter(m=>Yt(t,m));return qe(g.length>0?g:d,n)}function Yt(i,t){const n=Math.abs(Math.hypot(t.x-i.center.x,t.y-i.center.y)-i.radius);if(M.isPositive(n))return!1;const e=zn(i,t),s=i.clockwise?bn(p.normalizeAngle(i.startAngle)):p.normalizeAngle(i.startAngle),r=i.clockwise?bn(p.normalizeAngle(i.endAngle)):p.normalizeAngle(i.endAngle);return p.isBetweenAngle(e,s,r,i.clockwise)}function oi(i,t){const n=t.center.x-i.center.x,e=t.center.y-i.center.y,s=Math.hypot(n,e);if(M.isNonPositive(s))return[];const r=i.radius+t.radius,o=Math.abs(i.radius-t.radius);if(s>r+Xt)return[];if(s<o-Xt)return[];const a=(i.radius*i.radius-t.radius*t.radius+s*s)/(2*s),c=i.radius*i.radius-a*a;if(c<-Xt)return[];const h=i.center.x+a*n/s,l=i.center.y+a*e/s;if(c<=Xt)return[new P(h,l)];const u=Math.sqrt(c),d=-e*u/s,g=n*u/s;return[new P(h+d,l+g),new P(h-d,l-g)]}function qe(i,t){let n=i[0],e=n.distanceToSquared(t);for(let s=1;s<i.length;s++){const r=i[s].distanceToSquared(t);r<e&&(n=i[s],e=r)}return n.clone()}function ve(i,t){return new P((i.x+t.x)/2,(i.y+t.y)/2)}function ai(i){const t=i.numberOfVertices,n=i.closed?t:t-1;for(let e=0;e<n;e++){const s=i.vertices[e];if(M.isPositive(Math.abs(s.bulge??0)))return!0}return!1}function Ve(i){const t=ci(i.vertices.map(n=>new P(n.x,n.y)),i.closed);return t.length===i.numberOfVertices?i:new gt(t.map(n=>({x:n.x,y:n.y})),i.closed)}function ci(i,t){const n=Le(i);if(!t||n.length<2)return n;const e=n[0],s=n[n.length-1];return M.isNonPositive(Math.hypot(e.x-s.x,e.y-s.y))&&n.pop(),n}function Le(i){const t=[];return i.forEach(n=>{const e=t[t.length-1];(!e||M.isPositive(Math.hypot(e.x-n.x,e.y-n.y)))&&t.push(new P(n.x,n.y))}),t}function hi(i,t){const n=[];for(let o=0;o<i.numberOfVertices;o++)n.push(i.getPointAt(o));const e=li(n,i.closed,t);if(e.length===0)return null;const s=[];if(i.closed){if(e.length<2)return null;const o=e.length;for(let a=0;a<o;a++){const c=e[(a-1+o)%o],h=e[a];s.push(Sn(c,h))}}else{s.push(e[0].start);for(let o=1;o<e.length;o++)s.push(Sn(e[o-1],e[o]));s.push(e[e.length-1].end)}const r=new gt;return s.forEach((o,a)=>{r.addVertexAt(a,{x:o.x,y:o.y})}),r.closed=i.closed,r}function li(i,t,n){const e=[],s=t?i.length:i.length-1;for(let r=0;r<s;r++){const o=i[r],a=i[t?(r+1)%i.length:r+1],c=a.x-o.x,h=a.y-o.y,l=Math.hypot(c,h);if(M.isNonPositive(l))continue;const u=-h/l*n,d=c/l*n;e.push({start:new P(o.x+u,o.y+d),end:new P(a.x+u,a.y+d),dx:c,dy:h})}return e}function Sn(i,t){const n=i.dx*t.dy-i.dy*t.dx;if(M.equalToZero(n))return new P((i.end.x+t.start.x)/2,(i.end.y+t.start.y)/2);const e=t.start.x-i.start.x,s=t.start.y-i.start.y,r=(e*t.dy-s*t.dx)/n;return new P(i.start.x+r*i.dx,i.start.y+r*i.dy)}class gt extends zt{constructor(t=null,n=!1){super(),this._vertices=t||new Array,this._closed=n}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 P(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 n=this._vertices[0];return new P(n.x,n.y)}else{const n=this._vertices[t-1];return new P(n.x,n.y)}throw new Error("End point does not exist in an empty polyline.")}get length(){let t=0;const n=this._vertices.length;for(let e=0;e<n;++e){const s=this._vertices[e];let r=null;if(e<n-1?r=this._vertices[e+1]:e==n-1&&this.closed&&(r=this._vertices[0]),r)if(s.bulge){const o=new q(s,r,s.bulge);t+=o.length}else t+=new P(s.x,s.y).distanceTo(r)}return t}get area(){return js(this._vertices,this._closed)}set closed(t){this._closed=t,this._boundingBoxNeedsUpdate=!0}addVertexAt(t,n){t<=0?this._vertices.unshift(n):this._vertices.splice(t,0,n),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,n){t?n!==void 0&&n>=0&&n<this._vertices.length&&(this._vertices=this._vertices.slice(0,n),this._boundingBoxNeedsUpdate=!0):(this._vertices=new Array,this._boundingBoxNeedsUpdate=!0)}getPointAt(t){const n=this._vertices[t];return new P(n.x,n.y)}calculateBoundingBox(){const t=this.getPoints(100);return new K().setFromPoints(t)}transform(t){const n=t.determinant()<0;return this._vertices.forEach(e=>{const s=new P(e).applyMatrix2d(t);e.x=s.x,e.y=s.y,n&&e.bulge!=null&&(e.bulge=-e.bulge)}),this._boundingBoxNeedsUpdate=!0,this}clone(){return new gt(this._vertices.map(t=>({...t})),this._closed)}getPoints3d(t,n){const e=[];return this.getPoints(t).forEach(r=>e.push(new w().set(r.x,r.y,n))),e}getPoints(t){const n=[],e=this._vertices.length;for(let s=0;s<e;++s){const r=this._vertices[s];if(r.bulge){let o=null;if(s<e-1?o=this._vertices[s+1]:s==e-1&&this.closed&&(o=this._vertices[0]),o){const c=new q(r,o,r.bulge).getPoints(t),h=c.length;for(let l=0;l<h;++l){const u=c[l];n.push(new P(u.x,u.y))}}}else n.push(new P(r.x,r.y)),s==e-1&&this.closed&&n.push(n[0])}return n}tessellate(t){const n=[],e=this._vertices.length;for(let s=0;s<e;++s){const r=this._vertices[s];if(r.bulge){let o=null;if(s<e-1?o=this._vertices[s+1]:s===e-1&&this.closed&&(o=this._vertices[0]),o){const c=new q(r,o,r.bulge).tessellate(t);for(let h=0;h<c.length;++h)je(n,c[h])}}else je(n,r),s===e-1&&this.closed&&n.length>0&&n.push(n[0].clone())}return n}offset(t){return ke(this,t)}}function je(i,t){const n=i[i.length-1];if(n){const e=n.x-t.x,s=n.y-t.y;if(e*e+s*s<=C*C)return}i.push(new P(t.x,t.y))}function ui(i,t,n){const e=Math.hypot(t.x,t.y);if(M.isNonPositive(e))return null;const s=-t.y/e*n,r=t.x/e*n;return new w(i.x+s,i.y+r,i.z)}function di(i,t,n){if(i.length<2)return null;const e=Fs(new gt(i.map(r=>({x:r.x,y:r.y})),t));return ke(e,n)[0]??null}function gi(i,t,n,e){if(i.length<2||M.equalToZero(n))return null;const{points:s,tangents:r}=Oe(i,e);if(s.length<2)return null;const o=r??mi(s,t),a=fi(s,o,n),c=t?yi(a):xi(a);if(c.length<2)return null;const h=new gt;return c.forEach((l,u)=>{h.addVertexAt(u,{x:l.x,y:l.y})}),h.closed=t,h}function mi(i,t){const n=i.length,e=new Array(n);for(let s=0;s<n;s++){let r=0,o=0;if(t){const c=i[(s-1+n)%n],h=i[(s+1)%n];r=h.x-c.x,o=h.y-c.y}else s===0?(r=i[1].x-i[0].x,o=i[1].y-i[0].y):s===n-1?(r=i[n-1].x-i[n-2].x,o=i[n-1].y-i[n-2].y):(r=i[s+1].x-i[s-1].x,o=i[s+1].y-i[s-1].y);const a=Math.hypot(r,o);M.isNonPositive(a)?e[s]=new P(1,0):e[s]=new P(r/a,o/a)}return e}function fi(i,t,n){return i.map((e,s)=>{const r=t[s],o=-r.y*n,a=r.x*n;return new P(e.x+o,e.y+a)})}function xi(i){let t=Zt(i);if(t.length<3)return t;for(;;){const n=Fe(t,!1);if(!n||(t=Zt([...t.slice(0,n.segmentA+1),n.point,...t.slice(n.segmentB+1)]),t.length<2))break}return t}function yi(i){let t=Zt(i);if(t.length<4)return t;for(;;){const n=Fe(t,!0);if(!n||(t=Zt([...t.slice(0,n.segmentA+1),n.point,...t.slice(n.segmentB+1)]),t.length<3))break}return t}function Fe(i,t){const n=t?i.length:i.length-1;if(n<2)return null;for(let e=0;e<n;e++){const s=i[e],r=i[(e+1)%i.length];for(let o=e+1;o<n;o++){if(_i(e,o,n,t))continue;const a=i[o],c=i[(o+1)%i.length],h=Ai(s,r,a,c);if(h)return{point:h,segmentA:e,segmentB:o}}}return null}function _i(i,t,n,e){return!!(t===i||t===i+1||e&&i===0&&t===n-1)}function Ai(i,t,n,e){const s=t.x-i.x,r=t.y-i.y,o=e.x-n.x,a=e.y-n.y,c=s*a-r*o;if(M.equalToZero(c))return null;const h=n.x-i.x,l=n.y-i.y,u=(h*a-l*o)/c,d=(h*r-l*s)/c,g=Nt.equalPointTol;return u<-g||u>1+g||d<-g||d>1+g?null:new P(i.x+u*s,i.y+u*r)}function Oe(i,t){const n=[],e=[],s=t!=null&&t.length===i.length;return i.forEach((r,o)=>{const a=n[n.length-1];if((!a||M.isPositive(Math.hypot(a.x-r.x,a.y-r.y)))&&(n.push(new P(r.x,r.y)),s)){const c=t[o];e.push(new P(c.x,c.y))}}),{points:n,tangents:s?e:void 0}}function Zt(i){return Oe(i).points}class Cn extends Mn{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 K}transform(t){return this._loops.forEach(n=>{n.transform(t)}),this._boundingBoxNeedsUpdate=!0,this}clone(){const t=new Cn;return this._loops.forEach(n=>{t.add(n.clone())}),t}getPoints(t){const n=[];for(let e=0;e<this.loops.length;++e){const r=this.loops[e].getPoints(t);n.push(r)}return n}tessellate(t){return this.loops.map(n=>n.tessellate(t))}buildHierarchy(t){var c;const n=this.tessellate(t),e=this.calculateBoundaryBoxes(n),s=this.sortBoundaryBoxesByAreas(e),r=new Map,o=s.length;for(let h=0;h<o;h++)r.set(s[h],{index:s[h],children:[]});const a={index:-1,children:[]};for(let h=0;h<o;h++){const l=s[h],u=n[l],d=e[l];let g=h+1;for(;g<o;g++){const m=s[g],f=n[m],x=e[m];if(x.containsBox(d)&&Pi(u,f,x)){(c=r.get(m))==null||c.children.push(r.get(l));break}}g===o&&a.children.push(r.get(l))}return a}get area(){if(this._loops.length===0)return 0;let t=0;for(let n=0;n<this._loops.length;n++){const s=this._loops[n].getPoints(128),r=xn(s);n===0?t+=Math.abs(r):t-=Math.abs(r)}return t}calculateBoundaryBoxes(t){const n=[];return t.forEach(e=>{n.push(new K().setFromPoints(e))}),n}sortBoundaryBoxesByAreas(t){const n=[];t.forEach((s,r)=>{const o=s.size,a=o.width*o.height;n.push({area:a,index:r})}),n.sort((s,r)=>s.area-r.area);const e=[];return n.forEach(s=>{e.push(s.index)}),e}}function Pi(i,t,n){const e=n.size,s=Math.max(Math.max(e.width,e.height)*1e-9,C);for(const r of i)if(pi(r,t)>s)return U.isPointInPolygon(r,t);return!1}function pi(i,t){let n=1/0;for(let e=0,s=t.length-1;e<t.length;s=e++){const r=t[s],o=t[e],a=o.x-r.x,c=o.y-r.y,h=a*a+c*c;let l=h>0?((i.x-r.x)*a+(i.y-r.y)*c)/h:0;l=Math.max(0,Math.min(1,l)),n=Math.min(n,Math.hypot(i.x-(r.x+a*l),i.y-(r.y+c*l)))}return n}class wi extends Te{translate(t){return this.transform(new ot().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 ft extends wi{static tessellateParametricCurve(t,n,e,s){const r=Math.max(2,Math.round(s.maxSegments)),o=Math.max(1,Math.round(s.minSegments)),a=Math.max(0,s.deviation)*Math.max(0,s.deviation);if(!Number.isFinite(t)||!Number.isFinite(n))return[e(0)];if(Math.abs(n-t)<=C)return[e(t)];const c=Math.min(r,Math.max(2,o+1)),h=Math.min(r,Math.max(c,8));let l=zi(t,n,h);const u=[];for(let g=0;g<l.length;g++)u.push(e(l[g]));let d=u.length;for(let g=0;g<8&&d<r;g++){const m=[];for(let x=0;x<l.length-1&&!(d>=r);x++){const y=(l[x]+l[x+1])/2,S=e(y);d++,Mi(S,u[x],u[x+1])>a&&m.push({index:x,t:y,point:S})}if(m.length===0)break;const f=bi(l,u,m);l=f.params,u.length=0;for(let x=0;x<f.points.length;x++)u.push(f.points[x])}return u}}function Mi(i,t,n){const e=n.x-t.x,s=n.y-t.y,r=n.z-t.z,o=i.x-t.x,a=i.y-t.y,c=i.z-t.z,h=e*e+s*s+r*r;if(h<=C*C)return o*o+a*a+c*c;const l=G((o*e+a*s+c*r)/h,0,1),u=o-e*l,d=a-s*l,g=c-r*l;return u*u+d*d+g*g}function zi(i,t,n){if(n<=1)return[i];const e=[];for(let s=0;s<n;s++)e.push(s===n-1?t:i+(t-i)*s/(n-1));return e}function bi(i,t,n){const e=[],s=[];let r=0;for(let o=0;o<i.length;o++)for(e.push(i[o]),s.push(t[o]);r<n.length&&n[r].index===o;)e.push(n[r].t),s.push(n[r].point),r++;return{params:e,points:s}}class Q extends ft{static computeCenterPoint(t,n,e){var s;return((s=Me(t,e,n))==null?void 0:s.center)??null}static tryCreateByThreePoints(t,n,e){const s=Me(t,e,n);if(!s)return null;const{center:r,radius:o}=s,a=new _(t.x-r.x,t.y-r.y,(t.z??0)-r.z),c=new _(e.x-r.x,e.y-r.y,(e.z??0)-r.z),h=new _(n.x-r.x,n.y-r.y,(n.z??0)-r.z);if(a.lengthSq()===0||h.lengthSq()===0)return null;const l=new _().crossVectors(a,h);if(l.lengthSq()===0&&(l.crossVectors(a,c),l.lengthSq()===0))return null;l.normalize();const u=a.clone().normalize(),d=new _().crossVectors(l,u),g=f=>p.normalizeAngle(Math.atan2(f.dot(d),f.dot(u)));p.isAngleOnCcwSweep(0,g(c),g(h))||(l.negate(),d.negate());let m=g(h);return M.equalToZero(m)&&(m=b),new Q(r,o,0,m,l,u)}static createByThreePoints(t,n,e){return Q.tryCreateByThreePoints(t,n,e)}constructor(t,n,e,s,r,o=_.X_AXIS){super(),this.center=t,this.radius=n,this.startAngle=e,this.endAngle=s,this.normal=r,this.refVec=o,(s-e)%b==0?(this.startAngle=0,this.endAngle=b):(this.startAngle=e,this.endAngle=s)}get center(){return this._center}set center(t){this._center=new w(t.x,t.y,t.z||0),this._boundingBoxNeedsUpdate=!0}get radius(){return this._radius}set radius(t){if(t<0)throw V.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==b?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,n=this.deltaAngle;this.closed&&(t=0,n=b);const e=t+n*.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:0}nearestPoint(t){const n=new _(t.x,t.y,t.z||0),e=this.center,s=this.normal,o=n.clone().sub(e).dot(s),c=n.clone().sub(s.clone().multiplyScalar(o)).clone().sub(e);if(c.lengthSq()===0)return this.startPoint.clone();c.normalize().multiplyScalar(this.radius);const h=e.clone().add(c),l=this.getAngle(h.clone()),u=this.startAngle,d=this.deltaAngle;let g=p.normalizeAngle(l-u);g<0&&(g=0),g>d&&(g=d);const m=this.getPointAtAngle(u+g),f=m.distanceTo(n),x=this.startPoint.distanceTo(n),y=this.endPoint.distanceTo(n);return x<f&&x<=y?this.startPoint.clone():y<f&&y<x?this.endPoint.clone():m}tangentPoints(t){const n=[],e=new _(t.x,t.y,t.z||0),s=this.center,r=this.normal,o=this.radius,c=e.clone().sub(s).dot(r),h=e.clone().sub(r.clone().multiplyScalar(c)),l=s.clone(),d=h.clone().sub(l).length();if(d<o)return n;const g=Math.acos(o/d),m=this.getAngle(h.clone()),f=[m+g,m-g];for(const x of f){const y=p.normalizeAngle(x-this.startAngle);y>=0&&y<=this.deltaAngle&&n.push(this.getPointAtAngle(this.startAngle+y))}return n}perpendicularPoints(t){const n=[],e=new _(t.x,t.y,t.z||0),s=this.center,r=this.normal,o=this.radius,c=e.clone().sub(s).dot(r),l=e.clone().sub(r.clone().multiplyScalar(c)).clone().sub(s);if(l.lengthSq()<1e-24)return n;l.normalize();const u=[s.clone().add(l.clone().multiplyScalar(o)),s.clone().sub(l.clone().multiplyScalar(o))];for(const d of u){const g=this.getAngle(d.clone()),m=p.normalizeAngle(g-this.startAngle);m>=0&&m<=this.deltaAngle&&n.push(new w(d.x,d.y,d.z||0))}return n}nearestTangentPoint(t){const n=this.tangentPoints(t);if(n.length===0)return null;const e=new w(t.x,t.y,t.z||0);return n.length===1||n[0].distanceTo(e)<n[1].distanceTo(e)?n[0]:n[1]}calculateBoundingBox(){const t=[this.startAngle,this.endAngle];for(let c=0;c<2*Math.PI;c+=Math.PI/2)p.isBetweenAngle(c,this.startAngle,this.endAngle)&&t.push(c);let n=1/0,e=1/0,s=1/0,r=-1/0,o=-1/0,a=-1/0;for(const c of t){const h=this.getPointAtAngle(c);h.x<n&&(n=h.x),h.y<e&&(e=h.y),h.z<s&&(s=h.z),h.x>r&&(r=h.x),h.y>o&&(o=h.y),h.z>a&&(a=h.z)}return new W({x:n,y:e,z:s},{x:r,y:o,z:a})}get closed(){return Math.abs(this.endAngle-this.startAngle)/Math.PI%2==0}getPoints(t){const n=[];let e=this.deltaAngle,s=this.startAngle;this.closed&&(e=b,s=0);for(let r=0;r<=t;r++){const o=s+e*(r/t),a=this.getPointAtAngle(o);n.push(a)}return n}tessellate(t){const n=this.closed?b:this.deltaAngle,e=Q.segmentCount(this.radius,n,{...t,minSegments:(t==null?void 0:t.minSegments)??(this.closed?8:3)});return this.getPoints(e)}static segmentCount(t,n,e){return q.segmentCount(t,n,e)}transform(t){const n=this.center.clone().applyMatrix4(t),e=this.startPoint.clone().applyMatrix4(t),s=this.endPoint.clone().applyMatrix4(t),r=this.getPointAtAngle(this.closed?Math.PI/2:this.startAngle+this.deltaAngle/2).clone().applyMatrix4(t),o=new _(e).sub(n).normalize(),a=n.distanceTo(e);let c=new _().crossVectors(new _(e).sub(n),new _(r).sub(n)).normalize();c.lengthSq()===0&&(c=this.normal.clone().transformDirection(t));const h=l=>{const u=new _(l).sub(n);return Math.atan2(u.dot(Ue.crossVectors(c,o)),u.dot(o))};return this.center=n,this.radius=a,this.normal=c,this.refVec=o,this.startAngle=0,this.endAngle=this.closed?b:h(s),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 Q(this.center.clone(),this.radius,this.startAngle,this.endAngle,this.normal,this.refVec)}getAngle(t){return t.sub(this.center),Math.atan2(t.dot(Ue.crossVectors(this.refVec,this.normal)),t.dot(this.refVec))}getPointAtAngle(t){const n=this.normal,e=this.refVec,s={x:n.y*e.z-n.z*e.y,y:n.z*e.x-n.x*e.z,z:n.x*e.y-n.y*e.x},r=this.center,o=this.radius;return new w(r.x+o*(e.x*Math.cos(t)+s.x*Math.sin(t)),r.y+o*(e.y*Math.cos(t)+s.y*Math.sin(t)),r.z+o*(e.z*Math.cos(t)+s.z*Math.sin(t)))}get plane(){const t=new _(this.center).distanceTo(dn);return new Mt(this.normal,t)}offset(t){const n=this.radius+t;return n<=0?null:new Q(this.center,n,this.startAngle,this.endAngle,this.normal,this.refVec)}}const Ue=new _;class xt extends zt{constructor(t,n,e,s=0,r=b,o=!1,a=0){super(),this.center=t,this.majorAxisRadius=n,this.minorAxisRadius=e,(r-s)%b==0?(this.startAngle=0,this.endAngle=b):(this.startAngle=s,this.endAngle=r),this.clockwise=o,this.rotation=a}get center(){return this._center}set center(t){this._center=new w(t.x,t.y,t.z||0),this._boundingBoxNeedsUpdate=!0}get majorAxisRadius(){return this._majorAxisRadius}set majorAxisRadius(t){if(t<0)throw V.AcCmErrors.ILLEGAL_PARAMETERS;this._majorAxisRadius=t,this._boundingBoxNeedsUpdate=!0}get minorAxisRadius(){return this._minorAxisRadius}set minorAxisRadius(t){if(t<0)throw V.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==b?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 n=1/0,e=1/0,s=-1/0,r=-1/0;for(let o=0;o<=100;o++){const a=this.getPoint(o/100);n=Math.min(n,a.x),e=Math.min(e,a.y),s=Math.max(s,a.x),r=Math.max(r,a.y)}return new K({x:n,y:e},{x:s,y:r})}get closed(){return this.deltaAngle==0}getPoint(t){const n=Math.PI*2;let e=this.endAngle-this.startAngle;const s=Math.abs(e)<Number.EPSILON;for(;e<0;)e+=n;for(;e>n;)e-=n;e<Number.EPSILON&&(s?e=0:e=n),this.clockwise===!0&&!s&&(e===n?e=-n:e=e-n);const r=this.startAngle+t*e;let o=this.center.x+this.majorAxisRadius*Math.cos(r),a=this.center.y+this.minorAxisRadius*Math.sin(r);if(this.rotation!==0){const c=Math.cos(this.rotation),h=Math.sin(this.rotation),l=o-this.center.x,u=a-this.center.y;o=l*c-u*h+this.center.x,a=l*h+u*c+this.center.y}return new P(o,a)}transform(t){const n=t,e=new P(this.center).applyMatrix2d(n),s=new w(e.x,e.y,this.center.z),r=this.getPointAtAngle(0).clone().applyMatrix2d(n),o=this.getPointAtAngle(Math.PI/2).clone().applyMatrix2d(n),a=new P(r).sub(e),c=new P(o).sub(e),h=a.length(),l=c.length(),u=Math.atan2(a.y,a.x),d=a.clone().normalize(),g=c.clone().normalize(),m=y=>{const S=new P(y).sub(e),k=S.dot(d),N=S.dot(g);return p.normalizeAngle(Math.atan2(N/l,k/h))},f=n.determinant()<0?!this.clockwise:this.clockwise,x=this.closed?new xt(s,h,l,0,b,f,u):new xt(s,h,l,m(this.startPoint.clone().applyMatrix2d(n)),m(this.endPoint.clone().applyMatrix2d(n)),f,u);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/b: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 xt(this.center,this.majorAxisRadius,this.minorAxisRadius,this.startAngle,this.endAngle,this.clockwise,this.rotation)}getFocusPoints(){const t=Math.max(this.majorAxisRadius,this.minorAxisRadius),n=Math.min(this.majorAxisRadius,this.minorAxisRadius);if(t-n<1e-9)return[];const e=Math.sqrt(t*t-n*n),s=Math.cos(this.rotation),r=Math.sin(this.rotation),o=this.majorAxisRadius>=this.minorAxisRadius,a=o?s:-r,c=o?r:s;return[new P(this.center.x-e*a,this.center.y-e*c),new P(this.center.x+e*a,this.center.y+e*c)]}getQuadrantPoints(){return this.closed?[this.getPoint(0),this.getPoint(.25),this.getPoint(.5),this.getPoint(.75)]:[]}nearestPoint(t){const n=new P(t.x,t.y);let e=this.getPoint(0),s=n.distanceToSquared(e);const r=72;for(let o=1;o<=r;o++){const a=this.getPoint(o/r),c=n.distanceToSquared(a);c<s&&(s=c,e=a)}return e}tangentPoints(t){const n=this._projectPointToLocal(t);return this._findSnapAngles(n,(s,r,o,a)=>{const c=-this.majorAxisRadius*a,h=this.minorAxisRadius*o;return(s-n.x)*h-(r-n.y)*c}).map(s=>this.getPointAtAngle(s))}perpendicularPoints(t){const n=this._projectPointToLocal(t);return this._findSnapAngles(n,(s,r,o,a)=>{const c=this.minorAxisRadius*o,h=this.majorAxisRadius*a;return(s-n.x)*h-(r-n.y)*c}).map(s=>this.getPointAtAngle(s))}_projectPointToLocal(t){const n=t.x-this.center.x,e=t.y-this.center.y,s=Math.cos(-this.rotation),r=Math.sin(-this.rotation);return{x:n*s-e*r,y:n*r+e*s}}_findSnapAngles(t,n,e=144){const s=this.majorAxisRadius,r=this.minorAxisRadius,o=this.startAngle,a=this.deltaAngle,c=[],h=d=>{const g=Math.cos(d),m=Math.sin(d);return n(s*g,r*m,g,m)};let l=o,u=h(l);for(let d=1;d<=e;d++){const g=o+a*d/e,m=h(g);if(Math.abs(u)<1e-10&&c.push(l),u*m<0){let f=l,x=g;for(let y=0;y<32;y++){const S=(f+x)/2;h(f)*h(S)<=0?x=S:f=S}c.push((f+x)/2)}l=g,u=m}return c}}class tt extends ft{constructor(t,n,e,s,r,o=0,a=b){super(),this.center=t,this.normal=n,this.majorAxis=e,this.majorAxisRadius=s,this.minorAxisRadius=r;const c=Math.abs(a-o);Math.abs(c-b)<1e-10||Math.abs(c-2*b)<1e-10?(this.startAngle=0,this.endAngle=b):(this.startAngle=o,this.endAngle=a)}get center(){return this._center}set center(t){this._center=new w(t.x,t.y,t.z||0),this._boundingBoxNeedsUpdate=!0}get majorAxisRadius(){return this._majorAxisRadius}set majorAxisRadius(t){if(t<0)throw V.AcCmErrors.ILLEGAL_PARAMETERS;this._majorAxisRadius=t,this._boundingBoxNeedsUpdate=!0}get minorAxisRadius(){return this._minorAxisRadius}set minorAxisRadius(t){if(t<0)throw V.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==b?t:p.normalizeAngle(t),this._boundingBoxNeedsUpdate=!0}get deltaAngle(){const t=this.endAngle-this.startAngle;return Math.abs(t-b)<1e-10?b: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,n=this.deltaAngle;(this.closed||Math.abs(n-b)<1e-10)&&(t=0,n=b);const e=t+n/2;return this.getPointAtAngle(e)}get isCircular(){return M.equal(this.majorAxisRadius,this.minorAxisRadius)}get length(){if(this.isCircular)return this.majorAxisRadius*Math.abs(this.deltaAngle);const t=1e3,n=this.deltaAngle/t;let e=0,s=this.getPointAtAngle(this.startAngle);for(let r=1;r<=t;r++){const o=this.startAngle+r*n,a=this.getPointAtAngle(o),c=a.x-s.x,h=a.y-s.y,l=a.z-s.z;e+=Math.sqrt(c*c+h*h+l*l),s=a}return e}get area(){return Math.abs(this.deltaAngle-b)>=1e-10?0:Math.PI*this.majorAxisRadius*this.minorAxisRadius}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 c=0;c<2*Math.PI;c+=Math.PI/2)p.isBetweenAngle(c,this.startAngle,this.endAngle)&&t.push(c);let n=1/0,e=1/0,s=1/0,r=-1/0,o=-1/0,a=-1/0;for(const c of t){const h=this.getPointAtAngle(c);h.x<n&&(n=h.x),h.y<e&&(e=h.y),h.z<s&&(s=h.z),h.x>r&&(r=h.x),h.y>o&&(o=h.y),h.z>a&&(a=h.z)}return new W({x:n,y:e,z:s},{x:r,y:o,z:a})}else{let n=1/0,e=1/0,s=1/0,r=-1/0,o=-1/0,a=-1/0;for(let c=0;c<=100;c++){const h=this.startAngle+this.deltaAngle*(c/100),l=this.getPointAtAngle(h);n=Math.min(n,l.x),e=Math.min(e,l.y),s=Math.min(s,l.z),r=Math.max(r,l.x),o=Math.max(o,l.y),a=Math.max(a,l.z)}return new W({x:n,y:e,z:s},{x:r,y:o,z:a})}}get closed(){return this.deltaAngle==0}getPoints(t=100){const n=[];let e=this.deltaAngle,s=this.startAngle;this.closed&&(e=b,s=0);for(let r=0;r<=t;r++){const o=s+e*(r/t),a=this.getPointAtAngle(o);n.push(a)}return n}tessellate(t){const n=q.resolveTessellateOptions(t),e=this.closed?b:this.deltaAngle,s=Math.max(this.majorAxisRadius,this.minorAxisRadius),r=Math.abs(e)>=b-1e-8,o=n.minSegments??(r?8:3);if(this.isCircular){const h=Q.segmentCount(s,e,{...t,minSegments:o});return this.getPoints(h)}const a=n.deviation??q.chordDeviationFromRadius(s,n.circleSides),c=this.closed?0:this.startAngle;return ft.tessellateParametricCurve(c,c+e,h=>this.getPointAtAngle(h),{deviation:Math.max(C,a),minSegments:o,maxSegments:n.maxSegments})}getPointAtAngle(t){const n=Math.cos(t),e=Math.sin(t),s=this.minorAxis.clone().multiplyScalar(this.minorAxisRadius).multiplyScalar(e),r=this.majorAxis.clone().multiplyScalar(n*this.majorAxisRadius).add(s);return new w(this.center.x+r.x,this.center.y+r.y,this.center.z+r.z)}nearestPoint(t,n=72){const e=new w(t.x,t.y,t.z||0);let s=this.getPointAtAngle(this.startAngle),r=e.distanceToSquared(s);for(let c=1;c<=n;c++){const h=this.startAngle+this.deltaAngle*c/n,l=this.getPointAtAngle(h),u=e.distanceToSquared(l);u<r&&(r=u,s=l)}const o=e.distanceToSquared(this.startPoint),a=e.distanceToSquared(this.endPoint);return o<r&&o<=a?this.startPoint.clone():a<r&&a<o?this.endPoint.clone():s.clone()}tangentPoints(t){const n=this._projectPointToLocalPlane(t);return this._findSnapParameterAngles((s,r,o,a)=>{const c=-this.majorAxisRadius*a,h=this.minorAxisRadius*o;return(s-n.x)*h-(r-n.y)*c}).map(s=>this.getPointAtAngle(s))}perpendicularPoints(t){const n=this._projectPointToLocalPlane(t);return this._findSnapParameterAngles((s,r,o,a)=>{const c=this.minorAxisRadius*o,h=this.majorAxisRadius*a;return(s-n.x)*h-(r-n.y)*c}).map(s=>this.getPointAtAngle(s))}_projectPointToLocalPlane(t){const n=new w(t.x,t.y,t.z||0),e=new _(n).sub(this.center),s=e.dot(this.normal);return e.sub(this.normal.clone().multiplyScalar(s)),{x:e.dot(this.majorAxis),y:e.dot(this.minorAxis)}}_findSnapParameterAngles(t,n=144){const e=this.majorAxisRadius,s=this.minorAxisRadius,r=this.startAngle,o=this.deltaAngle,a=[],c=u=>{const d=Math.cos(u),g=Math.sin(u);return t(e*d,s*g,d,g)};let h=r,l=c(h);for(let u=1;u<=n;u++){const d=r+o*u/n,g=c(d);if(Math.abs(l)<1e-10&&a.push(h),l*g<0){let m=h,f=d;for(let x=0;x<32;x++){const y=(m+f)/2;c(m)*c(y)<=0?f=y:m=y}a.push((m+f)/2)}h=d,l=g}return a}contains(t){const n=new _(t).sub(this.center),e=n.dot(this.majorAxis),s=n.dot(this.minorAxis),r=e/this.majorAxisRadius,o=s/this.minorAxisRadius;return r*r+o*o<=1}transform(t){const n=t,e=this.center.clone().applyMatrix4(n),s=this.getPointAtAngle(0).clone().applyMatrix4(n),r=this.getPointAtAngle(Math.PI/2).clone().applyMatrix4(n),o=new _(s).sub(e),a=new _(r).sub(e),c=o.length(),h=a.length(),l=o.clone().normalize(),u=new _().crossVectors(o,a).normalize();let d=new _().crossVectors(u,l).normalize();d.dot(a)<0&&(u.negate(),d=new _().crossVectors(u,l).normalize());const g=f=>{const x=new _(f).sub(e),y=x.dot(l),S=x.dot(d);return p.normalizeAngle(Math.atan2(S/h,y/c))},m=this.closed?new tt(e,u,l,c,h,0,b):new tt(e,u,l,c,h,g(this.startPoint.clone().applyMatrix4(n)),g(this.endPoint.clone().applyMatrix4(n)));return this.center=m.center,this.normal=m.normal,this.majorAxis=m.majorAxis,this.majorAxisRadius=m.majorAxisRadius,this.minorAxisRadius=m.minorAxisRadius,this._startAngle=m._startAngle,this._endAngle=m._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 tt(this.center,this.normal,this.majorAxis,this.majorAxisRadius,this.minorAxisRadius,this.startAngle,this.endAngle)}get plane(){const t=new _(this.center).distanceTo(dn);return new Mt(this.normal,t)}offset(t){const n=this.majorAxisRadius+t,e=this.minorAxisRadius+t;return n<=0||e<=0?null:new tt(this.center,this.normal,this.majorAxis,n,e,this.startAngle,this.endAngle)}}class bt extends zt{constructor(t,n){super(),this._start=new P(t),this._end=new P(n)}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 P(Math.min(this._start.x,this._end.x),Math.min(this._start.y,this._end.y)),n=new P(Math.max(this._start.x,this._end.x),Math.max(this._start.y,this._end.y));return new K(t,n)}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 bt(this._start.clone(),this._end.clone())}project(t){const n=this._end.x-this._start.x,e=this._end.y-this._start.y,s=n*n+e*e;if(s<1e-18)return this._start.clone();let r=((t.x-this._start.x)*n+(t.y-this._start.y)*e)/s;return r=Math.max(0,Math.min(1,r)),new P(this._start.x+r*n,this._start.y+r*e)}nearestPoint(t){return this.project(t)}}class Gt extends ft{constructor(t,n){super(),this._start=new w(t),this._end=new w(n)}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 w((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,n){return this.delta(n).multiplyScalar(t).add(this._start)}atLength(t,n=!1){if(n){const e=this.delta(yt).normalize();return new w(this._start).addScaledVector(e,t)}else{const e=this.delta(yt).normalize();return new w(this._end).addScaledVector(e,t)}}extend(t,n=!1){if(n){const e=yt.subVectors(this._start,this._end).normalize();this._start=new w(this._start).addScaledVector(e,t)}else{const e=this.delta(yt).normalize();this._end=new w(this._end).addScaledVector(e,t)}return this._boundingBoxNeedsUpdate=!0,this}closestPointToPointParameter(t,n){De.subVectors(t,this._start),Wt.subVectors(this.endPoint,this.startPoint);const e=Wt.dot(Wt);let r=Wt.dot(De)/e;return n&&(r=p.clamp(r,0,1)),r}closestPointToPoint(t,n,e){const s=this.closestPointToPointParameter(t,n);return this.delta(e).multiplyScalar(s).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 n=this.direction,s=yt.subVectors(t,this.startPoint).dot(n);return new w().copy(n).multiplyScalar(s).add(this.startPoint)}perpPoint(t){const n=this.direction,e=this.startPoint,r=yt.subVectors(t,e).dot(n),o=yt.copy(n).multiplyScalar(r);return new w().addVectors(e,o)}calculateBoundingBox(){const t=new w(Math.min(this._start.x,this._end.x),Math.min(this._start.y,this._end.y),Math.min(this._start.z,this._end.z)),n=new w(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 W(t,n)}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 Gt(this._start.clone(),this._end.clone())}offset(t){const n=this.startPoint,e=this.endPoint;if(Math.hypot(e.x-n.x,e.y-n.y)===0)return this.clone();const r=new _(e.x-n.x,e.y-n.y,0).normalize(),o=new _(-r.y,r.x,0);return new Gt(new w(n.x+o.x*t,n.y+o.y*t,n.z),new w(e.x+o.x*t,e.y+o.y*t,e.z))}}const yt=new _,De=new _,Wt=new _;class En{constructor(){this.c0=0,this.c1=0,this.c2=0,this.c3=0}init(t,n,e,s){this.c0=t,this.c1=e,this.c2=-3*t+3*n-2*e-s,this.c3=2*t-2*n+e+s}initCatmullRom(t,n,e,s,r){this.init(n,e,r*(e-t),r*(s-n))}initNonuniformCatmullRom(t,n,e,s,r,o,a){let c=(n-t)/r-(e-t)/(r+o)+(e-n)/o,h=(e-n)/o-(s-n)/(o+a)+(s-e)/a;c*=o,h*=o,this.init(n,e,c,h)}calc(t){const n=t*t,e=n*t;return this.c0+this.c1*t+this.c2*n+this.c3*e}}class Kt extends ft{constructor(t=[],n=!1,e="centripetal",s=.5){super(),this.isCatmullRomCurve3d=!0,this.type="CatmullRomCurve3d",this._tmp=new _,this._px=new En,this._py=new En,this._pz=new En,this._points=t.map(r=>new w(r)),this._closed=n,this._curveType=e,this._tension=s}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 w}get endPoint(){return this._points.length>0?this._points[this._points.length-1]:new w}get length(){if(this._points.length<2)return 0;let t=0;for(let n=1;n<this._points.length;n++)t+=this._points[n-1].distanceTo(this._points[n]);return this._closed&&this._points.length>2&&(t+=this._points[this._points.length-1].distanceTo(this._points[0])),t}getPoint(t,n=new w){const e=n,s=this._points,r=s.length;if(r===0)return e.set(0,0,0);if(r===1)return e.copy(s[0]);const o=(r-(this._closed?0:1))*t;let a=Math.floor(o),c=o-a;this._closed?a+=a>0?0:(Math.floor(Math.abs(a)/r)+1)*r:c===0&&a===r-1&&(a=r-2,c=1);let h,l;this._closed||a>0?h=s[(a-1)%r]:(this._tmp.subVectors(s[0],s[1]).add(s[0]),h=new w(this._tmp.x,this._tmp.y,this._tmp.z));const u=s[a%r],d=s[(a+1)%r];if(this._closed||a+2<r?l=s[(a+2)%r]:(this._tmp.subVectors(s[r-1],s[r-2]).add(s[r-1]),l=new w(this._tmp.x,this._tmp.y,this._tmp.z)),this._curveType==="centripetal"||this._curveType==="chordal"){const g=this._curveType==="chordal"?.5:.25;let m=Math.pow(h.distanceToSquared(u),g),f=Math.pow(u.distanceToSquared(d),g),x=Math.pow(d.distanceToSquared(l),g);f<1e-4&&(f=1),m<1e-4&&(m=f),x<1e-4&&(x=f),this._px.initNonuniformCatmullRom(h.x,u.x,d.x,l.x,m,f,x),this._py.initNonuniformCatmullRom(h.y,u.y,d.y,l.y,m,f,x),this._pz.initNonuniformCatmullRom(h.z,u.z,d.z,l.z,m,f,x)}else this._curveType==="catmullrom"&&(this._px.initCatmullRom(h.x,u.x,d.x,l.x,this._tension),this._py.initCatmullRom(h.y,u.y,d.y,l.y,this._tension),this._pz.initCatmullRom(h.z,u.z,d.z,l.z,this._tension));return e.set(this._px.calc(c),this._py.calc(c),this._pz.calc(c)),e}getPoints(t){const n=[];for(let e=0;e<=t;e++)n.push(this.getPoint(e/t));return n}setPoints(t){this._points=t.map(n=>new w(n)),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 Kt(this._points.map(t=>t.clone()),this._closed,this._curveType,this._tension)}transform(t){return this._points=this._points.map(n=>{const e=new w;return e.copy(n),e.applyMatrix4(t),e}),this._boundingBoxNeedsUpdate=!0,this}calculateBoundingBox(){if(this._points.length===0)return new W;const t=new W;return this._points.forEach(n=>{t.expandByPoint(n)}),t}}function Xe(i,t){const n=i.x-t[0],e=i.y-t[1],s=(i.z??0)-(t[2]??0);return n*n+e*e+s*s}class L{constructor(t,n,e,s){this._degree=t,this._knots=[...n],this._controlPoints=e.map(r=>({x:r.x,y:r.y,z:r.z})),this._weights=s?[...s]: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){return this.evaluate(t).point}evaluate(t){const n=this._controlPoints.map(e=>[e.x,e.y,e.z]);return xe(t,this._degree,this._knots,n,this._weights)}signedPlanarCurvatureAt(t){const n=this.evaluate(t);return ye(n.deriv1,n.deriv2)}getOffsetSamplePath2d(t,n=512){const e=Math.abs(t),{start:s,end:r}=this.getParameterRange(),o=this.length(),a=Math.max(64,Math.ceil(o/Math.max(e*.2,1e-6)));let c=Si(s,r,Math.min(a,n));for(let u=0;u<8&&c.length<n;u++){const d=[];for(let g=0;g<c.length-1;g++){const m=c[g],f=c[g+1],x=(m+f)/2,y=Math.max(Math.abs(this.signedPlanarCurvatureAt(m)),Math.abs(this.signedPlanarCurvatureAt(f)),Math.abs(this.signedPlanarCurvatureAt(x)));e*y>.85&&d.push(x)}if(d.length===0)break;if(c=Ci(c,d),c.length>n){c=c.slice(0,n);break}}const h=[],l=[];return c.forEach(u=>{const d=this.evaluate(u);h.push(new P(d.point[0],d.point[1]));const g=d.deriv1[0],m=d.deriv1[1],f=Math.hypot(g,m);l.push(f>1e-10?new P(g/f,m/f):new P(1,0))}),{points:h,tangents:l}}length(){const t=this._controlPoints.map(n=>[n.x,n.y,n.z]);return _e(this._degree,this._knots,t,this._weights)}static byKnotsControlPointsWeights(t,n,e,s){return new L(t,n,e,s)}static byPoints(t,n,e="Uniform",s,r){const o=yn(t,n,e,s,r),a=o.controlPoints.map(c=>({x:c[0],y:c[1],z:c[2]}));return new L(n,o.knots,a,o.weights)}getParameterRange(){const t=this._knots[this._degree],n=this._knots[this._knots.length-this._degree-1];return{start:t,end:n}}getPoints(t){const n=[],{start:e,end:s}=this.getParameterRange();for(let r=0;r<=t;r++){const o=e+(s-e)*(r/t);n.push(this.point(o))}return n}isClosed(t=1e-6){const{start:n,end:e}=this.getParameterRange(),s=this.point(n),r=this.point(e),o=s[0]-r[0],a=s[1]-r[1],c=s[2]-r[2];return Math.sqrt(o*o+a*a+c*c)<t}static createFitPointsForClosedCurve(t){if(t.length<4)throw new Error("At least 4 points are required for a closed NURBS curve");const n=new Kt(t,!0,"centripetal"),e=Math.max(50,t.length*2);return n.getPoints(e)}nearestPoint(t,n=64){const{start:e,end:s}=this.getParameterRange();let r=this.point(e),o=Xe(t,r);for(let a=0;a<=n;a++){const c=e+(s-e)*a/n,h=this.point(c),l=Xe(t,h);l<o&&(o=l,r=h)}return{x:r[0],y:r[1],z:r[2]??0}}static createClosedCurve(t,n,e="Chord"){const r=this.createFitPointsForClosedCurve(t).map(o=>[o.x,o.y,o.z]);return L.byPoints(r,n,e)}}function Si(i,t,n){if(n<2)return[i,t];const e=[];for(let s=0;s<n;s++)e.push(s===n-1?t:i+(t-i)*s/(n-1));return e}function Ci(i,t){const n=[...i,...t].sort((s,r)=>s-r),e=[];return n.forEach(s=>{const r=e[e.length-1];(r===void 0||Math.abs(r-s)>1e-10)&&e.push(s)}),e}function Ye(i){if(!i)return!1;const t=i.x??0,n=i.y??0,e=i.z??0;return t*t+n*n+e*e>1e-20}function Ei(i,t,n){let e=i??0;return e<1&&n>0&&t>0&&(e=n-t-1),e<1&&(e=3),e=Math.min(e,t-1),Math.max(1,e)}function Ii(i,t,n){let e=i??0;e<1&&(e=3);const s=t+n-1;return e=Math.min(e,s),Math.max(1,e)}function Ti(i,t){if(!(!i||i.length!==t))return i}class X extends ft{constructor(t,n,e,s,r,o){super();const a=arguments.length;if(this._degree=3,this._closed=!1,Array.isArray(n)){if(a<2||a>5)throw V.AcCmErrors.ILLEGAL_PARAMETERS;this._controlPoints=t;let c,h=3,l=!1;if(a>=3&&(Array.isArray(e)?(c=e,a>=4&&(h=s||3),a>=5&&(l=r)):e!==void 0&&(h=e||3,a>=4&&(l=s))),e===void 0&&a>=4&&(h=s||3,a>=5&&(l=r)),this._degree=h,this._closed=l,this._controlPoints.length<this._degree+1)throw V.AcCmErrors.ILLEGAL_PARAMETERS;this._nurbsCurve=L.byKnotsControlPointsWeights(this._degree,n,this._controlPoints,c)}else{if(a<2||a>6)throw V.AcCmErrors.ILLEGAL_PARAMETERS;this._fitPoints=t,this._knotParameterization=n,a>=3&&(this._degree=e||3);const c=typeof s=="boolean";a>=4&&c&&(this._closed=s),c?(a>=5&&(this._startTangent=r),a>=6&&(this._endTangent=o)):(a>=4&&(this._startTangent=s),a>=5&&(this._endTangent=r)),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 V.AcCmErrors.ILLEGAL_PARAMETERS;if(this._closed)this._nurbsCurve=L.createClosedCurve(this._fitPoints,this._degree,this._knotParameterization);else{const l=this.toNurbsPoints(this._fitPoints);this._nurbsCurve=L.byPoints(l,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(l=>[l.x,l.y,l.z||0]))}}buildCurve(){if(this._fitPoints&&this._knotParameterization){if(this._closed){const t=L.createFitPointsForClosedCurve(this._fitPoints),n=this.toNurbsPoints(t);this._nurbsCurve=L.byPoints(n,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),n=this.toNurbsPoints(t);this._nurbsCurve=L.byPoints(n,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(),n=this._nurbsCurve.weights();this._nurbsCurve=L.byKnotsControlPointsWeights(this._degree,t,this._controlPoints,n)}}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(U.point2dToPoint3d)}get fitPoints(){var t;return(t=this._fitPoints)==null?void 0:t.map(U.point2dToPoint3d)}get knots(){return[...this._nurbsCurve.knots()]}get weights(){return[...this._nurbsCurve.weights()]}get startPoint(){const t=this._nurbsCurve.knots(),n=this._nurbsCurve.degree(),e=t[n],s=this._nurbsCurve.point(e);return new w(s[0],s[1],s[2])}get endPoint(){const t=this._nurbsCurve.knots(),n=this._nurbsCurve.degree(),e=t[t.length-n-1],s=this._nurbsCurve.point(e);return new w(s[0],s[1],s[2])}get length(){return this._nurbsCurve.length()}nearestPoint(t,n=64){const e=this._nurbsCurve.nearestPoint(t,n);return new w(e.x,e.y,e.z||0)}evaluateAt(t){const n=this._nurbsCurve.point(t);return new w(n[0],n[1],n[2])}getFitPointAt(t){if(!this._fitPoints)throw new Error("No fit points in this spline");const n=this._fitPoints.length,e=t<0||t>=n?n-1:t,s=this._fitPoints[e];return U.point2dToPoint3d(s)}getControlPointAt(t){const n=this._controlPoints.length,e=t<0||t>=n?n-1:t;return this._controlPoints[e]}get isFitPointSpline(){return!!(this._fitPoints&&this._fitPoints.length>0&&this._knotParameterization)}get isControlPointSpline(){return!this.isFitPointSpline}getGripPoints(){return this.isFitPointSpline?this._fitPoints.map(t=>new w(t.x,t.y,t.z??0)):this._controlPoints.map(t=>new w(t.x,t.y,t.z??0))}moveGripPointsAt(t,n){return this.isFitPointSpline?(this.moveFitPointsAt(t,n),this):(this.moveControlPointsAt(t,n),this)}moveFitPointsAt(t,n){if(this._fitPoints){for(const e of t){if(!Number.isInteger(e)||e<0)continue;const s=this._fitPoints[e];s&&U.applyOffsetToPoint3d(s,n)}this._boundingBoxNeedsUpdate=!0,this.buildCurve()}}moveControlPointsAt(t,n){for(const e of t){if(!Number.isInteger(e)||e<0)continue;const s=this.getControlPointAt(e);s&&U.applyOffsetToPoint3d(s,n)}this.rebuildAfterControlPointMutation()}rebuildAfterControlPointMutation(){const t=this._nurbsCurve.knots(),n=this._nurbsCurve.weights();this.isFitPointSpline&&(this._fitPoints=void 0,this._knotParameterization=void 0,this._startTangent=void 0,this._endTangent=void 0),this._nurbsCurve=L.byKnotsControlPointsWeights(this._degree,t,this._controlPoints,n.length>0?n:void 0),this._boundingBoxNeedsUpdate=!0}getOffsetSamplePath2d(t){return this._nurbsCurve.getOffsetSamplePath2d(t)}getPoints(t=100){const n=this._nurbsCurve,e=[],s=n.knots(),r=this._nurbsCurve.degree(),o=s[r],a=s[s.length-r-1],c=(a-o)/(t-1);for(let h=0;h<t;h++){const l=h===t-1?a:o+h*c,u=n.point(l);e.push(new w(u[0],u[1],u[2]))}return e}tessellate(t){const n=q.resolveTessellateOptions(t),e=this._nurbsCurve.knots(),s=this._nurbsCurve.degree();if(e.length<s+2)return[this.startPoint.clone(),this.endPoint.clone()];const r=e[s],o=e[e.length-s-1],a=n.circleSides,c=Math.abs(this.length),h=n.deviation??Math.max(C,c<=C?C:c/(2*a*a));return ft.tessellateParametricCurve(r,o,l=>this.evaluateAt(l),{deviation:h,minSegments:n.minSegments??(this.closed?8:2),maxSegments:n.maxSegments})}getCurvePoints(t,n){const e=[],s=t.knots(),r=t.degree(),o=s[r],c=(s[s.length-r-1]-o)/(n-1);for(let h=0;h<n;h++){const l=o+h*c;e.push(t.point(l))}return e}calculateBoundingBox(){const t=this.getPoints(100);return new W().setFromPoints(t)}get closed(){return this._closed}set closed(t){this.setClosed(t)}get area(){if(!this._closed)return 0;const t=this.getPoints(128);return de(t)}transform(t){if(this._fitPoints&&this._knotParameterization)this._fitPoints=this._fitPoints.map(n=>new w(n).applyMatrix4(t)),this._startTangent&&(this._startTangent=new w(this._startTangent).transformDirection(t)),this._endTangent&&(this._endTangent=new w(this._endTangent).transformDirection(t)),this.buildCurve();else{const n=this._nurbsCurve.knots(),e=this._nurbsCurve.weights();this._controlPoints=this._controlPoints.map(s=>new w(s).applyMatrix4(t)),this._nurbsCurve=L.byKnotsControlPointsWeights(this._degree,n,this._controlPoints,e.length>0?e:void 0)}return this._boundingBoxNeedsUpdate=!0,this}clone(){return this._fitPoints&&this._knotParameterization?new X(this._fitPoints.map(U.point2dToPoint3d),this._knotParameterization,this._degree,this._closed,this._startTangent?U.point2dToPoint3d(this._startTangent):void 0,this._endTangent?U.point2dToPoint3d(this._endTangent):void 0):new X(this._controlPoints.map(U.point2dToPoint3d),this._nurbsCurve.knots(),this._nurbsCurve.weights(),this._degree,this._closed)}toNurbsPoints(t){const n=new Array(t.length);return t.forEach((e,s)=>{n[s]=[e.x,e.y,e.z||0]}),n}toGePoints(t){const n=new Array(t.length);return t.forEach((e,s)=>{n[s]={x:e[0],y:e[1],z:e[2]}}),n}toNurbsPoint(t){return[t.x,t.y,t.z||0]}static createClosedSpline(t,n="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 X(t,n,e,!0)}static fromControlPoints(t,n,e,s,r){if(t.length<2||n.length<2)return null;const o=Ei(s,t.length,n.length);if(t.length<o+1)return null;try{return new X(t,n,Ti(e,t.length),o,r)}catch{return null}}static fromFitPoints(t,n,e,s,r,o){if(t.length<2)return null;const a=Ye(r),c=Ye(o),h=(a?1:0)+(c?1:0),l=Ii(e,t.length,h);if(t.length+h<l+1)return null;try{return a||c?new X(t,n,l,s,a?r:void 0,c?o:void 0):new X(t,n,l,s)}catch{return null}}static fromDwgSplineEdge(t){if(t.numberOfControlPoints>0&&t.numberOfKnots>0){const n=t.controlPoints.map(U.point2dToPoint3d);let e=!0;const s=t.controlPoints.map(r=>(r.weight==null&&(e=!1),r.weight||1));return X.fromControlPoints(n,t.knots,e?s:void 0,t.degree,!1)}if(t.numberOfFitData>0){const n=t.fitDatum.map(U.point2dToPoint3d);return X.fromFitPoints(n,"Uniform",t.degree,!1,t.startTangent?U.point2dToPoint3d(t.startTangent):void 0,t.endTangent?U.point2dToPoint3d(t.endTangent):void 0)}return null}}class Z extends zt{constructor(t=[]){super(),this._curves=t}get curves(){return this._curves}static buildFromEdges(t,n=.001){if(t.length===0)return[];const e=[...t],s=[],r=n*n,o=(a,c)=>{const h=a.x-c.x,l=a.y-c.y;return h*h+l*l<=r};for(;e.length>0;){const a=[],c=e.shift();a.push(c);const h=Z.getEdgeStartPoint(c);let l=Z.getEdgeEndPoint(c);if(!o(h,l))for(;e.length>0;){const u=Z.findConnectingEdge(e,l,r);if(u.index<0)break;let d=e.splice(u.index,1)[0];if(u.reverse&&(d=Z.reverseEdge(d)),a.push(d),l=Z.getEdgeEndPoint(d),o(l,h))break}s.push(new Z(a))}return s}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 P(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(n=>{t+=n.length}),t}calculateBoundingBox(){const t=this.getPoints(100),n=new K;return n.setFromPoints(t),n}transform(t){const n=new ot().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 X?e.transform(n):e.transform(t)}),this._boundingBoxNeedsUpdate=!0,this}clone(){return new Z(this._curves.map(t=>t.clone()))}get closed(){return!0}getPoints(t){const n=[];return this.curves.forEach(e=>{e.getPoints(t).forEach(s=>{n.push(new P(s.x,s.y))})}),n}tessellate(t){const n=[];return this._curves.forEach(e=>{ki(e,t).forEach(s=>{const r=n[n.length-1];r&&(r.x-s.x)**2+(r.y-s.y)**2<=C*C||n.push(new P(s.x,s.y))})}),n}static findConnectingEdge(t,n,e){let s=-1,r=!1,o=Number.POSITIVE_INFINITY;for(let a=0;a<t.length;a++){const c=t[a],h=Z.getEdgeStartPoint(c),l=Z.getEdgeEndPoint(c),u=n.x-h.x,d=n.y-h.y,g=u*u+d*d;g<o&&(o=g,s=a,r=!1);const m=n.x-l.x,f=n.y-l.y,x=m*m+f*f;x<o&&(o=x,s=a,r=!0)}return o>e?{index:-1,reverse:!1}:{index:s,reverse:r}}static getEdgeStartPoint(t){const n=t.startPoint;return new P(n.x,n.y)}static getEdgeEndPoint(t){const n=t.endPoint;return new P(n.x,n.y)}static reverseEdge(t){return t instanceof bt?new bt(t.endPoint,t.startPoint):t instanceof q?Z.reverseCircArcEdge(t):t instanceof xt?new xt(t.center,t.majorAxisRadius,t.minorAxisRadius,t.endAngle,t.startAngle,!t.clockwise,t.rotation):t instanceof X?Z.reverseSplineEdge(t):t}static reverseCircArcEdge(t){const n=t.startPoint,e=t.endPoint,s=!t.clockwise,r=Math.atan2(e.y-t.center.y,e.x-t.center.x),o=Math.atan2(n.y-t.center.y,n.x-t.center.x),a=c=>{const h=p.normalizeAngle(c);return s?p.normalizeAngle(-h):h};return new q(t.center,t.radius,a(r),a(o),s)}static reverseSplineEdge(t){const n=[...t.controlPoints].reverse(),e=t.knots,s=e[0],r=e[e.length-1],o=e.map(h=>s+r-h).reverse(),a=t.weights,c=a.length>0?[...a].reverse():void 0;return new X(n,o,c,t.degree,t.closed)}}function ki(i,t){if(i instanceof bt)return i.getPoints();if(i instanceof q||i instanceof X)return i.tessellate(t);const n=i.closed?b:i.deltaAngle,e=q.segmentCount(Math.max(i.majorAxisRadius,i.minorAxisRadius),n,t);return i.getPoints(e)}const vt=128,Qt=96,z=Nt.equalPointTol,In=z*8;function Ni(i,t,n=!1,e=!1,s){const r=Ge(i,n,s),o=Ge(t,e,s),a=[];for(const c of r)for(const h of o)kn(c,h)&&Vn(a,He(c,h));return Qi(a)}function Ri(i,t){const n=Ze(i);switch(n.kind){case"line":return n.line.transform(t),n;case"circArc":return n.arc.transform(t),n;case"ellipseArc":return n.arc.transform(t),n;case"spline":return n.spline.transform(t),n}}function Ze(i){switch(i.kind){case"line":return{kind:"line",line:i.line.clone(),extent:i.extent,extendable:i.extendable};case"circArc":return{kind:"circArc",arc:i.arc.clone(),extendable:i.extendable};case"ellipseArc":return{kind:"ellipseArc",arc:i.arc.clone(),extendable:i.extendable};case"spline":return{kind:"spline",spline:i.spline.clone(),extendable:i.extendable}}}function Ge(i,t,n){const e=[];for(const s of i){const r=t&&s.extendable!==!1;switch(s.kind){case"line":{const o=Vi(s.line,n);if(!o)break;const a=r?"unbounded":s.extent;e.push(St(o.start,o.end,a));break}case"circArc":{const o=qi(s.arc,r);if(n&&!Vt(o.normal,n.normal)){const a=ji(o,n);(a==null?void 0:a.kind)==="circArc"?e.push(We(a.arc,rt(a.arc))):(a==null?void 0:a.kind)==="ellipseArc"?e.push(Ke(a.arc,ht(a.arc))):Tn(e,Qe(o,rt(o)),rt(o),n)}else{const a=Li(o,n);a&&e.push(We(a,rt(a)))}break}case"ellipseArc":{const o=vi(s.arc,r);if(n&&!Vt(o.normal,n.normal))Tn(e,$e(o,ht(o)),ht(o),n);else{const a=Fi(o,n);a&&e.push(Ke(a,ht(a)))}break}case"spline":{n?Tn(e,s.spline.getPoints(vt),s.spline.closed,n):e.push(Bi(s.spline));break}}}return e}function St(i,t,n){const e=new _().subVectors(t,i);return{kind:"line",start:i,dir:e,extent:n,box:n==="bounded"?new W().setFromPoints([i,t]):void 0}}function We(i,t){return{kind:"circArc",arc:i,full:t||rt(i),box:i.box}}function Ke(i,t){return{kind:"ellipseArc",arc:i,full:t||ht(i),box:i.box}}function Bi(i){const t=[],n=i.getPoints(vt);if(n.length>=2){const s=i.closed?n.length:n.length-1;for(let r=0;r<s;r++){const o=n[r],a=n[(r+1)%n.length];o.distanceToSquared(a)<z*z||t.push(St(o.clone(),a.clone(),"bounded"))}}const e=new W;for(const s of t)s.box&&e.union(s.box);return{kind:"spline",spline:i,samples:t,box:t.length>0?e:void 0}}function qi(i,t){return!t||rt(i)?i:new Q(i.center,i.radius,0,b,i.normal,i.refVec)}function vi(i,t){return!t||ht(i)?i:new tt(i.center,i.normal,i.majorAxis,i.majorAxisRadius,i.minorAxisRadius,0,b)}function Vi(i,t){if(!t)return{start:i.startPoint.clone(),end:i.endPoint.clone()};const n=ct(i.startPoint,t),e=ct(i.endPoint,t);return n.distanceToSquared(e)<z*z?null:{start:n,end:e}}function Li(i,t){if(!t)return i;const n=ct(i.center,t);return new Q(n,i.radius,i.startAngle,i.endAngle,t.normal.clone(),Bn(i.refVec,t.normal))}function ji(i,t){const n=ct(i.center,t),e=i.normal.clone();if(e.lengthSq()<z*z)return null;e.normalize();const s=t.normal.clone();if(s.lengthSq()<z*z)return null;s.normalize();const r=e.dot(s),o=Math.abs(r);if(o>1-1e-8)return{kind:"circArc",arc:new Q(n,i.radius,i.startAngle,i.endAngle,s,Bn(i.refVec,s))};if(o<1e-8)return null;const a=new _().crossVectors(e,s);if(a.lengthSq()<z*z)return null;a.normalize();const c=new tt(n,s,a,i.radius,i.radius*o,0,b);if(rt(i))return{kind:"ellipseArc",arc:c};const h=ct(i.startPoint,t),l=ct(i.endPoint,t),u=ct(i.midPoint,t),d=It(c,h),g=It(c,l),m=It(c,u),f=p.normalizeAngle(m-d),x=p.normalizeAngle(g-d),y=f<=x||x<1e-8?d+x:d+x+b;return{kind:"ellipseArc",arc:new tt(n,s,a,i.radius,i.radius*o,d,y)}}function Fi(i,t){if(!t)return i;const n=ct(i.center,t),e=Bn(i.majorAxis,t.normal);return e.lengthSq()<z*z?null:new tt(n,t.normal.clone(),e,i.majorAxisRadius,i.minorAxisRadius,i.startAngle,i.endAngle)}function Tn(i,t,n,e){if(t.length<2)return;const s=e?t.map(o=>ct(o,e)):t,r=n?s.length:s.length-1;for(let o=0;o<r;o++){const a=s[o],c=s[(o+1)%s.length];a.distanceToSquared(c)<z*z||i.push(St(a.clone(),c.clone(),"bounded"))}}function Qe(i,t){return t||rt(i)?new Q(i.center,i.radius,0,b,i.normal,i.refVec).getPoints(Qt):i.getPoints(Qt)}function $e(i,t){return t||ht(i)?new tt(i.center,i.normal,i.majorAxis,i.majorAxisRadius,i.minorAxisRadius,0,b).getPoints(Qt):i.getPoints(Qt)}function kn(i,t){return!i.box||!t.box?!0:i.box.intersectsBox(t.box)}function He(i,t){return i.kind==="spline"&&t.kind==="spline"?Oi(i,t):i.kind==="spline"?Je(i,t):t.kind==="spline"?Je(t,i):i.kind==="line"&&t.kind==="line"?ts(i,t):i.kind==="line"&&t.kind==="circArc"?$t(i,t.arc,t.full):t.kind==="line"&&i.kind==="circArc"?$t(t,i.arc,i.full):i.kind==="line"&&t.kind==="ellipseArc"?Nn(i,t.arc,t.full):t.kind==="line"&&i.kind==="ellipseArc"?Nn(t,i.arc,i.full):i.kind==="circArc"&&t.kind==="circArc"?Zi(i.arc,i.full,t.arc,t.full):i.kind==="circArc"&&t.kind==="ellipseArc"?ns(i.arc,i.full,t.arc,t.full):i.kind==="ellipseArc"&&t.kind==="circArc"?ns(t.arc,t.full,i.arc,i.full):i.kind==="ellipseArc"&&t.kind==="ellipseArc"?Wi(i.arc,i.full,t.arc,t.full):[]}function Je(i,t){const n=[];for(const e of i.samples)kn(e,t)&&Vn(n,He(e,t));return Ui(i.spline,n,t)}function Oi(i,t){const n=[];for(const s of i.samples)for(const r of t.samples)kn(s,r)&&Vn(n,ts(s,r));const e=[];for(const s of n){const r=i.spline.nearestPoint(s,vt),o=t.spline.nearestPoint(s,vt);r.distanceTo(o)<=In&&e.push(r)}return e}function Ui(i,t,n){const e=[];for(const s of t){const r=i.nearestPoint(s,vt);Di(n,r)<=In&&e.push(r)}return e}function Di(i,t){if(i.kind==="line"){const n=i.dir.lengthSq();if(n<z*z)return Number.POSITIVE_INFINITY;const e=new _().subVectors(t,i.start).dot(i.dir)/n;return Ct(e,i.extent)?Et(i.start,i.dir,e).distanceTo(t):Number.POSITIVE_INFINITY}if(i.kind==="circArc"){if(!vn(t,i.arc)){const n=$(i.arc.normal,i.arc.center),e=Math.abs(n.distanceToPoint(t)),s=Math.abs(t.distanceTo(i.arc.center)-i.arc.radius),r=Math.hypot(e,s);if(r>In)return r}return At(i.arc,_t(i.arc,t),i.full)?0:Number.POSITIVE_INFINITY}return i.kind==="ellipseArc"?Tt(t,i.arc,i.full)?0:Math.abs(Ht(i.arc,t)):Number.POSITIVE_INFINITY}function ts(i,t){const n=i.dir,e=t.dir,s=n.lengthSq(),r=e.lengthSq();if(s<z*z||r<z*z)return[];const o=new _().subVectors(i.start,t.start),a=n.dot(n),c=n.dot(e),h=e.dot(e),l=n.dot(o),u=e.dot(o),d=a*h-c*c;if(Math.abs(d)<C*C*a*h)return[];const g=(c*u-h*l)/d,m=(a*u-c*l)/d;if(!Ct(g,i.extent)||!Ct(m,t.extent))return[];const f=Et(i.start,n,g),x=Et(t.start,e,m);return f.distanceTo(x)>z?[]:[f]}function $t(i,t,n){const e=$(t.normal,t.center),s=ss(i,e);return s==="coplanar"?Xi(i,t,n):s?vn(s,t)?At(t,_t(t,s),n)?[s]:[]:[]:[]}function Xi(i,t,n){const e=new _().subVectors(i.start,t.center),s=i.dir.dot(i.dir);if(s<z*z)return[];const r=2*i.dir.dot(e),o=e.dot(e)-t.radius*t.radius,a=[];for(const c of rs(s,r,o)){if(!Ct(c,i.extent))continue;const h=Et(i.start,i.dir,c);At(t,_t(t,h),n)&&a.push(h)}return a}function Nn(i,t,n){const e=$(t.normal,t.center),s=ss(i,e);return s==="coplanar"?Yi(i,t,n):s?Tt(s,t,n)?[s]:[]:[]}function Yi(i,t,n){const e=t.majorAxis,s=t.minorAxis,r=t.majorAxisRadius,o=t.minorAxisRadius;if(r<z||o<z)return[];const a=new _().subVectors(i.start,t.center),c=a.dot(e),h=a.dot(s),l=i.dir.dot(e),u=i.dir.dot(s),d=l*l/(r*r)+u*u/(o*o),g=2*c*l/(r*r)+2*h*u/(o*o),m=c*c/(r*r)+h*h/(o*o)-1,f=[];for(const x of rs(d,g,m)){if(!Ct(x,i.extent))continue;const y=Et(i.start,i.dir,x);qn(t,It(t,y),n)&&f.push(y)}return f}function Zi(i,t,n,e){if(Vt(i.normal,n.normal)){const a=$(i.normal,i.center);return Math.abs(a.distanceToPoint(n.center))>z?[]:Ki(Gi(i,n),i,t,n,e)}const s=Rn($(i.normal,i.center),$(n.normal,n.center));if(!s)return[];const r=St(s.point.clone(),new w().addVectors(s.point,s.dir),"unbounded");return $t(r,i,t).filter(a=>vn(a,n)?At(n,_t(n,a),e):!1)}function Gi(i,t){const n=new _().subVectors(t.center,i.center),e=n.length(),s=i.radius,r=t.radius;if(e<z&&M.equal(s,r,z))return[];if(e>s+r+z)return[];if(e+Math.min(s,r)+z<Math.max(s,r))return[];const o=e<z?is(i.normal):n.clone().normalize(),a=(s*s-r*r+e*e)/(2*Math.max(e,z)),c=s*s-a*a,h=new w().copy(i.center).addScaledVector(o,a);if(c<-z*z)return[];if(c<z*z)return[h];const l=Math.sqrt(Math.max(0,c)),u=new _().crossVectors(i.normal,o).normalize();return[new w().copy(h).addScaledVector(u,l),new w().copy(h).addScaledVector(u,-l)]}function ns(i,t,n,e){if(!Vt(i.normal,n.normal)){const s=Rn($(i.normal,i.center),$(n.normal,n.center));if(!s)return[];const r=St(s.point.clone(),new w().addVectors(s.point,s.dir),"unbounded");return $t(r,i,t).filter(o=>Tt(o,n,e))}return es(Qe(i,t),rt(i)||t,s=>Ht(n,s),s=>At(i,_t(i,s),t)&&Tt(s,n,e))}function Wi(i,t,n,e){if(!Vt(i.normal,n.normal)){const s=Rn($(i.normal,i.center),$(n.normal,n.center));if(!s)return[];const r=St(s.point.clone(),new w().addVectors(s.point,s.dir),"unbounded");return Nn(r,i,t).filter(o=>Tt(o,n,e))}return es($e(i,t),ht(i)||t,s=>Ht(n,s),s=>qn(i,It(i,s),t)&&Tt(s,n,e))}function es(i,t,n,e){const s=[],r=t?i.length:i.length-1;for(let o=0;o<r;o++){const a=i[o],c=i[(o+1)%i.length],h=n(a),l=n(c);if(Math.abs(h)<=z){e(a)&&s.push(a.clone());continue}if(h*l>0)continue;let u=0,d=1,g=h;for(let f=0;f<40;f++){const x=(u+d)/2,y=new w().lerpVectors(a,c,x),S=n(y);g*S<=0?d=x:(u=x,g=S)}const m=new w().lerpVectors(a,c,(u+d)/2);e(m)&&s.push(m)}return s}function ss(i,t){const n=t.normal.dot(i.dir),e=t.distanceToPoint(i.start);if(M.equalToZero(n,z*Math.max(1,i.dir.length())))return M.equalToZero(e,z)?"coplanar":null;const s=-e/n;return Ct(s,i.extent)?Et(i.start,i.dir,s):null}function Rn(i,t){const n=new _().crossVectors(i.normal,t.normal);if(n.lengthSq()<z*z)return null;n.normalize();const e=i.normal,s=t.normal,r=e.dot(e)*s.dot(s)-e.dot(s)**2;if(Math.abs(r)<C)return null;const o=-i.constant,a=-t.constant,c=(s.dot(s)*o-e.dot(s)*a)/r,h=(e.dot(e)*a-e.dot(s)*o)/r;return{point:new w().addScaledVector(e,c).addScaledVector(s,h),dir:n}}function Ct(i,t){return t==="unbounded"?!0:t==="ray"?i>=-z:i>=-z&&i<=1+z}function Et(i,t,n){return new w().copy(i).addScaledVector(t,n)}function ct(i,t){const n=new w;return t.projectPoint(i,n),n}function Bn(i,t){const n=i.clone().addScaledVector(t,-i.dot(t));return n.lengthSq()<z*z?is(t):n.normalize()}function $(i,t){return new Mt().setFromNormalAndCoplanarPoint(i,t)}function Vt(i,t){return new _().crossVectors(i,t).lengthSq()<z*z}function _t(i,t){const n=new _().subVectors(t,i.center),e=new _().crossVectors(i.normal,i.refVec);return Math.atan2(n.dot(e),n.dot(i.refVec))}function It(i,t){const n=new _().subVectors(t,i.center),e=n.dot(i.majorAxis)/i.majorAxisRadius,s=n.dot(i.minorAxis)/i.minorAxisRadius;return Math.atan2(s,e)}function rt(i){return i.closed||Math.abs(i.deltaAngle-b)<1e-10}function ht(i){return i.closed||Math.abs(i.endAngle-i.startAngle)<1e-10||Math.abs(i.deltaAngle-b)<1e-10}function At(i,t,n){return n||rt(i)?!0:p.normalizeAngle(t-i.startAngle)<=i.deltaAngle+1e-8}function qn(i,t,n){return n||ht(i)?!0:p.normalizeAngle(t-i.startAngle)<=i.deltaAngle+1e-8}function vn(i,t){const n=$(t.normal,t.center);return Math.abs(n.distanceToPoint(i))>z?!1:Math.abs(i.distanceTo(t.center)-t.radius)<=z}function Ht(i,t){const n=new _().subVectors(t,i.center),e=n.dot(i.majorAxis)/i.majorAxisRadius,s=n.dot(i.minorAxis)/i.minorAxisRadius;return e*e+s*s-1}function Tt(i,t,n){const e=$(t.normal,t.center);return Math.abs(e.distanceToPoint(i))>z||Math.abs(Ht(t,i))>1e-4?!1:qn(t,It(t,i),n)}function Ki(i,t,n,e,s){return i.filter(r=>At(t,_t(t,r),n)&&At(e,_t(e,r),s))}function is(i){const t=Math.abs(i.x)<.9?_.X_AXIS:_.Y_AXIS,n=new _().crossVectors(i,t);return n.lengthSq()<z*z&&n.crossVectors(i,_.Z_AXIS),n.normalize()}function rs(i,t,n){if(Math.abs(i)<C)return Math.abs(t)<C?[]:[-n/t];const e=t*t-4*i*n;if(e<-z)return[];if(e<z)return[-t/(2*i)];const s=Math.sqrt(Math.max(0,e));return[(-t-s)/(2*i),(-t+s)/(2*i)]}function Vn(i,t){for(const n of t)i.push(n)}function Qi(i){const t=[];for(const n of i)t.some(e=>e.distanceTo(n)<=z)||t.push(n);return t}A.AcGeArea2d=Cn,A.AcGeBox2d=K,A.AcGeBox3d=W,A.AcGeCatmullRomCurve3d=Kt,A.AcGeCircArc2d=q,A.AcGeCircArc3d=Q,A.AcGeCurve2d=zt,A.AcGeEllipseArc2d=xt,A.AcGeEllipseArc3d=tt,A.AcGeEuler=fn,A.AcGeGeometryUtil=U,A.AcGeLine2d=bt,A.AcGeLine3d=Gt,A.AcGeLoop2d=Z,A.AcGeMathUtil=p,A.AcGeMatrix2d=pt,A.AcGeMatrix3d=ot,A.AcGeNurbsCurve=L,A.AcGePlane=Mt,A.AcGePoint2d=P,A.AcGePoint3d=w,A.AcGePolyline2d=gt,A.AcGeQuaternion=Rt,A.AcGeShape2d=Mn,A.AcGeSpline3d=X,A.AcGeTol=M,A.AcGeVector2d=B,A.AcGeVector3d=_,A.DEFAULT_TOL=Nt,A.DEG2RAD=on,A.FLOAT_TOL=C,A.ORIGIN_POINT_2D=os,A.ORIGIN_POINT_3D=dn,A.RAD2DEG=an,A.TAU=b,A.acgeBasisFunction=ut,A.acgeCalculateCurveLength=_e,A.acgeCeilPowerOfTwo=Jn,A.acgeClamp=G,A.acgeCloneIntersectPrimitive=Ze,A.acgeClosedPolygonArea2d=us,A.acgeClosedPolygonArea3d=de,A.acgeComputeParameterValues=ge,A.acgeDamp=Un,A.acgeDegToRad=Qn,A.acgeEuclideanModulo=cn,A.acgeEvaluateNurbsDerivatives=xe,A.acgeEvaluateNurbsPoint=Bt,A.acgeFloorPowerOfTwo=te,A.acgeGenerateAveragedKnots=me,A.acgeGenerateChordKnots=ys,A.acgeGenerateSqrtChordKnots=_s,A.acgeGenerateUUID=jn,A.acgeGenerateUniformKnots=xs,A.acgeGetOcsAngle=Es,A.acgeGetOcsReferenceVector=Ss,A.acgeGetOcsReferenceVectorInto=pe,A.acgeIntPartLength=ln,A.acgeInterpolateControlPoints=ws,A.acgeInterpolateNurbsCurve=yn,A.acgeIntersectCurves=Ni,A.acgeInverseLerp=On,A.acgeIsAngleOnCcwSweep=se,A.acgeIsBetterDistanceAlign=Ce,A.acgeIsBetween=ne,A.acgeIsBetweenAngle=ee,A.acgeIsPowerOfTwo=Hn,A.acgeLerp=hn,A.acgeMapLinear=Fn,A.acgeNormalizeAngle=mt,A.acgeOffsetPointByDirectionInXY=ui,A.acgeOffsetSmoothedSampledPath=gi,A.acgeOffsetVertexPath=di,A.acgePingpong=Dn,A.acgePointLiesOnCircle2d=be,A.acgePolygonArea2d=le,A.acgePolygonArea3d=ue,A.acgeRadToDeg=$n,A.acgeRandFloat=Gn,A.acgeRandFloatSpread=Wn,A.acgeRandInt=Zn,A.acgeRelativeEps=ie,A.acgeSameCircle2d=Se,A.acgeSeededRandom=Kn,A.acgeSignedPlanarCurvature=ye,A.acgeSignedPolygonArea2d=xn,A.acgeSmootherstep=Yn,A.acgeSmoothstep=Xn,A.acgeTransformIntersectPrimitive=Ri,A.acgeTransformOcsPointToWcs=Cs,A.acgeTransformOcsPointToWcsInto=we,A.acgeTransformWcsPointToOcs=Pn,Object.defineProperty(A,Symbol.toStringTag,{value:"Module"})}));
1
+ (function(A,V){typeof exports=="object"&&typeof module<"u"?V(exports,require("@mlightcad/common")):typeof define=="function"&&define.amd?define(["exports","@mlightcad/common"],V):(A=typeof globalThis<"u"?globalThis:A||self,V(A["geometry-engine"]={},A.common))})(this,(function(A,V){"use strict";const U=["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 Ln=1234567;const on=Math.PI/180,an=180/Math.PI;function jn(){const i=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0,e=Math.random()*4294967295|0;return(U[i&255]+U[i>>8&255]+U[i>>16&255]+U[i>>24&255]+"-"+U[t&255]+U[t>>8&255]+"-"+U[t>>16&15|64]+U[t>>24&255]+"-"+U[n&63|128]+U[n>>8&255]+"-"+U[n>>16&255]+U[n>>24&255]+U[e&255]+U[e>>8&255]+U[e>>16&255]+U[e>>24&255]).toLowerCase()}function W(i,t,n){return Math.max(t,Math.min(n,i))}function cn(i,t){return(i%t+t)%t}function Fn(i,t,n,e,s){return e+(i-t)*(s-e)/(n-t)}function On(i,t,n){return i!==t?(n-i)/(t-i):0}function hn(i,t,n){return(1-n)*i+n*t}function Un(i,t,n,e){return hn(i,t,1-Math.exp(-n*e))}function Dn(i,t=1){return t-Math.abs(cn(i,t*2)-t)}function Xn(i,t,n){return i<=t?0:i>=n?1:(i=(i-t)/(n-t),i*i*(3-2*i))}function Yn(i,t,n){return i<=t?0:i>=n?1:(i=(i-t)/(n-t),i*i*i*(i*(i*6-15)+10))}function Zn(i,t){return i+Math.floor(Math.random()*(t-i+1))}function Gn(i,t){return i+Math.random()*(t-i)}function Wn(i){return i*(.5-Math.random())}function Kn(i){i!==void 0&&(Ln=i);let t=Ln+=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 Qn(i){return i*on}function $n(i){return i*an}function Hn(i){return(i&i-1)===0&&i!==0}function Jn(i){return Math.pow(2,Math.ceil(Math.log(i)/Math.LN2))}function te(i){return Math.pow(2,Math.floor(Math.log(i)/Math.LN2))}function mt(i){const t=Math.PI*2;return(i%t+t)%t}function ne(i,t,n){return i>t&&i<n||i>n&&i<t}function ee(i,t,n,e=!1){return i=mt(i),t=mt(t),n=mt(n),e?t>n?i<=t&&i>=n:i<=t||i>=n:t<n?i>=t&&i<=n:i>=t||i<=n}function se(i,t,n){const e=mt(n-i);return mt(t-i)<=e+1e-7}function ln(i){return i=Math.abs(i),i<1?0:Math.ceil(Math.log10(Math.abs(i)+1))}function ie(i,t=1e-7){const n=ln(i);return Math.max(Math.pow(10,n)*t,t)}const p={DEG2RAD:on,RAD2DEG:an,generateUUID:jn,clamp:W,euclideanModulo:cn,mapLinear:Fn,inverseLerp:On,lerp:hn,damp:Un,pingpong:Dn,smoothstep:Xn,smootherstep:Yn,randInt:Zn,randFloat:Gn,randFloatSpread:Wn,seededRandom:Kn,degToRad:Qn,radToDeg:$n,isPowerOfTwo:Hn,ceilPowerOfTwo:Jn,floorPowerOfTwo:te,normalizeAngle:mt,isBetween:ne,isBetweenAngle:ee,isAngleOnCcwSweep:se,intPartLength:ln,relativeEps:ie},Lt=class Lt{constructor(t,n){this.x=0,this.y=0;const e=+(t!==void 0)+ +(n!==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:s,y:r}=t;this.x=s,this.y=r;return}if(e===2){this.x=t,this.y=n;return}throw V.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,n){return this.x=t,this.y=n,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,n){switch(t){case 0:this.x=n;break;case 1:this.y=n;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 Lt(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,n){return this.x=t.x+n.x,this.y=t.y+n.y,this}addScaledVector(t,n){return this.x+=t.x*n,this.y+=t.y*n,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,n){return this.x=t.x-n.x,this.y=t.y-n.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 n=this.x,e=this.y,s=t.elements;return this.x=s[0]*n+s[3]*e+s[6],this.y=s[1]*n+s[4]*e+s[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,n){return this.x=Math.max(t.x,Math.min(n.x,this.x)),this.y=Math.max(t.y,Math.min(n.y,this.y)),this}clampScalar(t,n){return this.x=Math.max(t,Math.min(n,this.x)),this.y=Math.max(t,Math.min(n,this.y)),this}clampLength(t,n){const e=this.length();return this.divideScalar(e||1).multiplyScalar(Math.max(t,Math.min(n,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 n=Math.sqrt(this.lengthSq()*t.lengthSq());if(n===0)return Math.PI/2;const e=this.dot(t)/n;return Math.acos(Math.max(-1,Math.min(1,e)))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const n=this.x-t.x,e=this.y-t.y;return n*n+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,n){return this.x+=(t.x-this.x)*n,this.y+=(t.y-this.y)*n,this}lerpVectors(t,n,e){return this.x=t.x+(n.x-t.x)*e,this.y=t.y+(n.y-t.y)*e,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,n=0){return this.x=t[n],this.y=t[n+1],this}toArray(t=[],n=0){return t[n]=this.x,t[n+1]=this.y,t}rotateAround(t,n){const e=Math.cos(n),s=Math.sin(n),r=this.x-t.x,o=this.y-t.y;return this.x=r*e-o*s+t.x,this.y=r*s+o*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}};Lt.EMPTY=Object.freeze(new Lt(0,0));let B=Lt;const jt=class jt{constructor(t,n,e,s,r,o,a,c,h){this.elements=[1,0,0,0,1,0,0,0,1],t!=null&&n!=null&&e!=null&&s!=null&&r!=null&&o!=null&&a!=null&&c!=null&&h!=null&&this.set(t,n,e,s,r,o,a,c,h)}set(t,n,e,s,r,o,a,c,h){const l=this.elements;return l[0]=t,l[1]=s,l[2]=a,l[3]=n,l[4]=r,l[5]=c,l[6]=e,l[7]=o,l[8]=h,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const n=this.elements,e=t.elements;return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],this}extractBasis(t,n,e){return t.setFromMatrix3Column(this,0),n.setFromMatrix3Column(this,1),e.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const n=t.elements;return this.set(n[0],n[4],n[8],n[1],n[5],n[9],n[2],n[6],n[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,n){const e=t.elements,s=n.elements,r=this.elements,o=e[0],a=e[3],c=e[6],h=e[1],l=e[4],u=e[7],d=e[2],g=e[5],m=e[8],f=s[0],x=s[3],y=s[6],S=s[1],k=s[4],R=s[7],N=s[2],I=s[5],E=s[8];return r[0]=o*f+a*S+c*N,r[3]=o*x+a*k+c*I,r[6]=o*y+a*R+c*E,r[1]=h*f+l*S+u*N,r[4]=h*x+l*k+u*I,r[7]=h*y+l*R+u*E,r[2]=d*f+g*S+m*N,r[5]=d*x+g*k+m*I,r[8]=d*y+g*R+m*E,this}multiplyScalar(t){const n=this.elements;return n[0]*=t,n[3]*=t,n[6]*=t,n[1]*=t,n[4]*=t,n[7]*=t,n[2]*=t,n[5]*=t,n[8]*=t,this}determinant(){const t=this.elements,n=t[0],e=t[1],s=t[2],r=t[3],o=t[4],a=t[5],c=t[6],h=t[7],l=t[8];return n*o*l-n*a*h-e*r*l+e*a*c+s*r*h-s*o*c}invert(){const t=this.elements,n=t[0],e=t[1],s=t[2],r=t[3],o=t[4],a=t[5],c=t[6],h=t[7],l=t[8],u=l*o-a*h,d=a*c-l*r,g=h*r-o*c,m=n*u+e*d+s*g;if(m===0)return this.set(0,0,0,0,0,0,0,0,0);const f=1/m;return t[0]=u*f,t[1]=(s*h-l*e)*f,t[2]=(a*e-s*o)*f,t[3]=d*f,t[4]=(l*n-s*c)*f,t[5]=(s*r-a*n)*f,t[6]=g*f,t[7]=(e*c-h*n)*f,t[8]=(o*n-e*r)*f,this}transpose(){let t;const n=this.elements;return t=n[1],n[1]=n[3],n[3]=t,t=n[2],n[2]=n[6],n[6]=t,t=n[5],n[5]=n[7],n[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const n=this.elements;return t.elements[0]=n[0],t.elements[1]=n[3],t.elements[2]=n[6],t.elements[3]=n[1],t.elements[4]=n[4],t.elements[5]=n[7],t.elements[6]=n[2],t.elements[7]=n[5],t.elements[8]=n[8],this}setUvTransform(t,n,e,s,r,o,a){const c=Math.cos(r),h=Math.sin(r);return this.set(e*c,e*h,-e*(c*o+h*a)+o+t,-s*h,s*c,-s*(-h*o+c*a)+a+n,0,0,1),this}scale(t,n){return this.premultiply(un.makeScale(t,n)),this}rotate(t){return this.premultiply(un.makeRotation(-t)),this}translate(t,n){return this.premultiply(un.makeTranslation(t,n)),this}makeTranslation(t,n){return t instanceof B?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,n,0,0,1),this}makeRotation(t){const n=Math.cos(t),e=Math.sin(t);return this.set(n,-e,0,e,n,0,0,0,1),this}makeScale(t,n){return this.set(t,0,0,0,n,0,0,0,1),this}equals(t){const n=this.elements,e=t.elements;for(let s=0;s<9;s++)if(n[s]!==e[s])return!1;return!0}fromArray(t,n=0){for(let e=0;e<9;e++)this.elements[e]=t[e+n];return this}toArray(t=[],n=0){const e=this.elements;return t[n]=e[0],t[n+1]=e[1],t[n+2]=e[2],t[n+3]=e[3],t[n+4]=e[4],t[n+5]=e[5],t[n+6]=e[6],t[n+7]=e[7],t[n+8]=e[8],t}clone(){return new jt().fromArray(this.elements)}};jt.IDENTITY=Object.freeze(new jt);let pt=jt;const un=new pt,C=1e-6,b=2*Math.PI,os={x:0,y:0},dn={x:0,y:0,z:0};class M{constructor(){this.equalPointTol=C,this.equalVectorTol=C}clone(){const t=new M;return t.equalPointTol=this.equalPointTol,t.equalVectorTol=this.equalVectorTol,t}equalPoint2d(t,n){return new B(t).sub(n).length()<this.equalPointTol}equalPoint3d(t,n){return new _(t).sub(n).length()<this.equalPointTol}static equalToZero(t,n=C){return t<n&&t>-n}static equal(t,n,e=C){return Math.abs(t-n)<e}static great(t,n,e=C){return t-n>e}static less(t,n,e=C){return t-n<e}static isPositive(t,n=C){return t>n}static isNonPositive(t,n=C){return t<=n}}const Rt=new M;class Nt{constructor(t=0,n=0,e=0,s=1){this._x=t,this._y=n,this._z=e,this._w=s}static slerpFlat(t,n,e,s,r,o,a){let c=e[s+0],h=e[s+1],l=e[s+2],u=e[s+3];const d=r[o+0],g=r[o+1],m=r[o+2],f=r[o+3];if(a===0){t[n+0]=c,t[n+1]=h,t[n+2]=l,t[n+3]=u;return}if(a===1){t[n+0]=d,t[n+1]=g,t[n+2]=m,t[n+3]=f;return}if(u!==f||c!==d||h!==g||l!==m){let x=1-a;const y=c*d+h*g+l*m+u*f,S=y>=0?1:-1,k=1-y*y;if(k>Number.EPSILON){const N=Math.sqrt(k),I=Math.atan2(N,y*S);x=Math.sin(x*I)/N,a=Math.sin(a*I)/N}const R=a*S;if(c=c*x+d*R,h=h*x+g*R,l=l*x+m*R,u=u*x+f*R,x===1-a){const N=1/Math.sqrt(c*c+h*h+l*l+u*u);c*=N,h*=N,l*=N,u*=N}}t[n]=c,t[n+1]=h,t[n+2]=l,t[n+3]=u}static multiplyQuaternionsFlat(t,n,e,s,r,o){const a=e[s],c=e[s+1],h=e[s+2],l=e[s+3],u=r[o],d=r[o+1],g=r[o+2],m=r[o+3];return t[n]=a*m+l*u+c*g-h*d,t[n+1]=c*m+l*d+h*u-a*g,t[n+2]=h*m+l*g+a*d-c*u,t[n+3]=l*m-a*u-c*d-h*g,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,n,e,s){return this._x=t,this._y=n,this._z=e,this._w=s,this._onChangeCallback(),this}clone(){return new Nt(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,n=!0){const e=t.x,s=t.y,r=t.z,o=t.order,a=Math.cos,c=Math.sin,h=a(e/2),l=a(s/2),u=a(r/2),d=c(e/2),g=c(s/2),m=c(r/2);switch(o){case"XYZ":this._x=d*l*u+h*g*m,this._y=h*g*u-d*l*m,this._z=h*l*m+d*g*u,this._w=h*l*u-d*g*m;break;case"YXZ":this._x=d*l*u+h*g*m,this._y=h*g*u-d*l*m,this._z=h*l*m-d*g*u,this._w=h*l*u+d*g*m;break;case"ZXY":this._x=d*l*u-h*g*m,this._y=h*g*u+d*l*m,this._z=h*l*m+d*g*u,this._w=h*l*u-d*g*m;break;case"ZYX":this._x=d*l*u-h*g*m,this._y=h*g*u+d*l*m,this._z=h*l*m-d*g*u,this._w=h*l*u+d*g*m;break;case"YZX":this._x=d*l*u+h*g*m,this._y=h*g*u+d*l*m,this._z=h*l*m-d*g*u,this._w=h*l*u-d*g*m;break;case"XZY":this._x=d*l*u-h*g*m,this._y=h*g*u-d*l*m,this._z=h*l*m+d*g*u,this._w=h*l*u+d*g*m;break}return n===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,n){const e=n/2,s=Math.sin(e);return this._x=t.x*s,this._y=t.y*s,this._z=t.z*s,this._w=Math.cos(e),this._onChangeCallback(),this}setFromRotationMatrix(t){const n=t.elements,e=n[0],s=n[4],r=n[8],o=n[1],a=n[5],c=n[9],h=n[2],l=n[6],u=n[10],d=e+a+u;if(d>0){const g=.5/Math.sqrt(d+1);this._w=.25/g,this._x=(l-c)*g,this._y=(r-h)*g,this._z=(o-s)*g}else if(e>a&&e>u){const g=2*Math.sqrt(1+e-a-u);this._w=(l-c)/g,this._x=.25*g,this._y=(s+o)/g,this._z=(r+h)/g}else if(a>u){const g=2*Math.sqrt(1+a-e-u);this._w=(r-h)/g,this._x=(s+o)/g,this._y=.25*g,this._z=(c+l)/g}else{const g=2*Math.sqrt(1+u-e-a);this._w=(o-s)/g,this._x=(r+h)/g,this._y=(c+l)/g,this._z=.25*g}return this._onChangeCallback(),this}setFromUnitVectors(t,n){let e=t.dot(n)+1;return e<Number.EPSILON?(e=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=e):(this._x=0,this._y=-t.z,this._z=t.y,this._w=e)):(this._x=t.y*n.z-t.z*n.y,this._y=t.z*n.x-t.x*n.z,this._z=t.x*n.y-t.y*n.x,this._w=e),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(W(this.dot(t),-1,1)))}rotateTowards(t,n){const e=this.angleTo(t);if(e===0)return this;const s=Math.min(1,n/e);return this.slerp(t,s),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,n){const e=t._x,s=t._y,r=t._z,o=t._w,a=n._x,c=n._y,h=n._z,l=n._w;return this._x=e*l+o*a+s*h-r*c,this._y=s*l+o*c+r*a-e*h,this._z=r*l+o*h+e*c-s*a,this._w=o*l-e*a-s*c-r*h,this._onChangeCallback(),this}slerp(t,n){if(n===0)return this;if(n===1)return this.copy(t);const e=this._x,s=this._y,r=this._z,o=this._w;let a=o*t._w+e*t._x+s*t._y+r*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=o,this._x=e,this._y=s,this._z=r,this;const c=1-a*a;if(c<=Number.EPSILON){const g=1-n;return this._w=g*o+n*this._w,this._x=g*e+n*this._x,this._y=g*s+n*this._y,this._z=g*r+n*this._z,this.normalize(),this}const h=Math.sqrt(c),l=Math.atan2(h,a),u=Math.sin((1-n)*l)/h,d=Math.sin(n*l)/h;return this._w=o*u+this._w*d,this._x=e*u+this._x*d,this._y=s*u+this._y*d,this._z=r*u+this._z*d,this._onChangeCallback(),this}slerpQuaternions(t,n,e){return this.copy(t).slerp(n,e)}random(){const t=2*Math.PI*Math.random(),n=2*Math.PI*Math.random(),e=Math.random(),s=Math.sqrt(1-e),r=Math.sqrt(e);return this.set(s*Math.sin(t),s*Math.cos(t),r*Math.sin(n),r*Math.cos(n))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,n=0){return this._x=t[n],this._y=t[n+1],this._z=t[n+2],this._w=t[n+3],this._onChangeCallback(),this}toArray(t=[],n=0){return t[n]=this._x,t[n+1]=this._y,t[n+2]=this._z,t[n+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 F=class F{constructor(t,n,e){this.x=0,this.y=0,this.z=0;const s=+(t!==void 0)+ +(n!==void 0)+ +(e!==void 0);if(s!==0){if(s===1&&t instanceof Array){this.x=t[0],this.y=t[1],this.z=t[2];return}if(s===1){const{x:r,y:o,z:a}=t;this.x=r,this.y=o,this.z=a||0;return}if(s===3){this.x=t,this.y=n,this.z=e;return}throw V.AcCmErrors.ILLEGAL_PARAMETERS}}set(t,n,e){return e===void 0&&(e=this.z),this.x=t,this.y=n,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,n){switch(t){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;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 F(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,n){return this.x=t.x+n.x,this.y=t.y+n.y,this.z=t.z+n.z,this}addScaledVector(t,n){return this.x+=t.x*n,this.y+=t.y*n,this.z+=t.z*n,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,n){return this.x=t.x-n.x,this.y=t.y-n.y,this.z=t.z-n.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,n){return this.x=t.x*n.x,this.y=t.y*n.y,this.z=t.z*n.z,this}applyEuler(t){return this.applyQuaternion(re.setFromEuler(t))}applyAxisAngle(t,n){return this.applyQuaternion(re.setFromAxisAngle(t,n))}applyMatrix3(t){const n=this.x,e=this.y,s=this.z,r=t.elements;return this.x=r[0]*n+r[3]*e+r[6]*s,this.y=r[1]*n+r[4]*e+r[7]*s,this.z=r[2]*n+r[5]*e+r[8]*s,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const n=this.x,e=this.y,s=this.z,r=t.elements,o=1/(r[3]*n+r[7]*e+r[11]*s+r[15]);return this.x=(r[0]*n+r[4]*e+r[8]*s+r[12])*o,this.y=(r[1]*n+r[5]*e+r[9]*s+r[13])*o,this.z=(r[2]*n+r[6]*e+r[10]*s+r[14])*o,this}applyQuaternion(t){const n=this.x,e=this.y,s=this.z,r=t.x,o=t.y,a=t.z,c=t.w,h=2*(o*s-a*e),l=2*(a*n-r*s),u=2*(r*e-o*n);return this.x=n+c*h+o*u-a*l,this.y=e+c*l+a*h-r*u,this.z=s+c*u+r*l-o*h,this}transformDirection(t){const n=this.x,e=this.y,s=this.z,r=t.elements;return this.x=r[0]*n+r[4]*e+r[8]*s,this.y=r[1]*n+r[5]*e+r[9]*s,this.z=r[2]*n+r[6]*e+r[10]*s,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,n){return this.x=Math.max(t.x,Math.min(n.x,this.x)),this.y=Math.max(t.y,Math.min(n.y,this.y)),this.z=Math.max(t.z,Math.min(n.z,this.z)),this}clampScalar(t,n){return this.x=Math.max(t,Math.min(n,this.x)),this.y=Math.max(t,Math.min(n,this.y)),this.z=Math.max(t,Math.min(n,this.z)),this}clampLength(t,n){const e=this.length();return this.divideScalar(e||1).multiplyScalar(Math.max(t,Math.min(n,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 n=this.dot(t),e=this.length(),s=t.length();return Math.abs(n)===e*s}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,n){return this.x+=(t.x-this.x)*n,this.y+=(t.y-this.y)*n,this.z+=(t.z-this.z)*n,this}lerpVectors(t,n,e){return this.x=t.x+(n.x-t.x)*e,this.y=t.y+(n.y-t.y)*e,this.z=t.z+(n.z-t.z)*e,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,n){const e=t.x,s=t.y,r=t.z,o=n.x,a=n.y,c=n.z;return this.x=s*c-r*a,this.y=r*o-e*c,this.z=e*a-s*o,this}projectOnVector(t){const n=t.lengthSq();if(n===0)return this.set(0,0,0);const e=t.dot(this)/n;return this.copy(t).multiplyScalar(e)}projectOnPlane(t){return gn.copy(this).projectOnVector(t),this.sub(gn)}reflect(t){return this.sub(gn.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const n=Math.sqrt(this.lengthSq()*t.lengthSq());if(n===0)return Math.PI/2;const e=this.dot(t)/n;return Math.acos(Math.max(-1,Math.min(1,e)))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const n=this.x-t.x,e=this.y-t.y,s=this.z-t.z;return n*n+e*e+s*s}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromMatrixPosition(t){const n=t.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this}setFromMatrixScale(t){const n=this.setFromMatrixColumn(t,0).length(),e=this.setFromMatrixColumn(t,1).length(),s=this.setFromMatrixColumn(t,2).length();return this.x=n,this.y=e,this.z=s,this}setFromMatrixColumn(t,n){return this.fromArray(t.elements,n*4)}setFromMatrix3Column(t,n){return this.fromArray(t.elements,n*3)}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,n=0){return this.x=t[n],this.y=t[n+1],this.z=t[n+2],this}toArray(t=[],n=0){return t[n]=this.x,t[n+1]=this.y,t[n+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,n=Math.random()*2-1,e=Math.sqrt(1-n*n);return this.x=e*Math.cos(t),this.y=n,this.z=e*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}};F.ORIGIN=Object.freeze(new F(0,0,0)),F.X_AXIS=Object.freeze(new F(1,0,0)),F.NEGATIVE_X_AXIS=Object.freeze(new F(-1,0,0)),F.Y_AXIS=Object.freeze(new F(0,1,0)),F.NEGATIVE_Y_AXIS=Object.freeze(new F(0,-1,0)),F.Z_AXIS=Object.freeze(new F(0,0,1)),F.NEGATIVE_Z_AXIS=Object.freeze(new F(0,0,-1));let _=F;const gn=new _,re=new Nt,kt=class kt{static makeTranslation(t,n,e){return new kt().makeTranslation(t,n,e)}constructor(t,n,e,s,r,o,a,c,h,l,u,d,g,m,f,x){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!=null&&n!=null&&e!=null&&s!=null&&r!=null&&o!=null&&a!=null&&c!=null&&h!=null&&l!=null&&u!=null&&d!=null&&g!=null&&m!=null&&f!=null&&x!=null&&this.set(t,n,e,s,r,o,a,c,h,l,u,d,g,m,f,x)}set(t,n,e,s,r,o,a,c,h,l,u,d,g,m,f,x){const y=this.elements;return y[0]=t,y[4]=n,y[8]=e,y[12]=s,y[1]=r,y[5]=o,y[9]=a,y[13]=c,y[2]=h,y[6]=l,y[10]=u,y[14]=d,y[3]=g,y[7]=m,y[11]=f,y[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 kt().fromArray(this.elements)}copy(t){const n=this.elements,e=t.elements;return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],this}copyPosition(t){const n=this.elements,e=t.elements;return n[12]=e[12],n[13]=e[13],n[14]=e[14],this}setFromMatrix3(t){const n=t.elements;return this.set(n[0],n[3],n[6],0,n[1],n[4],n[7],0,n[2],n[5],n[8],0,0,0,0,1),this}setFromExtrusionDirection(t){const n=Math.hypot(t.x,t.y,t.z);if(!Number.isFinite(n)||n<1e-12)return this.identity(),this;const e=Math.abs(n-1)>1e-6?t.clone().multiplyScalar(1/n):t;if(Rt.equalPoint3d(e,_.Z_AXIS))this.identity();else{const s=new _(1,0,0);Math.abs(e.x)<1/64&&Math.abs(e.y)<1/64?s.crossVectors(_.Y_AXIS,e).normalize():s.crossVectors(_.Z_AXIS,e).normalize();const r=e.clone().cross(s).normalize();this.makeBasis(s,r,e)}return this}extractBasis(t,n,e){return t.setFromMatrixColumn(this,0),n.setFromMatrixColumn(this,1),e.setFromMatrixColumn(this,2),this}makeBasis(t,n,e){return this.set(t.x,n.x,e.x,0,t.y,n.y,e.y,0,t.z,n.z,e.z,0,0,0,0,1),this}extractRotation(t){const n=this.elements,e=t.elements,s=1/wt.setFromMatrixColumn(t,0).length(),r=1/wt.setFromMatrixColumn(t,1).length(),o=1/wt.setFromMatrixColumn(t,2).length();return n[0]=e[0]*s,n[1]=e[1]*s,n[2]=e[2]*s,n[3]=0,n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*r,n[7]=0,n[8]=e[8]*o,n[9]=e[9]*o,n[10]=e[10]*o,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromQuaternion(t){return this.compose(hs,t,ls)}lookAt(t,n,e){const s=this.elements;return Z.subVectors(t,n),Z.lengthSq()===0&&(Z.z=1),Z.normalize(),lt.crossVectors(e,Z),lt.lengthSq()===0&&(Math.abs(e.z)===1?Z.x+=1e-4:Z.z+=1e-4,Z.normalize(),lt.crossVectors(e,Z)),lt.normalize(),Ot.crossVectors(Z,lt),s[0]=lt.x,s[4]=Ot.x,s[8]=Z.x,s[1]=lt.y,s[5]=Ot.y,s[9]=Z.y,s[2]=lt.z,s[6]=Ot.z,s[10]=Z.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,n){const e=t.elements,s=n.elements,r=this.elements,o=e[0],a=e[4],c=e[8],h=e[12],l=e[1],u=e[5],d=e[9],g=e[13],m=e[2],f=e[6],x=e[10],y=e[14],S=e[3],k=e[7],R=e[11],N=e[15],I=s[0],E=s[4],T=s[8],X=s[12],et=s[1],J=s[5],st=s[9],it=s[13],v=s[2],Pt=s[6],Jt=s[10],tn=s[14],nn=s[3],en=s[7],sn=s[11],rn=s[15];return r[0]=o*I+a*et+c*v+h*nn,r[4]=o*E+a*J+c*Pt+h*en,r[8]=o*T+a*st+c*Jt+h*sn,r[12]=o*X+a*it+c*tn+h*rn,r[1]=l*I+u*et+d*v+g*nn,r[5]=l*E+u*J+d*Pt+g*en,r[9]=l*T+u*st+d*Jt+g*sn,r[13]=l*X+u*it+d*tn+g*rn,r[2]=m*I+f*et+x*v+y*nn,r[6]=m*E+f*J+x*Pt+y*en,r[10]=m*T+f*st+x*Jt+y*sn,r[14]=m*X+f*it+x*tn+y*rn,r[3]=S*I+k*et+R*v+N*nn,r[7]=S*E+k*J+R*Pt+N*en,r[11]=S*T+k*st+R*Jt+N*sn,r[15]=S*X+k*it+R*tn+N*rn,this}multiplyScalar(t){const n=this.elements;return n[0]*=t,n[4]*=t,n[8]*=t,n[12]*=t,n[1]*=t,n[5]*=t,n[9]*=t,n[13]*=t,n[2]*=t,n[6]*=t,n[10]*=t,n[14]*=t,n[3]*=t,n[7]*=t,n[11]*=t,n[15]*=t,this}determinant(){const t=this.elements,n=t[0],e=t[4],s=t[8],r=t[12],o=t[1],a=t[5],c=t[9],h=t[13],l=t[2],u=t[6],d=t[10],g=t[14],m=t[3],f=t[7],x=t[11],y=t[15];return m*(+r*c*u-s*h*u-r*a*d+e*h*d+s*a*g-e*c*g)+f*(+n*c*g-n*h*d+r*o*d-s*o*g+s*h*l-r*c*l)+x*(+n*h*u-n*a*g-r*o*u+e*o*g+r*a*l-e*h*l)+y*(-s*a*l-n*c*u+n*a*d+s*o*u-e*o*d+e*c*l)}transpose(){const t=this.elements;let n;return n=t[1],t[1]=t[4],t[4]=n,n=t[2],t[2]=t[8],t[8]=n,n=t[6],t[6]=t[9],t[9]=n,n=t[3],t[3]=t[12],t[12]=n,n=t[7],t[7]=t[13],t[13]=n,n=t[11],t[11]=t[14],t[14]=n,this}setPosition(t,n,e){const s=this.elements;return t instanceof _?(s[12]=t.x,s[13]=t.y,s[14]=t.z):(s[12]=t,s[13]=n,s[14]=e),this}invert(){const t=this.elements,n=t[0],e=t[1],s=t[2],r=t[3],o=t[4],a=t[5],c=t[6],h=t[7],l=t[8],u=t[9],d=t[10],g=t[11],m=t[12],f=t[13],x=t[14],y=t[15],S=u*x*h-f*d*h+f*c*g-a*x*g-u*c*y+a*d*y,k=m*d*h-l*x*h-m*c*g+o*x*g+l*c*y-o*d*y,R=l*f*h-m*u*h+m*a*g-o*f*g-l*a*y+o*u*y,N=m*u*c-l*f*c-m*a*d+o*f*d+l*a*x-o*u*x,I=n*S+e*k+s*R+r*N;if(I===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const E=1/I;return t[0]=S*E,t[1]=(f*d*r-u*x*r-f*s*g+e*x*g+u*s*y-e*d*y)*E,t[2]=(a*x*r-f*c*r+f*s*h-e*x*h-a*s*y+e*c*y)*E,t[3]=(u*c*r-a*d*r-u*s*h+e*d*h+a*s*g-e*c*g)*E,t[4]=k*E,t[5]=(l*x*r-m*d*r+m*s*g-n*x*g-l*s*y+n*d*y)*E,t[6]=(m*c*r-o*x*r-m*s*h+n*x*h+o*s*y-n*c*y)*E,t[7]=(o*d*r-l*c*r+l*s*h-n*d*h-o*s*g+n*c*g)*E,t[8]=R*E,t[9]=(m*u*r-l*f*r-m*e*g+n*f*g+l*e*y-n*u*y)*E,t[10]=(o*f*r-m*a*r+m*e*h-n*f*h-o*e*y+n*a*y)*E,t[11]=(l*a*r-o*u*r-l*e*h+n*u*h+o*e*g-n*a*g)*E,t[12]=N*E,t[13]=(l*f*s-m*u*s+m*e*d-n*f*d-l*e*x+n*u*x)*E,t[14]=(m*a*s-o*f*s-m*e*c+n*f*c+o*e*x-n*a*x)*E,t[15]=(o*u*s-l*a*s+l*e*c-n*u*c-o*e*d+n*a*d)*E,this}scale(t){const n=this.elements,e=t.x,s=t.y,r=t.z;return n[0]*=e,n[4]*=s,n[8]*=r,n[1]*=e,n[5]*=s,n[9]*=r,n[2]*=e,n[6]*=s,n[10]*=r,n[3]*=e,n[7]*=s,n[11]*=r,this}getMaxScaleOnAxis(){const t=this.elements,n=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],s=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(n,e,s))}makeTranslation(t,n,e){return typeof t=="object"?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z??0,0,0,0,1):this.set(1,0,0,t,0,1,0,n,0,0,1,e,0,0,0,1),this}makeRotationX(t){const n=Math.cos(t),e=Math.sin(t);return this.set(1,0,0,0,0,n,-e,0,0,e,n,0,0,0,0,1),this}makeRotationY(t){const n=Math.cos(t),e=Math.sin(t);return this.set(n,0,e,0,0,1,0,0,-e,0,n,0,0,0,0,1),this}makeRotationZ(t){const n=Math.cos(t),e=Math.sin(t);return this.set(n,-e,0,0,e,n,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,n){const e=Math.cos(n),s=Math.sin(n),r=1-e,o=t.x,a=t.y,c=t.z,h=r*o,l=r*a;return this.set(h*o+e,h*a-s*c,h*c+s*a,0,h*a+s*c,l*a+e,l*c-s*o,0,h*c-s*a,l*c+s*o,r*c*c+e,0,0,0,0,1),this}makeScale(t,n,e){return this.set(t,0,0,0,0,n,0,0,0,0,e,0,0,0,0,1),this}setToMirroring(t,n,e="line"){return e==="plane"?cs(this,t,n):as(this,t,n),this}makeShear(t,n,e,s,r,o){return this.set(1,e,r,0,t,1,o,0,n,s,1,0,0,0,0,1),this}compose(t,n,e){const s=this.elements,r=n.x,o=n.y,a=n.z,c=n.w,h=r+r,l=o+o,u=a+a,d=r*h,g=r*l,m=r*u,f=o*l,x=o*u,y=a*u,S=c*h,k=c*l,R=c*u,N=e.x,I=e.y,E=e.z;return s[0]=(1-(f+y))*N,s[1]=(g+R)*N,s[2]=(m-k)*N,s[3]=0,s[4]=(g-R)*I,s[5]=(1-(d+y))*I,s[6]=(x+S)*I,s[7]=0,s[8]=(m+k)*E,s[9]=(x-S)*E,s[10]=(1-(d+f))*E,s[11]=0,s[12]=t.x,s[13]=t.y,s[14]=t.z,s[15]=1,this}decompose(t,n,e){const s=this.elements;let r=wt.set(s[0],s[1],s[2]).length();const o=wt.set(s[4],s[5],s[6]).length(),a=wt.set(s[8],s[9],s[10]).length();this.determinant()<0&&(r=-r),t.x=s[12],t.y=s[13],t.z=s[14],tt.copy(this);const h=1/r,l=1/o,u=1/a;return tt.elements[0]*=h,tt.elements[1]*=h,tt.elements[2]*=h,tt.elements[4]*=l,tt.elements[5]*=l,tt.elements[6]*=l,tt.elements[8]*=u,tt.elements[9]*=u,tt.elements[10]*=u,n.setFromRotationMatrix(tt),e.x=r,e.y=o,e.z=a,this}equals(t){const n=this.elements,e=t.elements;for(let s=0;s<16;s++)if(n[s]!==e[s])return!1;return!0}fromArray(t,n=0){for(let e=0;e<16;e++)this.elements[e]=t[e+n];return this}toArray(t=[],n=0){const e=this.elements;return t[n]=e[0],t[n+1]=e[1],t[n+2]=e[2],t[n+3]=e[3],t[n+4]=e[4],t[n+5]=e[5],t[n+6]=e[6],t[n+7]=e[7],t[n+8]=e[8],t[n+9]=e[9],t[n+10]=e[10],t[n+11]=e[11],t[n+12]=e[12],t[n+13]=e[13],t[n+14]=e[14],t[n+15]=e[15],t}};kt.IDENTITY=Object.freeze(new kt);let L=kt;function as(i,t,n){const e=n.x-t.x,s=n.y-t.y,r=e*e+s*s;if(M.equalToZero(Math.sqrt(r)))return i.copy(new L().makeTranslation(t.x,t.y,t.z??0).multiply(new L().makeScale(-1,1,1)).multiply(new L().makeTranslation(-t.x,-t.y,-(t.z??0))));const o=Math.atan2(s,e),a=t.z??0;return i.copy(new L().makeTranslation(t.x,t.y,a).multiply(new L().makeRotationZ(o)).multiply(new L().makeScale(1,-1,1)).multiply(new L().makeRotationZ(-o)).multiply(new L().makeTranslation(-t.x,-t.y,-a)))}function cs(i,t,n){const e=n.x,s=n.y,r=n.z??0,o=Math.hypot(e,s,r);if(M.equalToZero(o))return i.identity();const a=e/o,c=s/o,h=r/o,l=t.x,u=t.y,d=t.z??0,g=a*l+c*u+h*d;return i.set(1-2*a*a,-2*a*c,-2*a*h,2*g*a,-2*c*a,1-2*c*c,-2*c*h,2*g*c,-2*h*a,-2*h*c,1-2*h*h,2*g*h,0,0,0,1)}const wt=new _,tt=new L,hs=new _(0,0,0),ls=new _(1,1,1),lt=new _,Ot=new _,Z=new _;class K{constructor(t=void 0,n=void 0){this.min=t==null?new _(1/0,1/0,1/0):new _(t.x,t.y,t.z),this.max=n==null?new _(-1/0,-1/0,-1/0):new _(n.x,n.y,n.z)}set(t,n){return this.min.copy(t),this.max.copy(n),this}setFromArray(t){this.makeEmpty();for(let n=0,e=t.length;n<e;n+=3)this.expandByPoint(mn.fromArray(t,n));return this}setFromPoints(t){this.makeEmpty();for(let n=0,e=t.length;n<e;n++)this.expandByPoint(t[n]);return this}setFromCenterAndSize(t,n){const e=mn.copy(n).multiplyScalar(.5);return this.min.copy(t).sub(e),this.max.copy(t).add(e),this}clone(){return new K().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!Number.isFinite(t.x)||!Number.isFinite(t.y)||!Number.isFinite(t.z)?this:(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,n){return n.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 n,e;return t.normal.x>0?(n=t.normal.x*this.min.x,e=t.normal.x*this.max.x):(n=t.normal.x*this.max.x,e=t.normal.x*this.min.x),t.normal.y>0?(n+=t.normal.y*this.min.y,e+=t.normal.y*this.max.y):(n+=t.normal.y*this.max.y,e+=t.normal.y*this.min.y),t.normal.z>0?(n+=t.normal.z*this.min.z,e+=t.normal.z*this.max.z):(n+=t.normal.z*this.max.z,e+=t.normal.z*this.min.z),n<=-t.constant&&e>=-t.constant}clampPoint(t,n){return n.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,mn).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:(at[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),at[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),at[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),at[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),at[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),at[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),at[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),at[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(at),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 at=[new _,new _,new _,new _,new _,new _,new _,new _],mn=new _,oe=new B;class Q{constructor(t=void 0,n=void 0){this.min=t==null?new B(1/0,1/0):new B(t.x,t.y),this.max=n==null?new B(-1/0,-1/0):new B(n.x,n.y)}set(t,n){return this.min.copy(t),this.max.copy(n),this}setFromPoints(t){this.makeEmpty();for(let n=0,e=t.length;n<e;n++)this.expandByPoint(t[n]);return this}setFromCenterAndSize(t,n){const e=oe.copy(n).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!Number.isFinite(t.x)||!Number.isFinite(t.y)?this:(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,n){return n.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,n){return n.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,oe).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 ae=new _,us=new _,ds=new pt;class Mt{constructor(t=new _(1,0,0),n=0){this.normal=t,this.constant=n}set(t,n){return this.normal.copy(t),this.constant=n,this}setComponents(t,n,e,s){return this.normal.set(t,n,e),this.constant=s,this}setFromNormalAndCoplanarPoint(t,n){return this.normal.copy(t),this.constant=-n.dot(this.normal),this}setFromCoplanarPoints(t,n,e){const s=ae.subVectors(e,n).cross(us.subVectors(t,n)).normalize();return this.setFromNormalAndCoplanarPoint(s,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,n){return n.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,n){const e=n||ds.getNormalMatrix(t),s=this.coplanarPoint(ae).applyMatrix4(t),r=this.normal.applyMatrix3(e).normalize();return this.constant=-s.dot(r),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 Mt().copy(this)}}class P extends B{clone(){return new P(this.x,this.y)}static pointArrayToNumberArray(t){const n=new Array(t.length*2);return t.forEach((e,s)=>{e.toArray(n,s*2)}),n}}class w extends _{clone(){return new w(this.x,this.y,this.z)}static pointArrayToNumberArray(t,n=!0){const e=n?3:2,s=new Array(t.length*e);return t.forEach((r,o)=>{r.toArray(s,o*e)}),s}}const ce=new L,he=new Nt,Ft=class Ft{constructor(t=0,n=0,e=0,s=Ft.DEFAULT_ORDER){this._x=t,this._y=n,this._z=e,this._order=s}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,n,e,s=this._order){return this._x=t,this._y=n,this._z=e,this._order=s,this._onChangeCallback(),this}clone(){return new Ft(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,n=this._order,e=!0){const s=t.elements,r=s[0],o=s[4],a=s[8],c=s[1],h=s[5],l=s[9],u=s[2],d=s[6],g=s[10];switch(n){case"XYZ":this._y=Math.asin(W(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-l,g),this._z=Math.atan2(-o,r)):(this._x=Math.atan2(d,h),this._z=0);break;case"YXZ":this._x=Math.asin(-W(l,-1,1)),Math.abs(l)<.9999999?(this._y=Math.atan2(a,g),this._z=Math.atan2(c,h)):(this._y=Math.atan2(-u,r),this._z=0);break;case"ZXY":this._x=Math.asin(W(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-u,g),this._z=Math.atan2(-o,h)):(this._y=0,this._z=Math.atan2(c,r));break;case"ZYX":this._y=Math.asin(-W(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(d,g),this._z=Math.atan2(c,r)):(this._x=0,this._z=Math.atan2(-o,h));break;case"YZX":this._z=Math.asin(W(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-l,h),this._y=Math.atan2(-u,r)):(this._x=0,this._y=Math.atan2(a,g));break;case"XZY":this._z=Math.asin(-W(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(d,h),this._y=Math.atan2(a,r)):(this._x=Math.atan2(-l,g),this._y=0);break}return this._order=n,e===!0&&this._onChangeCallback(),this}setFromQuaternion(t,n,e=!0){return ce.makeRotationFromQuaternion(t),this.setFromRotationMatrix(ce,n,e)}setFromVector3(t,n=this._order){return this.set(t.x,t.y,t.z,n)}reorder(t){return he.setFromEuler(this),this.setFromQuaternion(he,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=[],n=0){return t[n]=this._x,t[n+1]=this._y,t[n+2]=this._z,t[n+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}};Ft.DEFAULT_ORDER="XYZ";let fn=Ft;function xn(i){const t=i.length;if(t<3)return 0;let n=0;for(let e=0,s=t-1;e<t;s=e++){const r=i[s],o=i[e];n+=r.x*o.y-o.x*r.y}return n*.5}function le(i){return Math.abs(xn(i))}function ue(i){const t=i.length;if(t<3)return 0;let n=0,e=0,s=0;for(let r=0,o=t-1;r<t;o=r++){const a=i[o],c=i[r],h=a.x,l=a.y,u=a.z??0,d=c.x,g=c.y,m=c.z??0;n+=(u+m)*(l-g),e+=(h+d)*(u-m),s+=(l+g)*(h-d)}return .5*Math.hypot(n,e,s)}function gs(i){return i.length<3?0:le(i)}function de(i){return i.length<3?0:ue(i)}function ms(i){const t=i;return{x:i.x,y:i.y,z:t.z??0}}function fs(i,t){i.x+=t.x,i.y+=t.y,i.z=(i.z??0)+(t.z??0)}function xs(i,t,n=!1){const e=i.x,s=i.y;let r=!1;const o=t.length;for(let a=0,c=o-1;a<o;c=a++){const h=t[a].x,l=t[a].y,u=t[c].x,d=t[c].y;let g=l>s!=d>s;n&&(g=l>=s!=d>=s),g&&e<(u-h)*(s-l)/(d-l)+h&&(r=!r)}return r}function ys(i,t){if(i.length===0||t.length===0)return!1;const n=new Q().setFromPoints(i),e=new Q().setFromPoints(t);if(!n.intersectsBox(e))return!1;for(let s=0;s<i.length;){if(D.isPointInPolygon(i[s],t,!0))return!0;s<i.length-1&&Rt.equalPoint2d(i[s+1],i[s])&&++s,++s}return!1}const D={applyOffsetToPoint3d:fs,isPointInPolygon:xs,isPolygonIntersect:ys,point2dToPoint3d:ms};function _s(i,t){const n=[],e=t-1,s=i;for(let r=0;r<=s;r++)n.push(0);for(let r=1;r<=e-s;r++)n.push(r);for(let r=0;r<=s;r++)n.push(e-s+1);return n}function As(i,t){const n=t.length-1,e=i,s=[0];let r=0;for(let a=1;a<=n;a++){const c=t[a][0]-t[a-1][0],h=t[a][1]-t[a-1][1],l=t[a][2]-t[a-1][2],u=Math.sqrt(c*c+h*h+l*l);r+=u,s.push(r)}const o=[];for(let a=0;a<=e;a++)o.push(0);for(let a=1;a<=n-e;a++){const c=s[a]/r;o.push(c*(n-e+1))}for(let a=0;a<=e;a++)o.push(n-e+1);return o}function ge(i,t="Uniform"){const n=i.length;if(n===0)return[];if(n===1)return[0];const e=n-1;if(t==="Uniform")return new Array(n).fill(0).map((o,a)=>a/e);const s=[0];let r=0;for(let o=1;o<=e;o++){const a=i[o][0]-i[o-1][0],c=i[o][1]-i[o-1][1],h=i[o][2]-i[o-1][2],l=Math.sqrt(a*a+c*c+h*h),u=t==="SqrtChord"?Math.sqrt(l):l;r+=u,s.push(r)}return r<1e-12?new Array(n).fill(0).map((o,a)=>a/e):s.map(o=>o/r)}function me(i,t){const n=t.length-1,e=i,s=n+e+1,r=new Array(s+1).fill(0),o=t[t.length-1];for(let a=s-e;a<=s;a++)r[a]=o;for(let a=1;a<=n-e;a++){let c=0;for(let h=a;h<a+e;h++)c+=t[h];r[a+e]=c/e}return r}function Ps(i,t){const n=t.length-1,e=i,s=[0];let r=0;for(let a=1;a<=n;a++){const c=t[a][0]-t[a-1][0],h=t[a][1]-t[a-1][1],l=t[a][2]-t[a-1][2],u=Math.sqrt(c*c+h*h+l*l),d=Math.sqrt(u);r+=d,s.push(r)}const o=[];for(let a=0;a<=e;a++)o.push(0);for(let a=1;a<=n-e;a++){const c=s[a]/r;o.push(c*(n-e+1))}for(let a=0;a<=e;a++)o.push(n-e+1);return o}function Ut(i,t){for(const n of i)if(n.col===t)return n.value;return 0}function fe(i,t){for(let n=0;n<i.length;n++)if(i[n].col===t)return n;return-1}function ps(i,t){const n=i.length,e=i.map(o=>o.map(a=>({col:a.col,value:a.value}))),s=t.map(o=>o.slice());for(let o=0;o<n;o++){let a=-1,c=1e-12;for(let l=o;l<n;l++){const u=Math.abs(Ut(e[l],o));u>c&&(c=u,a=l)}if(a<0)throw new Error("Interpolation matrix is singular.");if(a!==o){const l=e[o];e[o]=e[a],e[a]=l;for(const u of s){const d=u[o];u[o]=u[a],u[a]=d}}const h=Ut(e[o],o);for(let l=o+1;l<n;l++){const u=fe(e[l],o);if(u<0)continue;const d=e[l][u].value/h;if(!(Math.abs(d)<1e-14)){for(const g of e[l])g.col>o&&(g.value-=d*Ut(e[o],g.col));for(const g of e[o])g.col<=o||g.value===0||fe(e[l],g.col)<0&&e[l].push({col:g.col,value:-d*g.value});e[l][u].value=0;for(const g of s)g[l]-=d*g[o]}}}const r=s.map(()=>new Array(n).fill(0));for(let o=n-1;o>=0;o--){const a=Ut(e[o],o);for(let c=0;c<s.length;c++){let h=s[c][o];for(const l of e[o])l.col>o&&(h-=l.value*r[c][l.col]);r[c][o]=h/a}}return r}function ws(i,t,n){const e=n.length-t-2;if(i>=n[e+1])return e;let s=t,r=n.length-t-2;for(;s<=r;){const o=s+r>>1;if(i<n[o])r=o-1;else if(i>=n[o+1])s=o+1;else return o}return t}function yn(i,t,n="Uniform",e,s){if(i.length===0)return{controlPoints:[],knots:[],weights:[]};const r=i.map(T=>[T[0],T[1],T[2]??0]),o=!!e,a=!!s,c=(o?1:0)+(a?1:0),h=r.length-1,l=h+c;if(l<t)throw new Error("Not enough points to interpolate a curve of this degree.");const u=ge(r,n),d=u.slice();o&&d.unshift(u[0]),a&&d.push(u[u.length-1]);const g=me(t,d),m=l+1,f=[],x=[],y=[],S=[];if(o){const T=g[t+1]-g[0],X=T!==0?t/T:0;f.push([{col:0,value:-X},{col:1,value:X}]),x.push((e==null?void 0:e[0])??0),y.push((e==null?void 0:e[1])??0),S.push((e==null?void 0:e[2])??0)}f.push([{col:0,value:1}]),x.push(r[0][0]),y.push(r[0][1]),S.push(r[0][2]);for(let T=1;T<=h-1;T++){const X=u[T],et=[],J=ws(X,t,g),st=Math.max(0,J-t),it=Math.min(l,J);for(let v=st;v<=it;v++){const Pt=ut(v,t,X,g);Pt!==0&&et.push({col:v,value:Pt})}f.push(et),x.push(r[T][0]),y.push(r[T][1]),S.push(r[T][2])}if(f.push([{col:l,value:1}]),x.push(r[h][0]),y.push(r[h][1]),S.push(r[h][2]),a){const T=g[l+t+1]-g[l],X=T!==0?t/T:0;f.push([{col:l-1,value:-X},{col:l,value:X}]),x.push((s==null?void 0:s[0])??0),y.push((s==null?void 0:s[1])??0),S.push((s==null?void 0:s[2])??0)}const[k,R,N]=ps(f,[x,y,S]),I=new Array(m);for(let T=0;T<m;T++)I[T]=[k[T],R[T],N[T]];const E=new Array(m).fill(1);return{controlPoints:I,knots:g,weights:E}}function ut(i,t,n,e){if(t===0)return n>=e[i]&&n<e[i+1]?1:0;const s=e[i+t]-e[i],r=e[i+t+1]-e[i+1],o=s>1e-10?(n-e[i])/s:0,a=r>1e-10?(e[i+t+1]-n)/r:0;return o*ut(i,t-1,n,e)+a*ut(i+1,t-1,n,e)}function Bt(i,t,n,e,s){const r=e.length-1,o=t;if(i=Math.max(n[o],Math.min(n[r+1],i)),Math.abs(i-n[r+1])<1e-8)return[...e[r]];if(Math.abs(i-n[o])<1e-8)return[...e[0]];const a=[0,0,0];let c=0;for(let h=0;h<=r;h++){const l=ut(h,o,i,n),u=s[h]*l;a[0]+=e[h][0]*u,a[1]+=e[h][1]*u,a[2]+=e[h][2]*u,c+=u}if(Math.abs(c)<1e-10){const h=n[n.length-o-1];if(Math.abs(i-h)<1e-8)return[...e[r]];if(Math.abs(i-n[o])<1e-8)return[...e[0]]}return Math.abs(c)>=1e-10&&(a[0]/=c,a[1]/=c,a[2]/=c),a}function _n(i,t,n,e){if(t===0)return 0;const s=e[i+t]-e[i],r=e[i+t+1]-e[i+1];let o=0;return s>1e-10&&(o+=t/s*ut(i,t-1,n,e)),r>1e-10&&(o-=t/r*ut(i+1,t-1,n,e)),o}function Ms(i,t,n,e){if(t<=1)return 0;const s=e[i+t]-e[i],r=e[i+t+1]-e[i+1];let o=0;return s>1e-10&&(o+=t/s*_n(i,t-1,n,e)),r>1e-10&&(o-=t/r*_n(i+1,t-1,n,e)),o}function xe(i,t,n,e,s){const r=e.length-1,o=t,a=n[o],c=n[r+1];i=Math.max(a,Math.min(c,i));const h=[0,0,0],l=[0,0,0],u=[0,0,0];let d=0,g=0,m=0;for(let I=0;I<=r;I++){const E=ut(I,o,i,n),T=_n(I,o,i,n),X=Ms(I,o,i,n),et=s[I],J=et*E,st=et*T,it=et*X,v=e[I];h[0]+=J*v[0],h[1]+=J*v[1],h[2]+=J*v[2],l[0]+=st*v[0],l[1]+=st*v[1],l[2]+=st*v[2],u[0]+=it*v[0],u[1]+=it*v[1],u[2]+=it*v[2],d+=J,g+=st,m+=it}if(Math.abs(d)<1e-10)return{point:Bt(i,t,n,e,s),deriv1:[0,0,0],deriv2:[0,0,0]};const f=d*d,x=[h[0]/d,h[1]/d,h[2]/d],y=[(l[0]*d-h[0]*g)/f,(l[1]*d-h[1]*g)/f,(l[2]*d-h[2]*g)/f],S=u[0]*d-h[0]*m,k=u[1]*d-h[1]*m,R=u[2]*d-h[2]*m,N=[S/f-2*g*y[0]/d,k/f-2*g*y[1]/d,R/f-2*g*y[2]/d];return{point:x,deriv1:y,deriv2:N}}function ye(i,t){const n=i[0],e=i[1],s=t[0],r=t[1],o=n*n+e*e;return o<1e-20?0:(n*r-e*s)/Math.pow(o,1.5)}function _e(i,t,n,e){const s=i,r=t[s],o=t[t.length-s-1];let a=0;const c=1e3,h=(o-r)/c;let l=Bt(r,i,t,n,e);for(let f=1;f<=c;f++){const x=r+f*h,y=Bt(x,i,t,n,e),S=y[0]-l[0],k=y[1]-l[1],R=y[2]-l[2];a+=Math.sqrt(S*S+k*k+R*R),l=y}const u=Bt(o,i,t,n,e),d=u[0]-l[0],g=u[1]-l[1],m=u[2]-l[2];return a+=Math.sqrt(d*d+g*g+m*m),a}function zs(i,t=3,n="Uniform",e,s){return i.length===0?[]:yn(i,t,n,e,s).controlPoints}const Dt=new L,Ae=new _,bs=new _,Ss=new _,An=new w,Pe=new _;function Cs(i){return new L().setFromExtrusionDirection(new _(i.x,i.y,i.z))}function Es(i){return pe(new _,i)}function pe(i,t){return Dt.setFromExtrusionDirection(Pe.set(t.x,t.y,t.z)),Dt.extractBasis(Ae,bs,Ss),i.copy(Ae),i}function Is(i,t){return we(new w,i,t)}function we(i,t,n){return n.x===0&&n.y===0&&n.z===1?(i.set(t.x,t.y,t.z??0),i):(Dt.setFromExtrusionDirection(Pe.set(n.x,n.y,n.z)),i.set(t.x,t.y,t.z??0),i.applyMatrix4(Dt),i)}function Pn(i,t){return new w(i.x,i.y,i.z??0).applyMatrix4(Cs(t).invert())}function Ts(i,t,n){const e=Pn(i,n),s=Pn(t,n);return An.set(s.x-e.x,s.y-e.y,(s.z??0)-(e.z??0)),p.normalizeAngle(Math.atan2(An.y,An.x))}function pn(i,t,n){const e=i.x,s=i.y,r=t.x,o=t.y,a=n.x,c=n.y,h=2*(e*(o-c)+r*(c-s)+a*(s-o));if(M.equalToZero(h))return null;const l=((e*e+s*s)*(o-c)+(r*r+o*o)*(c-s)+(a*a+c*c)*(s-o))/h,u=((e*e+s*s)*(a-r)+(r*r+o*o)*(e-a)+(a*a+c*c)*(r-e))/h,d=Math.hypot(l-e,u-s);return!Number.isFinite(d)||M.isNonPositive(d)?null:{center:new P(l,u),radius:d}}function Me(i,t,n){const e=i.x,s=i.y,r=i.z??0,o=new _(t.x-e,t.y-s,(t.z??0)-r),a=new _(n.x-e,n.y-s,(n.z??0)-r),c=new _().crossVectors(o,a),h=c.lengthSq();if(h<C*C)return null;const l=o.lengthSq(),u=a.lengthSq(),d=new _().crossVectors(c,o).multiplyScalar(u).add(new _().crossVectors(a,c).multiplyScalar(l)).multiplyScalar(1/(2*h)),g=new w(e+d.x,s+d.y,r+d.z),m=Math.hypot(g.x-e,g.y-s,g.z-r);return!Number.isFinite(m)||M.isNonPositive(m)?null:{center:g,radius:m}}function dt(i,t){return Math.atan2(t.y-i.y,t.x-i.x)}function rt(i,t){return Math.hypot(t.x-i.x,t.y-i.y)}function ze(i,t,n){if(M.isNonPositive(t))return null;const e=n.x-i.x,s=n.y-i.y,r=Math.hypot(e,s);if(M.isNonPositive(r))return null;const o=t/r;return new P(i.x+e*o,i.y+s*o)}const ks=1e-8;function be(i,t,n,e){return Math.abs(rt(i,t)-n)<=(e??Math.max(C,n*1e-5))}function Se(i,t,n,e,s=ks){return Math.abs(i.x-n.x)<=s&&Math.abs(i.y-n.y)<=s&&Math.abs(t-e)<=s}function Ce(i,t,n,e){const s=Math.max(1e-18,Math.abs(n)*1e-9);return i<n-s?!0:i>n+s?!1:t>e}function Ee(i,t,n,e=!1){const s=pn(i,t,n);if(!s)return null;const r=dt(s.center,i),o=dt(s.center,t),a=dt(s.center,n);let c=!p.isAngleOnCcwSweep(r,o,a);return e&&(c=!c),q.fromMathAngles(s.center,s.radius,r,a,c)}function wn(i,t){return!Number.isFinite(t)||M.isNonPositive(t)?null:new q(i,t,0,b,!1)}function Rs(i,t){const n=rt(i,t);return M.isNonPositive(n)?null:wn({x:(i.x+t.x)/2,y:(i.y+t.y)/2},n/2)}function Ns(i,t,n){const e=pn(i,t,n);return e?wn(e.center,e.radius):null}function Bs(i,t,n){const e=rt(n,i);if(M.isNonPositive(e))return null;const s=dt(n,i),r=dt(n,t),o=p.normalizeAngle(r-s);return q.fromMathAngles(n,e,s,r,o>Math.PI)}function qt(i,t,n,e){const s=rt(i,t),r=rt(i,n);if(M.isNonPositive(s)||M.isNonPositive(r))return null;const o=Math.max(C,s*C);return Math.abs(s-r)>o?null:q.fromMathAngles(i,s,dt(i,t),dt(i,n),e)}function qs(i,t,n,e){const s=rt(i,t);if(M.isNonPositive(s))return null;const r=ze(i,s,n);return r?qt(i,t,r,e):null}function Ie(i,t,n){const e=rt(i,t),s=Math.abs(n);if(M.isNonPositive(e)||M.isNonPositive(s)||!M.great(b-s,0))return null;const r=n<0,o=dt(i,t),a=r?o-s:o+s;return q.fromMathAngles(i,e,o,a,r)}function vs(i,t,n){const e=rt(i,t),s=Math.abs(n);if(M.isNonPositive(e)||M.isNonPositive(s)||M.great(s,2*e))return null;const r=Math.max(-1,Math.min(1,s/(2*e))),o=2*Math.asin(r);return Ie(i,t,n>=0?o:-o)}function Vs(i,t,n){const e=rt(i,t),s=Math.abs(n);if(M.isNonPositive(e)||M.isNonPositive(s)||!M.great(b-s,0))return null;const r=Math.sin(s/2);if(M.equalToZero(r))return null;const o=e/(2*r),a=o*o-e*e/4;if(M.less(a,0))return null;const c=Math.sqrt(Math.max(0,a)),h=(i.x+t.x)/2,l=(i.y+t.y)/2,u=t.x-i.x,g=-(t.y-i.y)/e,m=u/e,f=n>=0,y=f&&s<=Math.PI||!f&&s>Math.PI?1:-1,S={x:h+g*c*y,y:l+m*c*y};return qt(S,i,t,!f)}function Ls(i,t,n){const e=Math.cos(n),s=Math.sin(n),r=t.x-i.x,o=t.y-i.y,a=-s,c=e,h=2*(r*a+o*c);if(M.equalToZero(h))return null;const l=(r*r+o*o)/h;if(!Number.isFinite(l))return null;const u={x:i.x+a*l,y:i.y+c*l},d=i.x-u.x,g=i.y-u.y,m=d*s-g*e;return M.equalToZero(m)?null:qt(u,i,t,m<0)}function js(i,t,n){const e=Math.abs(n),s=rt(i,t);if(M.isNonPositive(e)||M.isNonPositive(s)||M.great(s,2*e))return null;const r=(i.x+t.x)/2,o=(i.y+t.y)/2,a=t.x-i.x,h=-(t.y-i.y)/s,l=a/s,u=Math.sqrt(Math.max(0,e*e-s*s/4)),d=n>=0?1:-1,g={x:r+h*u*d,y:o+l*u*d};return qt(g,i,t,n<0)}class Te{constructor(){this._boundingBoxNeedsUpdate=!1}get boundingBoxNeedUpdate(){return this._boundingBoxNeedsUpdate}}class Mn extends Te{translate(t){return this.transform(new pt().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 Mn{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 n=this.getUtoTmapping(t);return this.getPoint(n)}getPoints(t=5){const n=[];for(let e=0;e<=t;e++)n.push(this.getPoint(e/t));return n}getSpacedPoints(t=5){const n=[];for(let e=0;e<=t;e++)n.push(this.getPointAt(e/t));return n}getLength(){const t=this.getLengths();return t[t.length-1]}getLengths(t=this.arcLengthDivisions){const n=[];let e,s=this.getPoint(0),r=0;n.push(0);for(let o=1;o<=t;o++)e=this.getPoint(o/t),r+=e.distanceTo(s),n.push(r),s=e;return n}getUtoTmapping(t,n){const e=this.getLengths();let s=0;const r=e.length;let o;n?o=n:o=t*e[r-1];let a=0,c=r-1,h;for(;a<=c;)if(s=Math.floor(a+(c-a)/2),h=e[s]-o,h<0)a=s+1;else if(h>0)c=s-1;else{c=s;break}if(s=c,e[s]===o)return s/(r-1);const l=e[s],d=e[s+1]-l,g=(o-l)/d;return(s+g)/(r-1)}getTangent(t){let e=t-1e-4,s=t+1e-4;e<0&&(e=0),s>1&&(s=1);const r=this.getPoint(e),o=this.getPoint(s),a=new P;return a.copy(o).sub(r).normalize(),a}getTangentAt(t){const n=this.getUtoTmapping(t);return this.getTangent(n)}}const O=class O extends zt{constructor(t,n,e,s,r){super();const o=+(t!==void 0)+ +(n!==void 0)+ +(e!==void 0)+ +(s!==void 0)+ +(r!==void 0);if(o==3)typeof t=="object"&&typeof n=="object"&&typeof e=="object"?this.createByThreePoints(t,n,e):this.createByStartEndPointsAndBulge(t,n,e);else if(o==5){const a=t;this.center=new P(a.x,a.y),this.radius=n,this._clockwise=r,this._startAngle=this._clockwise?this._mirrorAngle(p.normalizeAngle(e)):p.normalizeAngle(e),this._endAngle=this._clockwise?this._mirrorAngle(p.normalizeAngle(s)):p.normalizeAngle(s)}else throw V.AcCmErrors.ILLEGAL_PARAMETERS}static fromMathAngles(t,n,e,s,r){const o=new O(t,n,p.normalizeAngle(e),p.normalizeAngle(s),!1);return o._clockwise=r,o._boundingBoxNeedsUpdate=!0,o}static computeCircumcircle(t,n,e){return pn(t,n,e)}static projectPoint(t,n,e){return ze(t,n,e)}static pointLiesOnCircle(t,n,e,s){return be(t,n,e,s)}static sameCircle(t,n,e,s,r){return Se(t,n,e,s,r)}static isBetterDistanceAlign(t,n,e,s){return Ce(t,n,e,s)}static tryCreateByThreePoints(t,n,e,s=!1){return Ee(t,n,e,s)}static tryCreateCircle(t,n){return wn(t,n)}static tryCreateCircleByDiameter(t,n){return Rs(t,n)}static tryCreateCircleByThreePoints(t,n,e){return Ns(t,n,e)}static tryCreateShorterArc(t,n,e){return Bs(t,n,e)}static tryCreateByCenterStartEnd(t,n,e,s){return qt(t,n,e,s)}static tryCreateByCenterStartProjectedEnd(t,n,e,s){return qs(t,n,e,s)}static tryCreateByCenterStartSweep(t,n,e){return Ie(t,n,e)}static tryCreateByCenterStartChord(t,n,e){return vs(t,n,e)}static tryCreateByStartEndAngle(t,n,e){return Vs(t,n,e)}static tryCreateByStartEndDirection(t,n,e){return Ls(t,n,e)}static tryCreateByStartEndRadius(t,n,e){return js(t,n,e)}createByThreePoints(t,n,e){const s=Ee(t,n,e);if(!s)throw V.AcCmErrors.ILLEGAL_PARAMETERS;this.center=s.center,this.radius=s.radius,this._clockwise=s._clockwise,this._startAngle=s._startAngle,this._endAngle=s._endAngle,this._boundingBoxNeedsUpdate=!0}createByStartEndPointsAndBulge(t,n,e){let s,r,o;e<0?(s=Math.atan(-e)*4,r=new B(t),o=new B(n)):(s=Math.atan(e)*4,r=new B(n),o=new B(t));const a=new B().subVectors(o,r),c=a.length(),h=new B().addVectors(r,a.multiplyScalar(.5)),l=Math.abs(c/2/Math.tan(s/2)),u=a.normalize(),d=e<0?-Math.PI/2:Math.PI/2,g=new B(u.x*Math.cos(d)-u.y*Math.sin(d),u.y*Math.cos(d)+u.x*Math.sin(d));let m;s<Math.PI?e<0?m=h.add(g.multiplyScalar(l)):m=h.add(g.multiplyScalar(-l)):e<0?m=h.add(g.multiplyScalar(-l)):m=h.add(g.multiplyScalar(l)),e<0?(this._startAngle=Math.atan2(r.y-m.y,r.x-m.x),this._endAngle=Math.atan2(o.y-m.y,o.x-m.x)):(this._startAngle=Math.atan2(o.y-m.y,o.x-m.x),this._endAngle=Math.atan2(r.y-m.y,r.x-m.x)),this._clockwise=e<0,this.center=m,this.radius=o.sub(m).length()}get center(){return this._center}set center(t){this._center=new P(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 n=this.startAngle==0&&t==b?t:p.normalizeAngle(t);this._endAngle=this._clockwise?this._mirrorAngle(n):n,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),n=this._getInternalAngle(this.endAngle);return this.clockwise?p.normalizeAngle(t-n):p.normalizeAngle(n-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),n=this._clockwise?p.normalizeAngle(t-this.deltaAngle/2):p.normalizeAngle(t+this.deltaAngle/2),e=this._clockwise?this._mirrorAngle(n):n;return this.getPointAtAngle(e)}get closed(){const t=this._getInternalAngle(this.startAngle),n=this._getInternalAngle(this.endAngle);return Math.abs(n-t)/Math.PI%2==0}calculateBoundingBox(){const t=[this.startPoint,this.endPoint],n=[0,Math.PI/2,Math.PI,3*Math.PI/2];for(const r of n){const o=this._getInternalAngle(r);p.isBetweenAngle(o,this._getInternalAngle(this.startAngle),this._getInternalAngle(this.endAngle),this.clockwise)&&t.push(this.getPointAtAngle(r))}const e=t.map(r=>r.x),s=t.map(r=>r.y);return new Q(new P(Math.min(...e),Math.min(...s)),new P(Math.max(...e),Math.max(...s)))}get length(){return Math.abs(this.deltaAngle*this.radius)}transform(t){const n=t,e=this.center.clone().applyMatrix2d(n),s=this.startPoint.clone().applyMatrix2d(n);if(this.closed)return this.center=e,this.radius=e.distanceTo(s),this._startAngle=Math.atan2(s.y-e.y,s.x-e.x),this._endAngle=this._startAngle,this._clockwise=n.determinant()<0?!this._clockwise:this._clockwise,this._boundingBoxNeedsUpdate=!0,this;const r=this.midPoint.clone().applyMatrix2d(n),o=this.endPoint.clone().applyMatrix2d(n),a=new O(s,r,o),c=n.determinant()<0?!this.clockwise:this.clockwise,h=l=>{const u=p.normalizeAngle(l);return c?this._mirrorAngle(u):u};return this.center=a.center,this.radius=a.radius,this.clockwise=c,this.startAngle=h(Math.atan2(s.y-a.center.y,s.x-a.center.x)),this.endAngle=h(Math.atan2(o.y-a.center.y,o.x-a.center.x)),this._boundingBoxNeedsUpdate=!0,this}clone(){return new O(this.center.clone(),this.radius,this._startAngle,this._endAngle,this.clockwise)}getPointAtAngle(t){const n=this._getInternalAngle(t),e=this.center.x+this.radius*Math.cos(n),s=this.center.y+this.radius*Math.sin(n);return new P(e,s)}getQuadrantPoints(){const t=[],n=this._getInternalAngle(this.startAngle),e=this._getInternalAngle(this.endAngle),s=[0,Math.PI/2,Math.PI,3*Math.PI/2];for(const r of s){const o=this._getInternalAngle(r);p.isBetweenAngle(o,n,e,this.clockwise)&&t.push(this.getPointAtAngle(r))}return t}nearestPoint(t){const n=new P(t.x,t.y),e=n.x-this.center.x,s=n.y-this.center.y;if(Math.hypot(e,s)<1e-12)return this.startPoint.clone();const o=Math.atan2(s,e),a=this.clockwise?this._mirrorAngle(p.normalizeAngle(o)):p.normalizeAngle(o),c=this._getInternalAngle(a),h=this._getInternalAngle(this.startAngle),l=this._getInternalAngle(this.endAngle);if(p.isBetweenAngle(c,h,l,this.clockwise))return this.getPointAtAngle(a);const u=n.distanceToSquared(this.startPoint),d=n.distanceToSquared(this.endPoint);return u<=d?this.startPoint.clone():this.endPoint.clone()}inwardAlignment(t,n){const e=n.x-t.x,s=n.y-t.y;if(e*e+s*s<1e-24)return 0;const r=this.radius>0?this.radius:1,o=Math.max(1e-16,1e-12*r*r),a=this.startPoint.distanceToSquared(t)<=o,c=this.endPoint.distanceToSquared(t)<=o;if(!a&&!c)return 0;const h=this.getPoints(8);if(h.length<3)return 0;const l=a&&!c?h[1]:h[h.length-2],u=l.x-t.x,d=l.y-t.y,g=Math.hypot(u,d);return g>1e-18?(e*u+s*d)/g:0}perpendicularPoints(t){const n=new P(t.x,t.y),e=n.x-this.center.x,s=n.y-this.center.y,r=Math.hypot(e,s);if(r<1e-12)return[];const o=e/r,a=s/r,c=[new P(this.center.x+o*this.radius,this.center.y+a*this.radius),new P(this.center.x-o*this.radius,this.center.y-a*this.radius)],h=[],l=this._getInternalAngle(this.startAngle),u=this._getInternalAngle(this.endAngle);for(const d of c){const g=Math.atan2(d.y-this.center.y,d.x-this.center.x),m=this.clockwise?this._mirrorAngle(p.normalizeAngle(g)):p.normalizeAngle(g),f=this._getInternalAngle(m);(this.closed||p.isBetweenAngle(f,l,u,this.clockwise))&&h.push(d)}return h}tangentPoints(t){const n=[],e=t.x-this.center.x,s=t.y-this.center.y,r=Math.hypot(e,s),o=this.radius;if(r<o)return n;const a=Math.acos(o/r),c=Math.atan2(s,e),h=[c+a,c-a],l=this._getInternalAngle(this.startAngle),u=this._getInternalAngle(this.endAngle);for(const d of h){const g=this.clockwise?this._mirrorAngle(p.normalizeAngle(d)):p.normalizeAngle(d),m=this._getInternalAngle(g);(this.closed||p.isBetweenAngle(m,l,u,this.clockwise))&&n.push(this.getPointAtAngle(g))}return n}getPoints(t=100){const n=[];let e=this.deltaAngle,s=this._getInternalAngle(this.startAngle);if(this.closed&&(e=b,s=0),this.clockwise)for(let r=0;r<=t;r++){const o=s-e*(r/t),a=this._clockwise?this._mirrorAngle(o):o,c=this.getPointAtAngle(a);n.push(new P(c.x,c.y))}else for(let r=0;r<=t;r++){const o=s+e*(r/t),a=this._clockwise?this._mirrorAngle(o):o,c=this.getPointAtAngle(a);n.push(new P(c.x,c.y))}return n}tessellate(t){const n=this.closed?b:this.deltaAngle,e=O.segmentCount(this.radius,n,{...t,minSegments:(t==null?void 0:t.minSegments)??(this.closed?8:3)});return this.getPoints(e)}static resolveCircleSides(t){return t==null||!Number.isFinite(t)?O.DEFAULT_CIRCLE_SIDES:W(Math.round(t),O.MIN_CIRCLE_SIDES,O.MAX_CIRCLE_SIDES)}static resolveTessellateOptions(t){const n=O.resolveCircleSides(t==null?void 0:t.circleSides),e=Math.max(1,Math.round((t==null?void 0:t.maxSegments)??n));return{deviation:t==null?void 0:t.deviation,circleSides:n,minSegments:t==null?void 0:t.minSegments,maxSegments:e}}static chordDeviationFromRadius(t,n=O.DEFAULT_CIRCLE_SIDES){const e=Math.abs(t),s=O.resolveCircleSides(n);return e<=C?C:Math.max(C,e*(1-Math.cos(Math.PI/s)))}static segmentCount(t,n,e){const s=O.resolveTessellateOptions(e),r=Math.abs(n),o=r>=b-1e-8,a=Math.max(1,Math.round(s.minSegments??(o?8:3))),c=Math.max(a,s.maxSegments),h=Math.abs(t);if(h<=C||r<=C)return a;const u=1-(s.deviation??O.chordDeviationFromRadius(h,s.circleSides))/h;if(!Number.isFinite(u)||u>=1)return c;if(u<=-1)return a;const d=2*Math.acos(u);return d<=C?c:W(Math.ceil(r/d),a,c)}};O.DEFAULT_CIRCLE_SIDES=100,O.MIN_CIRCLE_SIDES=8,O.MAX_CIRCLE_SIDES=2e4;let q=O;function Fs(i){const t=Math.abs(i);if(t<.1){const n=t*t,e=1-n/20*(1-n/42*(1-n/72*(1-n/110))),s=t*n/6*e;return i<0?-s:s}return i-Math.sin(i)}function Os(i,t){const n=i.length;if(!t||n<2)return 0;const e=i[0].x,s=i[0].y;let r=0;for(let o=0;o<n;++o){const a=i[o],c=i[(o+1)%n],h=a.x-e,l=a.y-s,u=c.x-e,d=c.y-s;r+=.5*(h*d-u*l);const g=a.bulge??0,m=u-h,f=d-l,x=m*m+f*f;if(g===0||!(x>0))continue;const y=4*Math.atan(g),S=Math.sin(y/2),k=x/(4*S*S);r+=.5*k*Fs(y)}return Math.abs(r)}const Xt=1e-6;function ke(i,t){if(hi(i)){const r=Ds(i,t);return r?[r]:[]}const n=Ve(i);if(n.numberOfVertices<2)return[];const s=ui(n,t);return s?[s]:[]}function Us(i){return Ve(i)}function Ds(i,t){const n=Xs(i);if(n.length===0)return null;const e=[];for(const a of n){const c=Zs(a,t);if(!c)return null;e.push(c)}const s=Ys(i),r=Qs(e,s,i.closed,t);if(r.length<2)return null;const o=new gt;return r.forEach((a,c)=>{o.addVertexAt(c,{x:a.x,y:a.y})}),o.closed=i.closed,o}function Xs(i){const t=[],n=i.numberOfVertices,e=i.closed?n:n-1;for(let s=0;s<e;s++){const r=i.vertices[s],o=i.vertices[(s+1)%n];M.isPositive(Math.abs(r.bulge??0))?t.push({kind:"arc",arc:new q(r,o,r.bulge)}):t.push({kind:"line",start:new P(r.x,r.y),end:new P(o.x,o.y)})}return t}function Ys(i){const t=[];for(let n=0;n<i.numberOfVertices;n++)t.push(i.getPointAt(n));return t}function Zs(i,t){if(i.kind==="line"){const e=Ks(i.start,i.end,t);return e?{kind:"line",...e}:null}const n=Gs(i.arc,i.arc.startPoint,i.arc.endPoint,t);return n?{kind:"arc",arc:n}:null}function Gs(i,t,n,e){const s=Ws(i,t,n,e),r=i.radius+s;return M.isNonPositive(r)?null:new q(i.center,r,i.startAngle,i.endAngle,i.clockwise)}function Ws(i,t,n,e){const s=n.x-t.x,r=n.y-t.y,o=Math.hypot(s,r);if(M.isNonPositive(o))return i.clockwise?-e:e;const a=-r/o,c=s/o,h=i.center.x-(t.x+n.x)/2,l=i.center.y-(t.y+n.y)/2;return h*a+l*c>0?-e:e}function Ks(i,t,n){const e=t.x-i.x,s=t.y-i.y,r=Math.hypot(e,s);if(M.isNonPositive(r))return null;const o=-s/r*n,a=e/r*n;return{start:new P(i.x+o,i.y+a),end:new P(t.x+o,t.y+a),dx:e,dy:s}}function Qs(i,t,n,e){var a;const s=i.length;if(s===0)return[];const r=$s(i,t,n,e),o=[((a=r[0].nextSegmentStart)==null?void 0:a.clone())??r[0].point.clone()];for(let c=0;c<s;c++){const h=i[c],l=c===s-1&&!n?{point:ei(h)}:r[(c+1)%s];if(c>0&&r[c].filletPoints&&r[c].filletPoints.forEach(u=>o.push(u.clone())),h.kind==="arc"){const u=r[c].nextSegmentStart??r[c].point,d=l.point,g=Hs(h.arc,u,d,Math.max(16,32));for(let m=1;m<g.length;m++)o.push(g[m])}else o.push(l.point.clone())}return Le(o)}function $s(i,t,n,e){const s=i.length,r=[];for(let o=0;o<s;o++)o===0?r.push(n?Re(i[s-1],i[0],t[0],e):{point:ni(i[0])}):r.push(Re(i[o-1],i[o],t[o],e));return r}function Hs(i,t,n,e){const s=i.nearestPoint(t),r=i.nearestPoint(n),o=zn(i,s),a=zn(i,r),c=ti(i,o,a),h=[];for(let l=0;l<=e;l++){const u=l/e,d=i.clockwise?o-c*u:o+c*u;h.push(i.getPointAtAngle(Js(i,d)))}return h}function zn(i,t){return Math.atan2(t.y-i.center.y,t.x-i.center.x)}function Js(i,t){const n=p.normalizeAngle(t);return i.clockwise?bn(n):n}function bn(i){return(360-i*180/Math.PI)%360*(Math.PI/180)}function ti(i,t,n){if(i.clockwise){let s=t-n;return M.isNonPositive(s)&&(s+=b),s}let e=n-t;return M.isNonPositive(e)&&(e+=b),e}function ni(i){return i.kind==="line"?i.start.clone():i.arc.startPoint.clone()}function ei(i){return i.kind==="line"?i.end.clone():i.arc.endPoint.clone()}function Re(i,t,n,e){return i.kind==="line"&&t.kind==="line"?{point:Sn({start:i.start,end:i.end,dx:i.dx,dy:i.dy},{start:t.start,end:t.end,dx:t.dx,dy:t.dy})}:i.kind==="line"&&t.kind==="arc"?Ne(i,t.arc,n,e,!0):i.kind==="arc"&&t.kind==="line"?Ne(t,i.arc,n,e,!1):i.kind==="arc"&&t.kind==="arc"?si(i.arc,t.arc,n,e):{point:n.clone()}}function si(i,t,n,e){const s=ve(i.endPoint,t.startPoint),o=ci(i,t).filter(l=>Yt(i,l)&&Yt(t,l));if(o.length>0)return{point:qe(o,s)};const a=i.endPoint.clone(),c=t.startPoint.clone(),h=Be(n,Math.abs(e),a,c);return{point:a,filletPoints:h,nextSegmentStart:c}}function Ne(i,t,n,e,s){const r=ve(s?i.end:i.start,s?t.startPoint:t.endPoint),o=ai(i,t,r);if(ri(i,o)&&Yt(t,o))return{point:o};const a=ii(i,n,e),c=s?t.startPoint.clone():t.endPoint.clone(),h=Be(n,Math.abs(e),s?a:c,s?c:a);return s?{point:a,filletPoints:h,nextSegmentStart:c}:{point:c,filletPoints:h,nextSegmentStart:a}}function ii(i,t,n){const e=Math.hypot(i.dx,i.dy),s=-i.dy/e*n,r=i.dx/e*n;return new P(t.x+s,t.y+r)}function ri(i,t){const n=Math.hypot(i.dx,i.dy);if(M.isNonPositive(n))return!1;const e=i.dx/n,s=i.dy/n,r=t.x-i.start.x,o=t.y-i.start.y,a=Math.abs(r*s-o*e);return M.equalToZero(a)}function Be(i,t,n,e){const s=Math.atan2(n.y-i.y,n.x-i.x),r=Math.atan2(e.y-i.y,e.x-i.x),o=oi(s,r);if(M.equalToZero(Math.abs(o)))return[];const a=[],c=Math.max(2,Math.ceil(Math.abs(o)/Math.PI*16));for(let h=1;h<c;h++){const l=h/c,u=s+o*l;a.push(new P(i.x+t*Math.cos(u),i.y+t*Math.sin(u)))}return a}function oi(i,t){let n=t-i;for(;n>Math.PI;)n-=b;for(;n<=-Math.PI;)n+=b;return n}function ai(i,t,n){const e=Math.hypot(i.dx,i.dy);if(M.isNonPositive(e))return n.clone();const s=i.dx/e,r=i.dy/e,o=i.start.x-t.center.x,a=i.start.y-t.center.y,c=2*(o*s+a*r),h=o*o+a*a-t.radius*t.radius,l=c*c-4*h;if(l<0)return n.clone();const u=Math.sqrt(l),d=[(-c-u)/2,(-c+u)/2].map(m=>new P(i.start.x+s*m,i.start.y+r*m)),g=d.filter(m=>Yt(t,m));return qe(g.length>0?g:d,n)}function Yt(i,t){const n=Math.abs(Math.hypot(t.x-i.center.x,t.y-i.center.y)-i.radius);if(M.isPositive(n))return!1;const e=zn(i,t),s=i.clockwise?bn(p.normalizeAngle(i.startAngle)):p.normalizeAngle(i.startAngle),r=i.clockwise?bn(p.normalizeAngle(i.endAngle)):p.normalizeAngle(i.endAngle);return p.isBetweenAngle(e,s,r,i.clockwise)}function ci(i,t){const n=t.center.x-i.center.x,e=t.center.y-i.center.y,s=Math.hypot(n,e);if(M.isNonPositive(s))return[];const r=i.radius+t.radius,o=Math.abs(i.radius-t.radius);if(s>r+Xt)return[];if(s<o-Xt)return[];const a=(i.radius*i.radius-t.radius*t.radius+s*s)/(2*s),c=i.radius*i.radius-a*a;if(c<-Xt)return[];const h=i.center.x+a*n/s,l=i.center.y+a*e/s;if(c<=Xt)return[new P(h,l)];const u=Math.sqrt(c),d=-e*u/s,g=n*u/s;return[new P(h+d,l+g),new P(h-d,l-g)]}function qe(i,t){let n=i[0],e=n.distanceToSquared(t);for(let s=1;s<i.length;s++){const r=i[s].distanceToSquared(t);r<e&&(n=i[s],e=r)}return n.clone()}function ve(i,t){return new P((i.x+t.x)/2,(i.y+t.y)/2)}function hi(i){const t=i.numberOfVertices,n=i.closed?t:t-1;for(let e=0;e<n;e++){const s=i.vertices[e];if(M.isPositive(Math.abs(s.bulge??0)))return!0}return!1}function Ve(i){const t=li(i.vertices.map(n=>new P(n.x,n.y)),i.closed);return t.length===i.numberOfVertices?i:new gt(t.map(n=>({x:n.x,y:n.y})),i.closed)}function li(i,t){const n=Le(i);if(!t||n.length<2)return n;const e=n[0],s=n[n.length-1];return M.isNonPositive(Math.hypot(e.x-s.x,e.y-s.y))&&n.pop(),n}function Le(i){const t=[];return i.forEach(n=>{const e=t[t.length-1];(!e||M.isPositive(Math.hypot(e.x-n.x,e.y-n.y)))&&t.push(new P(n.x,n.y))}),t}function ui(i,t){const n=[];for(let o=0;o<i.numberOfVertices;o++)n.push(i.getPointAt(o));const e=di(n,i.closed,t);if(e.length===0)return null;const s=[];if(i.closed){if(e.length<2)return null;const o=e.length;for(let a=0;a<o;a++){const c=e[(a-1+o)%o],h=e[a];s.push(Sn(c,h))}}else{s.push(e[0].start);for(let o=1;o<e.length;o++)s.push(Sn(e[o-1],e[o]));s.push(e[e.length-1].end)}const r=new gt;return s.forEach((o,a)=>{r.addVertexAt(a,{x:o.x,y:o.y})}),r.closed=i.closed,r}function di(i,t,n){const e=[],s=t?i.length:i.length-1;for(let r=0;r<s;r++){const o=i[r],a=i[t?(r+1)%i.length:r+1],c=a.x-o.x,h=a.y-o.y,l=Math.hypot(c,h);if(M.isNonPositive(l))continue;const u=-h/l*n,d=c/l*n;e.push({start:new P(o.x+u,o.y+d),end:new P(a.x+u,a.y+d),dx:c,dy:h})}return e}function Sn(i,t){const n=i.dx*t.dy-i.dy*t.dx;if(M.equalToZero(n))return new P((i.end.x+t.start.x)/2,(i.end.y+t.start.y)/2);const e=t.start.x-i.start.x,s=t.start.y-i.start.y,r=(e*t.dy-s*t.dx)/n;return new P(i.start.x+r*i.dx,i.start.y+r*i.dy)}class gt extends zt{constructor(t=null,n=!1){super(),this._vertices=t||new Array,this._closed=n}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 P(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 n=this._vertices[0];return new P(n.x,n.y)}else{const n=this._vertices[t-1];return new P(n.x,n.y)}throw new Error("End point does not exist in an empty polyline.")}get length(){let t=0;const n=this._vertices.length;for(let e=0;e<n;++e){const s=this._vertices[e];let r=null;if(e<n-1?r=this._vertices[e+1]:e==n-1&&this.closed&&(r=this._vertices[0]),r)if(s.bulge){const o=new q(s,r,s.bulge);t+=o.length}else t+=new P(s.x,s.y).distanceTo(r)}return t}get area(){return Os(this._vertices,this._closed)}set closed(t){this._closed=t,this._boundingBoxNeedsUpdate=!0}addVertexAt(t,n){t<=0?this._vertices.unshift(n):this._vertices.splice(t,0,n),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,n){t?n!==void 0&&n>=0&&n<this._vertices.length&&(this._vertices=this._vertices.slice(0,n),this._boundingBoxNeedsUpdate=!0):(this._vertices=new Array,this._boundingBoxNeedsUpdate=!0)}getPointAt(t){const n=this._vertices[t];return new P(n.x,n.y)}calculateBoundingBox(){const t=this.getPoints(100);return new Q().setFromPoints(t)}transform(t){const n=t.determinant()<0;return this._vertices.forEach(e=>{const s=new P(e).applyMatrix2d(t);e.x=s.x,e.y=s.y,n&&e.bulge!=null&&(e.bulge=-e.bulge)}),this._boundingBoxNeedsUpdate=!0,this}clone(){return new gt(this._vertices.map(t=>({...t})),this._closed)}getPoints3d(t,n){const e=[];return this.getPoints(t).forEach(r=>e.push(new w().set(r.x,r.y,n))),e}getPoints(t){const n=[],e=this._vertices.length;for(let s=0;s<e;++s){const r=this._vertices[s];if(r.bulge){let o=null;if(s<e-1?o=this._vertices[s+1]:s==e-1&&this.closed&&(o=this._vertices[0]),o){const c=new q(r,o,r.bulge).getPoints(t),h=c.length;for(let l=0;l<h;++l){const u=c[l];n.push(new P(u.x,u.y))}}}else n.push(new P(r.x,r.y)),s==e-1&&this.closed&&n.push(n[0])}return n}tessellate(t){const n=[],e=this._vertices.length;for(let s=0;s<e;++s){const r=this._vertices[s];if(r.bulge){let o=null;if(s<e-1?o=this._vertices[s+1]:s===e-1&&this.closed&&(o=this._vertices[0]),o){const c=new q(r,o,r.bulge).tessellate(t);for(let h=0;h<c.length;++h)je(n,c[h])}}else je(n,r),s===e-1&&this.closed&&n.length>0&&n.push(n[0].clone())}return n}offset(t){return ke(this,t)}}function je(i,t){const n=i[i.length-1];if(n){const e=n.x-t.x,s=n.y-t.y;if(e*e+s*s<=C*C)return}i.push(new P(t.x,t.y))}function gi(i,t,n){const e=Math.hypot(t.x,t.y);if(M.isNonPositive(e))return null;const s=-t.y/e*n,r=t.x/e*n;return new w(i.x+s,i.y+r,i.z)}function mi(i,t,n){if(i.length<2)return null;const e=Us(new gt(i.map(r=>({x:r.x,y:r.y})),t));return ke(e,n)[0]??null}function fi(i,t,n,e){if(i.length<2||M.equalToZero(n))return null;const{points:s,tangents:r}=Oe(i,e);if(s.length<2)return null;const o=r??xi(s,t),a=yi(s,o,n),c=t?Ai(a):_i(a);if(c.length<2)return null;const h=new gt;return c.forEach((l,u)=>{h.addVertexAt(u,{x:l.x,y:l.y})}),h.closed=t,h}function xi(i,t){const n=i.length,e=new Array(n);for(let s=0;s<n;s++){let r=0,o=0;if(t){const c=i[(s-1+n)%n],h=i[(s+1)%n];r=h.x-c.x,o=h.y-c.y}else s===0?(r=i[1].x-i[0].x,o=i[1].y-i[0].y):s===n-1?(r=i[n-1].x-i[n-2].x,o=i[n-1].y-i[n-2].y):(r=i[s+1].x-i[s-1].x,o=i[s+1].y-i[s-1].y);const a=Math.hypot(r,o);M.isNonPositive(a)?e[s]=new P(1,0):e[s]=new P(r/a,o/a)}return e}function yi(i,t,n){return i.map((e,s)=>{const r=t[s],o=-r.y*n,a=r.x*n;return new P(e.x+o,e.y+a)})}function _i(i){let t=Zt(i);if(t.length<3)return t;for(;;){const n=Fe(t,!1);if(!n||(t=Zt([...t.slice(0,n.segmentA+1),n.point,...t.slice(n.segmentB+1)]),t.length<2))break}return t}function Ai(i){let t=Zt(i);if(t.length<4)return t;for(;;){const n=Fe(t,!0);if(!n||(t=Zt([...t.slice(0,n.segmentA+1),n.point,...t.slice(n.segmentB+1)]),t.length<3))break}return t}function Fe(i,t){const n=t?i.length:i.length-1;if(n<2)return null;for(let e=0;e<n;e++){const s=i[e],r=i[(e+1)%i.length];for(let o=e+1;o<n;o++){if(Pi(e,o,n,t))continue;const a=i[o],c=i[(o+1)%i.length],h=pi(s,r,a,c);if(h)return{point:h,segmentA:e,segmentB:o}}}return null}function Pi(i,t,n,e){return!!(t===i||t===i+1||e&&i===0&&t===n-1)}function pi(i,t,n,e){const s=t.x-i.x,r=t.y-i.y,o=e.x-n.x,a=e.y-n.y,c=s*a-r*o;if(M.equalToZero(c))return null;const h=n.x-i.x,l=n.y-i.y,u=(h*a-l*o)/c,d=(h*r-l*s)/c,g=Rt.equalPointTol;return u<-g||u>1+g||d<-g||d>1+g?null:new P(i.x+u*s,i.y+u*r)}function Oe(i,t){const n=[],e=[],s=t!=null&&t.length===i.length;return i.forEach((r,o)=>{const a=n[n.length-1];if((!a||M.isPositive(Math.hypot(a.x-r.x,a.y-r.y)))&&(n.push(new P(r.x,r.y)),s)){const c=t[o];e.push(new P(c.x,c.y))}}),{points:n,tangents:s?e:void 0}}function Zt(i){return Oe(i).points}class Cn extends Mn{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(n=>{n.transform(t)}),this._boundingBoxNeedsUpdate=!0,this}clone(){const t=new Cn;return this._loops.forEach(n=>{t.add(n.clone())}),t}getPoints(t){const n=[];for(let e=0;e<this.loops.length;++e){const r=this.loops[e].getPoints(t);n.push(r)}return n}tessellate(t){return this.loops.map(n=>n.tessellate(t))}buildHierarchy(t){var c;const n=this.tessellate(t),e=this.calculateBoundaryBoxes(n),s=this.sortBoundaryBoxesByAreas(e),r=new Map,o=s.length;for(let h=0;h<o;h++)r.set(s[h],{index:s[h],children:[]});const a={index:-1,children:[]};for(let h=0;h<o;h++){const l=s[h],u=n[l],d=e[l];let g=h+1;for(;g<o;g++){const m=s[g],f=n[m],x=e[m];if(x.containsBox(d)&&wi(u,f,x)){(c=r.get(m))==null||c.children.push(r.get(l));break}}g===o&&a.children.push(r.get(l))}return a}get area(){if(this._loops.length===0)return 0;let t=0;for(let n=0;n<this._loops.length;n++){const s=this._loops[n].getPoints(128),r=xn(s);n===0?t+=Math.abs(r):t-=Math.abs(r)}return t}calculateBoundaryBoxes(t){const n=[];return t.forEach(e=>{n.push(new Q().setFromPoints(e))}),n}sortBoundaryBoxesByAreas(t){const n=[];t.forEach((s,r)=>{const o=s.size,a=o.width*o.height;n.push({area:a,index:r})}),n.sort((s,r)=>s.area-r.area);const e=[];return n.forEach(s=>{e.push(s.index)}),e}}function wi(i,t,n){const e=n.size,s=Math.max(Math.max(e.width,e.height)*1e-9,C);for(const r of i)if(Mi(r,t)>s)return D.isPointInPolygon(r,t);return!1}function Mi(i,t){let n=1/0;for(let e=0,s=t.length-1;e<t.length;s=e++){const r=t[s],o=t[e],a=o.x-r.x,c=o.y-r.y,h=a*a+c*c;let l=h>0?((i.x-r.x)*a+(i.y-r.y)*c)/h:0;l=Math.max(0,Math.min(1,l)),n=Math.min(n,Math.hypot(i.x-(r.x+a*l),i.y-(r.y+c*l)))}return n}class zi extends Te{translate(t){return this.transform(new L().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 ft extends zi{static tessellateParametricCurve(t,n,e,s){const r=Math.max(2,Math.round(s.maxSegments)),o=Math.max(1,Math.round(s.minSegments)),a=Math.max(0,s.deviation)*Math.max(0,s.deviation);if(!Number.isFinite(t)||!Number.isFinite(n))return[e(0)];if(Math.abs(n-t)<=C)return[e(t)];const c=Math.min(r,Math.max(2,o+1)),h=Math.min(r,Math.max(c,8));let l=Si(t,n,h);const u=[];for(let g=0;g<l.length;g++)u.push(e(l[g]));let d=u.length;for(let g=0;g<8&&d<r;g++){const m=[];for(let x=0;x<l.length-1&&!(d>=r);x++){const y=(l[x]+l[x+1])/2,S=e(y);d++,bi(S,u[x],u[x+1])>a&&m.push({index:x,t:y,point:S})}if(m.length===0)break;const f=Ci(l,u,m);l=f.params,u.length=0;for(let x=0;x<f.points.length;x++)u.push(f.points[x])}return u}}function bi(i,t,n){const e=n.x-t.x,s=n.y-t.y,r=n.z-t.z,o=i.x-t.x,a=i.y-t.y,c=i.z-t.z,h=e*e+s*s+r*r;if(h<=C*C)return o*o+a*a+c*c;const l=W((o*e+a*s+c*r)/h,0,1),u=o-e*l,d=a-s*l,g=c-r*l;return u*u+d*d+g*g}function Si(i,t,n){if(n<=1)return[i];const e=[];for(let s=0;s<n;s++)e.push(s===n-1?t:i+(t-i)*s/(n-1));return e}function Ci(i,t,n){const e=[],s=[];let r=0;for(let o=0;o<i.length;o++)for(e.push(i[o]),s.push(t[o]);r<n.length&&n[r].index===o;)e.push(n[r].t),s.push(n[r].point),r++;return{params:e,points:s}}class $ extends ft{static computeCenterPoint(t,n,e){var s;return((s=Me(t,e,n))==null?void 0:s.center)??null}static tryCreateByThreePoints(t,n,e){const s=Me(t,e,n);if(!s)return null;const{center:r,radius:o}=s,a=new _(t.x-r.x,t.y-r.y,(t.z??0)-r.z),c=new _(e.x-r.x,e.y-r.y,(e.z??0)-r.z),h=new _(n.x-r.x,n.y-r.y,(n.z??0)-r.z);if(a.lengthSq()===0||h.lengthSq()===0)return null;const l=new _().crossVectors(a,h);if(l.lengthSq()===0&&(l.crossVectors(a,c),l.lengthSq()===0))return null;l.normalize();const u=a.clone().normalize(),d=new _().crossVectors(l,u),g=f=>p.normalizeAngle(Math.atan2(f.dot(d),f.dot(u)));p.isAngleOnCcwSweep(0,g(c),g(h))||(l.negate(),d.negate());let m=g(h);return M.equalToZero(m)&&(m=b),new $(r,o,0,m,l,u)}static createByThreePoints(t,n,e){return $.tryCreateByThreePoints(t,n,e)}constructor(t,n,e,s,r,o=_.X_AXIS){super(),this.center=t,this.radius=n,this.startAngle=e,this.endAngle=s,this.normal=r,this.refVec=o,(s-e)%b==0?(this.startAngle=0,this.endAngle=b):(this.startAngle=e,this.endAngle=s)}get center(){return this._center}set center(t){this._center=new w(t.x,t.y,t.z||0),this._boundingBoxNeedsUpdate=!0}get radius(){return this._radius}set radius(t){if(t<0)throw V.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==b?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,n=this.deltaAngle;this.closed&&(t=0,n=b);const e=t+n*.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:0}nearestPoint(t){const n=new _(t.x,t.y,t.z||0),e=this.center,s=this.normal,o=n.clone().sub(e).dot(s),c=n.clone().sub(s.clone().multiplyScalar(o)).clone().sub(e);if(c.lengthSq()===0)return this.startPoint.clone();c.normalize().multiplyScalar(this.radius);const h=e.clone().add(c),l=this.getAngle(h.clone()),u=this.startAngle,d=this.deltaAngle;let g=p.normalizeAngle(l-u);g<0&&(g=0),g>d&&(g=d);const m=this.getPointAtAngle(u+g),f=m.distanceTo(n),x=this.startPoint.distanceTo(n),y=this.endPoint.distanceTo(n);return x<f&&x<=y?this.startPoint.clone():y<f&&y<x?this.endPoint.clone():m}tangentPoints(t){const n=[],e=new _(t.x,t.y,t.z||0),s=this.center,r=this.normal,o=this.radius,c=e.clone().sub(s).dot(r),h=e.clone().sub(r.clone().multiplyScalar(c)),l=s.clone(),d=h.clone().sub(l).length();if(d<o)return n;const g=Math.acos(o/d),m=this.getAngle(h.clone()),f=[m+g,m-g];for(const x of f){const y=p.normalizeAngle(x-this.startAngle);y>=0&&y<=this.deltaAngle&&n.push(this.getPointAtAngle(this.startAngle+y))}return n}perpendicularPoints(t){const n=[],e=new _(t.x,t.y,t.z||0),s=this.center,r=this.normal,o=this.radius,c=e.clone().sub(s).dot(r),l=e.clone().sub(r.clone().multiplyScalar(c)).clone().sub(s);if(l.lengthSq()<1e-24)return n;l.normalize();const u=[s.clone().add(l.clone().multiplyScalar(o)),s.clone().sub(l.clone().multiplyScalar(o))];for(const d of u){const g=this.getAngle(d.clone()),m=p.normalizeAngle(g-this.startAngle);m>=0&&m<=this.deltaAngle&&n.push(new w(d.x,d.y,d.z||0))}return n}nearestTangentPoint(t){const n=this.tangentPoints(t);if(n.length===0)return null;const e=new w(t.x,t.y,t.z||0);return n.length===1||n[0].distanceTo(e)<n[1].distanceTo(e)?n[0]:n[1]}calculateBoundingBox(){const t=[this.startAngle,this.endAngle];for(let c=0;c<2*Math.PI;c+=Math.PI/2)p.isBetweenAngle(c,this.startAngle,this.endAngle)&&t.push(c);let n=1/0,e=1/0,s=1/0,r=-1/0,o=-1/0,a=-1/0;for(const c of t){const h=this.getPointAtAngle(c);h.x<n&&(n=h.x),h.y<e&&(e=h.y),h.z<s&&(s=h.z),h.x>r&&(r=h.x),h.y>o&&(o=h.y),h.z>a&&(a=h.z)}return new K({x:n,y:e,z:s},{x:r,y:o,z:a})}get closed(){return Math.abs(this.endAngle-this.startAngle)/Math.PI%2==0}getPoints(t){const n=[];let e=this.deltaAngle,s=this.startAngle;this.closed&&(e=b,s=0);for(let r=0;r<=t;r++){const o=s+e*(r/t),a=this.getPointAtAngle(o);n.push(a)}return n}tessellate(t){const n=this.closed?b:this.deltaAngle,e=$.segmentCount(this.radius,n,{...t,minSegments:(t==null?void 0:t.minSegments)??(this.closed?8:3)});return this.getPoints(e)}static segmentCount(t,n,e){return q.segmentCount(t,n,e)}transform(t){const n=this.center.clone().applyMatrix4(t),e=this.startPoint.clone().applyMatrix4(t),s=this.endPoint.clone().applyMatrix4(t),r=this.getPointAtAngle(this.closed?Math.PI/2:this.startAngle+this.deltaAngle/2).clone().applyMatrix4(t),o=new _(e).sub(n).normalize(),a=n.distanceTo(e);let c=new _().crossVectors(new _(e).sub(n),new _(r).sub(n)).normalize();c.lengthSq()===0&&(c=this.normal.clone().transformDirection(t));const h=l=>{const u=new _(l).sub(n);return Math.atan2(u.dot(Ue.crossVectors(c,o)),u.dot(o))};return this.center=n,this.radius=a,this.normal=c,this.refVec=o,this.startAngle=0,this.endAngle=this.closed?b:h(s),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 $(this.center.clone(),this.radius,this.startAngle,this.endAngle,this.normal,this.refVec)}getAngle(t){return t.sub(this.center),Math.atan2(t.dot(Ue.crossVectors(this.refVec,this.normal)),t.dot(this.refVec))}getPointAtAngle(t){const n=this.normal,e=this.refVec,s={x:n.y*e.z-n.z*e.y,y:n.z*e.x-n.x*e.z,z:n.x*e.y-n.y*e.x},r=this.center,o=this.radius;return new w(r.x+o*(e.x*Math.cos(t)+s.x*Math.sin(t)),r.y+o*(e.y*Math.cos(t)+s.y*Math.sin(t)),r.z+o*(e.z*Math.cos(t)+s.z*Math.sin(t)))}get plane(){const t=new _(this.center).distanceTo(dn);return new Mt(this.normal,t)}offset(t){const n=this.radius+t;return n<=0?null:new $(this.center,n,this.startAngle,this.endAngle,this.normal,this.refVec)}}const Ue=new _;class xt extends zt{constructor(t,n,e,s=0,r=b,o=!1,a=0){super(),this.center=t,this.majorAxisRadius=n,this.minorAxisRadius=e,(r-s)%b==0?(this.startAngle=0,this.endAngle=b):(this.startAngle=s,this.endAngle=r),this.clockwise=o,this.rotation=a}get center(){return this._center}set center(t){this._center=new w(t.x,t.y,t.z||0),this._boundingBoxNeedsUpdate=!0}get majorAxisRadius(){return this._majorAxisRadius}set majorAxisRadius(t){if(t<0)throw V.AcCmErrors.ILLEGAL_PARAMETERS;this._majorAxisRadius=t,this._boundingBoxNeedsUpdate=!0}get minorAxisRadius(){return this._minorAxisRadius}set minorAxisRadius(t){if(t<0)throw V.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==b?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 n=1/0,e=1/0,s=-1/0,r=-1/0;for(let o=0;o<=100;o++){const a=this.getPoint(o/100);n=Math.min(n,a.x),e=Math.min(e,a.y),s=Math.max(s,a.x),r=Math.max(r,a.y)}return new Q({x:n,y:e},{x:s,y:r})}get closed(){return this.deltaAngle==0}getPoint(t){const n=Math.PI*2;let e=this.endAngle-this.startAngle;const s=Math.abs(e)<Number.EPSILON;for(;e<0;)e+=n;for(;e>n;)e-=n;e<Number.EPSILON&&(s?e=0:e=n),this.clockwise===!0&&!s&&(e===n?e=-n:e=e-n);const r=this.startAngle+t*e;let o=this.center.x+this.majorAxisRadius*Math.cos(r),a=this.center.y+this.minorAxisRadius*Math.sin(r);if(this.rotation!==0){const c=Math.cos(this.rotation),h=Math.sin(this.rotation),l=o-this.center.x,u=a-this.center.y;o=l*c-u*h+this.center.x,a=l*h+u*c+this.center.y}return new P(o,a)}transform(t){const n=t,e=new P(this.center).applyMatrix2d(n),s=new w(e.x,e.y,this.center.z),r=this.getPointAtAngle(0).clone().applyMatrix2d(n),o=this.getPointAtAngle(Math.PI/2).clone().applyMatrix2d(n),a=new P(r).sub(e),c=new P(o).sub(e),h=a.length(),l=c.length(),u=Math.atan2(a.y,a.x),d=a.clone().normalize(),g=c.clone().normalize(),m=y=>{const S=new P(y).sub(e),k=S.dot(d),R=S.dot(g);return p.normalizeAngle(Math.atan2(R/l,k/h))},f=n.determinant()<0?!this.clockwise:this.clockwise,x=this.closed?new xt(s,h,l,0,b,f,u):new xt(s,h,l,m(this.startPoint.clone().applyMatrix2d(n)),m(this.endPoint.clone().applyMatrix2d(n)),f,u);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/b: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 xt(this.center,this.majorAxisRadius,this.minorAxisRadius,this.startAngle,this.endAngle,this.clockwise,this.rotation)}getFocusPoints(){const t=Math.max(this.majorAxisRadius,this.minorAxisRadius),n=Math.min(this.majorAxisRadius,this.minorAxisRadius);if(t-n<1e-9)return[];const e=Math.sqrt(t*t-n*n),s=Math.cos(this.rotation),r=Math.sin(this.rotation),o=this.majorAxisRadius>=this.minorAxisRadius,a=o?s:-r,c=o?r:s;return[new P(this.center.x-e*a,this.center.y-e*c),new P(this.center.x+e*a,this.center.y+e*c)]}getQuadrantPoints(){return this.closed?[this.getPoint(0),this.getPoint(.25),this.getPoint(.5),this.getPoint(.75)]:[]}nearestPoint(t){const n=new P(t.x,t.y);let e=this.getPoint(0),s=n.distanceToSquared(e);const r=72;for(let o=1;o<=r;o++){const a=this.getPoint(o/r),c=n.distanceToSquared(a);c<s&&(s=c,e=a)}return e}tangentPoints(t){const n=this._projectPointToLocal(t);return this._findSnapAngles(n,(s,r,o,a)=>{const c=-this.majorAxisRadius*a,h=this.minorAxisRadius*o;return(s-n.x)*h-(r-n.y)*c}).map(s=>this.getPointAtAngle(s))}perpendicularPoints(t){const n=this._projectPointToLocal(t);return this._findSnapAngles(n,(s,r,o,a)=>{const c=this.minorAxisRadius*o,h=this.majorAxisRadius*a;return(s-n.x)*h-(r-n.y)*c}).map(s=>this.getPointAtAngle(s))}_projectPointToLocal(t){const n=t.x-this.center.x,e=t.y-this.center.y,s=Math.cos(-this.rotation),r=Math.sin(-this.rotation);return{x:n*s-e*r,y:n*r+e*s}}_findSnapAngles(t,n,e=144){const s=this.majorAxisRadius,r=this.minorAxisRadius,o=this.startAngle,a=this.deltaAngle,c=[],h=d=>{const g=Math.cos(d),m=Math.sin(d);return n(s*g,r*m,g,m)};let l=o,u=h(l);for(let d=1;d<=e;d++){const g=o+a*d/e,m=h(g);if(Math.abs(u)<1e-10&&c.push(l),u*m<0){let f=l,x=g;for(let y=0;y<32;y++){const S=(f+x)/2;h(f)*h(S)<=0?x=S:f=S}c.push((f+x)/2)}l=g,u=m}return c}}class nt extends ft{constructor(t,n,e,s,r,o=0,a=b){super(),this.center=t,this.normal=n,this.majorAxis=e,this.majorAxisRadius=s,this.minorAxisRadius=r;const c=Math.abs(a-o);Math.abs(c-b)<1e-10||Math.abs(c-2*b)<1e-10?(this.startAngle=0,this.endAngle=b):(this.startAngle=o,this.endAngle=a)}get center(){return this._center}set center(t){this._center=new w(t.x,t.y,t.z||0),this._boundingBoxNeedsUpdate=!0}get majorAxisRadius(){return this._majorAxisRadius}set majorAxisRadius(t){if(t<0)throw V.AcCmErrors.ILLEGAL_PARAMETERS;this._majorAxisRadius=t,this._boundingBoxNeedsUpdate=!0}get minorAxisRadius(){return this._minorAxisRadius}set minorAxisRadius(t){if(t<0)throw V.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==b?t:p.normalizeAngle(t),this._boundingBoxNeedsUpdate=!0}get deltaAngle(){const t=this.endAngle-this.startAngle;return Math.abs(t-b)<1e-10?b: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,n=this.deltaAngle;(this.closed||Math.abs(n-b)<1e-10)&&(t=0,n=b);const e=t+n/2;return this.getPointAtAngle(e)}get isCircular(){return M.equal(this.majorAxisRadius,this.minorAxisRadius)}get length(){if(this.isCircular)return this.majorAxisRadius*Math.abs(this.deltaAngle);const t=1e3,n=this.deltaAngle/t;let e=0,s=this.getPointAtAngle(this.startAngle);for(let r=1;r<=t;r++){const o=this.startAngle+r*n,a=this.getPointAtAngle(o),c=a.x-s.x,h=a.y-s.y,l=a.z-s.z;e+=Math.sqrt(c*c+h*h+l*l),s=a}return e}get area(){return Math.abs(this.deltaAngle-b)>=1e-10?0:Math.PI*this.majorAxisRadius*this.minorAxisRadius}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 c=0;c<2*Math.PI;c+=Math.PI/2)p.isBetweenAngle(c,this.startAngle,this.endAngle)&&t.push(c);let n=1/0,e=1/0,s=1/0,r=-1/0,o=-1/0,a=-1/0;for(const c of t){const h=this.getPointAtAngle(c);h.x<n&&(n=h.x),h.y<e&&(e=h.y),h.z<s&&(s=h.z),h.x>r&&(r=h.x),h.y>o&&(o=h.y),h.z>a&&(a=h.z)}return new K({x:n,y:e,z:s},{x:r,y:o,z:a})}else{let n=1/0,e=1/0,s=1/0,r=-1/0,o=-1/0,a=-1/0;for(let c=0;c<=100;c++){const h=this.startAngle+this.deltaAngle*(c/100),l=this.getPointAtAngle(h);n=Math.min(n,l.x),e=Math.min(e,l.y),s=Math.min(s,l.z),r=Math.max(r,l.x),o=Math.max(o,l.y),a=Math.max(a,l.z)}return new K({x:n,y:e,z:s},{x:r,y:o,z:a})}}get closed(){return this.deltaAngle==0}getPoints(t=100){const n=[];let e=this.deltaAngle,s=this.startAngle;this.closed&&(e=b,s=0);for(let r=0;r<=t;r++){const o=s+e*(r/t),a=this.getPointAtAngle(o);n.push(a)}return n}tessellate(t){const n=q.resolveTessellateOptions(t),e=this.closed?b:this.deltaAngle,s=Math.max(this.majorAxisRadius,this.minorAxisRadius),r=Math.abs(e)>=b-1e-8,o=n.minSegments??(r?8:3);if(this.isCircular){const h=$.segmentCount(s,e,{...t,minSegments:o});return this.getPoints(h)}const a=n.deviation??q.chordDeviationFromRadius(s,n.circleSides),c=this.closed?0:this.startAngle;return ft.tessellateParametricCurve(c,c+e,h=>this.getPointAtAngle(h),{deviation:Math.max(C,a),minSegments:o,maxSegments:n.maxSegments})}getPointAtAngle(t){const n=Math.cos(t),e=Math.sin(t),s=this.minorAxis.clone().multiplyScalar(this.minorAxisRadius).multiplyScalar(e),r=this.majorAxis.clone().multiplyScalar(n*this.majorAxisRadius).add(s);return new w(this.center.x+r.x,this.center.y+r.y,this.center.z+r.z)}nearestPoint(t,n=72){const e=new w(t.x,t.y,t.z||0);let s=this.getPointAtAngle(this.startAngle),r=e.distanceToSquared(s);for(let c=1;c<=n;c++){const h=this.startAngle+this.deltaAngle*c/n,l=this.getPointAtAngle(h),u=e.distanceToSquared(l);u<r&&(r=u,s=l)}const o=e.distanceToSquared(this.startPoint),a=e.distanceToSquared(this.endPoint);return o<r&&o<=a?this.startPoint.clone():a<r&&a<o?this.endPoint.clone():s.clone()}tangentPoints(t){const n=this._projectPointToLocalPlane(t);return this._findSnapParameterAngles((s,r,o,a)=>{const c=-this.majorAxisRadius*a,h=this.minorAxisRadius*o;return(s-n.x)*h-(r-n.y)*c}).map(s=>this.getPointAtAngle(s))}perpendicularPoints(t){const n=this._projectPointToLocalPlane(t);return this._findSnapParameterAngles((s,r,o,a)=>{const c=this.minorAxisRadius*o,h=this.majorAxisRadius*a;return(s-n.x)*h-(r-n.y)*c}).map(s=>this.getPointAtAngle(s))}_projectPointToLocalPlane(t){const n=new w(t.x,t.y,t.z||0),e=new _(n).sub(this.center),s=e.dot(this.normal);return e.sub(this.normal.clone().multiplyScalar(s)),{x:e.dot(this.majorAxis),y:e.dot(this.minorAxis)}}_findSnapParameterAngles(t,n=144){const e=this.majorAxisRadius,s=this.minorAxisRadius,r=this.startAngle,o=this.deltaAngle,a=[],c=u=>{const d=Math.cos(u),g=Math.sin(u);return t(e*d,s*g,d,g)};let h=r,l=c(h);for(let u=1;u<=n;u++){const d=r+o*u/n,g=c(d);if(Math.abs(l)<1e-10&&a.push(h),l*g<0){let m=h,f=d;for(let x=0;x<32;x++){const y=(m+f)/2;c(m)*c(y)<=0?f=y:m=y}a.push((m+f)/2)}h=d,l=g}return a}contains(t){const n=new _(t).sub(this.center),e=n.dot(this.majorAxis),s=n.dot(this.minorAxis),r=e/this.majorAxisRadius,o=s/this.minorAxisRadius;return r*r+o*o<=1}transform(t){const n=t,e=this.center.clone().applyMatrix4(n),s=this.getPointAtAngle(0).clone().applyMatrix4(n),r=this.getPointAtAngle(Math.PI/2).clone().applyMatrix4(n),o=new _(s).sub(e),a=new _(r).sub(e),c=o.length(),h=a.length(),l=o.clone().normalize(),u=new _().crossVectors(o,a).normalize();let d=new _().crossVectors(u,l).normalize();d.dot(a)<0&&(u.negate(),d=new _().crossVectors(u,l).normalize());const g=f=>{const x=new _(f).sub(e),y=x.dot(l),S=x.dot(d);return p.normalizeAngle(Math.atan2(S/h,y/c))},m=this.closed?new nt(e,u,l,c,h,0,b):new nt(e,u,l,c,h,g(this.startPoint.clone().applyMatrix4(n)),g(this.endPoint.clone().applyMatrix4(n)));return this.center=m.center,this.normal=m.normal,this.majorAxis=m.majorAxis,this.majorAxisRadius=m.majorAxisRadius,this.minorAxisRadius=m.minorAxisRadius,this._startAngle=m._startAngle,this._endAngle=m._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 nt(this.center,this.normal,this.majorAxis,this.majorAxisRadius,this.minorAxisRadius,this.startAngle,this.endAngle)}get plane(){const t=new _(this.center).distanceTo(dn);return new Mt(this.normal,t)}offset(t){const n=this.majorAxisRadius+t,e=this.minorAxisRadius+t;return n<=0||e<=0?null:new nt(this.center,this.normal,this.majorAxis,n,e,this.startAngle,this.endAngle)}}class bt extends zt{constructor(t,n){super(),this._start=new P(t),this._end=new P(n)}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 P(Math.min(this._start.x,this._end.x),Math.min(this._start.y,this._end.y)),n=new P(Math.max(this._start.x,this._end.x),Math.max(this._start.y,this._end.y));return new Q(t,n)}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 bt(this._start.clone(),this._end.clone())}project(t){const n=this._end.x-this._start.x,e=this._end.y-this._start.y,s=n*n+e*e;if(s<1e-18)return this._start.clone();let r=((t.x-this._start.x)*n+(t.y-this._start.y)*e)/s;return r=Math.max(0,Math.min(1,r)),new P(this._start.x+r*n,this._start.y+r*e)}nearestPoint(t){return this.project(t)}}class Gt extends ft{constructor(t,n){super(),this._start=new w(t),this._end=new w(n)}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 w((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,n){return this.delta(n).multiplyScalar(t).add(this._start)}atLength(t,n=!1){if(n){const e=this.delta(yt).normalize();return new w(this._start).addScaledVector(e,t)}else{const e=this.delta(yt).normalize();return new w(this._end).addScaledVector(e,t)}}extend(t,n=!1){if(n){const e=yt.subVectors(this._start,this._end).normalize();this._start=new w(this._start).addScaledVector(e,t)}else{const e=this.delta(yt).normalize();this._end=new w(this._end).addScaledVector(e,t)}return this._boundingBoxNeedsUpdate=!0,this}closestPointToPointParameter(t,n){De.subVectors(t,this._start),Wt.subVectors(this.endPoint,this.startPoint);const e=Wt.dot(Wt);let r=Wt.dot(De)/e;return n&&(r=p.clamp(r,0,1)),r}closestPointToPoint(t,n,e){const s=this.closestPointToPointParameter(t,n);return this.delta(e).multiplyScalar(s).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 n=this.direction,s=yt.subVectors(t,this.startPoint).dot(n);return new w().copy(n).multiplyScalar(s).add(this.startPoint)}perpPoint(t){const n=this.direction,e=this.startPoint,r=yt.subVectors(t,e).dot(n),o=yt.copy(n).multiplyScalar(r);return new w().addVectors(e,o)}calculateBoundingBox(){const t=new w(Math.min(this._start.x,this._end.x),Math.min(this._start.y,this._end.y),Math.min(this._start.z,this._end.z)),n=new w(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 K(t,n)}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 Gt(this._start.clone(),this._end.clone())}offset(t){const n=this.startPoint,e=this.endPoint;if(Math.hypot(e.x-n.x,e.y-n.y)===0)return this.clone();const r=new _(e.x-n.x,e.y-n.y,0).normalize(),o=new _(-r.y,r.x,0);return new Gt(new w(n.x+o.x*t,n.y+o.y*t,n.z),new w(e.x+o.x*t,e.y+o.y*t,e.z))}}const yt=new _,De=new _,Wt=new _;class En{constructor(){this.c0=0,this.c1=0,this.c2=0,this.c3=0}init(t,n,e,s){this.c0=t,this.c1=e,this.c2=-3*t+3*n-2*e-s,this.c3=2*t-2*n+e+s}initCatmullRom(t,n,e,s,r){this.init(n,e,r*(e-t),r*(s-n))}initNonuniformCatmullRom(t,n,e,s,r,o,a){let c=(n-t)/r-(e-t)/(r+o)+(e-n)/o,h=(e-n)/o-(s-n)/(o+a)+(s-e)/a;c*=o,h*=o,this.init(n,e,c,h)}calc(t){const n=t*t,e=n*t;return this.c0+this.c1*t+this.c2*n+this.c3*e}}class Kt extends ft{constructor(t=[],n=!1,e="centripetal",s=.5){super(),this.isCatmullRomCurve3d=!0,this.type="CatmullRomCurve3d",this._tmp=new _,this._px=new En,this._py=new En,this._pz=new En,this._points=t.map(r=>new w(r)),this._closed=n,this._curveType=e,this._tension=s}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 w}get endPoint(){return this._points.length>0?this._points[this._points.length-1]:new w}get length(){if(this._points.length<2)return 0;let t=0;for(let n=1;n<this._points.length;n++)t+=this._points[n-1].distanceTo(this._points[n]);return this._closed&&this._points.length>2&&(t+=this._points[this._points.length-1].distanceTo(this._points[0])),t}getPoint(t,n=new w){const e=n,s=this._points,r=s.length;if(r===0)return e.set(0,0,0);if(r===1)return e.copy(s[0]);const o=(r-(this._closed?0:1))*t;let a=Math.floor(o),c=o-a;this._closed?a+=a>0?0:(Math.floor(Math.abs(a)/r)+1)*r:c===0&&a===r-1&&(a=r-2,c=1);let h,l;this._closed||a>0?h=s[(a-1)%r]:(this._tmp.subVectors(s[0],s[1]).add(s[0]),h=new w(this._tmp.x,this._tmp.y,this._tmp.z));const u=s[a%r],d=s[(a+1)%r];if(this._closed||a+2<r?l=s[(a+2)%r]:(this._tmp.subVectors(s[r-1],s[r-2]).add(s[r-1]),l=new w(this._tmp.x,this._tmp.y,this._tmp.z)),this._curveType==="centripetal"||this._curveType==="chordal"){const g=this._curveType==="chordal"?.5:.25;let m=Math.pow(h.distanceToSquared(u),g),f=Math.pow(u.distanceToSquared(d),g),x=Math.pow(d.distanceToSquared(l),g);f<1e-4&&(f=1),m<1e-4&&(m=f),x<1e-4&&(x=f),this._px.initNonuniformCatmullRom(h.x,u.x,d.x,l.x,m,f,x),this._py.initNonuniformCatmullRom(h.y,u.y,d.y,l.y,m,f,x),this._pz.initNonuniformCatmullRom(h.z,u.z,d.z,l.z,m,f,x)}else this._curveType==="catmullrom"&&(this._px.initCatmullRom(h.x,u.x,d.x,l.x,this._tension),this._py.initCatmullRom(h.y,u.y,d.y,l.y,this._tension),this._pz.initCatmullRom(h.z,u.z,d.z,l.z,this._tension));return e.set(this._px.calc(c),this._py.calc(c),this._pz.calc(c)),e}getPoints(t){const n=[];for(let e=0;e<=t;e++)n.push(this.getPoint(e/t));return n}setPoints(t){this._points=t.map(n=>new w(n)),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 Kt(this._points.map(t=>t.clone()),this._closed,this._curveType,this._tension)}transform(t){return this._points=this._points.map(n=>{const e=new w;return e.copy(n),e.applyMatrix4(t),e}),this._boundingBoxNeedsUpdate=!0,this}calculateBoundingBox(){if(this._points.length===0)return new K;const t=new K;return this._points.forEach(n=>{t.expandByPoint(n)}),t}}function Xe(i,t){const n=i.x-t[0],e=i.y-t[1],s=(i.z??0)-(t[2]??0);return n*n+e*e+s*s}class j{constructor(t,n,e,s){this._degree=t,this._knots=[...n],this._controlPoints=e.map(r=>({x:r.x,y:r.y,z:r.z})),this._weights=s?[...s]: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 j(this._degree,this._knots,this._controlPoints,this._weights)}point(t){return this.evaluate(t).point}evaluate(t){const n=this._controlPoints.map(e=>[e.x,e.y,e.z]);return xe(t,this._degree,this._knots,n,this._weights)}signedPlanarCurvatureAt(t){const n=this.evaluate(t);return ye(n.deriv1,n.deriv2)}getOffsetSamplePath2d(t,n=512){const e=Math.abs(t),{start:s,end:r}=this.getParameterRange(),o=this.length(),a=Math.max(64,Math.ceil(o/Math.max(e*.2,1e-6)));let c=Ei(s,r,Math.min(a,n));for(let u=0;u<8&&c.length<n;u++){const d=[];for(let g=0;g<c.length-1;g++){const m=c[g],f=c[g+1],x=(m+f)/2,y=Math.max(Math.abs(this.signedPlanarCurvatureAt(m)),Math.abs(this.signedPlanarCurvatureAt(f)),Math.abs(this.signedPlanarCurvatureAt(x)));e*y>.85&&d.push(x)}if(d.length===0)break;if(c=Ii(c,d),c.length>n){c=c.slice(0,n);break}}const h=[],l=[];return c.forEach(u=>{const d=this.evaluate(u);h.push(new P(d.point[0],d.point[1]));const g=d.deriv1[0],m=d.deriv1[1],f=Math.hypot(g,m);l.push(f>1e-10?new P(g/f,m/f):new P(1,0))}),{points:h,tangents:l}}length(){const t=this._controlPoints.map(n=>[n.x,n.y,n.z]);return _e(this._degree,this._knots,t,this._weights)}static byKnotsControlPointsWeights(t,n,e,s){return new j(t,n,e,s)}static byPoints(t,n,e="Uniform",s,r){const o=yn(t,n,e,s,r),a=o.controlPoints.map(c=>({x:c[0],y:c[1],z:c[2]}));return new j(n,o.knots,a,o.weights)}getParameterRange(){const t=this._knots[this._degree],n=this._knots[this._knots.length-this._degree-1];return{start:t,end:n}}getPoints(t){const n=[],{start:e,end:s}=this.getParameterRange();for(let r=0;r<=t;r++){const o=e+(s-e)*(r/t);n.push(this.point(o))}return n}isClosed(t=1e-6){const{start:n,end:e}=this.getParameterRange(),s=this.point(n),r=this.point(e),o=s[0]-r[0],a=s[1]-r[1],c=s[2]-r[2];return Math.sqrt(o*o+a*a+c*c)<t}static createFitPointsForClosedCurve(t){if(t.length<4)throw new Error("At least 4 points are required for a closed NURBS curve");const n=new Kt(t,!0,"centripetal"),e=Math.max(50,t.length*2);return n.getPoints(e)}nearestPoint(t,n=64){const{start:e,end:s}=this.getParameterRange();let r=this.point(e),o=Xe(t,r);for(let a=0;a<=n;a++){const c=e+(s-e)*a/n,h=this.point(c),l=Xe(t,h);l<o&&(o=l,r=h)}return{x:r[0],y:r[1],z:r[2]??0}}static createClosedCurve(t,n,e="Chord"){const r=this.createFitPointsForClosedCurve(t).map(o=>[o.x,o.y,o.z]);return j.byPoints(r,n,e)}}function Ei(i,t,n){if(n<2)return[i,t];const e=[];for(let s=0;s<n;s++)e.push(s===n-1?t:i+(t-i)*s/(n-1));return e}function Ii(i,t){const n=[...i,...t].sort((s,r)=>s-r),e=[];return n.forEach(s=>{const r=e[e.length-1];(r===void 0||Math.abs(r-s)>1e-10)&&e.push(s)}),e}function Ye(i){if(!i)return!1;const t=i.x??0,n=i.y??0,e=i.z??0;return t*t+n*n+e*e>1e-20}function Ti(i,t,n){let e=i??0;return e<1&&n>0&&t>0&&(e=n-t-1),e<1&&(e=3),e=Math.min(e,t-1),Math.max(1,e)}function ki(i,t,n){let e=i??0;e<1&&(e=3);const s=t+n-1;return e=Math.min(e,s),Math.max(1,e)}function Ri(i,t){if(!(!i||i.length!==t))return i}class Y extends ft{constructor(t,n,e,s,r,o){super();const a=arguments.length;if(this._degree=3,this._closed=!1,Array.isArray(n)){if(a<2||a>5)throw V.AcCmErrors.ILLEGAL_PARAMETERS;this._controlPoints=t;let c,h=3,l=!1;if(a>=3&&(Array.isArray(e)?(c=e,a>=4&&(h=s||3),a>=5&&(l=r)):e!==void 0&&(h=e||3,a>=4&&(l=s))),e===void 0&&a>=4&&(h=s||3,a>=5&&(l=r)),this._degree=h,this._closed=l,this._controlPoints.length<this._degree+1)throw V.AcCmErrors.ILLEGAL_PARAMETERS;this._nurbsCurve=j.byKnotsControlPointsWeights(this._degree,n,this._controlPoints,c)}else{if(a<2||a>6)throw V.AcCmErrors.ILLEGAL_PARAMETERS;this._fitPoints=t,this._knotParameterization=n,a>=3&&(this._degree=e||3);const c=typeof s=="boolean";a>=4&&c&&(this._closed=s),c?(a>=5&&(this._startTangent=r),a>=6&&(this._endTangent=o)):(a>=4&&(this._startTangent=s),a>=5&&(this._endTangent=r)),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 V.AcCmErrors.ILLEGAL_PARAMETERS;if(this._closed)this._nurbsCurve=j.createClosedCurve(this._fitPoints,this._degree,this._knotParameterization);else{const l=this.toNurbsPoints(this._fitPoints);this._nurbsCurve=j.byPoints(l,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(l=>[l.x,l.y,l.z||0]))}}buildCurve(){if(this._fitPoints&&this._knotParameterization){if(this._closed){const t=j.createFitPointsForClosedCurve(this._fitPoints),n=this.toNurbsPoints(t);this._nurbsCurve=j.byPoints(n,this._degree,this._knotParameterization)}else{const t=this.toNurbsPoints(this._fitPoints);this._nurbsCurve=j.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=j.createFitPointsForClosedCurve(this._controlPoints),n=this.toNurbsPoints(t);this._nurbsCurve=j.byPoints(n,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(),n=this._nurbsCurve.weights();this._nurbsCurve=j.byKnotsControlPointsWeights(this._degree,t,this._controlPoints,n)}}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(D.point2dToPoint3d)}get fitPoints(){var t;return(t=this._fitPoints)==null?void 0:t.map(D.point2dToPoint3d)}get knots(){return[...this._nurbsCurve.knots()]}get weights(){return[...this._nurbsCurve.weights()]}get startPoint(){const t=this._nurbsCurve.knots(),n=this._nurbsCurve.degree(),e=t[n],s=this._nurbsCurve.point(e);return new w(s[0],s[1],s[2])}get endPoint(){const t=this._nurbsCurve.knots(),n=this._nurbsCurve.degree(),e=t[t.length-n-1],s=this._nurbsCurve.point(e);return new w(s[0],s[1],s[2])}get length(){return this._nurbsCurve.length()}nearestPoint(t,n=64){const e=this._nurbsCurve.nearestPoint(t,n);return new w(e.x,e.y,e.z||0)}evaluateAt(t){const n=this._nurbsCurve.point(t);return new w(n[0],n[1],n[2])}getFitPointAt(t){if(!this._fitPoints)throw new Error("No fit points in this spline");const n=this._fitPoints.length,e=t<0||t>=n?n-1:t,s=this._fitPoints[e];return D.point2dToPoint3d(s)}getControlPointAt(t){const n=this._controlPoints.length,e=t<0||t>=n?n-1:t;return this._controlPoints[e]}get isFitPointSpline(){return!!(this._fitPoints&&this._fitPoints.length>0&&this._knotParameterization)}get isControlPointSpline(){return!this.isFitPointSpline}getGripPoints(){return this.isFitPointSpline?this._fitPoints.map(t=>new w(t.x,t.y,t.z??0)):this._controlPoints.map(t=>new w(t.x,t.y,t.z??0))}moveGripPointsAt(t,n){return this.isFitPointSpline?(this.moveFitPointsAt(t,n),this):(this.moveControlPointsAt(t,n),this)}moveFitPointsAt(t,n){if(this._fitPoints){for(const e of t){if(!Number.isInteger(e)||e<0)continue;const s=this._fitPoints[e];s&&D.applyOffsetToPoint3d(s,n)}this._boundingBoxNeedsUpdate=!0,this.buildCurve()}}moveControlPointsAt(t,n){for(const e of t){if(!Number.isInteger(e)||e<0)continue;const s=this.getControlPointAt(e);s&&D.applyOffsetToPoint3d(s,n)}this.rebuildAfterControlPointMutation()}rebuildAfterControlPointMutation(){const t=this._nurbsCurve.knots(),n=this._nurbsCurve.weights();this.isFitPointSpline&&(this._fitPoints=void 0,this._knotParameterization=void 0,this._startTangent=void 0,this._endTangent=void 0),this._nurbsCurve=j.byKnotsControlPointsWeights(this._degree,t,this._controlPoints,n.length>0?n:void 0),this._boundingBoxNeedsUpdate=!0}getOffsetSamplePath2d(t){return this._nurbsCurve.getOffsetSamplePath2d(t)}getPoints(t=100){const n=this._nurbsCurve,e=[],s=n.knots(),r=this._nurbsCurve.degree(),o=s[r],a=s[s.length-r-1],c=(a-o)/(t-1);for(let h=0;h<t;h++){const l=h===t-1?a:o+h*c,u=n.point(l);e.push(new w(u[0],u[1],u[2]))}return e}tessellate(t){const n=q.resolveTessellateOptions(t),e=this._nurbsCurve.knots(),s=this._nurbsCurve.degree();if(e.length<s+2)return[this.startPoint.clone(),this.endPoint.clone()];const r=e[s],o=e[e.length-s-1],a=n.circleSides,c=Math.abs(this.length),h=n.deviation??Math.max(C,c<=C?C:c/(2*a*a));return ft.tessellateParametricCurve(r,o,l=>this.evaluateAt(l),{deviation:h,minSegments:n.minSegments??(this.closed?8:2),maxSegments:n.maxSegments})}getCurvePoints(t,n){const e=[],s=t.knots(),r=t.degree(),o=s[r],c=(s[s.length-r-1]-o)/(n-1);for(let h=0;h<n;h++){const l=o+h*c;e.push(t.point(l))}return e}calculateBoundingBox(){const t=this.getPoints(100);return new K().setFromPoints(t)}get closed(){return this._closed}set closed(t){this.setClosed(t)}get area(){if(!this._closed)return 0;const t=this.getPoints(128);return de(t)}transform(t){if(this._fitPoints&&this._knotParameterization)this._fitPoints=this._fitPoints.map(n=>new w(n).applyMatrix4(t)),this._startTangent&&(this._startTangent=new w(this._startTangent).transformDirection(t)),this._endTangent&&(this._endTangent=new w(this._endTangent).transformDirection(t)),this.buildCurve();else{const n=this._nurbsCurve.knots(),e=this._nurbsCurve.weights();this._controlPoints=this._controlPoints.map(s=>new w(s).applyMatrix4(t)),this._nurbsCurve=j.byKnotsControlPointsWeights(this._degree,n,this._controlPoints,e.length>0?e:void 0)}return this._boundingBoxNeedsUpdate=!0,this}clone(){return this._fitPoints&&this._knotParameterization?new Y(this._fitPoints.map(D.point2dToPoint3d),this._knotParameterization,this._degree,this._closed,this._startTangent?D.point2dToPoint3d(this._startTangent):void 0,this._endTangent?D.point2dToPoint3d(this._endTangent):void 0):new Y(this._controlPoints.map(D.point2dToPoint3d),this._nurbsCurve.knots(),this._nurbsCurve.weights(),this._degree,this._closed)}toNurbsPoints(t){const n=new Array(t.length);return t.forEach((e,s)=>{n[s]=[e.x,e.y,e.z||0]}),n}toGePoints(t){const n=new Array(t.length);return t.forEach((e,s)=>{n[s]={x:e[0],y:e[1],z:e[2]}}),n}toNurbsPoint(t){return[t.x,t.y,t.z||0]}static createClosedSpline(t,n="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 Y(t,n,e,!0)}static fromControlPoints(t,n,e,s,r){if(t.length<2||n.length<2)return null;const o=Ti(s,t.length,n.length);if(t.length<o+1)return null;try{return new Y(t,n,Ri(e,t.length),o,r)}catch{return null}}static fromFitPoints(t,n,e,s,r,o){if(t.length<2)return null;const a=Ye(r),c=Ye(o),h=(a?1:0)+(c?1:0),l=ki(e,t.length,h);if(t.length+h<l+1)return null;try{return a||c?new Y(t,n,l,s,a?r:void 0,c?o:void 0):new Y(t,n,l,s)}catch{return null}}static fromDwgSplineEdge(t){if(t.numberOfControlPoints>0&&t.numberOfKnots>0){const n=t.controlPoints.map(D.point2dToPoint3d);let e=!0;const s=t.controlPoints.map(r=>(r.weight==null&&(e=!1),r.weight||1));return Y.fromControlPoints(n,t.knots,e?s:void 0,t.degree,!1)}if(t.numberOfFitData>0){const n=t.fitDatum.map(D.point2dToPoint3d);return Y.fromFitPoints(n,"Uniform",t.degree,!1,t.startTangent?D.point2dToPoint3d(t.startTangent):void 0,t.endTangent?D.point2dToPoint3d(t.endTangent):void 0)}return null}}class G extends zt{constructor(t=[]){super(),this._curves=t}get curves(){return this._curves}static buildFromEdges(t,n=.001){if(t.length===0)return[];const e=[...t],s=[],r=n*n,o=(a,c)=>{const h=a.x-c.x,l=a.y-c.y;return h*h+l*l<=r};for(;e.length>0;){const a=[],c=e.shift();a.push(c);const h=G.getEdgeStartPoint(c);let l=G.getEdgeEndPoint(c);if(!o(h,l))for(;e.length>0;){const u=G.findConnectingEdge(e,l,r);if(u.index<0)break;let d=e.splice(u.index,1)[0];if(u.reverse&&(d=G.reverseEdge(d)),a.push(d),l=G.getEdgeEndPoint(d),o(l,h))break}s.push(new G(a))}return s}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 P(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(n=>{t+=n.length}),t}calculateBoundingBox(){const t=this.getPoints(100),n=new Q;return n.setFromPoints(t),n}transform(t){const n=new L().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 Y?e.transform(n):e.transform(t)}),this._boundingBoxNeedsUpdate=!0,this}clone(){return new G(this._curves.map(t=>t.clone()))}get closed(){return!0}getPoints(t){const n=[];return this.curves.forEach(e=>{e.getPoints(t).forEach(s=>{n.push(new P(s.x,s.y))})}),n}tessellate(t){const n=[];return this._curves.forEach(e=>{Ni(e,t).forEach(s=>{const r=n[n.length-1];r&&(r.x-s.x)**2+(r.y-s.y)**2<=C*C||n.push(new P(s.x,s.y))})}),n}static findConnectingEdge(t,n,e){let s=-1,r=!1,o=Number.POSITIVE_INFINITY;for(let a=0;a<t.length;a++){const c=t[a],h=G.getEdgeStartPoint(c),l=G.getEdgeEndPoint(c),u=n.x-h.x,d=n.y-h.y,g=u*u+d*d;g<o&&(o=g,s=a,r=!1);const m=n.x-l.x,f=n.y-l.y,x=m*m+f*f;x<o&&(o=x,s=a,r=!0)}return o>e?{index:-1,reverse:!1}:{index:s,reverse:r}}static getEdgeStartPoint(t){const n=t.startPoint;return new P(n.x,n.y)}static getEdgeEndPoint(t){const n=t.endPoint;return new P(n.x,n.y)}static reverseEdge(t){return t instanceof bt?new bt(t.endPoint,t.startPoint):t instanceof q?G.reverseCircArcEdge(t):t instanceof xt?new xt(t.center,t.majorAxisRadius,t.minorAxisRadius,t.endAngle,t.startAngle,!t.clockwise,t.rotation):t instanceof Y?G.reverseSplineEdge(t):t}static reverseCircArcEdge(t){const n=t.startPoint,e=t.endPoint,s=!t.clockwise,r=Math.atan2(e.y-t.center.y,e.x-t.center.x),o=Math.atan2(n.y-t.center.y,n.x-t.center.x),a=c=>{const h=p.normalizeAngle(c);return s?p.normalizeAngle(-h):h};return new q(t.center,t.radius,a(r),a(o),s)}static reverseSplineEdge(t){const n=[...t.controlPoints].reverse(),e=t.knots,s=e[0],r=e[e.length-1],o=e.map(h=>s+r-h).reverse(),a=t.weights,c=a.length>0?[...a].reverse():void 0;return new Y(n,o,c,t.degree,t.closed)}}function Ni(i,t){if(i instanceof bt)return i.getPoints();if(i instanceof q||i instanceof Y)return i.tessellate(t);const n=i.closed?b:i.deltaAngle,e=q.segmentCount(Math.max(i.majorAxisRadius,i.minorAxisRadius),n,t);return i.getPoints(e)}const vt=128,Qt=96,z=Rt.equalPointTol,In=z*8;function Bi(i,t,n=!1,e=!1,s){const r=Ge(i,n,s),o=Ge(t,e,s),a=[];for(const c of r)for(const h of o)kn(c,h)&&Vn(a,He(c,h));return Hi(a)}function qi(i,t){const n=Ze(i);switch(n.kind){case"line":return n.line.transform(t),n;case"circArc":return n.arc.transform(t),n;case"ellipseArc":return n.arc.transform(t),n;case"spline":return n.spline.transform(t),n}}function Ze(i){switch(i.kind){case"line":return{kind:"line",line:i.line.clone(),extent:i.extent,extendable:i.extendable};case"circArc":return{kind:"circArc",arc:i.arc.clone(),extendable:i.extendable};case"ellipseArc":return{kind:"ellipseArc",arc:i.arc.clone(),extendable:i.extendable};case"spline":return{kind:"spline",spline:i.spline.clone(),extendable:i.extendable}}}function Ge(i,t,n){const e=[];for(const s of i){const r=t&&s.extendable!==!1;switch(s.kind){case"line":{const o=ji(s.line,n);if(!o)break;const a=r?"unbounded":s.extent;e.push(St(o.start,o.end,a));break}case"circArc":{const o=Vi(s.arc,r);if(n&&!Vt(o.normal,n.normal)){const a=Oi(o,n);(a==null?void 0:a.kind)==="circArc"?e.push(We(a.arc,ot(a.arc))):(a==null?void 0:a.kind)==="ellipseArc"?e.push(Ke(a.arc,ht(a.arc))):Tn(e,Qe(o,ot(o)),ot(o),n)}else{const a=Fi(o,n);a&&e.push(We(a,ot(a)))}break}case"ellipseArc":{const o=Li(s.arc,r);if(n&&!Vt(o.normal,n.normal))Tn(e,$e(o,ht(o)),ht(o),n);else{const a=Ui(o,n);a&&e.push(Ke(a,ht(a)))}break}case"spline":{n?Tn(e,s.spline.getPoints(vt),s.spline.closed,n):e.push(vi(s.spline));break}}}return e}function St(i,t,n){const e=new _().subVectors(t,i);return{kind:"line",start:i,dir:e,extent:n,box:n==="bounded"?new K().setFromPoints([i,t]):void 0}}function We(i,t){return{kind:"circArc",arc:i,full:t||ot(i),box:i.box}}function Ke(i,t){return{kind:"ellipseArc",arc:i,full:t||ht(i),box:i.box}}function vi(i){const t=[],n=i.getPoints(vt);if(n.length>=2){const s=i.closed?n.length:n.length-1;for(let r=0;r<s;r++){const o=n[r],a=n[(r+1)%n.length];o.distanceToSquared(a)<z*z||t.push(St(o.clone(),a.clone(),"bounded"))}}const e=new K;for(const s of t)s.box&&e.union(s.box);return{kind:"spline",spline:i,samples:t,box:t.length>0?e:void 0}}function Vi(i,t){return!t||ot(i)?i:new $(i.center,i.radius,0,b,i.normal,i.refVec)}function Li(i,t){return!t||ht(i)?i:new nt(i.center,i.normal,i.majorAxis,i.majorAxisRadius,i.minorAxisRadius,0,b)}function ji(i,t){if(!t)return{start:i.startPoint.clone(),end:i.endPoint.clone()};const n=ct(i.startPoint,t),e=ct(i.endPoint,t);return n.distanceToSquared(e)<z*z?null:{start:n,end:e}}function Fi(i,t){if(!t)return i;const n=ct(i.center,t);return new $(n,i.radius,i.startAngle,i.endAngle,t.normal.clone(),Bn(i.refVec,t.normal))}function Oi(i,t){const n=ct(i.center,t),e=i.normal.clone();if(e.lengthSq()<z*z)return null;e.normalize();const s=t.normal.clone();if(s.lengthSq()<z*z)return null;s.normalize();const r=e.dot(s),o=Math.abs(r);if(o>1-1e-8)return{kind:"circArc",arc:new $(n,i.radius,i.startAngle,i.endAngle,s,Bn(i.refVec,s))};if(o<1e-8)return null;const a=new _().crossVectors(e,s);if(a.lengthSq()<z*z)return null;a.normalize();const c=new nt(n,s,a,i.radius,i.radius*o,0,b);if(ot(i))return{kind:"ellipseArc",arc:c};const h=ct(i.startPoint,t),l=ct(i.endPoint,t),u=ct(i.midPoint,t),d=It(c,h),g=It(c,l),m=It(c,u),f=p.normalizeAngle(m-d),x=p.normalizeAngle(g-d),y=f<=x||x<1e-8?d+x:d+x+b;return{kind:"ellipseArc",arc:new nt(n,s,a,i.radius,i.radius*o,d,y)}}function Ui(i,t){if(!t)return i;const n=ct(i.center,t),e=Bn(i.majorAxis,t.normal);return e.lengthSq()<z*z?null:new nt(n,t.normal.clone(),e,i.majorAxisRadius,i.minorAxisRadius,i.startAngle,i.endAngle)}function Tn(i,t,n,e){if(t.length<2)return;const s=e?t.map(o=>ct(o,e)):t,r=n?s.length:s.length-1;for(let o=0;o<r;o++){const a=s[o],c=s[(o+1)%s.length];a.distanceToSquared(c)<z*z||i.push(St(a.clone(),c.clone(),"bounded"))}}function Qe(i,t){return t||ot(i)?new $(i.center,i.radius,0,b,i.normal,i.refVec).getPoints(Qt):i.getPoints(Qt)}function $e(i,t){return t||ht(i)?new nt(i.center,i.normal,i.majorAxis,i.majorAxisRadius,i.minorAxisRadius,0,b).getPoints(Qt):i.getPoints(Qt)}function kn(i,t){return!i.box||!t.box?!0:i.box.intersectsBox(t.box)}function He(i,t){return i.kind==="spline"&&t.kind==="spline"?Di(i,t):i.kind==="spline"?Je(i,t):t.kind==="spline"?Je(t,i):i.kind==="line"&&t.kind==="line"?ts(i,t):i.kind==="line"&&t.kind==="circArc"?$t(i,t.arc,t.full):t.kind==="line"&&i.kind==="circArc"?$t(t,i.arc,i.full):i.kind==="line"&&t.kind==="ellipseArc"?Rn(i,t.arc,t.full):t.kind==="line"&&i.kind==="ellipseArc"?Rn(t,i.arc,i.full):i.kind==="circArc"&&t.kind==="circArc"?Wi(i.arc,i.full,t.arc,t.full):i.kind==="circArc"&&t.kind==="ellipseArc"?ns(i.arc,i.full,t.arc,t.full):i.kind==="ellipseArc"&&t.kind==="circArc"?ns(t.arc,t.full,i.arc,i.full):i.kind==="ellipseArc"&&t.kind==="ellipseArc"?Qi(i.arc,i.full,t.arc,t.full):[]}function Je(i,t){const n=[];for(const e of i.samples)kn(e,t)&&Vn(n,He(e,t));return Xi(i.spline,n,t)}function Di(i,t){const n=[];for(const s of i.samples)for(const r of t.samples)kn(s,r)&&Vn(n,ts(s,r));const e=[];for(const s of n){const r=i.spline.nearestPoint(s,vt),o=t.spline.nearestPoint(s,vt);r.distanceTo(o)<=In&&e.push(r)}return e}function Xi(i,t,n){const e=[];for(const s of t){const r=i.nearestPoint(s,vt);Yi(n,r)<=In&&e.push(r)}return e}function Yi(i,t){if(i.kind==="line"){const n=i.dir.lengthSq();if(n<z*z)return Number.POSITIVE_INFINITY;const e=new _().subVectors(t,i.start).dot(i.dir)/n;return Ct(e,i.extent)?Et(i.start,i.dir,e).distanceTo(t):Number.POSITIVE_INFINITY}if(i.kind==="circArc"){if(!vn(t,i.arc)){const n=H(i.arc.normal,i.arc.center),e=Math.abs(n.distanceToPoint(t)),s=Math.abs(t.distanceTo(i.arc.center)-i.arc.radius),r=Math.hypot(e,s);if(r>In)return r}return At(i.arc,_t(i.arc,t),i.full)?0:Number.POSITIVE_INFINITY}return i.kind==="ellipseArc"?Tt(t,i.arc,i.full)?0:Math.abs(Ht(i.arc,t)):Number.POSITIVE_INFINITY}function ts(i,t){const n=i.dir,e=t.dir,s=n.lengthSq(),r=e.lengthSq();if(s<z*z||r<z*z)return[];const o=new _().subVectors(i.start,t.start),a=n.dot(n),c=n.dot(e),h=e.dot(e),l=n.dot(o),u=e.dot(o),d=a*h-c*c;if(Math.abs(d)<C*C*a*h)return[];const g=(c*u-h*l)/d,m=(a*u-c*l)/d;if(!Ct(g,i.extent)||!Ct(m,t.extent))return[];const f=Et(i.start,n,g),x=Et(t.start,e,m);return f.distanceTo(x)>z?[]:[f]}function $t(i,t,n){const e=H(t.normal,t.center),s=ss(i,e);return s==="coplanar"?Zi(i,t,n):s?vn(s,t)?At(t,_t(t,s),n)?[s]:[]:[]:[]}function Zi(i,t,n){const e=new _().subVectors(i.start,t.center),s=i.dir.dot(i.dir);if(s<z*z)return[];const r=2*i.dir.dot(e),o=e.dot(e)-t.radius*t.radius,a=[];for(const c of rs(s,r,o)){if(!Ct(c,i.extent))continue;const h=Et(i.start,i.dir,c);At(t,_t(t,h),n)&&a.push(h)}return a}function Rn(i,t,n){const e=H(t.normal,t.center),s=ss(i,e);return s==="coplanar"?Gi(i,t,n):s?Tt(s,t,n)?[s]:[]:[]}function Gi(i,t,n){const e=t.majorAxis,s=t.minorAxis,r=t.majorAxisRadius,o=t.minorAxisRadius;if(r<z||o<z)return[];const a=new _().subVectors(i.start,t.center),c=a.dot(e),h=a.dot(s),l=i.dir.dot(e),u=i.dir.dot(s),d=l*l/(r*r)+u*u/(o*o),g=2*c*l/(r*r)+2*h*u/(o*o),m=c*c/(r*r)+h*h/(o*o)-1,f=[];for(const x of rs(d,g,m)){if(!Ct(x,i.extent))continue;const y=Et(i.start,i.dir,x);qn(t,It(t,y),n)&&f.push(y)}return f}function Wi(i,t,n,e){if(Vt(i.normal,n.normal)){const a=H(i.normal,i.center);return Math.abs(a.distanceToPoint(n.center))>z?[]:$i(Ki(i,n),i,t,n,e)}const s=Nn(H(i.normal,i.center),H(n.normal,n.center));if(!s)return[];const r=St(s.point.clone(),new w().addVectors(s.point,s.dir),"unbounded");return $t(r,i,t).filter(a=>vn(a,n)?At(n,_t(n,a),e):!1)}function Ki(i,t){const n=new _().subVectors(t.center,i.center),e=n.length(),s=i.radius,r=t.radius;if(e<z&&M.equal(s,r,z))return[];if(e>s+r+z)return[];if(e+Math.min(s,r)+z<Math.max(s,r))return[];const o=e<z?is(i.normal):n.clone().normalize(),a=(s*s-r*r+e*e)/(2*Math.max(e,z)),c=s*s-a*a,h=new w().copy(i.center).addScaledVector(o,a);if(c<-z*z)return[];if(c<z*z)return[h];const l=Math.sqrt(Math.max(0,c)),u=new _().crossVectors(i.normal,o).normalize();return[new w().copy(h).addScaledVector(u,l),new w().copy(h).addScaledVector(u,-l)]}function ns(i,t,n,e){if(!Vt(i.normal,n.normal)){const s=Nn(H(i.normal,i.center),H(n.normal,n.center));if(!s)return[];const r=St(s.point.clone(),new w().addVectors(s.point,s.dir),"unbounded");return $t(r,i,t).filter(o=>Tt(o,n,e))}return es(Qe(i,t),ot(i)||t,s=>Ht(n,s),s=>At(i,_t(i,s),t)&&Tt(s,n,e))}function Qi(i,t,n,e){if(!Vt(i.normal,n.normal)){const s=Nn(H(i.normal,i.center),H(n.normal,n.center));if(!s)return[];const r=St(s.point.clone(),new w().addVectors(s.point,s.dir),"unbounded");return Rn(r,i,t).filter(o=>Tt(o,n,e))}return es($e(i,t),ht(i)||t,s=>Ht(n,s),s=>qn(i,It(i,s),t)&&Tt(s,n,e))}function es(i,t,n,e){const s=[],r=t?i.length:i.length-1;for(let o=0;o<r;o++){const a=i[o],c=i[(o+1)%i.length],h=n(a),l=n(c);if(Math.abs(h)<=z){e(a)&&s.push(a.clone());continue}if(h*l>0)continue;let u=0,d=1,g=h;for(let f=0;f<40;f++){const x=(u+d)/2,y=new w().lerpVectors(a,c,x),S=n(y);g*S<=0?d=x:(u=x,g=S)}const m=new w().lerpVectors(a,c,(u+d)/2);e(m)&&s.push(m)}return s}function ss(i,t){const n=t.normal.dot(i.dir),e=t.distanceToPoint(i.start);if(M.equalToZero(n,z*Math.max(1,i.dir.length())))return M.equalToZero(e,z)?"coplanar":null;const s=-e/n;return Ct(s,i.extent)?Et(i.start,i.dir,s):null}function Nn(i,t){const n=new _().crossVectors(i.normal,t.normal);if(n.lengthSq()<z*z)return null;n.normalize();const e=i.normal,s=t.normal,r=e.dot(e)*s.dot(s)-e.dot(s)**2;if(Math.abs(r)<C)return null;const o=-i.constant,a=-t.constant,c=(s.dot(s)*o-e.dot(s)*a)/r,h=(e.dot(e)*a-e.dot(s)*o)/r;return{point:new w().addScaledVector(e,c).addScaledVector(s,h),dir:n}}function Ct(i,t){return t==="unbounded"?!0:t==="ray"?i>=-z:i>=-z&&i<=1+z}function Et(i,t,n){return new w().copy(i).addScaledVector(t,n)}function ct(i,t){const n=new w;return t.projectPoint(i,n),n}function Bn(i,t){const n=i.clone().addScaledVector(t,-i.dot(t));return n.lengthSq()<z*z?is(t):n.normalize()}function H(i,t){return new Mt().setFromNormalAndCoplanarPoint(i,t)}function Vt(i,t){return new _().crossVectors(i,t).lengthSq()<z*z}function _t(i,t){const n=new _().subVectors(t,i.center),e=new _().crossVectors(i.normal,i.refVec);return Math.atan2(n.dot(e),n.dot(i.refVec))}function It(i,t){const n=new _().subVectors(t,i.center),e=n.dot(i.majorAxis)/i.majorAxisRadius,s=n.dot(i.minorAxis)/i.minorAxisRadius;return Math.atan2(s,e)}function ot(i){return i.closed||Math.abs(i.deltaAngle-b)<1e-10}function ht(i){return i.closed||Math.abs(i.endAngle-i.startAngle)<1e-10||Math.abs(i.deltaAngle-b)<1e-10}function At(i,t,n){return n||ot(i)?!0:p.normalizeAngle(t-i.startAngle)<=i.deltaAngle+1e-8}function qn(i,t,n){return n||ht(i)?!0:p.normalizeAngle(t-i.startAngle)<=i.deltaAngle+1e-8}function vn(i,t){const n=H(t.normal,t.center);return Math.abs(n.distanceToPoint(i))>z?!1:Math.abs(i.distanceTo(t.center)-t.radius)<=z}function Ht(i,t){const n=new _().subVectors(t,i.center),e=n.dot(i.majorAxis)/i.majorAxisRadius,s=n.dot(i.minorAxis)/i.minorAxisRadius;return e*e+s*s-1}function Tt(i,t,n){const e=H(t.normal,t.center);return Math.abs(e.distanceToPoint(i))>z||Math.abs(Ht(t,i))>1e-4?!1:qn(t,It(t,i),n)}function $i(i,t,n,e,s){return i.filter(r=>At(t,_t(t,r),n)&&At(e,_t(e,r),s))}function is(i){const t=Math.abs(i.x)<.9?_.X_AXIS:_.Y_AXIS,n=new _().crossVectors(i,t);return n.lengthSq()<z*z&&n.crossVectors(i,_.Z_AXIS),n.normalize()}function rs(i,t,n){if(Math.abs(i)<C)return Math.abs(t)<C?[]:[-n/t];const e=t*t-4*i*n;if(e<-z)return[];if(e<z)return[-t/(2*i)];const s=Math.sqrt(Math.max(0,e));return[(-t-s)/(2*i),(-t+s)/(2*i)]}function Vn(i,t){for(const n of t)i.push(n)}function Hi(i){const t=[];for(const n of i)t.some(e=>e.distanceTo(n)<=z)||t.push(n);return t}A.AcGeArea2d=Cn,A.AcGeBox2d=Q,A.AcGeBox3d=K,A.AcGeCatmullRomCurve3d=Kt,A.AcGeCircArc2d=q,A.AcGeCircArc3d=$,A.AcGeCurve2d=zt,A.AcGeEllipseArc2d=xt,A.AcGeEllipseArc3d=nt,A.AcGeEuler=fn,A.AcGeGeometryUtil=D,A.AcGeLine2d=bt,A.AcGeLine3d=Gt,A.AcGeLoop2d=G,A.AcGeMathUtil=p,A.AcGeMatrix2d=pt,A.AcGeMatrix3d=L,A.AcGeNurbsCurve=j,A.AcGePlane=Mt,A.AcGePoint2d=P,A.AcGePoint3d=w,A.AcGePolyline2d=gt,A.AcGeQuaternion=Nt,A.AcGeShape2d=Mn,A.AcGeSpline3d=Y,A.AcGeTol=M,A.AcGeVector2d=B,A.AcGeVector3d=_,A.DEFAULT_TOL=Rt,A.DEG2RAD=on,A.FLOAT_TOL=C,A.ORIGIN_POINT_2D=os,A.ORIGIN_POINT_3D=dn,A.RAD2DEG=an,A.TAU=b,A.acgeBasisFunction=ut,A.acgeCalculateCurveLength=_e,A.acgeCeilPowerOfTwo=Jn,A.acgeClamp=W,A.acgeCloneIntersectPrimitive=Ze,A.acgeClosedPolygonArea2d=gs,A.acgeClosedPolygonArea3d=de,A.acgeComputeParameterValues=ge,A.acgeDamp=Un,A.acgeDegToRad=Qn,A.acgeEuclideanModulo=cn,A.acgeEvaluateNurbsDerivatives=xe,A.acgeEvaluateNurbsPoint=Bt,A.acgeFloorPowerOfTwo=te,A.acgeGenerateAveragedKnots=me,A.acgeGenerateChordKnots=As,A.acgeGenerateSqrtChordKnots=Ps,A.acgeGenerateUUID=jn,A.acgeGenerateUniformKnots=_s,A.acgeGetOcsAngle=Ts,A.acgeGetOcsReferenceVector=Es,A.acgeGetOcsReferenceVectorInto=pe,A.acgeIntPartLength=ln,A.acgeInterpolateControlPoints=zs,A.acgeInterpolateNurbsCurve=yn,A.acgeIntersectCurves=Bi,A.acgeInverseLerp=On,A.acgeIsAngleOnCcwSweep=se,A.acgeIsBetterDistanceAlign=Ce,A.acgeIsBetween=ne,A.acgeIsBetweenAngle=ee,A.acgeIsPowerOfTwo=Hn,A.acgeLerp=hn,A.acgeMapLinear=Fn,A.acgeNormalizeAngle=mt,A.acgeOffsetPointByDirectionInXY=gi,A.acgeOffsetSmoothedSampledPath=fi,A.acgeOffsetVertexPath=mi,A.acgePingpong=Dn,A.acgePointLiesOnCircle2d=be,A.acgePolygonArea2d=le,A.acgePolygonArea3d=ue,A.acgeRadToDeg=$n,A.acgeRandFloat=Gn,A.acgeRandFloatSpread=Wn,A.acgeRandInt=Zn,A.acgeRelativeEps=ie,A.acgeSameCircle2d=Se,A.acgeSeededRandom=Kn,A.acgeSignedPlanarCurvature=ye,A.acgeSignedPolygonArea2d=xn,A.acgeSmootherstep=Yn,A.acgeSmoothstep=Xn,A.acgeTransformIntersectPrimitive=qi,A.acgeTransformOcsPointToWcs=Is,A.acgeTransformOcsPointToWcsInto=we,A.acgeTransformWcsPointToOcs=Pn,Object.defineProperty(A,Symbol.toStringTag,{value:"Module"})}));
@@ -228,6 +228,20 @@ export declare class AcGeMatrix3d {
228
228
  * @returns Return this matrix
229
229
  */
230
230
  makeScale(x: number, y: number, z: number): this;
231
+ /**
232
+ * Set this matrix to a reflection (mirroring) transform.
233
+ *
234
+ * - Default (`mode` omitted or `'line'`): mirror about the XY line through
235
+ * `a` → `b`. Degenerate (coincident) points fall back to mirroring about
236
+ * the vertical line `x = a.x` through `a`.
237
+ * - `mode: 'plane'`: mirror about the plane through point `a` with normal `b`.
238
+ *
239
+ * @param a - First line point, or a point on the mirror plane.
240
+ * @param b - Second line point, or the plane normal when `mode` is `'plane'`.
241
+ * @param mode - `'line'` (default) or `'plane'`.
242
+ * @returns This matrix.
243
+ */
244
+ setToMirroring(a: AcGeVector3dLike, b: AcGeVector3dLike, mode?: 'line' | 'plane'): this;
231
245
  /**
232
246
  * Set this matrix as a shear transform.
233
247
  * @param xy Input the amount to shear X by Y.
@@ -1 +1 @@
1
- {"version":3,"file":"AcGeMatrix3d.d.ts","sourceRoot":"","sources":["../../src/math/AcGeMatrix3d.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAElE;;GAEG;AACH,qBAAa,YAAY;IACvB;;OAEG;IACH,MAAM,CAAC,QAAQ,yBAAoC;IAEnD;;OAEG;IACH,MAAM,CAAC,eAAe,CACpB,CAAC,EAAE,MAAM,GAAG,gBAAgB,EAC5B,CAAC,CAAC,EAAE,MAAM,EACV,CAAC,CAAC,EAAE,MAAM,GACT,YAAY;IAGf;;OAEG;IACI,QAAQ,EAAE,MAAM,EAAE,CAAA;IAEzB;;;;;;;;;;;;;;;;;;;;OAoBG;gBAED,GAAG,CAAC,EAAE,MAAM,EACZ,GAAG,CAAC,EAAE,MAAM,EACZ,GAAG,CAAC,EAAE,MAAM,EACZ,GAAG,CAAC,EAAE,MAAM,EACZ,GAAG,CAAC,EAAE,MAAM,EACZ,GAAG,CAAC,EAAE,MAAM,EACZ,GAAG,CAAC,EAAE,MAAM,EACZ,GAAG,CAAC,EAAE,MAAM,EACZ,GAAG,CAAC,EAAE,MAAM,EACZ,GAAG,CAAC,EAAE,MAAM,EACZ,GAAG,CAAC,EAAE,MAAM,EACZ,GAAG,CAAC,EAAE,MAAM,EACZ,GAAG,CAAC,EAAE,MAAM,EACZ,GAAG,CAAC,EAAE,MAAM,EACZ,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MAAM;IAOZ;;;;;;OAMG;IACH,OAAO,CACL,QAAQ,EAAE,gBAAgB,EAC1B,UAAU,EAAE,cAAc,EAC1B,KAAK,EAAE,YAAY;IAgDrB;;;;;;;;;;OAUG;IACH,SAAS,CACP,QAAQ,EAAE,gBAAgB,EAC1B,UAAU,EAAE,cAAc,EAC1B,KAAK,EAAE,YAAY;IAmJrB;;;;OAIG;IACH,MAAM,CAAC,MAAM,EAAE,YAAY;IAW3B;;;;;OAKG;IACH,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,MAAM,SAAI;IAQrC;;;;;OAKG;IACH,OAAO,CAAC,KAAK,GAAE,MAAM,EAAO,EAAE,MAAM,GAAE,MAAU;CAyBjD"}
@@ -1,4 +1,4 @@
1
- import { DEFAULT_TOL } from '../util/AcGeTol.js';
1
+ import { AcGeTol, DEFAULT_TOL } from '../util/AcGeTol.js';
2
2
  import { AcGeVector3d } from './AcGeVector3d.js';
3
3
  /**
4
4
  * The class representing a 4x4 matrix.
@@ -801,6 +801,29 @@ var AcGeMatrix3d = /** @class */ (function () {
801
801
  this.set(x, 0, 0, 0, 0, y, 0, 0, 0, 0, z, 0, 0, 0, 0, 1);
802
802
  return this;
803
803
  };
804
+ /**
805
+ * Set this matrix to a reflection (mirroring) transform.
806
+ *
807
+ * - Default (`mode` omitted or `'line'`): mirror about the XY line through
808
+ * `a` → `b`. Degenerate (coincident) points fall back to mirroring about
809
+ * the vertical line `x = a.x` through `a`.
810
+ * - `mode: 'plane'`: mirror about the plane through point `a` with normal `b`.
811
+ *
812
+ * @param a - First line point, or a point on the mirror plane.
813
+ * @param b - Second line point, or the plane normal when `mode` is `'plane'`.
814
+ * @param mode - `'line'` (default) or `'plane'`.
815
+ * @returns This matrix.
816
+ */
817
+ AcGeMatrix3d.prototype.setToMirroring = function (a, b, mode) {
818
+ if (mode === void 0) { mode = 'line'; }
819
+ if (mode === 'plane') {
820
+ acgeSetToMirroringAboutPlane(this, a, b);
821
+ }
822
+ else {
823
+ acgeSetToMirroringAboutLine(this, a, b);
824
+ }
825
+ return this;
826
+ };
804
827
  /**
805
828
  * Set this matrix as a shear transform.
806
829
  * @param xy Input the amount to shear X by Y.
@@ -1044,6 +1067,55 @@ var AcGeMatrix3d = /** @class */ (function () {
1044
1067
  return AcGeMatrix3d;
1045
1068
  }());
1046
1069
  export { AcGeMatrix3d };
1070
+ /**
1071
+ * Mirror about the XY line through `point1` → `point2`.
1072
+ *
1073
+ * Composes `T(p1) · R(θ) · Scale(1,-1,1) · R(-θ) · T(-p1)`.
1074
+ */
1075
+ function acgeSetToMirroringAboutLine(target, point1, point2) {
1076
+ var _a, _b, _c;
1077
+ var dx = point2.x - point1.x;
1078
+ var dy = point2.y - point1.y;
1079
+ var lenSq = dx * dx + dy * dy;
1080
+ if (AcGeTol.equalToZero(Math.sqrt(lenSq))) {
1081
+ // Degenerate: mirror about the vertical line through point1.
1082
+ return target.copy(new AcGeMatrix3d()
1083
+ .makeTranslation(point1.x, point1.y, (_a = point1.z) !== null && _a !== void 0 ? _a : 0)
1084
+ .multiply(new AcGeMatrix3d().makeScale(-1, 1, 1))
1085
+ .multiply(new AcGeMatrix3d().makeTranslation(-point1.x, -point1.y, -((_b = point1.z) !== null && _b !== void 0 ? _b : 0))));
1086
+ }
1087
+ var theta = Math.atan2(dy, dx);
1088
+ var z = (_c = point1.z) !== null && _c !== void 0 ? _c : 0;
1089
+ return target.copy(new AcGeMatrix3d()
1090
+ .makeTranslation(point1.x, point1.y, z)
1091
+ .multiply(new AcGeMatrix3d().makeRotationZ(theta))
1092
+ .multiply(new AcGeMatrix3d().makeScale(1, -1, 1))
1093
+ .multiply(new AcGeMatrix3d().makeRotationZ(-theta))
1094
+ .multiply(new AcGeMatrix3d().makeTranslation(-point1.x, -point1.y, -z)));
1095
+ }
1096
+ /**
1097
+ * Mirror about the plane through `planePoint` with normal `normal`
1098
+ * (Householder reflection).
1099
+ */
1100
+ function acgeSetToMirroringAboutPlane(target, planePoint, normal) {
1101
+ var _a, _b;
1102
+ var nx = normal.x;
1103
+ var ny = normal.y;
1104
+ var nz = (_a = normal.z) !== null && _a !== void 0 ? _a : 0;
1105
+ var len = Math.hypot(nx, ny, nz);
1106
+ if (AcGeTol.equalToZero(len)) {
1107
+ return target.identity();
1108
+ }
1109
+ var nX = nx / len;
1110
+ var nY = ny / len;
1111
+ var nZ = nz / len;
1112
+ var px = planePoint.x;
1113
+ var py = planePoint.y;
1114
+ var pz = (_b = planePoint.z) !== null && _b !== void 0 ? _b : 0;
1115
+ var d = nX * px + nY * py + nZ * pz;
1116
+ // Column-major: upper-left I - 2 n n^T, translation 2 (n·p) n.
1117
+ return target.set(1 - 2 * nX * nX, -2 * nX * nY, -2 * nX * nZ, 2 * d * nX, -2 * nY * nX, 1 - 2 * nY * nY, -2 * nY * nZ, 2 * d * nY, -2 * nZ * nX, -2 * nZ * nY, 1 - 2 * nZ * nZ, 2 * d * nZ, 0, 0, 0, 1);
1118
+ }
1047
1119
  var _v1 = /*@__PURE__*/ new AcGeVector3d();
1048
1120
  var _m1 = /*@__PURE__*/ new AcGeMatrix3d();
1049
1121
  var _zero = /*@__PURE__*/ new AcGeVector3d(0, 0, 0);
@@ -1 +1 @@
1
- {"version":3,"file":"AcGeMatrix3d.js","sourceRoot":"","sources":["../../src/math/AcGeMatrix3d.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAGhD,OAAO,EAAE,YAAY,EAAoB,MAAM,mBAAmB,CAAA;AAElE;;GAEG;AACH;IAqBE;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,sBACE,GAAY,EACZ,GAAY,EACZ,GAAY,EACZ,GAAY,EACZ,GAAY,EACZ,GAAY,EACZ,GAAY,EACZ,GAAY,EACZ,GAAY,EACZ,GAAY,EACZ,GAAY,EACZ,GAAY,EACZ,GAAY,EACZ,GAAY,EACZ,GAAY,EACZ,GAAY;QAEZ,IAAI,CAAC,QAAQ,GAAG,CAAC,CA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AAa,CAAC,IAAI,YAAY,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;AACpD,IAAM,EAAE,GAAG,aAAa,CAAC,IAAI,YAAY,EAAE,CAAA;AAC3C,IAAM,EAAE,GAAG,aAAa,CAAC,IAAI,YAAY,EAAE,CAAA;AAC3C,IAAM,EAAE,GAAG,aAAa,CAAC,IAAI,YAAY,EAAE,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mlightcad/geometry-engine",
3
- "version": "3.16.0",
3
+ "version": "3.16.2",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "repository": {
@@ -34,7 +34,7 @@
34
34
  "require": "./dist/geometry-engine.umd.cjs"
35
35
  },
36
36
  "peerDependencies": {
37
- "@mlightcad/common": "1.16.0"
37
+ "@mlightcad/common": "^1.16.2"
38
38
  },
39
39
  "scripts": {
40
40
  "clean": "rimraf dist lib tsconfig.tsbuildinfo",