/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import{e as t}from"../../../../chunks/earcut.js";import e from"../../../../geometry/Extent.js";import i from"../../../../geometry/Polygon.js";import{getZeroIndexArray as r}from"../../../../geometry/support/Indices.js";import{leastSignificantAxis as o}from"../../../../geometry/support/polygonUtils.js";import{Attribute as n}from"../../webgl-engine/lib/Attribute.js";import{Geometry as a}from"../../webgl-engine/lib/Geometry.js";function u(e,i,r){const n=(i.length>0?i[0]:e.length/3)-1,a=o(e,n,r);if(2!==a){e=e.slice();for(let t=0;t<e.length;t+=3)e[t+a]=e[t+2]}return t(e,i,3)}function s(t){const e=[["position",new n(t.attributeData.position,t.indices,3,!0)]],i=r(t.indices.length);return null!=t.attributeData.colorFeature?e.push(["colorFeatureAttribute",new n([t.attributeData.colorFeature],i,1,!0)]):t.attributeData.color&&e.push(["color",new n(t.attributeData.color,i,4,!0)]),t.attributeData.uvMapSpace&&e.push(["uvMapSpace",new n(t.attributeData.uvMapSpace,t.indices,4,!0)]),t.attributeData.boundingRect&&e.push(["boundingRect",new n(t.attributeData.boundingRect,[0],9,!0)]),new a(t.material,e,t.mapPositions,0,t.attributeData.olidColor)}function c(t,e=null){const i=[["position",new n(t.attributeData.position,t.indices,3,!0)],["uv0",new n(t.attributeData.uv0,t.indices,2,!0)]];return new a(t.material,i,t.mapPositions,0,e)}function l(t){switch(t.type){case"extent":if(t instanceof e)return i.fromExtent(t);break;case"polygon":return t}return null}class p{constructor(t,e,i){this.renderData=t,this.layerViewUid=e,this.graphicUid=i,this.outGeometries=new Array}}export{p as PolygonCreationDataBase,s as createColorGeometry,u as createIndices3D,c as createWaterGeometry,l as geometryAsPolygon};
