UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

6 lines (5 loc) 699 B
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.33/esri/copyright.txt for details. */ import{LodResources as e,LodComponentResources as n,LodComponentEngineGeometry as o,LodLevelResources as r}from"../../webgl-engine/lib/lodRendering/LodResources.js";function t(e,t){const s=e.stageResources.geometries.map((r=>new n(new o(r),e.stageResources.textures))),l=null==e.lodThreshold||0===e.lodThreshold&&t>0?u(s):e.lodThreshold;return new r(s,l,e.pivotOffset)}function s(n){return new e(n.map(((e,n)=>t(e,n))))}function u(e){const n=e.reduce(((e,n)=>e+n.numTriangles),0);return Math.sqrt(n*l/Math.PI)}const l=20;export{s as makeLodResources};