/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../../../../core/maybe","../../../../../chunks/vec3","../../../../../chunks/vec3f64","../../../../Point"],(function(e,t,n,o,s){"use strict";function r(e,t){if(e.components)for(const n of e.components)n.faces&&"smooth"===n.shading&&c(n,t)}function c(e,o){t.isNone(o.normal)&&(o.normal=new Float32Array(o.position.length));const s=e.faces,{position:r,normal:c}=o,i=s.length/3;for(let t=0;t<i;++t){const e=3*s[3*t+0],o=3*s[3*t+1],i=3*s[3*t+2],m=n.set(a,r[e+0],r[e+1],r[e+2]),u=n.set(f,r[o+0],r[o+1],r[o+2]),h=n.set(l,r[i+0],r[i+1],r[i+2]),x=n.subtract(u,u,m),g=n.subtract(h,h,m),p=n.cross(x,x,g);c[e+0]+=p[0],c[e+1]+=p[1],c[e+2]+=p[2],c[o+0]+=p[0],c[o+1]+=p[1],c[o+2]+=p[2],c[i+0]+=p[0],c[i+1]+=p[1],c[i+2]+=p[2]}for(let t=0;t<c.length;t+=3)n.set(m,c[t],c[t+1],c[t+2]),n.normalize(m,m),c[t+0]=m[0],c[t+1]=m[1],c[t+2]=m[2]}function i(e){if(t.isSome(e.transform))return e.transform.getOriginPoint(e.spatialReference);const n=e.extent.xmax-e.extent.width/2,o=e.extent.ymax-e.extent.height/2,r=e.extent.zmin;return new s({x:n,y:o,z:r,spatialReference:e.extent.spatialReference})}const a=o.create(),f=o.create(),l=o.create(),m=o.create();e.computeOrigin=i,e.smoothNormals=r,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
