/*
All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
*/
import{fromRotation as t}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as e}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{dot as r}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{p as i}from"../../../../chunks/vec32.js";import{create as o}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";class n{}class c{numProfilesPerJoin(){return 1}extrude(t,e,r){for(let s=0;s<e.vertices.length;++s)r(t.frame,e.vertices[s],e.normals[s],!1)}}class a{constructor(t,e){this.cutoffAngle=t,this.numBendSubdivisions=e}numProfilesPerJoin(){return this.numBendSubdivisions+1}extrude(e,s,i){const o=h,{rotationAngle:n,rotationRight:c,frame:a}=e;if(Math.abs(n)>=this.cutoffAngle){const l=e.rotationFrameUp;for(let h=0;h<this.numBendSubdivisions+1;++h){t(u,.5*-n+h*n/this.numBendSubdivisions,l),m(o,a,u);for(let t=0;t<s.vertices.length;++t){if(r(s.vertices[t],c)*n>=0)i(o,s.vertices[t],s.normals[t],!1);else{i(a,e.applyMiterStretch(f,s.vertices[t]),s.normals[t],!0)}}}}else for(let t=0;t<this.numBendSubdivisions+1;++t)for(let o=0;o<s.vertices.length;++o){const t=r(s.vertices[o],c)*n>=0;i(a,e.applyMiterStretch(f,s.vertices[o]),s.normals[o],!t)}}}class l{constructor(){this.up=o(),this.right=o()}}function m(t,e,r){i(t.up,e.up,r),i(t.right,e.right,r)}const f=s(),u=e(),h=new l;export{l as Frame2D,a as MiterExtruder,n as PathExtruder,c as SimpleExtruder};
