@arcgis/core 5.1.0-next.113 → 5.1.0-next.114

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (204) hide show
  1. package/Graphic.d.ts +1 -0
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/{31a8bc25aa1441c70caa.js → 009250a7bded12099dd1.js} +1 -1
  4. package/assets/esri/core/workers/chunks/019a4fe7e085b2fc6ae9.js +1 -0
  5. package/assets/esri/core/workers/chunks/023837e5d9d2b6af66d8.js +1 -0
  6. package/assets/esri/core/workers/chunks/{a001e7e8a39f27284d87.js → 03c46880b69ce75a010f.js} +1 -1
  7. package/assets/esri/core/workers/chunks/0a530fbbb4486c670ea2.js +1 -0
  8. package/assets/esri/core/workers/chunks/{14b7b55c42af65ffa024.js → 0bd2b035c6ee89c725f9.js} +1 -1
  9. package/assets/esri/core/workers/chunks/0ded5c114cbb7574f2f4.js +1 -0
  10. package/assets/esri/core/workers/chunks/{b432a5a829e309837db6.js → 0e549d942d6cba1608cf.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{7dafe608c224b9d48ffa.js → 115664cb7d7b22a315bb.js} +1 -1
  12. package/assets/esri/core/workers/chunks/123a67e84ed68b96ac59.js +1 -0
  13. package/assets/esri/core/workers/chunks/14a241b07baa67743248.js +1 -0
  14. package/assets/esri/core/workers/chunks/{054ae729e7cefa2c7778.js → 170f8dc97614e9609443.js} +1 -1
  15. package/assets/esri/core/workers/chunks/179ffa2168c42615ccf2.js +1 -0
  16. package/assets/esri/core/workers/chunks/{4a65bc9091d7ea7e80df.js → 19f07c8d0f32ec889861.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{ca92176d5348e2c533d7.js → 224a9f39876aa426a9bc.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{0550dc63b6b1274242b8.js → 27d7c701306efeea6b82.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{8aac1155b8ac071cd2ad.js → 2855357a2c1f2ab03fb7.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{33329f5d88e60b4ec568.js → 2a8f198f6c272f92bad5.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{cb3004998eff7c60930e.js → 2b2a09ce14d00b4b1187.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{5d60253ea3d247cdb3d1.js → 2bdfae998371e3aa9f2d.js} +1 -1
  23. package/assets/esri/core/workers/chunks/2f99a95facddc44319a9.js +1 -0
  24. package/assets/esri/core/workers/chunks/{bd17ac2e6f1eb8cf7abf.js → 2fa080539d039c92ce08.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{ee635172be7fdea69367.js → 3109b05fe4fc40d4f25b.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{92db9a6d273ae2862883.js → 315bf08dff4757ffbed3.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{593772bd8b19ac664b29.js → 35527a01d61cabbfd33e.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{52a91c314afec70199bc.js → 39987c06636e757d1f00.js} +1 -1
  29. package/assets/esri/core/workers/chunks/41074d383af3662673ca.js +1 -0
  30. package/assets/esri/core/workers/chunks/49675e77a351abda2728.js +1 -0
  31. package/assets/esri/core/workers/chunks/4bfeac7338df9e0b7ce1.js +1 -0
  32. package/assets/esri/core/workers/chunks/4ffcca40e7aa24c8cc35.js +1 -0
  33. package/assets/esri/core/workers/chunks/534dd93c72ea448ee908.js +1 -0
  34. package/assets/esri/core/workers/chunks/{2dc2487d05381de07e3f.js → 548c34ea88f113d03c93.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{77ac243d4dcd901c2eec.js → 621d71d26bd20e296138.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{7e203e947846d40f897e.js → 67dffb896b6ef4b2038b.js} +1 -1
  37. package/assets/esri/core/workers/chunks/6920e7f700a9ba280dba.js +1 -0
  38. package/assets/esri/core/workers/chunks/696967c8c6f53b94f851.js +1 -0
  39. package/assets/esri/core/workers/chunks/6b1f2b36bdc6b2ff2ea5.js +1 -0
  40. package/assets/esri/core/workers/chunks/7014e73dfd3c8baa704c.js +1 -0
  41. package/assets/esri/core/workers/chunks/75dfdd85abbac26ac899.js +1 -0
  42. package/assets/esri/core/workers/chunks/76a9b64fd573775bf6cd.js +1 -0
  43. package/assets/esri/core/workers/chunks/798c4d3201fcc9f2a42b.js +1 -0
  44. package/assets/esri/core/workers/chunks/{6c79e8e840c1d027fbb2.js → 7e0daf0864005cdd63c5.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{c0c693c2e0043ecba4a5.js → 817fd88fe9a48caf69fb.js} +1 -1
  46. package/assets/esri/core/workers/chunks/82f7d83a2073d1b0111c.js +1 -0
  47. package/assets/esri/core/workers/chunks/8795c4895df229cb471c.js +1 -0
  48. package/assets/esri/core/workers/chunks/{7bc746ea17f4e336e0b0.js → 8b5ee6be52e892fbd325.js} +1 -1
  49. package/assets/esri/core/workers/chunks/927c8ca7fd385b28a1b7.js +640 -0
  50. package/assets/esri/core/workers/chunks/942e527b9b92999886c7.js +1 -0
  51. package/assets/esri/core/workers/chunks/961995d8da45a9203255.js +1 -0
  52. package/assets/esri/core/workers/chunks/{eb1d6614eeac6d26bb9c.js → 9a3344f1dd22c425b8cc.js} +1 -1
  53. package/assets/esri/core/workers/chunks/9a6e62ef984e9c5babc4.js +1 -0
  54. package/assets/esri/core/workers/chunks/a0b6eef4890cc61609dc.js +1 -0
  55. package/assets/esri/core/workers/chunks/{f37be7e517f0892014e3.js → a320c69bc7528ff0d0cf.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{660713adb5a845dfa2ef.js → a40003dfe3c081d1a1d2.js} +1 -1
  57. package/assets/esri/core/workers/chunks/b5937ce657c1fff3864f.js +1 -0
  58. package/assets/esri/core/workers/chunks/{63ea9035dcf9ce45560c.js → b684ff4bc93bd60d6a19.js} +1 -1
  59. package/assets/esri/core/workers/chunks/b7a0a5b895ddd2d3d038.js +1 -0
  60. package/assets/esri/core/workers/chunks/{f3161c47a572194f6017.js → c06ae3a6ecc4a4fc67b2.js} +1 -1
  61. package/assets/esri/core/workers/chunks/{970e91de5dfbbc247afb.js → c5b7ff8650235c464dbf.js} +1 -1
  62. package/assets/esri/core/workers/chunks/c8dedc010fcc2382af24.js +1 -0
  63. package/assets/esri/core/workers/chunks/cd2b2babcdc130b4c368.js +1 -0
  64. package/assets/esri/core/workers/chunks/{5a6523c903b11dea77d4.js → cdef9c3f80588ae45a04.js} +1 -1
  65. package/assets/esri/core/workers/chunks/{e973cab79ec2541cb81b.js → d19600336cb6023d3e34.js} +1 -1
  66. package/assets/esri/core/workers/chunks/{34c11e7c8762fe0c19fb.js → d39f5590022d910ee951.js} +1 -1
  67. package/assets/esri/core/workers/chunks/d412a43060441d347fb4.js +1 -0
  68. package/assets/esri/core/workers/chunks/{01c70c27aa3a955e2928.js → d41b847d08c42e5329d6.js} +2 -2
  69. package/assets/esri/core/workers/chunks/{10491b5b106bc5ad0b2b.js → d66f68a811c90739951a.js} +1 -1
  70. package/assets/esri/core/workers/chunks/d8c2bed12f937228c763.js +1 -0
  71. package/assets/esri/core/workers/chunks/de916dd0c11aefb6832e.js +1 -0
  72. package/assets/esri/core/workers/chunks/{63513e706fe55a1def15.js → e227ae2c1a63e30e62d9.js} +1 -1
  73. package/assets/esri/core/workers/chunks/{e4c350dc65aae121171d.js → e29d182460564c2a52ad.js} +1 -1
  74. package/assets/esri/core/workers/chunks/e87d02af6d6b05e19d93.js +1 -0
  75. package/assets/esri/core/workers/chunks/f0b5c140a5ba174572b6.js +1 -0
  76. package/assets/esri/core/workers/chunks/{ce3b5b83237cf37ff523.js → f286680e363eefdf27df.js} +1 -1
  77. package/assets/esri/core/workers/chunks/f7698c855800e0af3038.js +1 -0
  78. package/assets/esri/core/workers/chunks/f931d560f3f14598f454.js +1 -0
  79. package/assets/esri/core/workers/chunks/{9890c85a238879490926.js → f9f331c76c96743d8522.js} +1 -1
  80. package/assets/esri/core/workers/chunks/fcbacca99c5a3ee5b69a.js +1 -0
  81. package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core-simd.wasm +0 -0
  82. package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core.wasm +0 -0
  83. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery.json +1 -1
  84. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_en.json +1 -1
  85. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm.json +1 -1
  86. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_en.json +1 -1
  87. package/chunks/Path.glsl.js +22 -17
  88. package/config.js +1 -1
  89. package/geometry/support/DoubleArray.js +1 -1
  90. package/geometry/support/Indices.js +1 -1
  91. package/kernel.js +1 -1
  92. package/layers/DimensionLayer.d.ts +22 -0
  93. package/layers/FeatureLayer.d.ts +15 -12
  94. package/layers/FeatureLayer.js +1 -1
  95. package/layers/GaussianSplatLayer.d.ts +22 -0
  96. package/layers/LineOfSightLayer.d.ts +22 -0
  97. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  98. package/layers/PointCloudLayer.d.ts +22 -0
  99. package/layers/ViewshedLayer.d.ts +22 -0
  100. package/layers/support/Field.d.ts +1 -0
  101. package/layers/support/Field.js +1 -1
  102. package/layers/support/SceneModification.js +1 -1
  103. package/layers/support/types.d.ts +1 -1
  104. package/layers/types.d.ts +1 -0
  105. package/package.json +1 -1
  106. package/rest/support/Query.d.ts +1 -0
  107. package/support/revision.js +1 -1
  108. package/symbols/cim/animationUtils.js +1 -1
  109. package/symbols/cim/defaultCIMValues.js +1 -1
  110. package/views/2d/engine/vectorTiles/VectorTileContainer.js +1 -1
  111. package/views/2d/engine/webgl/animations/instructions.js +1 -1
  112. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  113. package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
  114. package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
  115. package/views/2d/layers/features/layerAdapters/DimensionLayerAdapter.js +1 -1
  116. package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
  117. package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
  118. package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
  119. package/views/2d/layers/features/layerAdapters/OGCFeatureLayerAdapter.js +1 -1
  120. package/views/2d/layers/features/layerAdapters/OrientedImageryLayerAdapter.js +1 -1
  121. package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
  122. package/views/2d/layers/features/layerAdapters/StreamLayerAdapter.js +1 -1
  123. package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
  124. package/views/2d/support/clippingUtils.js +1 -1
  125. package/views/2d/support/hitTestUtils.js +1 -1
  126. package/views/3d/analysis/ShadowCast/ShadowCastTooltip.js +1 -1
  127. package/views/3d/input/SceneInputManager.js +1 -1
  128. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  129. package/views/3d/layers/IntegratedMesh3DTilesLayerWorkerHandle.js +1 -1
  130. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  131. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  132. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  133. package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
  134. package/views/3d/layers/graphics/extrudeUtils.js +1 -1
  135. package/views/3d/layers/graphics/tessellationUtils.js +1 -1
  136. package/views/3d/support/engineContent/line.js +1 -1
  137. package/views/3d/support/renderInfoUtils/polygon.js +1 -1
  138. package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBufferFields.glsl.js +3 -3
  139. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathEvaluate.glsl.js +233 -0
  140. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexInfo.glsl.js +19 -0
  141. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +64 -40
  142. package/views/3d/webgl-engine/core/shaderModules/Float2sPassUniform.js +2 -0
  143. package/views/3d/webgl-engine/core/shaderModules/IntegersPassUniform.js +2 -0
  144. package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
  145. package/views/3d/webgl-engine/lib/PathEvaluator.js +1 -1
  146. package/views/3d/webgl-engine/lib/PathExtruder.js +1 -1
  147. package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
  148. package/views/3d/webgl-engine/lib/PathProfile.js +1 -1
  149. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferFieldCreation.js +1 -1
  150. package/views/3d/webgl-engine/materials/PathLayouts.js +1 -1
  151. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  152. package/views/3d/webgl-engine/materials/PathTechniqueConfiguration.js +1 -1
  153. package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
  154. package/views/View2D.d.ts +1 -1
  155. package/views/draw/DrawTool.d.ts +34 -1
  156. package/views/input/EventMatch.js +1 -1
  157. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  158. package/widgets/BatchAttributeForm.js +1 -1
  159. package/widgets/Directions/DirectionsViewModel.js +1 -1
  160. package/widgets/Directions.js +1 -1
  161. package/widgets/FeatureTable/FeatureTableViewModel.d.ts +7 -1
  162. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  163. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  164. package/widgets/FeatureTable/support/types.d.ts +11 -1
  165. package/widgets/FeatureTable.d.ts +7 -1
  166. package/widgets/FeatureTable.js +1 -1
  167. package/assets/esri/core/workers/chunks/02c0640005b09007bb70.js +0 -1
  168. package/assets/esri/core/workers/chunks/0c8e6ccb5a8174718d62.js +0 -640
  169. package/assets/esri/core/workers/chunks/13f0e08de2dfab07d212.js +0 -1
  170. package/assets/esri/core/workers/chunks/1c0e8808d14d8e6dde2c.js +0 -1
  171. package/assets/esri/core/workers/chunks/1c8c8050d60205cf2156.js +0 -1
  172. package/assets/esri/core/workers/chunks/23119a1b1310b7dab2aa.js +0 -1
  173. package/assets/esri/core/workers/chunks/282f3d364411efac7b80.js +0 -1
  174. package/assets/esri/core/workers/chunks/2ffffc1931b2e27c6617.js +0 -1
  175. package/assets/esri/core/workers/chunks/313a89b334e3518d30a4.js +0 -1
  176. package/assets/esri/core/workers/chunks/389e57aab12d52d72695.js +0 -1
  177. package/assets/esri/core/workers/chunks/3fed503185ea1913fb84.js +0 -1
  178. package/assets/esri/core/workers/chunks/4020f95d8131493f799e.js +0 -1
  179. package/assets/esri/core/workers/chunks/4255ad7601c7a7621b71.js +0 -1
  180. package/assets/esri/core/workers/chunks/453c3b265481c80fc625.js +0 -1
  181. package/assets/esri/core/workers/chunks/4a41f98210f1da3b5041.js +0 -1
  182. package/assets/esri/core/workers/chunks/4afe76de6e82e86fe697.js +0 -1
  183. package/assets/esri/core/workers/chunks/5a85cbc04c64091d7f46.js +0 -1
  184. package/assets/esri/core/workers/chunks/5e5c7cc74ff1c9603aff.js +0 -1
  185. package/assets/esri/core/workers/chunks/601edefd8da4eb2eda28.js +0 -1
  186. package/assets/esri/core/workers/chunks/6f02681bcaa9bef501fc.js +0 -1
  187. package/assets/esri/core/workers/chunks/7b66691d133dabd87ce6.js +0 -1
  188. package/assets/esri/core/workers/chunks/7c077e1a63ab97bf3e87.js +0 -1
  189. package/assets/esri/core/workers/chunks/7dc9ff66e1eceadbae24.js +0 -1
  190. package/assets/esri/core/workers/chunks/85a200aecc7a844c9566.js +0 -1
  191. package/assets/esri/core/workers/chunks/958617c3a9854ea04e06.js +0 -1
  192. package/assets/esri/core/workers/chunks/a5b9ae4c93f9af7589f2.js +0 -1
  193. package/assets/esri/core/workers/chunks/a93a058678c8c8996d54.js +0 -1
  194. package/assets/esri/core/workers/chunks/acb8cff06142f828fb78.js +0 -1
  195. package/assets/esri/core/workers/chunks/b4badbcf1bdb7823d825.js +0 -1
  196. package/assets/esri/core/workers/chunks/b891d95b7858665cd6c1.js +0 -1
  197. package/assets/esri/core/workers/chunks/c91d4f1b42cfe474df52.js +0 -1
  198. package/assets/esri/core/workers/chunks/d33a08e5f589355c57a3.js +0 -1
  199. package/assets/esri/core/workers/chunks/dd29fd1b3da90d3ca6b1.js +0 -1
  200. package/assets/esri/core/workers/chunks/e393fd61deb2e7f22ee6.js +0 -1
  201. package/assets/esri/core/workers/chunks/e8518bd3596543b387f8.js +0 -1
  202. package/assets/esri/core/workers/chunks/ee56290e600cbeb25a00.js +0 -1
  203. package/assets/esri/core/workers/chunks/f91a2c69a93295cf4de6.js +0 -1
  204. package/assets/esri/core/workers/chunks/fec3fffcf854a6226df4.js +0 -1
@@ -0,0 +1,233 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import{freeze as e}from"../../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{pathNumRoundCapExtrusionSubdivisions as t}from"../../../../layers/graphics/Graphics3DPathSymbolLayerConstants.js";import{PathVertexInfo as o}from"./PathVertexInfo.glsl.js";import{PiUtils as r}from"../shading/PiUtils.glsl.js";import{Float2sPassUniform as a}from"../../shaderModules/Float2sPassUniform.js";import{Float4sPassUniform as n}from"../../shaderModules/Float4sPassUniform.js";import{FloatPassUniform as i}from"../../shaderModules/FloatPassUniform.js";import{glsl as l,If as s}from"../../shaderModules/glsl.js";import{IntegerPassUniform as f}from"../../shaderModules/IntegerPassUniform.js";import{IntegersPassUniform as p}from"../../shaderModules/IntegersPassUniform.js";import{pathProfileUniformLayout as d}from"../../../lib/PathProfile.js";function x(e,x){const{vertex:u}=e;e.include(o);const m=1===x.upVectorAlignment;u.uniforms.add(new i("angleCutoff",e=>e.cutoffAngle)),u.code.add(l`float reciprocalClamped(float value) {
3
+ float signValue = value < 0.0 ? -1.0 : 1.0;
4
+ return signValue / max(abs(value), 1e-6);
5
+ }`),m?u.code.add(l`vec2 applyMiterStretch(vec2 vertex, float rotationAngle, vec2 rotationRight) {
6
+ if (abs(rotationAngle) == 0.0) {
7
+ return vertex;
8
+ }
9
+ float k = reciprocalClamped(cos(0.5 * rotationAngle));
10
+ mat2 miterStretch = mat2(
11
+ 1. + (k - 1.) * rotationRight.x * rotationRight.x,
12
+ (k - 1.) * rotationRight.x * rotationRight.y,
13
+ (k - 1.) * rotationRight.x * rotationRight.y,
14
+ 1. + (k - 1.) * rotationRight.y * rotationRight.y
15
+ );
16
+ return miterStretch * vertex;
17
+ }`):u.code.add(l`vec2 applyMiterStretch(vec2 vertex, float rotationAngle) {
18
+ if (abs(rotationAngle) == 0.0) {
19
+ return vertex;
20
+ }
21
+ float k = reciprocalClamped(cos(0.5 * rotationAngle));
22
+ return vec2(k, 1.) * vertex;
23
+ }`);const{vertexCount:h,indexCount:v,poleCount:g}=d[x.pathProfileType];switch(u.uniforms.add(new a("pathProfileVertices",h,e=>e.profile.vertices.flat()),new a("pathProfileNormals",h,e=>e.profile.normals.flat())),u.code.add(l`mat3 mat3FromRotation(float angle, vec3 axis) {
24
+ float x = axis.x;
25
+ float y = axis.y;
26
+ float z = axis.z;
27
+ float s = sin(angle);
28
+ float c = cos(angle);
29
+ float t = 1.0 - c;
30
+ return mat3(
31
+ x * x * t + c, y * x * t + z * s, z * x * t - y * s,
32
+ x * y * t - z * s, y * y * t + c, z * y * t + x * s,
33
+ x * z * t + y * s, y * z * t - x * s, z * z * t + c
34
+ );
35
+ }`),u.code.add(l`struct ExtrusionFrame {
36
+ vec3 up;
37
+ vec3 right;
38
+ };
39
+ struct ExtrudedVertex {
40
+ vec2 profileVertex;
41
+ vec2 profileNormal;
42
+ vec2 rotationRight;
43
+ float capPositionOffset;
44
+ float capNormalOffset;
45
+ bool isCap;
46
+ ExtrusionFrame frame;
47
+ };`),u.constants.add("pathVertexTypeJoin","uint",0),u.uniforms.add(new f("numJoinSubdivisions",e=>e.numJoinSubdivisions)),u.code.add(l`
48
+ ExtrudedVertex evaluateJoinVertex(PathVertexInfo vertexInfo) {
49
+ vec2 profileVertex = pathProfileVertices[vertexInfo.sourceIndex];
50
+ vec2 profileNormal = pathProfileNormals[vertexInfo.sourceIndex];
51
+ float profileRotation = getProfileRotation();
52
+ vec2 pathRotationRight = getPathRotationRight();
53
+ bool isBevel = abs(profileRotation) >= angleCutoff;
54
+
55
+ // determine if the current profile vertex is on the inside or outside of the rotationAxis
56
+ // this determines if the geometry folds inwards or is bend outwards
57
+ float b = dot(profileVertex, pathRotationRight);
58
+ bool isBend = b * profileRotation >= 0.;
59
+
60
+ bool isBevelBend = isBevel && isBend;
61
+
62
+ ExtrusionFrame frame = ExtrusionFrame(
63
+ getFrameUp(),
64
+ getFrameRight()
65
+ );
66
+
67
+ if (isBevelBend) {
68
+ float k = vertexInfo.subdivision;
69
+ // rotate half rotation angle backwards to where the rotation starts
70
+ // and then rotate a couple of times depending on the current subdivision segment
71
+ float bendRotation = -profileRotation * 0.5 + (k * profileRotation) / float(numJoinSubdivisions);
72
+ if (bendRotation != 0.) {
73
+ vec3 rotationUp = getFrameRotationUp();
74
+ mat3 transform = mat3FromRotation(bendRotation, rotationUp);
75
+ ${s(m,l`frame.up = normalize(transform * frame.up);`)}
76
+ frame.right = normalize(transform * frame.right);
77
+ }
78
+ } else {
79
+ profileVertex = applyMiterStretch(
80
+ profileVertex,
81
+ profileRotation${s(m,l`,
82
+ pathRotationRight`)}
83
+ );
84
+ }
85
+
86
+ vec2 rotationRight = isBend
87
+ ? vec2(0.)
88
+ : pathRotationRight * getMaxStretchDistance();
89
+
90
+ return ExtrudedVertex(
91
+ profileVertex,
92
+ profileNormal,
93
+ rotationRight,
94
+ 0.,
95
+ 0.,
96
+ false,
97
+ frame
98
+ );
99
+ }
100
+ `),u.constants.add("pathVertexTypeCapConnectingProfile","uint",1),u.code.add(l`
101
+ ExtrudedVertex evaluateConnectingVertex(PathVertexInfo vertexInfo) {
102
+ vec2 profileVertex = pathProfileVertices[vertexInfo.sourceIndex];
103
+ vec2 profileNormal = pathProfileNormals[vertexInfo.sourceIndex];
104
+
105
+ float profilePlaneVertexOffset = ${s(2===x.pathCapType,l`vertexInfo.isEnd ? 0.5 : -0.5`,l`0.`)};
106
+
107
+ return ExtrudedVertex(
108
+ profileVertex,
109
+ profileNormal,
110
+ vec2(0.),
111
+ profilePlaneVertexOffset,
112
+ 0.,
113
+ true,
114
+ ExtrusionFrame(
115
+ getFrameUp(),
116
+ getFrameRight()
117
+ )
118
+ );
119
+ }
120
+ `),x.pathCapType){case 1:case 2:u.constants.add("pathVertexTypeFlatCapProfile","uint",2),u.code.add(l`
121
+ ExtrudedVertex evaluateFlatCapVertex(PathVertexInfo vertexInfo) {
122
+ vec2 profileVertex = pathProfileVertices[vertexInfo.sourceIndex];
123
+ bool isEnd = vertexInfo.isEnd;
124
+ float normalOffset = isEnd ? 1. : -1.;
125
+ float profilePlaneOffset = ${s(2===x.pathCapType,l`isEnd ? 0.5 : -0.5`,l`0.0`)};
126
+ vec2 normal = vec2(0.);
127
+
128
+ return ExtrudedVertex(
129
+ profileVertex,
130
+ normal,
131
+ vec2(0.),
132
+ profilePlaneOffset,
133
+ normalOffset,
134
+ true,
135
+ ExtrusionFrame(
136
+ getFrameUp(),
137
+ getFrameRight()
138
+ )
139
+ );
140
+ }
141
+ `);break;case 3:u.uniforms.add(new n("pathProfilePoles",g,e=>e.profile.poles.flatMap(({position:e,normal:t})=>[...e,...t??c]),{supportsNaN:!0}),new p("pathProfilePoleIndices",v,e=>e.profile.poleIndices)),u.include(r),u.constants.add("pathVertexTypeRoundCapPole","uint",3),u.constants.add("pathVertexTypeRoundCapInnerProfile","uint",4),u.constants.add("pathNumRoundCapExtrusionSubdivisions","float",t),u.code.add(l`ExtrudedVertex evaluateRoundCapPoleVertex(PathVertexInfo vertexInfo) {
142
+ bool isEnd = vertexInfo.isEnd;
143
+ float capSign = isEnd ? 1. : -1.;
144
+ float offsetScale = capSign * 0.5;
145
+ vec4 pole = pathProfilePoles[vertexInfo.sourceIndex];
146
+ vec2 polePosition = pole.xy;
147
+ bool hasPoleNormal = !isnan(pole.z);
148
+ vec2 poleNormal = hasPoleNormal ? pole.zw : vec2(0.);
149
+ float normalOffset = hasPoleNormal ? 0. : capSign;
150
+ return ExtrudedVertex(
151
+ polePosition,
152
+ poleNormal,
153
+ vec2(0.),
154
+ offsetScale,
155
+ normalOffset,
156
+ true,
157
+ ExtrusionFrame(
158
+ getFrameUp(),
159
+ getFrameRight()
160
+ )
161
+ );
162
+ }
163
+ ExtrudedVertex evaluateRoundCapInnerVertex(PathVertexInfo vertexInfo) {
164
+ bool isEnd = vertexInfo.isEnd;
165
+ float capSign = isEnd ? 1. : -1.;
166
+ float offsetScale = capSign * 0.5;
167
+ float subdivision = vertexInfo.subdivision;
168
+ float t = 1. - (subdivision + 1.) / pathNumRoundCapExtrusionSubdivisions;
169
+ float theta = t * HALF_PI;
170
+ float t1 = sin(theta);
171
+ float t2 = cos(theta);
172
+ int poleIndex = pathProfilePoleIndices[vertexInfo.sourceIndex];
173
+ vec4 pole = pathProfilePoles[poleIndex];
174
+ vec2 polePosition = pole.xy;
175
+ bool hasPoleNormal = !isnan(pole.z);
176
+ vec2 profileVertex = pathProfileVertices[vertexInfo.sourceIndex];
177
+ vec2 poleOffsetScaled = (profileVertex - polePosition) * t1;
178
+ vec2 poleVertex = poleOffsetScaled + polePosition;
179
+ vec2 profileNormal = hasPoleNormal
180
+ ? pole.zw
181
+ : normalize(poleOffsetScaled) * t1;
182
+ float normalOffset = hasPoleNormal ? 0. : capSign * t2;
183
+ return ExtrudedVertex(
184
+ poleVertex,
185
+ profileNormal,
186
+ vec2(0.),
187
+ offsetScale * t2,
188
+ normalOffset,
189
+ true,
190
+ ExtrusionFrame(
191
+ getFrameUp(),
192
+ getFrameRight()
193
+ )
194
+ );
195
+ }`)}u.code.add(l`
196
+ ExtrudedVertex evaluateVertex() {
197
+ PathVertexInfo vertexInfo = decodePathVertexInfo();
198
+
199
+ switch (vertexInfo.type) {
200
+ case pathVertexTypeJoin:
201
+ return evaluateJoinVertex(vertexInfo);
202
+
203
+ case pathVertexTypeCapConnectingProfile:
204
+ return evaluateConnectingVertex(vertexInfo);
205
+
206
+ ${s(1===x.pathCapType||2===x.pathCapType,l`
207
+ case pathVertexTypeFlatCapProfile:
208
+ return evaluateFlatCapVertex(vertexInfo);
209
+ `)}
210
+
211
+ ${s(3===x.pathCapType,l`
212
+ case pathVertexTypeRoundCapPole:
213
+ return evaluateRoundCapPoleVertex(vertexInfo);
214
+ case pathVertexTypeRoundCapInnerProfile:
215
+ return evaluateRoundCapInnerVertex(vertexInfo);
216
+ `)}
217
+
218
+ default:
219
+ return ExtrudedVertex(
220
+ vec2(0.),
221
+ vec2(0.),
222
+ vec2(0.),
223
+ 0.,
224
+ 0.,
225
+ false,
226
+ ExtrusionFrame(
227
+ getFrameUp(),
228
+ getFrameRight()
229
+ )
230
+ );
231
+ }
232
+ }
233
+ `)}const c=e(NaN,NaN);export{x as PathEvaluate};
@@ -0,0 +1,19 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import{glsl as t}from"../../shaderModules/glsl.js";import{pathVertexInfoSourceIndexShift as e,pathVertexInfoSourceIndexMask as n,pathVertexInfoSubdivisionShift as a,pathVertexInfoSubdivisionMask as o,pathVertexInfoTypeShift as i,pathVertexInfoTypeMask as d,pathVertexInfoCapSideShift as s,pathVertexInfoCapSideMask as r}from"../../../lib/PathVertexInfo.js";function p(p){const{attributes:f,vertex:h}=p;f.add("pathVertexInfo","uint"),h.constants.add("pathVertexInfoSourceIndexShift","uint",e),h.constants.add("pathVertexInfoSourceIndexMask","uint",n),h.constants.add("pathVertexInfoSubdivisionShift","uint",a),h.constants.add("pathVertexInfoSubdivisionMask","uint",o),h.constants.add("pathVertexInfoTypeShift","uint",i),h.constants.add("pathVertexInfoTypeMask","uint",d),h.constants.add("pathVertexInfoCapSideShift","uint",s),h.constants.add("pathVertexInfoCapSideMask","uint",r),h.constants.add("pathVertexCapSideEnd","uint",1),h.code.add(t`struct PathVertexInfo {
3
+ uint sourceIndex;
4
+ float subdivision;
5
+ uint type;
6
+ bool isEnd;
7
+ };
8
+ PathVertexInfo decodePathVertexInfo() {
9
+ uint sourceIndex = (pathVertexInfo >> pathVertexInfoSourceIndexShift) & pathVertexInfoSourceIndexMask;
10
+ uint subdivision = (pathVertexInfo >> pathVertexInfoSubdivisionShift) & pathVertexInfoSubdivisionMask;
11
+ uint type = (pathVertexInfo >> pathVertexInfoTypeShift) & pathVertexInfoTypeMask;
12
+ uint capSide = (pathVertexInfo >> pathVertexInfoCapSideShift) & pathVertexInfoCapSideMask;
13
+ return PathVertexInfo(
14
+ sourceIndex,
15
+ float(subdivision),
16
+ type,
17
+ capSide == pathVertexCapSideEnd
18
+ );
19
+ }`)}export{p as PathVertexInfo};
@@ -1,17 +1,15 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{fromValues as e}from"../../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{TextureBackedBufferModule as r}from"../TextureBackedBuffer.glsl.js";import{Float2PassUniform as t}from"../../shaderModules/Float2PassUniform.js";import{Float3PassUniform as o}from"../../shaderModules/Float3PassUniform.js";import{Float4PassUniform as i}from"../../shaderModules/Float4PassUniform.js";import{Float4sPassUniform as a}from"../../shaderModules/Float4sPassUniform.js";import{FloatPassUniform as l}from"../../shaderModules/FloatPassUniform.js";import{FloatsPassUniform as s}from"../../shaderModules/FloatsPassUniform.js";import{glsl as v,If as c}from"../../shaderModules/glsl.js";import{Texture2DUintDrawUniform as n}from"../../shaderModules/Texture2DUintDrawUniform.js";import{getTextureLayout as u}from"../../../materials/PathLayouts.js";import{VisualVariablePassParameters as f,vvColorNumber as p}from"../../../materials/VisualVariablePassParameters.js";const d=8;function m(e,f){const{attributes:m,vertex:x}=e,y=new n("componentTextureBuffer",e=>e.textureBuffer),g=new r({layout:u(f),itemIndexAttribute:"textureElementIndex",bufferUniform:y});e.include(g.TextureBackedBufferModule,f),m.add("textureElementIndex","uint"),m.add("profileVertexAndNormal","vec4"),m.add("profileAuxData","vec3"),x.code.add(v`bool isCapVertex() {
3
- return profileAuxData.z == 1.0;
4
- }`),x.uniforms.add(new t("size",e=>e.size));const{hasVVSize:b,hasVVColor:z,hasVVOpacity:h}=f;b?(x.uniforms.add(new o("vvSizeMinSize",e=>e.vvSize.minSize),new o("vvSizeMaxSize",e=>e.vvSize.maxSize),new o("vvSizeOffset",e=>e.vvSize.offset),new o("vvSizeFactor",e=>e.vvSize.factor),new o("vvSizeFallback",e=>e.vvSize.fallback)),x.code.add(v`
2
+ import{fromValues as e}from"../../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{TextureBackedBufferModule as t}from"../TextureBackedBuffer.glsl.js";import{PathEvaluate as r}from"./PathEvaluate.glsl.js";import{Float2PassUniform as o}from"../../shaderModules/Float2PassUniform.js";import{Float3PassUniform as i}from"../../shaderModules/Float3PassUniform.js";import{Float4PassUniform as a}from"../../shaderModules/Float4PassUniform.js";import{Float4sPassUniform as l}from"../../shaderModules/Float4sPassUniform.js";import{FloatPassUniform as s}from"../../shaderModules/FloatPassUniform.js";import{FloatsPassUniform as v}from"../../shaderModules/FloatsPassUniform.js";import{glsl as c,If as n}from"../../shaderModules/glsl.js";import{Texture2DUintDrawUniform as u}from"../../shaderModules/Texture2DUintDrawUniform.js";import{circleProfiles as f}from"../../../lib/PathProfile.js";import{getTextureLayout as d}from"../../../materials/PathLayouts.js";import{VisualVariablePassParameters as p,vvColorNumber as m}from"../../../materials/VisualVariablePassParameters.js";const x=8;function g(e,f){const{attributes:p,vertex:g}=e,h=new u("componentTextureBuffer",e=>e.textureBuffer),y=new t({layout:d(f),itemIndexAttribute:"textureElementIndex",bufferUniform:h});e.include(y.TextureBackedBufferModule,f),p.add("textureElementIndex","uint"),g.uniforms.add(new o("size",e=>e.size));const{hasVVSize:V,hasVVColor:b,hasVVOpacity:z}=f;V?(g.uniforms.add(new i("vvSizeMinSize",e=>e.vvSize.minSize),new i("vvSizeMaxSize",e=>e.vvSize.maxSize),new i("vvSizeOffset",e=>e.vvSize.offset),new i("vvSizeFactor",e=>e.vvSize.factor),new i("vvSizeFallback",e=>e.vvSize.fallback)),g.code.add(c`
5
3
  vec2 getSize() {
6
- float value = ${g.getTextureAttribute("sizeFeatureAttribute")};
4
+ float value = ${y.getTextureAttribute("sizeFeatureAttribute")};
7
5
  if (isnan(value)) {
8
6
  return vvSizeFallback.xz;
9
7
  }
10
8
  return size * clamp(vvSizeOffset + value * vvSizeFactor, vvSizeMinSize, vvSizeMaxSize).xz;
11
9
  }
12
- `)):x.code.add(v`vec2 getSize(){
10
+ `)):g.code.add(c`vec2 getSize(){
13
11
  return size;
14
- }`),h?(x.constants.add("vvOpacityNumber","int",d),x.uniforms.add(new s("vvOpacityValues",d,e=>e.vvOpacity.values),new s("vvOpacityOpacities",d,e=>e.vvOpacity.opacityValues),new l("vvOpacityFallback",e=>e.vvOpacity.fallback,{supportsNaN:!0})),x.code.add(v`
12
+ }`),z?(g.constants.add("vvOpacityNumber","int",x),g.uniforms.add(new v("vvOpacityValues",x,e=>e.vvOpacity.values),new v("vvOpacityOpacities",x,e=>e.vvOpacity.opacityValues),new s("vvOpacityFallback",e=>e.vvOpacity.fallback,{supportsNaN:!0})),g.code.add(c`
15
13
  vec4 applyOpacity(vec4 color) {
16
14
  // if we encounter NaN in the color it means the color is in the fallback case where the symbol color
17
15
  // is not defined and there is no valid color visual variable override. In this case just return a fully
@@ -20,11 +18,11 @@ return size;
20
18
  return vec4(0);
21
19
  }
22
20
 
23
- float value = ${g.getTextureAttribute("opacityFeatureAttribute")};
21
+ float value = ${y.getTextureAttribute("opacityFeatureAttribute")};
24
22
 
25
23
  if (isnan(value)) {
26
24
  // If there is a color vv then it will already have taken care of applying the fallback
27
- return ${c(z,"color","vec4(color.rgb, vvOpacityFallback)")};
25
+ return ${n(b,"color","vec4(color.rgb, vvOpacityFallback)")};
28
26
  }
29
27
 
30
28
  if (value <= vvOpacityValues[0]) {
@@ -40,11 +38,11 @@ return size;
40
38
 
41
39
  return vec4( color.rgb, vvOpacityOpacities[vvOpacityNumber - 1]);
42
40
  }
43
- `)):x.code.add(v`vec4 applyOpacity(vec4 color){
41
+ `)):g.code.add(c`vec4 applyOpacity(vec4 color){
44
42
  return color;
45
- }`),z?(x.constants.add("vvColorNumber","int",p),x.uniforms.add(new s("vvColorValues",p,e=>e.vvColor.values),new a("vvColorColors",p,e=>e.vvColor.colors),new i("vvColorFallback",e=>e.vvColor.fallback)),x.code.add(v`
43
+ }`),b?(g.constants.add("vvColorNumber","int",m),g.uniforms.add(new v("vvColorValues",m,e=>e.vvColor.values),new l("vvColorColors",m,e=>e.vvColor.colors),new a("vvColorFallback",e=>e.vvColor.fallback)),g.code.add(c`
46
44
  vec4 getColor() {
47
- float value = ${g.getTextureAttribute("colorFeatureAttribute")};
45
+ float value = ${y.getTextureAttribute("colorFeatureAttribute")};
48
46
  if (isnan(value)) {
49
47
  return applyOpacity(vvColorFallback);
50
48
  }
@@ -62,28 +60,57 @@ return color;
62
60
 
63
61
  return applyOpacity(vvColorColors[vvColorNumber - 1]);
64
62
  }
65
- `)):x.code.add(v`vec4 getColor(){
63
+ `)):g.code.add(c`vec4 getColor(){
66
64
  return applyOpacity(vec4(1, 1, 1, 1));
67
- }`),x.code.add(v`
68
- vec3 decompressAxis(vec2 axis) {
69
- float z = 1.0 - abs(axis.x) - abs(axis.y);
70
- return normalize(vec3(axis + sign(axis) * min(z, 0.0), z));
71
- }
65
+ }`),g.code.add(c`
66
+ vec3 decompressAxis(vec2 axis) {
67
+ float z = 1.0 - abs(axis.x) - abs(axis.y);
68
+ return normalize(vec3(axis + sign(axis) * min(z, 0.0), z));
69
+ }
70
+
71
+ float getProfileRotation() {
72
+ return ${y.getTextureAttribute("profileRotation")};
73
+ }
74
+
75
+ float getMaxStretchDistance() {
76
+ return ${y.getTextureAttribute("pathMaxStretchDistance")};
77
+ }
72
78
 
73
- vec3 calculateVPos() {
79
+ vec3 getFrameUp() {
80
+ return decompressAxis(${y.getTextureAttribute("profileUp")});
81
+ }
82
+
83
+ vec3 getFrameRight() {
84
+ return decompressAxis(${y.getTextureAttribute("profileRight")});
85
+ }
86
+ `),1===f.upVectorAlignment?g.code.add(c`
87
+ vec2 getPathRotationRight() {
88
+ return ${y.getTextureAttribute("pathRotationRight")};
89
+ }
90
+
91
+ vec3 getFrameRotationUp() {
92
+ return ${y.getTextureAttribute("pathRotationUp")};
93
+ }
94
+ `):g.code.add(c`vec2 getPathRotationRight() {
95
+ return vec2(1., 0.);
96
+ }
97
+ vec3 getFrameRotationUp() {
98
+ return getFrameUp();
99
+ }`),e.include(r,f),g.code.add(c`
100
+ vec3 calculateVPos(ExtrudedVertex extrudedVertex) {
74
101
  vec2 size = getSize();
75
- vec3 origin = ${g.getTextureAttribute("position")};
76
- vec3 right = decompressAxis(${g.getTextureAttribute("profileRight")});
77
- vec3 up = decompressAxis(${g.getTextureAttribute("profileUp")});
78
- vec2 profileVertex = profileVertexAndNormal.xy * size;
79
- `),x.code.add(v`if(isCapVertex()) {
80
- float positionOffsetAlongProfilePlaneNormal = profileAuxData.x * size[0];
102
+ vec3 origin = ${y.getTextureAttribute("position")};
103
+ vec3 right = extrudedVertex.frame.right;
104
+ vec3 up = extrudedVertex.frame.up;
105
+ vec2 profileVertex = extrudedVertex.profileVertex * size;
106
+ `),g.code.add(c`if(extrudedVertex.isCap) {
107
+ float positionOffsetAlongProfilePlaneNormal = extrudedVertex.capPositionOffset * size[0];
81
108
  vec3 forward = cross(up, right);
82
109
  vec3 offset = right * profileVertex.x + up * profileVertex.y + forward * positionOffsetAlongProfilePlaneNormal;
83
110
  return origin + offset;
84
111
  }
85
- vec2 rotationRight = vec2(profileAuxData.x, profileAuxData.y);
86
- float maxDistance = length(rotationRight);`),x.code.add(v`rotationRight = maxDistance > 0.0 ? normalize(rotationRight) : vec2(0, 0);
112
+ vec2 rotationRight = extrudedVertex.rotationRight;
113
+ float maxDistance = length(rotationRight);`),g.code.add(c`rotationRight = maxDistance > 0.0 ? normalize(rotationRight) : vec2(0, 0);
87
114
  float rx = dot(profileVertex, rotationRight);
88
115
  if (abs(rx) > maxDistance) {
89
116
  vec2 rotationUp = vec2(-rotationRight.y, rotationRight.x);
@@ -92,17 +119,14 @@ profileVertex = rotationRight * maxDistance * sign(rx) + rotationUp * ry;
92
119
  }
93
120
  vec3 offset = right * profileVertex.x + up * profileVertex.y;
94
121
  return origin + offset;
95
- }`),x.code.add(v`
96
- vec3 localNormal() {
97
- vec3 right = decompressAxis(${g.getTextureAttribute("profileRight")});
98
- vec3 up = decompressAxis(${g.getTextureAttribute("profileUp")});
99
- vec3 normal = right * profileVertexAndNormal.z + up * profileVertexAndNormal.w;
100
-
101
- if(isCapVertex()) {
102
- vec3 forward = cross(up, right);
103
- normal += forward * profileAuxData.y;
104
- }
105
-
106
- return normal;
107
- }
108
- `)}class x extends f{constructor(){super(...arguments),this.size=e(1,1)}}export{m as PathVertexPosition,x as PathVertexPositionPassParameters};
122
+ }`),g.code.add(c`vec3 localNormal(ExtrudedVertex extrudedVertex) {
123
+ vec3 right = extrudedVertex.frame.right;
124
+ vec3 up = extrudedVertex.frame.up;
125
+ vec2 profileNormal = extrudedVertex.profileNormal;
126
+ vec3 normal = right * profileNormal.x + up * profileNormal.y;
127
+ if(extrudedVertex.isCap) {
128
+ vec3 forward = cross(up, right);
129
+ normal += forward * extrudedVertex.capNormalOffset;
130
+ }
131
+ return normal;
132
+ }`)}class h extends p{constructor(){super(...arguments),this.numJoinSubdivisions=1,this.size=e(1,1),this.cutoffAngle=0,this.profile=f.center}}export{g as PathVertexPosition,h as PathVertexPositionPassParameters};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import{Uniform as r}from"../../../../webgl/Uniform.js";class e extends r{constructor(r,e,o,s){super(r,"vec2",1,(e,t,c)=>e.setUniform2fv(r,o(t,c),s),e)}}export{e as Float2sPassUniform};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import{Uniform as r}from"../../../../webgl/Uniform.js";class o extends r{constructor(r,o,s){super(r,"int",1,(o,t,e)=>o.setUniform1iv(r,s(t,e)),o)}}export{o as IntegersPassUniform};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- 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{transformMat4 as i}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{newFloatArray as r,floatSubArray as o}from"../../../../geometry/support/FloatArray.js";import{newIndexArray as n,compactIndices as h}from"../../../../geometry/support/Indices.js";import{newShortArray as a}from"../../../../geometry/support/ShortArray.js";import{compressNormal as m}from"./Normals.js";import{PathEvaluator as u}from"./PathEvaluator.js";import{encodePathVertexInfo as p}from"./PathVertexInfo.js";class c{constructor(t,e,i,s,h){this.path=t,this.profile=e,this.extruder=i,this.cap=s,this._extrusionVertexCount=0,this._extrusionFrameCount=0;const m=this.path.vertices.length-2;this.numExtrusionProfiles=i.numProfilesPerJoin()*m+2,this.numVerticesTotal=e.vertices.length*this.numExtrusionProfiles,this.numExtrusionFrames=i.numProfileFramesPerPathVertex()*m+2;const p=this.cap.numVertices;this.startCapVertexBufferStart=this.numVerticesTotal,this.numVerticesTotal+=p,this.endCapVertexBufferStart=this.numVerticesTotal,this.numVerticesTotal+=p,this.profileRightAxes=a(2*this.numExtrusionFrames),this.profileUpAxes=a(2*this.numExtrusionFrames),this.profileRotationFrameRightAxes=1===h?r(2*this.numExtrusionFrames):null,this.pathMaxStretchDistances=r(this.numExtrusionFrames),this.profileRotations=r(this.numExtrusionFrames),this.framePositionIndices=n(this.numExtrusionFrames),this.pathVertexInfos=new Uint32Array(this.numVerticesTotal),this.vertexFrameIndices=n(this.numVerticesTotal),this.positions=o(t.positions,t.offset,3*t.vertices.length),this._rebuildGeometry(),this._buildTopology(),this.evaluator=new u(this,e,s.type,i.cutoffAngle,h)}emitVertexDescriptor(t,e){const i=this._extrusionVertexCount;this.pathVertexInfos[i]=p(t),this.vertexFrameIndices[i]=e,++this._extrusionVertexCount}emitExtrusionFrame(e,s,r){const{frame:o,rotationRight:n,rotationFrameUp:h,rotationAngle:a,maxStretchDistance:u}=e,p=this._extrusionFrameCount;return 0===r?(m(this.profileRightAxes,p,o.right[0],o.right[1],o.right[2]),m(this.profileUpAxes,p,o.up[0],o.up[1],o.up[2])):(t(f,r,h),i(l,o.up,f),i(x,o.right,f),m(this.profileRightAxes,p,x[0],x[1],x[2]),m(this.profileUpAxes,p,l[0],l[1],l[2])),this.profileRotations[p]=a,this.profileRotationFrameRightAxes&&(this.profileRotationFrameRightAxes[2*p]=n[0],this.profileRotationFrameRightAxes[2*p+1]=n[1]),this.pathMaxStretchDistances[p]=u,this.framePositionIndices[p]=s,this._extrusionFrameCount++}_rebuildGeometry(){this._extrusionVertexCount=0,this._extrusionFrameCount=0;const{positions:t,offset:e,vertices:i}=this.path,{profile:s}=this;this.positions=o(t,e,3*i.length);const r=this.emitExtrusionFrame(i[0],0,0);for(let o=0;o<s.vertices.length;++o)this.emitVertexDescriptor({sourceIndex:o,subdivision:0,type:1,capSide:0},r);const n=(t,e,i)=>{this.emitVertexDescriptor({sourceIndex:e,subdivision:i,type:0,capSide:0},t)},h=(t,e,i)=>this.emitExtrusionFrame(t,e,i);for(let o=1;o<i.length-1;++o){const t=i[o];this.extruder.extrude(t,o,this.profile,n,h)}const a=i.length-1,m=this.emitExtrusionFrame(i[a],a,0);for(let o=0;o<s.vertices.length;++o)this.emitVertexDescriptor({sourceIndex:o,subdivision:0,type:1,capSide:1},m);const u=(t,e,i)=>this.emitVertexDescriptor({sourceIndex:t,subdivision:e,type:i,capSide:0},0),p=(t,e,i)=>this.emitVertexDescriptor({sourceIndex:t,subdivision:e,type:i,capSide:1},m);this.cap.rebuildCapGeometry(u),this.cap.rebuildCapGeometry(p)}_buildTopology(){const t=this.profile.vertices.length,e=this.profile.numSegments,i=this.numExtrusionProfiles-1,s=0,r=t*(this.numExtrusionProfiles-1),o=new Array,n=(t,e,i)=>{o.push(t),o.push(e),o.push(i)};for(let h=0;h<e;++h){const e=this.profile.indices[2*h],s=this.profile.indices[2*h+1];for(let r=0;r<i;++r){const i=r*t+e,o=(r+1)*t+s,h=r*t+s;n(i,(r+1)*t+e,o),n(i,o,h)}}this.cap.buildTopology(n,0,this.startCapVertexBufferStart,s),this.cap.buildTopology(n,1,this.endCapVertexBufferStart,r),this.vertexIndices=h(o)}onPathChanged(){this._rebuildGeometry()}}const l=s(),x=s(),f=e();export{c as PathBuilder};
2
+ import{newFloatArray as t,floatSubArray as e}from"../../../../geometry/support/FloatArray.js";import{newIndexArray as i,compactIndices as s}from"../../../../geometry/support/Indices.js";import{newShortArray as r}from"../../../../geometry/support/ShortArray.js";import{compressNormal as o}from"./Normals.js";import{PathEvaluator as n}from"./PathEvaluator.js";import{encodePathVertexInfo as h}from"./PathVertexInfo.js";class a{constructor(s,o,h,a,u){this.path=s,this.profile=o,this.extruder=h,this.cap=a,this._extrusionVertexCount=0,this._extrusionFrameCount=0;const p=this.path.vertices.length-2;this.numExtrusionProfiles=h.numProfilesPerJoin()*p+2,this.numVerticesTotal=o.vertices.length*this.numExtrusionProfiles,this.numExtrusionFrames=this.path.vertices.length;const m=this.cap.numVertices;this.startCapVertexBufferStart=this.numVerticesTotal,this.numVerticesTotal+=m,this.endCapVertexBufferStart=this.numVerticesTotal,this.numVerticesTotal+=m,this.profileRightAxes=r(2*this.numExtrusionFrames),this.profileUpAxes=r(2*this.numExtrusionFrames);const l=1===u;this.profileRotationFrameRightAxes=l?t(2*this.numExtrusionFrames):null,this.profileRotationFrameUpAxes=l?t(3*this.numExtrusionFrames):null,this.pathMaxStretchDistances=t(this.numExtrusionFrames),this.profileRotations=t(this.numExtrusionFrames),this.framePositionIndices=i(this.numExtrusionFrames),this.pathVertexInfos=new Uint32Array(this.numVerticesTotal),this.vertexFrameIndices=i(this.numVerticesTotal),this.positions=e(s.positions,s.offset,3*s.vertices.length),this._rebuildGeometry(),this._buildTopology(),this.evaluator=new n(this,o,this.extruder.numBendSubdivisions,a.type,h.cutoffAngle,u)}emitVertexDescriptor(t,e){const i=this._extrusionVertexCount;this.pathVertexInfos[i]=h(t),this.vertexFrameIndices[i]=e,++this._extrusionVertexCount}emitExtrusionFrame(t,e){const{frame:i,rotationRight:s,rotationFrameUp:r,rotationAngle:n,maxStretchDistance:h}=t,a=this._extrusionFrameCount;return o(this.profileRightAxes,a,i.right[0],i.right[1],i.right[2]),o(this.profileUpAxes,a,i.up[0],i.up[1],i.up[2]),this.profileRotations[a]=n,this.profileRotationFrameRightAxes&&(this.profileRotationFrameRightAxes[2*a]=s[0],this.profileRotationFrameRightAxes[2*a+1]=s[1]),this.profileRotationFrameUpAxes&&(this.profileRotationFrameUpAxes[3*a]=r[0],this.profileRotationFrameUpAxes[3*a+1]=r[1],this.profileRotationFrameUpAxes[3*a+2]=r[2]),this.pathMaxStretchDistances[a]=h,this.framePositionIndices[a]=e,this._extrusionFrameCount++}_rebuildGeometry(){this._extrusionVertexCount=0,this._extrusionFrameCount=0;const{positions:t,offset:i,vertices:s}=this.path,{profile:r}=this;this.positions=e(t,i,3*s.length);for(let e=0;e<s.length;++e)this.emitExtrusionFrame(s[e],e);for(let e=0;e<r.vertices.length;++e)this.emitVertexDescriptor({sourceIndex:e,subdivision:0,type:1,capSide:0},0);const o=(t,e,i)=>{this.emitVertexDescriptor({sourceIndex:e,subdivision:i,type:0,capSide:0},t)};for(let e=1;e<s.length-1;++e)this.extruder.extrude(e,this.profile,o);const n=s.length-1;for(let e=0;e<r.vertices.length;++e)this.emitVertexDescriptor({sourceIndex:e,subdivision:0,type:1,capSide:1},n);this.cap.rebuildCapGeometry((t,e,i)=>this.emitVertexDescriptor({sourceIndex:t,subdivision:e,type:i,capSide:0},0)),this.cap.rebuildCapGeometry((t,e,i)=>this.emitVertexDescriptor({sourceIndex:t,subdivision:e,type:i,capSide:1},n))}_buildTopology(){const t=this.profile.vertices.length,e=this.profile.numSegments,i=this.numExtrusionProfiles-1,r=0,o=t*(this.numExtrusionProfiles-1),n=new Array,h=(t,e,i)=>{n.push(t),n.push(e),n.push(i)};for(let s=0;s<e;++s){const e=this.profile.indices[2*s],r=this.profile.indices[2*s+1];for(let s=0;s<i;++s){const i=s*t+e,o=(s+1)*t+r,n=s*t+r;h(i,(s+1)*t+e,o),h(i,o,n)}}this.cap.buildTopology(h,0,this.startCapVertexBufferStart,r),this.cap.buildTopology(h,1,this.endCapVertexBufferStart,o),this.vertexIndices=s(n)}onPathChanged(){this._rebuildGeometry()}}export{a as PathBuilder};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{reciprocalClamped as e}from"../../../../core/mathUtils.js";import{set as t}from"../../../../core/libs/gl-matrix-2/math/mat2.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/mat2f64.js";import{set as i,length as s,normalize as o,dot as a,scale as l,add as c,subtract as n,transformMat2 as f}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{UNIT_X as m,ZEROS as h,create as p}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{cross as x,set as u}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as A}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{newHalfFloatArray as d}from"../../../../geometry/support/HalfFloatArray.js";import{pathNumRoundCapExtrusionSubdivisions as P}from"../../layers/graphics/Graphics3DPathSymbolLayerConstants.js";import{decompressNormal as _,compressNormal as b}from"./Normals.js";import{decodePathVertexInfo as w}from"./PathVertexInfo.js";class V{constructor(e,t,r,i,s){this.builder=e,this.profile=t,this.capType=r,this.miterCutoffAngle=i,this.upVectorAlignment=s}evaluateBakedVertices(e,t,r){const{numVerticesTotal:n,profileRightAxes:f,profileUpAxes:m,framePositionIndices:h,vertexFrameIndices:p,positions:A}=this.builder,P=d(4),w=d(3);for(let d=0;d<n;++d){this._evaluateProfileVertexNormalAux(P,w,d,0);const n=k;let V=0,v=0;const g=p[d],I=_(C,f,g),D=_(M,m,g),N=3*h[g],j=i(F,P[0]*r[0],P[1]*r[1]);if(1===w[2])x(n,D,I),V=w[0]*r[0],v=w[1];else{const e=T,t=R;i(e,w[0],w[1]);const r=s(e);o(e,e);const f=a(j,e);if(Math.abs(f)>r){i(t,-e[1],e[0]);const s=a(j,t);l(e,e,r*Math.sign(f)),l(t,t,s),c(j,e,t)}u(n,0,0,0)}const y=I[0]*j[0]+D[0]*j[1],J=I[1]*j[0]+D[1]*j[1],S=I[2]*j[0]+D[2]*j[1],U=3*d;e[U]=A[N]+y+n[0]*V,e[U+1]=A[N+1]+J+n[1]*V,e[U+2]=A[N+2]+S+n[2]*V;const B=P[2],G=P[3];b(t,d,I[0]*B+D[0]*G+n[0]*v,I[1]*B+D[1]*G+n[1]*v,I[2]*B+D[2]*G+n[2]*v)}}evaluateFastPathVertices(e,t){const{numVerticesTotal:r}=this.builder;for(let i=0;i<r;++i)this._evaluateProfileVertexNormalAux(e,t,i,i)}_evaluateProfileVertexNormalAux(e,t,r,s){const{profileRotations:f,profileRotationFrameRightAxes:p,pathMaxStretchDistances:x,pathVertexInfos:u,vertexFrameIndices:A}=this.builder,{miterCutoffAngle:d,profile:_,upVectorAlignment:b}=this,V=v[b],j=w(u[r]),C=A[r],M=f[C],k=null!=p?i(y,p[2*C],p[2*C+1]):m,F=x[C];switch(j.type){case 0:{const r=_.vertices[j.sourceIndex],i=_.normals[j.sourceIndex],o=Math.abs(M)>=d,c=a(r,k)*M>=0;if(o&&c)this._writeProfileVertexAndNormal(e,s,r,i);else{const t=V(D,r,M,k);this._writeProfileVertexAndNormal(e,s,t,i)}if(c)this._writeProfileAuxDataJoin(t,s,h);else{const e=l(N,k,F);this._writeProfileAuxDataJoin(t,s,e)}break}case 1:{const r=_.vertices[j.sourceIndex],i=_.normals[j.sourceIndex];switch(this._writeProfileVertexAndNormal(e,s,r,i),this.capType){case 0:case 1:case 3:this._writeProfileAuxDataCap(t,s,0,0);break;case 2:this._writeProfileAuxDataCap(t,s,g(j)?.5:-.5,0)}break}case 2:{const r=_.vertices[j.sourceIndex],i=g(j),o=i?1:-1,a=2===this.capType?i?.5:-.5:0,l=h;this._writeProfileVertexAndNormal(e,s,r,l),this._writeProfileAuxDataCap(t,s,a,o);break}case 3:{const r=g(j)?1:-1,i=.5*r,o=_.poles[j.sourceIndex],a=o.position,l=o.normal;l?(this._writeProfileVertexAndNormal(e,s,a,l),this._writeProfileAuxDataCap(t,s,i,0)):(this._writeProfileVertexAndNormal(e,s,a,h),this._writeProfileAuxDataCap(t,s,i,r));break}case 4:{const r=g(j)?1:-1,i=.5*r,a=(1-(j.subdivision+1)/P)*Math.PI*.5,f=Math.sin(a),m=Math.cos(a),h=_.poleIndices[j.sourceIndex],p=_.poles[h],x=p.position,u=p.normal,A=_.vertices[j.sourceIndex];n(D,A,x),l(D,D,f),u?(c(D,D,x),this._writeProfileVertexAndNormal(e,s,D,u),this._writeProfileAuxDataCap(t,s,i*m,0)):(o(I,D),l(I,I,f),c(D,D,x),this._writeProfileVertexAndNormal(e,s,D,I),this._writeProfileAuxDataCap(t,s,i*m,r*m));break}}}_writeProfileVertexAndNormal(e,t,r,i){const s=4*t;e[s]=r[0],e[s+1]=r[1],e[s+2]=i[0],e[s+3]=i[1]}_writeProfileAuxDataJoin(e,t,r){const i=3*t;e[i]=r[0],e[i+1]=r[1],e[i+2]=0}_writeProfileAuxDataCap(e,t,r,i){const s=3*t;e[s]=r,e[s+1]=i,e[s+2]=1}}const v={0:(t,r,s)=>{if(Math.abs(s)<=0)return r;const o=e(Math.cos(.5*s));return i(t,(o-1+1)*r[0],r[1])},1:(r,i,s,o)=>{if(0===Math.abs(s))return i;const a=e(Math.cos(.5*s)),l=t(j,1+(a-1)*o[0]*o[0],(a-1)*o[0]*o[1],(a-1)*o[0]*o[1],1+(a-1)*o[1]*o[1]);return f(r,i,l)}};function g(e){return 1===e.capSide}const I=p(),D=p(),N=p(),j=r(),C=A(),M=A(),y=p(),k=A(),F=p(),T=p(),R=p();export{V as PathEvaluator};
2
+ import{reciprocalClamped as e}from"../../../../core/mathUtils.js";import{set as t}from"../../../../core/libs/gl-matrix-2/math/mat2.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/mat2f64.js";import{setAxisAngle as o}from"../../../../core/libs/gl-matrix-2/math/quat.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/quatf64.js";import{multiply as i,copy as a,length as f,normalize as c,dot as p,set as l,scale as n,add as m,subtract as h,transformMat2 as u}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{UNIT_X as x,ZEROS as b,create as d}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{cross as g,set as N,transformQuat as V}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as O}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{pathNumRoundCapExtrusionSubdivisions as v}from"../../layers/graphics/Graphics3DPathSymbolLayerConstants.js";import{compressNormal as I,decompressNormal as P}from"./Normals.js";import{PathFrame2D as j}from"./PathFrame2D.js";import{decodePathVertexInfo as M}from"./PathVertexInfo.js";class C{constructor(e,t,r,o,s,i){this.builder=e,this.profile=t,this.numJoinSubdivisions=r,this.capType=o,this.miterCutoffAngle=s,this.upVectorAlignment=i}evaluateBakedVertices(e,t,r){const{numVerticesTotal:o,framePositionIndices:s,vertexFrameIndices:h,positions:u}=this.builder;for(let x=0;x<o;++x){const o=J;this._evaluateExtrudedVertex(o,x);const b=T;let d=0,V=0;const O=h[x],v=o.frame.right,P=o.frame.up,j=3*s[O],M=i(w,o.profileVertex,r);if(o.isCap)g(b,P,v),d=o.capPositionOffset*r[0],V=o.capNormalOffset;else{const e=D,t=U;a(e,o.rotationRight);const r=f(e);c(e,e);const s=p(M,e);if(Math.abs(s)>r){l(t,-e[1],e[0]);const o=p(M,t);n(e,e,r*Math.sign(s)),n(t,t,o),m(M,e,t)}N(b,0,0,0)}const C=v[0]*M[0]+P[0]*M[1],A=v[1]*M[0]+P[1]*M[1],R=v[2]*M[0]+P[2]*M[1],y=3*x;e[y]=u[j]+C+b[0]*d,e[y+1]=u[j+1]+A+b[1]*d,e[y+2]=u[j+2]+R+b[2]*d;const k=o.profileNormal[0],F=o.profileNormal[1];I(t,x,v[0]*k+P[0]*F+b[0]*V,v[1]*k+P[1]*F+b[1]*V,v[2]*k+P[2]*F+b[2]*V)}}_evaluateExtrudedVertex(e,t){const{profileRotations:r,profileUpAxes:s,profileRightAxes:i,profileRotationFrameRightAxes:f,profileRotationFrameUpAxes:u,pathMaxStretchDistances:d,pathVertexInfos:g,vertexFrameIndices:O}=this.builder,{miterCutoffAngle:I,profile:j,upVectorAlignment:C}=this,F=A[C],T=1===this.upVectorAlignment,w=M(g[t]),D=O[t],U=r[D],J=null!=f?l(S,f[2*D],f[2*D+1]):x,_=d[D];switch(P(e.frame.right,i,D),P(e.frame.up,s,D),w.type){case 0:{e.isCap=!1;const t=j.vertices[w.sourceIndex],r=j.normals[w.sourceIndex],s=Math.abs(U)>=I,i=p(t,J)*U>=0;if(s&&i){a(e.profileVertex,t);const r=.5*-U+w.subdivision*U/this.numJoinSubdivisions;if(0!==r){const t=T?N(q,u[3*D],u[3*D+1],u[3*D+2]):e.frame.up;o(E,t,r),T&&V(e.frame.up,e.frame.up,E),V(e.frame.right,e.frame.right,E)}}else{const r=F(k,t,U,J);a(e.profileVertex,r)}a(e.profileNormal,r),i?a(e.rotationRight,b):n(e.rotationRight,J,_);break}case 1:{e.isCap=!0;const t=j.vertices[w.sourceIndex],r=j.normals[w.sourceIndex];switch(a(e.profileVertex,t),a(e.profileNormal,r),this.capType){case 0:case 1:case 3:e.capPositionOffset=0,e.capNormalOffset=0;break;case 2:e.capPositionOffset=R(w)?.5:-.5,e.capNormalOffset=0}break}case 2:{e.isCap=!0;const t=j.vertices[w.sourceIndex],r=R(w),o=r?1:-1,s=2===this.capType?r?.5:-.5:0,i=b;a(e.profileVertex,t),a(e.profileNormal,i),e.capPositionOffset=s,e.capNormalOffset=o;break}case 3:{e.isCap=!0;const t=R(w)?1:-1,r=.5*t,o=j.poles[w.sourceIndex],s=o.position,i=o.normal;i?(a(e.profileVertex,s),a(e.profileNormal,i),e.capPositionOffset=r,e.capNormalOffset=0):(a(e.profileVertex,s),a(e.profileNormal,b),e.capPositionOffset=r,e.capNormalOffset=t);break}case 4:{e.isCap=!0;const t=R(w)?1:-1,r=.5*t,o=(1-(w.subdivision+1)/v)*Math.PI*.5,s=Math.sin(o),i=Math.cos(o),f=j.poleIndices[w.sourceIndex],p=j.poles[f],l=p.position,u=p.normal,x=j.vertices[w.sourceIndex];h(k,x,l),n(k,k,s),u?(m(k,k,l),a(e.profileVertex,k),a(e.profileNormal,u),e.capPositionOffset=r*i,e.capNormalOffset=0):(c(y,k),n(y,y,s),m(k,k,l),a(e.profileVertex,k),a(e.profileNormal,y),e.capPositionOffset=r*i,e.capNormalOffset=t*i);break}default:w.type}}}const A={0:(t,r,o)=>{if(Math.abs(o)<=0)return r;const s=e(Math.cos(.5*o));return l(t,(s-1+1)*r[0],r[1])},1:(r,o,s,i)=>{if(0===Math.abs(s))return o;const a=e(Math.cos(.5*s)),f=t(F,1+(a-1)*i[0]*i[0],(a-1)*i[0]*i[1],(a-1)*i[0]*i[1],1+(a-1)*i[1]*i[1]);return u(r,o,f)}};function R(e){return 1===e.capSide}const y=d(),k=d(),F=r(),S=d(),T=O(),w=d(),D=d(),U=d(),q=O(),E=s(),J={profileVertex:d(),profileNormal:d(),rotationRight:d(),capPositionOffset:0,capNormalOffset:0,isCap:!1,frame:new j};export{C as PathEvaluator};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{dot as i}from"../../../../core/libs/gl-matrix-2/math/vec2.js";class t{constructor(i,t){this.cutoffAngle=i,this.numBendSubdivisions=t}numProfilesPerJoin(){return this.numBendSubdivisions+1}numProfileFramesPerPathVertex(){return this.numBendSubdivisions+2}extrude(t,e,s,n,o){const{rotationAngle:r,rotationRight:u}=t,h=o(t,e,0),l=new Array;for(let i=0;i<this.numBendSubdivisions+1;++i){const s=.5*-r+i*r/this.numBendSubdivisions;l.push(o(t,e,s))}if(Math.abs(r)>=this.cutoffAngle)for(let d=0;d<this.numBendSubdivisions+1;++d){const t=l[d];for(let e=0;e<s.vertices.length;++e){n(i(s.vertices[e],u)*r>=0?t:h,e,d)}}else for(let i=0;i<this.numBendSubdivisions+1;++i)for(let t=0;t<s.vertices.length;++t)n(h,t,i)}}export{t as MiterExtruder};
2
+ class i{constructor(i,e){this.cutoffAngle=i,this.numBendSubdivisions=e}numProfilesPerJoin(){return this.numBendSubdivisions+1}extrude(i,e,n){for(let s=0;s<this.numBendSubdivisions+1;++s)for(let t=0;t<e.vertices.length;++t)n(i,t,s)}}export{i as MiterExtruder};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{copy as t}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as e}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{copy as i}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as r}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{newFloatArray as s}from"../../../../geometry/support/FloatArray.js";import{newHalfFloatArray as o}from"../../../../geometry/support/HalfFloatArray.js";import{getContinuousIndexArray as a,getZeroIndexArray as l}from"../../../../geometry/support/Indices.js";import{Attribute as n,Vertices as h}from"./Attribute.js";import{intersectTriangles as u}from"./RayIntersections.js";class c{constructor(t){this.builder=t,this.color=r(255,255,255,255),this._size=e(),this.positions=s(3*this.builder.numVerticesTotal),this.normals=new Int16Array(2*this.builder.numVerticesTotal)}bakeVertexColors(t){i(this.color,t)}bake(e){t(this._size,e),this.builder.evaluator.evaluateBakedVertices(this.positions,this.normals,e)}createGeometryData(){const t=this.builder.vertexIndices;return[["position",new n(this.positions,t,3,!0)],["normalCompressed",new n(this.normals,t,2,!0)],["color",new n(this.color,l(t.length),4,!0)]]}onPathChanged(){this.builder.onPathChanged(),this.bake(this.size)}intersect(t,e,i,r){const s=this.builder.vertexIndices,o=new h(this.positions,3),a=s.length/3;u(t,e,0,a,s,o,void 0,i,r)}get size(){return this._size}}class m{constructor(t,e,i,r){this.builder=t,this.sizeAttributeValue=e,this.colorAttributeValue=i,this.opacityAttributeValue=r,this.baked=new c(t),this._profileVertexAndNormal=o(4*t.numVerticesTotal),this._profileAuxData=o(3*t.numVerticesTotal),t.evaluator.evaluateFastPathVertices(this._profileVertexAndNormal,this._profileAuxData),this._vvSize=e,this._vvColor=i,this._vvOpacity=r}createGeometryData(){const t=this.builder,{vertexIndices:e,framePositionIndices:i,numExtrusionFrames:r}=t,s=a(r),o=l(r);return[["position",new n(t.positions,i,3,!0)],["profileRight",new n(t.profileRightAxes,s,2,!0)],["profileUp",new n(t.profileUpAxes,s,2,!0)],["sizeFeatureAttribute",new n([this._vvSize],o,1,!0)],["colorFeatureAttribute",new n([this._vvColor],o,1,!0)],["opacityFeatureAttribute",new n([this._vvOpacity],o,1,!0)],["textureElementIndex",new n(t.vertexFrameIndices,e,1,!0)],["profileVertexAndNormal",new n(this._profileVertexAndNormal,e,4,!0)],["profileAuxData",new n(this._profileAuxData,e,3,!0)]]}onPathChanged(t){const e=this.builder;e.onPathChanged(),e.evaluator.evaluateFastPathVertices(this._profileVertexAndNormal,this._profileAuxData);const i=t.getMutableAttribute("position");i&&(i.data=this.builder.positions)}}export{m as FastUpdatePathGeometry,c as StaticPathGeometry};
2
+ import{copy as t}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as e}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{copy as i}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as o}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{newFloatArray as r}from"../../../../geometry/support/FloatArray.js";import{getContinuousIndexArray as s,getZeroIndexArray as a}from"../../../../geometry/support/Indices.js";import{Attribute as n,Vertices as h}from"./Attribute.js";import{intersectTriangles as l}from"./RayIntersections.js";class p{constructor(t){this.builder=t,this.color=o(255,255,255,255),this._size=e(),this.positions=r(3*this.builder.numVerticesTotal),this.normals=new Int16Array(2*this.builder.numVerticesTotal)}bakeVertexColors(t){i(this.color,t)}bake(e){t(this._size,e),this.builder.evaluator.evaluateBakedVertices(this.positions,this.normals,e)}createGeometryData(){const t=this.builder.vertexIndices;return[["position",new n(this.positions,t,3,!0)],["normalCompressed",new n(this.normals,t,2,!0)],["color",new n(this.color,a(t.length),4,!0)]]}onPathChanged(){this.builder.onPathChanged(),this.bake(this.size)}intersect(t,e,i,o){const r=this.builder.vertexIndices,s=new h(this.positions,3),a=r.length/3;l(t,e,0,a,r,s,void 0,i,o)}get size(){return this._size}}class c{constructor(t,e,i,o){this.builder=t,this.sizeAttributeValue=e,this.colorAttributeValue=i,this.opacityAttributeValue=o,this.baked=new p(t),this._vvSize=e,this._vvColor=i,this._vvOpacity=o}createGeometryData(){const t=this.builder,{vertexIndices:e,framePositionIndices:i,numExtrusionFrames:o}=t,r=s(o),h=a(o),l=[["position",new n(t.positions,i,3,!0)],["profileRight",new n(t.profileRightAxes,r,2,!0)],["profileUp",new n(t.profileUpAxes,r,2,!0)],["profileRotation",new n(t.profileRotations,r,1,!0)],["pathMaxStretchDistance",new n(t.pathMaxStretchDistances,r,1,!0)],["sizeFeatureAttribute",new n([this._vvSize],h,1,!0)],["colorFeatureAttribute",new n([this._vvColor],h,1,!0)],["opacityFeatureAttribute",new n([this._vvOpacity],h,1,!0)],["textureElementIndex",new n(t.vertexFrameIndices,e,1,!0)],["pathVertexInfo",new n(t.pathVertexInfos,e,1,!0)]];return t.profileRotationFrameRightAxes&&l.push(["pathRotationRight",new n(t.profileRotationFrameRightAxes,r,2,!0)]),t.profileRotationFrameUpAxes&&l.push(["pathRotationUp",new n(t.profileRotationFrameUpAxes,r,3,!0)]),l}onPathChanged(t){this.builder.onPathChanged();const e=t.getMutableAttribute("position");e&&(e.data=this.builder.positions)}}export{c as FastUpdatePathGeometry,p as StaticPathGeometry};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{estimateNumberArrayMemory as t}from"../../../../core/memoryEstimations.js";import{fromValues as e,clone as s}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{pathNumCircleProfileSubdivisions as o}from"../../layers/graphics/Graphics3DPathSymbolLayerConstants.js";class r{constructor(){this.vertices=new Array,this.normals=new Array,this.indices=new Array,this.poles=new Array,this.poleIndices=new Array}addVertex(t,e){return this.vertices.push(s(t)),this.normals.push(s(e)),this.vertices.length-1}addPole(t,e=null){return this.poles.push({position:s(t),normal:e?s(e):null}),this.poles.length-1}addSegment(t,e=null){this.indices.push(t.v0),this.indices.push(t.v1),e&&(this.poleIndices.push(e.v0),this.poleIndices.push(e.v1))}get numSegments(){return this.indices.length/2}translate(t,e){for(const s of this.vertices)s[0]+=t,s[1]+=e;for(const s of this.poles)s.position[0]+=t,s.position[1]+=e}get usedMemory(){return this.vertices.length*t(this.vertices[0])*2+t(this.indices)}}const n={top:[0,-.5],bottom:[0,.5]};function i(t){const s=.5,i=o,d=new r,a={v0:0,v1:0};d.addPole(e(0,0));for(let o=0;o<i;++o){const t=2*o*Math.PI/i,r=Math.cos(t),n=Math.sin(t),a=e(r*s,n*s),c=e(r,n);d.addVertex(a,c)}for(let e=0;e<i-1;++e){const t={v0:e,v1:e+1};d.addSegment(t,a)}const c={v0:i-1,v1:0};if(d.addSegment(c,a),"center"!==t){const e=n[t];d.translate(e[0],e[1])}return d}const d={center:i("center"),top:i("top"),bottom:i("bottom")},a={center:c("center"),top:c("top"),bottom:c("bottom")};function c(t){const s=1,o=1,i=new r,d=e(.5*-s,.5*-o),a=e(.5*s,.5*-o),c=e(.5*s,.5*o),h=e(.5*-s,.5*o),l=e(0,-1),v=e(1,0),m=e(0,1),p=e(-1,0);if(i.addPole(e(0,.5*o),m),i.addPole(e(0,.5*o)),i.addPole(e(0,.5*-o)),i.addPole(e(0,.5*-o),l),i.addVertex(d,l),i.addVertex(a,l),i.addSegment({v0:0,v1:1},{v0:3,v1:3}),i.addVertex(a,v),i.addVertex(c,v),i.addSegment({v0:2,v1:3},{v0:2,v1:1}),i.addVertex(c,m),i.addVertex(h,m),i.addSegment({v0:4,v1:5},{v0:0,v1:0}),i.addVertex(h,p),i.addVertex(d,p),i.addSegment({v0:6,v1:7},{v0:1,v1:2}),"center"!==t){const e=n[t];i.translate(e[0],e[1])}return i}export{r as PathProfile,d as circleProfiles,a as quadProfiles};
2
+ import{estimateNumberArrayMemory as t}from"../../../../core/memoryEstimations.js";import{fromValues as e,clone as s}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{pathNumCircleProfileSubdivisions as o}from"../../layers/graphics/Graphics3DPathSymbolLayerConstants.js";const n={0:{indexCount:2*o,poleCount:1,vertexCount:o},1:{indexCount:8,poleCount:4,vertexCount:8}};class r{constructor(t){this.type=t,this.vertices=new Array,this.normals=new Array,this.indices=new Array,this.poles=new Array,this.poleIndices=new Array}addVertex(t,e){return this.vertices.push(s(t)),this.normals.push(s(e)),this.vertices.length-1}addPole(t,e=null){return this.poles.push({position:s(t),normal:e?s(e):null}),this.poles.length-1}addSegment(t,e=null){this.indices.push(t.v0),this.indices.push(t.v1),e&&(this.poleIndices.push(e.v0),this.poleIndices.push(e.v1))}get numSegments(){return this.indices.length/2}translate(t,e){for(const s of this.vertices)s[0]+=t,s[1]+=e;for(const s of this.poles)s.position[0]+=t,s.position[1]+=e}get usedMemory(){return this.vertices.length*t(this.vertices[0])*2+t(this.indices)}}const i={top:[0,-.5],bottom:[0,.5]};function d(t){const s=.5,n=o,d=new r(0),a={v0:0,v1:0};d.addPole(e(0,0));for(let o=0;o<n;++o){const t=2*o*Math.PI/n,r=Math.cos(t),i=Math.sin(t),a=e(r*s,i*s),c=e(r,i);d.addVertex(a,c)}for(let e=0;e<n-1;++e){const t={v0:e,v1:e+1};d.addSegment(t,a)}const c={v0:n-1,v1:0};if(d.addSegment(c,a),"center"!==t){const e=i[t];d.translate(e[0],e[1])}return d}const a={center:d("center"),top:d("top"),bottom:d("bottom")},c={center:h("center"),top:h("top"),bottom:h("bottom")};function h(t){const s=1,o=1,n=new r(1),d=e(.5*-s,.5*-o),a=e(.5*s,.5*-o),c=e(.5*s,.5*o),h=e(.5*-s,.5*o),l=e(0,-1),v=e(1,0),p=e(0,1),m=e(-1,0);if(n.addPole(e(0,.5*o),p),n.addPole(e(0,.5*o)),n.addPole(e(0,.5*-o)),n.addPole(e(0,.5*-o),l),n.addVertex(d,l),n.addVertex(a,l),n.addSegment({v0:0,v1:1},{v0:3,v1:3}),n.addVertex(a,v),n.addVertex(c,v),n.addSegment({v0:2,v1:3},{v0:2,v1:1}),n.addVertex(c,p),n.addVertex(h,p),n.addSegment({v0:4,v1:5},{v0:0,v1:0}),n.addVertex(h,m),n.addVertex(d,m),n.addSegment({v0:6,v1:7},{v0:1,v1:2}),"center"!==t){const e=i[t];n.translate(e[0],e[1])}return n}export{r as PathProfile,a as circleProfiles,n as pathProfileUniformLayout,c as quadProfiles};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{hasNativeFloat16Array as e}from"../../../../../geometry/support/float16.js";import{BufferViewMat3f as t,BufferViewVec3f as o,BufferViewFloat as n,BufferViewFloat16 as r,BufferViewVec2Snorm16 as f,BufferViewVec4Unorm8 as u,BufferViewUnorm8 as m,BufferViewVec4u8 as s,BufferViewUint8 as i}from"../../../../../geometry/support/buffer/BufferView.js";import{elementTypeSize as l}from"../../../../../geometry/support/buffer/types.js";class p{constructor(e,t,o){this.elementCount=e,this.elementType=t,this.bufferViewConstructor=o,this.byteSize=w(o)}}function w(e){return l(e.ElementType)*e.ElementCount}const a={u8:new p(1,"uint",i),vec4u8:new p(4,"uint",s),unorm8:new p(1,"float",m),vec4unorm8:new p(4,"float",u),vec2snorm16:new p(2,"float",f),f16:new p(1,"float",e?r:n),f32:new p(1,"float",n),vec3f32:new p(3,"float",o),mat3f32:new p(9,"float",t)};export{p as FieldCreationInfo,a as typeToCreationInfoMap};
2
+ import{hasNativeFloat16Array as e}from"../../../../../geometry/support/float16.js";import{BufferViewMat3f as t,BufferViewVec3f as o,BufferViewVec2f as n,BufferViewFloat as f,BufferViewFloat16 as r,BufferViewVec2Snorm16 as u,BufferViewVec4Unorm8 as m,BufferViewUnorm8 as s,BufferViewVec4u8 as l,BufferViewUint8 as i}from"../../../../../geometry/support/buffer/BufferView.js";import{elementTypeSize as p}from"../../../../../geometry/support/buffer/types.js";class w{constructor(e,t,o){this.elementCount=e,this.elementType=t,this.bufferViewConstructor=o,this.byteSize=a(o)}}function a(e){return p(e.ElementType)*e.ElementCount}const c={u8:new w(1,"uint",i),vec4u8:new w(4,"uint",l),unorm8:new w(1,"float",s),vec4unorm8:new w(4,"float",m),vec2snorm16:new w(2,"float",u),f16:new w(1,"float",e?r:f),f32:new w(1,"float",f),vec2f32:new w(2,"float",n),vec3f32:new w(3,"float",o),mat3f32:new w(9,"float",t)};export{w as FieldCreationInfo,c as typeToCreationInfoMap};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{newLayout as e}from"../../support/buffer/InterleavedLayout.js";import{olidEnabled as t}from"../effects/geometry/olidUtils.js";import{TextureBackedBufferLayout as r}from"../lib/TextureBackedBuffer/TextureBackedBufferLayout.js";function o(){const r=e().vec4f16("profileVertexAndNormal").u32("textureElementIndex",{integer:!0});return t()&&r.vec4u8("olidColor"),r.vec3f16("profileAuxData"),r.freeze()}function u(e){const t=[{type:"vec3f32",name:"position"},{type:"vec2snorm16",name:"profileRight"},{type:"vec2snorm16",name:"profileUp"}];return e.hasVVSize&&t.push({type:"f32",name:"sizeFeatureAttribute"}),e.hasVVColor&&t.push({type:"f32",name:"colorFeatureAttribute"}),e.hasVVOpacity&&t.push({type:"f32",name:"opacityFeatureAttribute"}),new r(t)}export{o as getLayout,u as getTextureLayout};
2
+ import{newLayout as e}from"../../support/buffer/InterleavedLayout.js";import{olidEnabled as t}from"../effects/geometry/olidUtils.js";import{TextureBackedBufferLayout as r}from"../lib/TextureBackedBuffer/TextureBackedBufferLayout.js";function o(){const r=e().u32("pathVertexInfo",{integer:!0}).u32("textureElementIndex",{integer:!0});return t()&&r.vec4u8("olidColor"),r.freeze()}function n(e){const t=[{type:"vec3f32",name:"position"},{type:"vec2snorm16",name:"profileRight"},{type:"vec2snorm16",name:"profileUp"},{type:"f32",name:"profileRotation"},{type:"f32",name:"pathMaxStretchDistance"}];return 1===e.upVectorAlignment&&(t.push({type:"vec2f32",name:"pathRotationRight"}),t.push({type:"vec3f32",name:"pathRotationUp"})),e.hasVVSize&&t.push({type:"f32",name:"sizeFeatureAttribute"}),e.hasVVColor&&t.push({type:"f32",name:"colorFeatureAttribute"}),e.hasVVOpacity&&t.push({type:"f32",name:"opacityFeatureAttribute"}),new r(t)}export{o as getLayout,n as getTextureLayout};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{clamp as e}from"../../../../core/mathUtils.js";import{clone as t}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{fromValues as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as r}from"../../../../geometry/support/aaBoundingBox.js";import{BufferViewUint32 as s,BufferViewVec3f as o,BufferViewVec2Snorm16 as a,BufferViewFloat as n}from"../../../../geometry/support/buffer/BufferView.js";import{isShadowLike as u,is3DGeometry as h,isColor as p}from"../core/shaderLibrary/ShaderOutput.js";import c from"../lib/GLMaterial.js";import{isPathGeometry as f}from"../lib/PathGeometry.js";import{MeshIntersectionOptions as l,intersectAabbInvDir as m}from"../lib/RayIntersections.js";import{assert as d}from"../lib/Util.js";import{getLayout as g,getTextureLayout as b}from"./PathLayouts.js";import{PathPassParameters as S,PathTechnique as _}from"./PathTechnique.js";import{PathTechniqueConfiguration as w}from"./PathTechniqueConfiguration.js";import{TriangleMaterial as x}from"./TriangleMaterial.js";import{writeAttributes as y,writeTextureElementIndex as v,writePosition as j,writeBufferVec2 as V,writeBufferFloat as z}from"./internal/bufferWriterUtils.js";import{hasShadowHighlights as M}from"../shaders/ReceiveShadowsConfiguration.js";import{alphaCutoff as F}from"../../../../webscene/support/AlphaCutoff.js";class A extends x{constructor(e,t){super(e,B),this.supportsEdges=!0,this._pp0=i(0,0,1),this._pp1=i(0,0,0),this.produces=new Map([[2,e=>(this.parameters.castShadows&&u(e)||h(e))&&!this.transparent],[4,e=>(this.parameters.castShadows&&u(e)||h(e))&&this.transparent]]),this._configuration=new w(t.spherical)}get hasEmissions(){return this.parameters.emissiveStrength>0?this.transparent?2:1:0}updateConfiguration(e){super.updateConfiguration(e),this._configuration.hasVVSize=this.parameters.hasVVSize,this._configuration.hasVVColor=this.parameters.hasVVColor,this._configuration.hasVVOpacity=this.parameters.hasVVOpacity,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.transparent,this._configuration.hasOccludees=e.hasOccludees,p(e.output)?(this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?1:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?2:0,this._configuration.receiveShadows=e.shadowMap.enabled,this._configuration.hasShadowHighlights=M(this._configuration,e),this._configuration.receiveAmbientOcclusion=null!=e.ssao):this._configuration.receiveShadows=this._configuration.hasShadowHighlights=this._configuration.receiveAmbientOcclusion=!1,this._configuration.pbrMode=this.parameters.usePBR?2:0,this._configuration.emissionSource=this.parameters.usePBR?1:0,this._configuration.snowCover=e.snowCover>0}isVisibleForOutput(e){return 5!==e&&7!==e&&6!==e||this.parameters.castShadows}get visible(){return this.parameters.opacity>=F}intersect(e,t,i,r,s,o){this._intersect(e,i,r,s,o)}intersectDraped(e,t,i,r){return this._pp0[0]=this._pp1[0]=i[0],this._pp0[1]=this._pp1[1]=i[1],this._intersect(e,t,this._pp0,this._pp1,r)}_intersect(i,s,o,a,n){const u=i;if(!f(u))return;const h=u.path,p=t(this.parameters.size);if(this.parameters.vvSize){const{offset:t,factor:i,minSize:r,maxSize:s,fallback:o}=this.parameters.vvSize,a=h.sizeAttributeValue;Number.isNaN(a)?(p[0]*=o[0],p[1]*=o[2]):(p[0]*=e(t[0]+a*i[0],r[0],s[0]),p[1]*=e(t[2]+a*i[2],r[2],s[2]))}const c=new l(s.tolerance,!1,s.options.normalRequired),d=Math.max(p[0],p[1]),g=i.boundingInfo;if(null==g)return void O(h,p,o,a,c,n);const b=r(g.bbMin[0]-d,g.bbMin[1]-d,g.bbMin[2]-d,g.bbMax[0]+d,g.bbMax[1]+d,g.bbMax[2]+d),S=[a[0]-o[0],a[1]-o[1],a[2]-o[2]],_=Math.sqrt(S[0]*S[0]+S[1]*S[1]+S[2]*S[2]),w=[_/S[0],_/S[1],_/S[2]];m(b,o,w,s.tolerance)&&O(h,p,o,a,c,n)}createBufferWriter(){return new P(g(),b(this.parameters))}createGLMaterial(e){return new C(e)}get transparent(){const{parameters:e}=this;return e.drivenOpacity||e.opacity<1}}class C extends c{beginSlot(e){return this.getTechnique(_,e)}}function O(e,t,i,r,s,o){e.baked.size&&e.baked.size[0]===t[0]&&e.baked.size[1]===t[1]||e.baked.bake(t),e.baked.intersect(i,r,s,o)}class B extends S{constructor(){super(...arguments),this.doubleSided=!1,this.doubleSidedType="normal",this.polygonOffset=0,this.castShadows=!0,this.hasSlicePlane=!1,this.drivenOpacity=!1,this.usePBR=!1}}class P{constructor(e,t){this.layout=e,this.textureBufferLayout=t}elementCount(e){return e.get("profileVertexAndNormal")?.indices.length??0}elementCountTextureBuffer(e){return e.get("position")?.indices.length??0}write(e,t,i,r,u,h){d(null!=h,"Texture buffer is required for path material"),y(i,r,this.layout,e,t,u);const p=u.buffer.getField("textureElementIndex",s),c=i.get("textureElementIndex"),f=h.offset,l=h.textureBufferRange.from;p&&c&&v(c,p,u.offset,l);const m=h.buffer.getField("position",o),g=i.get("position");m&&g&&(d(3===g.size),j(g,e,m,f));const b=h.buffer.getField("profileRight",a),S=i.get("profileRight");b&&S&&(d(2===S.size),V(S,b,f));const _=h.buffer.getField("profileUp",a),w=i.get("profileUp");_&&w&&(d(2===w.size),V(w,_,f));const x=h.buffer.getField("sizeFeatureAttribute",n),M=i.get("sizeFeatureAttribute");x&&M&&z(M,x,f);const F=h.buffer.getField("opacityFeatureAttribute",n),A=i.get("opacityFeatureAttribute");F&&A&&z(A,F,f);const C=h.buffer.getField("colorFeatureAttribute",n),O=i.get("colorFeatureAttribute");C&&O&&z(O,C,f)}}export{B as Parameters,P as PathBufferWriter,A as PathMaterial};
2
+ import{clamp as t}from"../../../../core/mathUtils.js";import{clone as e}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{fromValues as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as r}from"../../../../geometry/support/aaBoundingBox.js";import{BufferViewUint32 as s,BufferViewVec3f as o,BufferViewVec2Snorm16 as a,BufferViewFloat as n,BufferViewVec2f as h}from"../../../../geometry/support/buffer/BufferView.js";import{isShadowLike as p,is3DGeometry as u,isColor as f}from"../core/shaderLibrary/ShaderOutput.js";import c from"../lib/GLMaterial.js";import{isPathGeometry as l}from"../lib/PathGeometry.js";import{MeshIntersectionOptions as m,intersectAabbInvDir as g}from"../lib/RayIntersections.js";import{assert as d}from"../lib/Util.js";import{getLayout as b,getTextureLayout as _}from"./PathLayouts.js";import{PathPassParameters as S,PathTechnique as y}from"./PathTechnique.js";import{PathTechniqueConfiguration as x}from"./PathTechniqueConfiguration.js";import{TriangleMaterial as V}from"./TriangleMaterial.js";import{writeAttributes as w,writeTextureElementIndex as z,writeBufferUint32 as F,writePosition as v,writeBufferVec2 as j,writeBufferFloat as M,writeBufferVec3 as R}from"./internal/bufferWriterUtils.js";import{hasShadowHighlights as C}from"../shaders/ReceiveShadowsConfiguration.js";import{alphaCutoff as A}from"../../../../webscene/support/AlphaCutoff.js";class T extends V{constructor(t,e){super(t,B),this.supportsEdges=!0,this._pp0=i(0,0,1),this._pp1=i(0,0,0),this.produces=new Map([[2,t=>(this.parameters.castShadows&&p(t)||u(t))&&!this.transparent],[4,t=>(this.parameters.castShadows&&p(t)||u(t))&&this.transparent]]),this._configuration=new x(e.spherical)}get hasEmissions(){return this.parameters.emissiveStrength>0?this.transparent?2:1:0}updateConfiguration(t){super.updateConfiguration(t),this._configuration.hasVVSize=this.parameters.hasVVSize,this._configuration.hasVVColor=this.parameters.hasVVColor,this._configuration.hasVVOpacity=this.parameters.hasVVOpacity,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.transparent,this._configuration.hasOccludees=t.hasOccludees,f(t.output)?(this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?1:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?2:0,this._configuration.receiveShadows=t.shadowMap.enabled,this._configuration.hasShadowHighlights=C(this._configuration,t),this._configuration.receiveAmbientOcclusion=null!=t.ssao):this._configuration.receiveShadows=this._configuration.hasShadowHighlights=this._configuration.receiveAmbientOcclusion=!1,this._configuration.pbrMode=this.parameters.usePBR?2:0,this._configuration.emissionSource=this.parameters.usePBR?1:0,this._configuration.snowCover=t.snowCover>0,this._configuration.upVectorAlignment=this.parameters.upVectorAlignment,this._configuration.pathCapType=this.parameters.pathCapType,this._configuration.pathProfileType=this.parameters.profile.type}isVisibleForOutput(t){return 5!==t&&7!==t&&6!==t||this.parameters.castShadows}get visible(){return this.parameters.opacity>=A}intersect(t,e,i,r,s,o){this._intersect(t,i,r,s,o)}intersectDraped(t,e,i,r){return this._pp0[0]=this._pp1[0]=i[0],this._pp0[1]=this._pp1[1]=i[1],this._intersect(t,e,this._pp0,this._pp1,r)}_intersect(i,s,o,a,n){const h=i;if(!l(h))return;const p=h.path,u=e(this.parameters.size);if(this.parameters.vvSize){const{offset:e,factor:i,minSize:r,maxSize:s,fallback:o}=this.parameters.vvSize,a=p.sizeAttributeValue;Number.isNaN(a)?(u[0]*=o[0],u[1]*=o[2]):(u[0]*=t(e[0]+a*i[0],r[0],s[0]),u[1]*=t(e[2]+a*i[2],r[2],s[2]))}const f=new m(s.tolerance,!1,s.options.normalRequired),c=Math.max(u[0],u[1]),d=i.boundingInfo;if(null==d)return void P(p,u,o,a,f,n);const b=r(d.bbMin[0]-c,d.bbMin[1]-c,d.bbMin[2]-c,d.bbMax[0]+c,d.bbMax[1]+c,d.bbMax[2]+c),_=[a[0]-o[0],a[1]-o[1],a[2]-o[2]],S=Math.sqrt(_[0]*_[0]+_[1]*_[1]+_[2]*_[2]),y=[S/_[0],S/_[1],S/_[2]];g(b,o,y,s.tolerance)&&P(p,u,o,a,f,n)}createBufferWriter(){return new k(b(),_(this.parameters))}createGLMaterial(t){return new O(t)}get transparent(){const{parameters:t}=this;return t.drivenOpacity||t.opacity<1}}class O extends c{beginSlot(t){return this.getTechnique(y,t)}}function P(t,e,i,r,s,o){t.baked.size&&t.baked.size[0]===e[0]&&t.baked.size[1]===e[1]||t.baked.bake(e),t.baked.intersect(i,r,s,o)}class B extends S{constructor(){super(...arguments),this.doubleSided=!1,this.doubleSidedType="normal",this.polygonOffset=0,this.castShadows=!0,this.hasSlicePlane=!1,this.drivenOpacity=!1,this.usePBR=!1,this.upVectorAlignment=0,this.pathCapType=1}}class k{constructor(t,e){this.layout=t,this.textureBufferLayout=e}elementCount(t){return t.get("pathVertexInfo")?.indices.length??0}elementCountTextureBuffer(t){return t.get("position")?.indices.length??0}write(t,e,i,r,p,u){d(null!=u,"Texture buffer is required for path material"),w(i,r,this.layout,t,e,p);const f=p.buffer.getField("textureElementIndex",s),c=i.get("textureElementIndex"),l=u.offset,m=u.textureBufferRange.from;f&&c&&z(c,f,p.offset,m);const g=p.buffer.getField("pathVertexInfo",s),b=i.get("pathVertexInfo");g&&b&&(d(1===b.size),F(b,g,p.offset));const _=u.buffer.getField("position",o),S=i.get("position");_&&S&&(d(3===S.size),v(S,t,_,l));const y=u.buffer.getField("profileRight",a),x=i.get("profileRight");y&&x&&(d(2===x.size),j(x,y,l));const V=u.buffer.getField("profileUp",a),C=i.get("profileUp");V&&C&&(d(2===C.size),j(C,V,l));const A=u.buffer.getField("profileRotation",n),T=i.get("profileRotation");A&&T&&(d(1===T.size),M(T,A,l));const O=u.buffer.getField("pathRotationRight",h),P=i.get("pathRotationRight");O&&P&&(d(2===P.size),j(P,O,l));const B=u.buffer.getField("pathRotationUp",o),k=i.get("pathRotationUp");B&&k&&(d(3===k.size),R(k,B,l));const I=u.buffer.getField("pathMaxStretchDistance",n),U=i.get("pathMaxStretchDistance");I&&U&&(d(1===U.size),M(U,I,l));const q=u.buffer.getField("sizeFeatureAttribute",n),L=i.get("sizeFeatureAttribute");q&&L&&M(L,q,l);const E=u.buffer.getField("opacityFeatureAttribute",n),D=i.get("opacityFeatureAttribute");E&&D&&M(D,E,l);const G=u.buffer.getField("colorFeatureAttribute",n),N=i.get("colorFeatureAttribute");G&&N&&M(N,G,l)}}export{B as Parameters,k as PathBufferWriter,T as PathMaterial};