/*
All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
*/
import e from"../../Color.js";import{clone as r}from"../../core/lang.js";import{n as o,f as t,e as s}from"../../chunks/vec32.js";import{fromValues as m,create as n}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import i from"../../geometry/Mesh.js";import p from"../../geometry/support/MeshComponent.js";import a from"../../geometry/support/MeshGeoreferencedVertexSpace.js";import c from"../../geometry/support/MeshLocalVertexSpace.js";import f from"../../geometry/support/MeshMaterialMetallicRoughness.js";import l from"../../geometry/support/MeshTransform.js";import u from"../../geometry/support/MeshVertexAttributes.js";import{addMeshCloneContext as g}from"../../geometry/support/meshUtils/meshCloneUtils.js";import{convertVertexSpace as v}from"../../geometry/support/meshUtils/vertexSpaceConversion.js";function x(r,a){const g=m(0,0,1),v=m(1,0,1),x=m(1,1,0),j=o(n(),t(n(),s(n(),v,g),s(n(),x,g)));return new i({components:[new p({faces:[0,1,2],material:new f({color:new e("red")})})],vertexAttributes:new u({normal:[...j,...j,...j],position:[...g,...v,...x],uv:[0,.375,.25,.375,.25,.125]}),spatialReference:r.spatialReference,vertexSpace:new c({origin:m(r.x,r.y,r.z??0)}),transform:new l({scale:a?.scale??[1,1,1],rotationAngle:a?.rotationAngle??0})})}function j(e){if(!e.vertexSpace.origin)return e;const o=new a;return e.clone(g(void 0,{vertexAttributes:new u({...v(e,o),uv:r(e.vertexAttributes.uv),color:r(e.vertexAttributes.color)}),vertexSpace:o,transform:null}))}export{x as createTriangle,j as meshMakeAbsolute};
