@antv/l7-layers 2.16.1 → 2.16.2

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 (386) hide show
  1. package/es/Geometry/index.js +9 -31
  2. package/es/Geometry/models/billboard.js +51 -89
  3. package/es/Geometry/models/plane.js +81 -143
  4. package/es/Geometry/models/sprite.js +60 -118
  5. package/es/canvas/index.js +10 -33
  6. package/es/canvas/models/canvas.js +41 -97
  7. package/es/citybuliding/building.js +8 -27
  8. package/es/citybuliding/models/build.js +57 -82
  9. package/es/core/BaseLayer.d.ts +3 -0
  10. package/es/core/BaseLayer.js +360 -528
  11. package/es/core/BaseModel.d.ts +9 -71
  12. package/es/core/BaseModel.js +118 -429
  13. package/es/core/CommonStyleAttribute.d.ts +2 -0
  14. package/es/core/CommonStyleAttribute.js +66 -0
  15. package/es/core/LayerPickService.js +21 -32
  16. package/es/core/TextureService.js +0 -13
  17. package/es/core/interface.d.ts +13 -3
  18. package/es/core/interface.js +17 -24
  19. package/es/core/shape/Path.js +13 -20
  20. package/es/core/shape/extrude.js +27 -36
  21. package/es/core/triangulation.d.ts +12 -0
  22. package/es/core/triangulation.js +124 -114
  23. package/es/earth/index.js +9 -33
  24. package/es/earth/models/atmosphere.js +30 -54
  25. package/es/earth/models/base.js +47 -85
  26. package/es/earth/models/bloomsphere.js +30 -54
  27. package/es/earth/utils.js +9 -13
  28. package/es/heatmap/index.js +10 -40
  29. package/es/heatmap/models/grid.js +29 -53
  30. package/es/heatmap/models/grid3d.js +29 -53
  31. package/es/heatmap/models/heatmap.d.ts +1 -0
  32. package/es/heatmap/models/heatmap.js +99 -150
  33. package/es/heatmap/models/hexagon.js +29 -53
  34. package/es/heatmap/shaders/grid_vert.glsl +2 -2
  35. package/es/heatmap/shaders/hexagon_3d_vert.glsl +2 -2
  36. package/es/heatmap/shaders/hexagon_vert.glsl +2 -2
  37. package/es/heatmap/triangulation.js +0 -4
  38. package/es/image/index.js +9 -28
  39. package/es/image/models/image.js +66 -100
  40. package/es/index.js +9 -17
  41. package/es/line/index.d.ts +1 -0
  42. package/es/line/index.js +12 -36
  43. package/es/line/models/arc.js +72 -160
  44. package/es/line/models/arc_3d.js +67 -148
  45. package/es/line/models/earthArc_3d.js +66 -148
  46. package/es/line/models/{half.d.ts → flow.d.ts} +1 -11
  47. package/es/line/models/flow.js +167 -0
  48. package/es/line/models/great_circle.js +57 -135
  49. package/es/line/models/index.d.ts +1 -1
  50. package/es/line/models/index.js +3 -3
  51. package/es/line/models/line.js +98 -186
  52. package/es/line/models/linearline.js +46 -115
  53. package/es/line/models/simpleLine.d.ts +0 -1
  54. package/es/line/models/simpleLine.js +42 -114
  55. package/es/line/models/wall.js +52 -92
  56. package/es/line/shaders/dash/arc_dash_frag.glsl +3 -6
  57. package/es/line/shaders/dash/arc_dash_vert.glsl +6 -46
  58. package/es/line/shaders/dash/line_dash_frag.glsl +4 -7
  59. package/es/line/shaders/dash/line_dash_vert.glsl +3 -33
  60. package/es/line/shaders/flow/flow_line_frag.glsl +13 -0
  61. package/es/line/shaders/flow/flow_line_vert.glsl +83 -0
  62. package/es/line/shaders/line_arc_3d_frag.glsl +6 -6
  63. package/es/line/shaders/line_arc_3d_vert.glsl +4 -34
  64. package/es/line/shaders/line_arc_frag.glsl +7 -11
  65. package/es/line/shaders/line_arc_great_circle_frag.glsl +5 -6
  66. package/es/line/shaders/line_arc_great_circle_vert.glsl +4 -32
  67. package/es/line/shaders/line_arc_vert.glsl +9 -45
  68. package/es/line/shaders/line_frag.glsl +15 -17
  69. package/es/line/shaders/line_vert.glsl +3 -34
  70. package/es/line/shaders/linear/arc3d_linear_frag.glsl +5 -19
  71. package/es/line/shaders/linear/arc3d_linear_vert.glsl +9 -48
  72. package/es/line/shaders/linear/arc_linear_frag.glsl +2 -30
  73. package/es/line/shaders/linear/arc_linear_vert.glsl +9 -45
  74. package/es/line/shaders/linear/line_linear_frag.glsl +5 -6
  75. package/es/line/shaders/linearLine/line_linear_frag.glsl +2 -14
  76. package/es/line/shaders/linearLine/line_linear_vert.glsl +14 -32
  77. package/es/line/shaders/simple/simpleline_frag.glsl +1 -5
  78. package/es/line/shaders/simple/simpleline_linear_frag.glsl +2 -6
  79. package/es/line/shaders/simple/simpleline_vert.glsl +7 -33
  80. package/es/mask/index.js +9 -28
  81. package/es/mask/models/fill.js +29 -54
  82. package/es/plugins/DataMappingPlugin.js +90 -141
  83. package/es/plugins/DataSourcePlugin.js +45 -68
  84. package/es/plugins/FeatureScalePlugin.js +67 -122
  85. package/es/plugins/LayerAnimateStylePlugin.js +0 -5
  86. package/es/plugins/LayerMaskPlugin.js +3 -11
  87. package/es/plugins/LayerModelPlugin.js +79 -104
  88. package/es/plugins/LayerStylePlugin.js +3 -9
  89. package/es/plugins/LightingPlugin.js +12 -18
  90. package/es/plugins/MultiPassRendererPlugin.js +11 -16
  91. package/es/plugins/PixelPickingPlugin.js +12 -21
  92. package/es/plugins/RegisterStyleAttributePlugin.js +5 -12
  93. package/es/plugins/ShaderUniformPlugin.js +15 -29
  94. package/es/plugins/UpdateModelPlugin.js +0 -5
  95. package/es/plugins/UpdateStyleAttributePlugin.js +5 -11
  96. package/es/point/index.d.ts +1 -0
  97. package/es/point/index.js +27 -77
  98. package/es/point/models/earthExtrude.d.ts +0 -3
  99. package/es/point/models/earthExtrude.js +60 -139
  100. package/es/point/models/earthFill.d.ts +0 -1
  101. package/es/point/models/earthFill.js +59 -140
  102. package/es/point/models/extrude.d.ts +0 -3
  103. package/es/point/models/extrude.js +60 -140
  104. package/es/point/models/fill.d.ts +0 -1
  105. package/es/point/models/fill.js +67 -158
  106. package/es/point/models/fillmage.js +66 -147
  107. package/es/point/models/image.js +52 -126
  108. package/es/point/models/index.js +2 -2
  109. package/es/point/models/normal.js +32 -56
  110. package/es/point/models/radar.d.ts +0 -1
  111. package/es/point/models/radar.js +42 -75
  112. package/es/point/models/simplePoint.d.ts +0 -1
  113. package/es/point/models/simplePoint.js +46 -115
  114. package/es/point/models/text.js +211 -344
  115. package/es/point/shaders/animate/wave_frag.glsl +1 -11
  116. package/es/point/shaders/earth/extrude_frag.glsl +5 -17
  117. package/es/point/shaders/earth/extrude_vert.glsl +14 -29
  118. package/es/point/shaders/earth/fill_frag.glsl +5 -14
  119. package/es/point/shaders/earth/fill_vert.glsl +1 -75
  120. package/es/point/shaders/extrude/extrude_frag.glsl +3 -29
  121. package/es/point/shaders/extrude/extrude_vert.glsl +27 -35
  122. package/es/point/shaders/fill_frag.glsl +9 -20
  123. package/es/point/shaders/fill_vert.glsl +16 -101
  124. package/es/point/shaders/image/fillImage_frag.glsl +2 -5
  125. package/es/point/shaders/image/fillImage_vert.glsl +4 -47
  126. package/es/point/shaders/image_frag.glsl +1 -5
  127. package/es/point/shaders/image_vert.glsl +1 -44
  128. package/es/point/shaders/normal_frag.glsl +0 -2
  129. package/es/point/shaders/normal_vert.glsl +2 -1
  130. package/es/point/shaders/radar/radar_vert.glsl +2 -2
  131. package/es/point/shaders/simplePoint_frag.glsl +0 -7
  132. package/es/point/shaders/simplePoint_vert.glsl +3 -45
  133. package/es/point/shaders/text_frag.glsl +6 -19
  134. package/es/point/shaders/text_vert.glsl +5 -66
  135. package/es/point/shape/extrude.js +4 -13
  136. package/es/polygon/index.d.ts +1 -0
  137. package/es/polygon/index.js +12 -40
  138. package/es/polygon/models/extrude.d.ts +0 -3
  139. package/es/polygon/models/extrude.js +122 -162
  140. package/es/polygon/models/fill.d.ts +0 -4
  141. package/es/polygon/models/fill.js +57 -130
  142. package/es/polygon/models/index.js +3 -2
  143. package/es/polygon/models/ocean.js +42 -76
  144. package/es/polygon/models/water.js +37 -71
  145. package/es/polygon/shaders/extrude/polygon_extrude_frag.glsl +2 -23
  146. package/es/polygon/shaders/extrude/polygon_extrude_picklight_frag.glsl +7 -5
  147. package/es/polygon/shaders/extrude/polygon_extrude_picklight_vert.glsl +7 -32
  148. package/es/polygon/shaders/extrude/polygon_extrude_vert.glsl +33 -38
  149. package/es/polygon/shaders/extrude/polygon_extrudetex_frag.glsl +12 -9
  150. package/es/polygon/shaders/extrude/polygon_extrudetex_vert.glsl +16 -44
  151. package/es/polygon/shaders/polygon_frag.glsl +0 -5
  152. package/es/polygon/shaders/polygon_linear_frag.glsl +0 -8
  153. package/es/polygon/shaders/polygon_linear_vert.glsl +0 -32
  154. package/es/polygon/shaders/polygon_vert.glsl +1 -27
  155. package/es/raster/buffers/triangulation.js +2 -4
  156. package/es/raster/index.js +9 -32
  157. package/es/raster/models/raster.js +80 -116
  158. package/es/raster/models/rasterRgb.js +84 -127
  159. package/es/raster/models/rasterTerrainRgb.js +56 -84
  160. package/es/tile/interaction/getRasterData.js +14 -20
  161. package/es/tile/interaction/utils.js +7 -9
  162. package/es/tile/manager/base.js +63 -96
  163. package/es/tile/service/TileLayerService.js +33 -55
  164. package/es/tile/service/TilePickService.js +26 -40
  165. package/es/tile/service/TileSourceService.js +3 -7
  166. package/es/tile/tileFactory/DebugTile.js +29 -46
  167. package/es/tile/tileFactory/ImageTile.js +20 -38
  168. package/es/tile/tileFactory/MaskTile.js +22 -43
  169. package/es/tile/tileFactory/RasterRGBTile.js +22 -42
  170. package/es/tile/tileFactory/RasterTerrainRGBTile.js +20 -38
  171. package/es/tile/tileFactory/RasterTile.js +30 -53
  172. package/es/tile/tileFactory/Tile.js +63 -97
  173. package/es/tile/tileFactory/VectorTile.js +41 -68
  174. package/es/tile/tileFactory/index.js +0 -11
  175. package/es/tile/tileFactory/layers/TileDebugLayer.js +6 -27
  176. package/es/tile/tileFactory/util.js +0 -3
  177. package/es/tile/tileLayer/BaseLayer.js +105 -146
  178. package/es/tile/utils.js +1 -1
  179. package/es/utils/blend.js +0 -2
  180. package/es/utils/collision-index.js +9 -16
  181. package/es/utils/extrude_polyline.js +101 -149
  182. package/es/utils/grid-index.js +2 -27
  183. package/es/utils/identityScale.js +0 -8
  184. package/es/utils/layerData.js +32 -46
  185. package/es/utils/multiPassRender.js +11 -13
  186. package/es/utils/polylineNormal.js +31 -37
  187. package/es/utils/simpleLine.js +2 -16
  188. package/es/utils/stencil.js +2 -3
  189. package/es/utils/symbol-layout.js +27 -53
  190. package/es/wind/index.js +9 -29
  191. package/es/wind/models/utils.js +26 -51
  192. package/es/wind/models/wind.js +101 -147
  193. package/es/wind/models/windRender.js +53 -66
  194. package/lib/Geometry/index.js +9 -38
  195. package/lib/Geometry/models/billboard.js +51 -97
  196. package/lib/Geometry/models/index.js +0 -5
  197. package/lib/Geometry/models/plane.js +79 -151
  198. package/lib/Geometry/models/sprite.js +60 -127
  199. package/lib/canvas/index.js +10 -40
  200. package/lib/canvas/models/canvas.js +41 -101
  201. package/lib/canvas/models/index.js +0 -3
  202. package/lib/citybuliding/building.js +8 -35
  203. package/lib/citybuliding/models/build.js +57 -92
  204. package/lib/core/BaseLayer.js +358 -520
  205. package/lib/core/BaseModel.js +117 -441
  206. package/lib/core/CommonStyleAttribute.js +72 -0
  207. package/lib/core/LayerPickService.js +21 -37
  208. package/lib/core/TextureService.js +0 -16
  209. package/lib/core/interface.js +21 -31
  210. package/lib/core/schema.js +0 -1
  211. package/lib/core/shape/Path.js +14 -31
  212. package/lib/core/shape/extrude.js +27 -59
  213. package/lib/core/triangulation.js +125 -153
  214. package/lib/earth/index.js +9 -43
  215. package/lib/earth/models/atmosphere.js +30 -63
  216. package/lib/earth/models/base.js +47 -90
  217. package/lib/earth/models/bloomsphere.js +30 -63
  218. package/lib/earth/utils.js +7 -31
  219. package/lib/heatmap/index.js +10 -48
  220. package/lib/heatmap/models/grid.js +29 -61
  221. package/lib/heatmap/models/grid3d.js +29 -61
  222. package/lib/heatmap/models/heatmap.js +99 -166
  223. package/lib/heatmap/models/hexagon.js +29 -61
  224. package/lib/heatmap/models/index.js +0 -6
  225. package/lib/heatmap/shaders/grid_vert.glsl +2 -2
  226. package/lib/heatmap/shaders/hexagon_3d_vert.glsl +2 -2
  227. package/lib/heatmap/shaders/hexagon_vert.glsl +2 -2
  228. package/lib/heatmap/triangulation.js +0 -5
  229. package/lib/image/index.js +9 -36
  230. package/lib/image/models/image.js +66 -109
  231. package/lib/image/models/index.js +0 -3
  232. package/lib/index.js +7 -61
  233. package/lib/line/index.js +12 -42
  234. package/lib/line/models/arc.js +70 -170
  235. package/lib/line/models/arc_3d.js +65 -159
  236. package/lib/line/models/earthArc_3d.js +64 -159
  237. package/lib/line/models/flow.js +174 -0
  238. package/lib/line/models/great_circle.js +57 -146
  239. package/lib/line/models/index.js +3 -14
  240. package/lib/line/models/line.js +96 -194
  241. package/lib/line/models/linearline.js +46 -127
  242. package/lib/line/models/simpleLine.js +42 -124
  243. package/lib/line/models/wall.js +52 -103
  244. package/lib/line/shaders/dash/arc_dash_frag.glsl +3 -6
  245. package/lib/line/shaders/dash/arc_dash_vert.glsl +6 -46
  246. package/lib/line/shaders/dash/line_dash_frag.glsl +4 -7
  247. package/lib/line/shaders/dash/line_dash_vert.glsl +3 -33
  248. package/lib/line/shaders/flow/flow_line_frag.glsl +13 -0
  249. package/lib/line/shaders/flow/flow_line_vert.glsl +83 -0
  250. package/lib/line/shaders/line_arc_3d_frag.glsl +6 -6
  251. package/lib/line/shaders/line_arc_3d_vert.glsl +4 -34
  252. package/lib/line/shaders/line_arc_frag.glsl +7 -11
  253. package/lib/line/shaders/line_arc_great_circle_frag.glsl +5 -6
  254. package/lib/line/shaders/line_arc_great_circle_vert.glsl +4 -32
  255. package/lib/line/shaders/line_arc_vert.glsl +9 -45
  256. package/lib/line/shaders/line_frag.glsl +15 -17
  257. package/lib/line/shaders/line_vert.glsl +3 -34
  258. package/lib/line/shaders/linear/arc3d_linear_frag.glsl +5 -19
  259. package/lib/line/shaders/linear/arc3d_linear_vert.glsl +9 -48
  260. package/lib/line/shaders/linear/arc_linear_frag.glsl +2 -30
  261. package/lib/line/shaders/linear/arc_linear_vert.glsl +9 -45
  262. package/lib/line/shaders/linear/line_linear_frag.glsl +5 -6
  263. package/lib/line/shaders/linearLine/line_linear_frag.glsl +2 -14
  264. package/lib/line/shaders/linearLine/line_linear_vert.glsl +14 -32
  265. package/lib/line/shaders/simple/simpleline_frag.glsl +1 -5
  266. package/lib/line/shaders/simple/simpleline_linear_frag.glsl +2 -6
  267. package/lib/line/shaders/simple/simpleline_vert.glsl +7 -33
  268. package/lib/mask/index.js +9 -36
  269. package/lib/mask/models/fill.js +29 -63
  270. package/lib/mask/models/index.js +0 -3
  271. package/lib/plugins/DataMappingPlugin.js +90 -152
  272. package/lib/plugins/DataSourcePlugin.js +45 -76
  273. package/lib/plugins/FeatureScalePlugin.js +67 -138
  274. package/lib/plugins/LayerAnimateStylePlugin.js +0 -10
  275. package/lib/plugins/LayerMaskPlugin.js +4 -17
  276. package/lib/plugins/LayerModelPlugin.js +80 -113
  277. package/lib/plugins/LayerStylePlugin.js +4 -14
  278. package/lib/plugins/LightingPlugin.js +12 -25
  279. package/lib/plugins/MultiPassRendererPlugin.js +11 -22
  280. package/lib/plugins/PixelPickingPlugin.js +12 -27
  281. package/lib/plugins/RegisterStyleAttributePlugin.js +5 -19
  282. package/lib/plugins/ShaderUniformPlugin.js +15 -36
  283. package/lib/plugins/UpdateModelPlugin.js +1 -10
  284. package/lib/plugins/UpdateStyleAttributePlugin.js +5 -16
  285. package/lib/point/index.js +27 -83
  286. package/lib/point/models/earthExtrude.js +60 -150
  287. package/lib/point/models/earthFill.js +59 -170
  288. package/lib/point/models/extrude.js +60 -150
  289. package/lib/point/models/fill.js +65 -167
  290. package/lib/point/models/fillmage.js +64 -155
  291. package/lib/point/models/image.js +52 -136
  292. package/lib/point/models/index.js +1 -12
  293. package/lib/point/models/normal.js +32 -66
  294. package/lib/point/models/radar.js +42 -85
  295. package/lib/point/models/simplePoint.js +46 -125
  296. package/lib/point/models/text.js +209 -350
  297. package/lib/point/shaders/animate/wave_frag.glsl +1 -11
  298. package/lib/point/shaders/earth/extrude_frag.glsl +5 -17
  299. package/lib/point/shaders/earth/extrude_vert.glsl +14 -29
  300. package/lib/point/shaders/earth/fill_frag.glsl +5 -14
  301. package/lib/point/shaders/earth/fill_vert.glsl +1 -75
  302. package/lib/point/shaders/extrude/extrude_frag.glsl +3 -29
  303. package/lib/point/shaders/extrude/extrude_vert.glsl +27 -35
  304. package/lib/point/shaders/fill_frag.glsl +9 -20
  305. package/lib/point/shaders/fill_vert.glsl +16 -101
  306. package/lib/point/shaders/image/fillImage_frag.glsl +2 -5
  307. package/lib/point/shaders/image/fillImage_vert.glsl +4 -47
  308. package/lib/point/shaders/image_frag.glsl +1 -5
  309. package/lib/point/shaders/image_vert.glsl +1 -44
  310. package/lib/point/shaders/normal_frag.glsl +0 -2
  311. package/lib/point/shaders/normal_vert.glsl +2 -1
  312. package/lib/point/shaders/radar/radar_vert.glsl +2 -2
  313. package/lib/point/shaders/simplePoint_frag.glsl +0 -7
  314. package/lib/point/shaders/simplePoint_vert.glsl +3 -45
  315. package/lib/point/shaders/text_frag.glsl +6 -19
  316. package/lib/point/shaders/text_vert.glsl +5 -66
  317. package/lib/point/shape/extrude.js +4 -20
  318. package/lib/polygon/index.js +12 -48
  319. package/lib/polygon/models/extrude.js +122 -173
  320. package/lib/polygon/models/fill.js +57 -140
  321. package/lib/polygon/models/index.js +2 -14
  322. package/lib/polygon/models/ocean.js +42 -88
  323. package/lib/polygon/models/water.js +37 -82
  324. package/lib/polygon/shaders/extrude/polygon_extrude_frag.glsl +2 -23
  325. package/lib/polygon/shaders/extrude/polygon_extrude_picklight_frag.glsl +7 -5
  326. package/lib/polygon/shaders/extrude/polygon_extrude_picklight_vert.glsl +7 -32
  327. package/lib/polygon/shaders/extrude/polygon_extrude_vert.glsl +33 -38
  328. package/lib/polygon/shaders/extrude/polygon_extrudetex_frag.glsl +12 -9
  329. package/lib/polygon/shaders/extrude/polygon_extrudetex_vert.glsl +16 -44
  330. package/lib/polygon/shaders/polygon_frag.glsl +0 -5
  331. package/lib/polygon/shaders/polygon_linear_frag.glsl +0 -8
  332. package/lib/polygon/shaders/polygon_linear_vert.glsl +0 -32
  333. package/lib/polygon/shaders/polygon_vert.glsl +1 -27
  334. package/lib/raster/buffers/triangulation.js +3 -7
  335. package/lib/raster/index.js +9 -40
  336. package/lib/raster/models/index.js +0 -5
  337. package/lib/raster/models/raster.js +80 -125
  338. package/lib/raster/models/rasterRgb.js +84 -139
  339. package/lib/raster/models/rasterTerrainRgb.js +56 -93
  340. package/lib/tile/interaction/getRasterData.js +14 -25
  341. package/lib/tile/interaction/utils.js +7 -19
  342. package/lib/tile/manager/base.js +63 -104
  343. package/lib/tile/service/TileLayerService.js +33 -60
  344. package/lib/tile/service/TilePickService.js +26 -48
  345. package/lib/tile/service/TileSourceService.js +2 -16
  346. package/lib/tile/style/utils.js +0 -3
  347. package/lib/tile/tileFactory/DebugTile.js +29 -54
  348. package/lib/tile/tileFactory/ImageTile.js +20 -46
  349. package/lib/tile/tileFactory/MaskTile.js +22 -51
  350. package/lib/tile/tileFactory/RasterRGBTile.js +22 -50
  351. package/lib/tile/tileFactory/RasterTerrainRGBTile.js +20 -46
  352. package/lib/tile/tileFactory/RasterTile.js +30 -63
  353. package/lib/tile/tileFactory/Tile.js +63 -102
  354. package/lib/tile/tileFactory/VectorTile.js +41 -76
  355. package/lib/tile/tileFactory/index.js +0 -25
  356. package/lib/tile/tileFactory/layers/TileDebugLayer.js +6 -32
  357. package/lib/tile/tileFactory/util.js +0 -9
  358. package/lib/tile/tileLayer/BaseLayer.js +105 -153
  359. package/lib/tile/utils.js +1 -5
  360. package/lib/utils/blend.js +0 -5
  361. package/lib/utils/collision-index.js +9 -25
  362. package/lib/utils/extrude_polyline.js +101 -181
  363. package/lib/utils/grid-index.js +2 -28
  364. package/lib/utils/identityScale.js +0 -9
  365. package/lib/utils/layerData.js +32 -51
  366. package/lib/utils/multiPassRender.js +11 -16
  367. package/lib/utils/polylineNormal.js +31 -66
  368. package/lib/utils/simpleLine.js +2 -21
  369. package/lib/utils/stencil.js +0 -4
  370. package/lib/utils/symbol-layout.js +27 -55
  371. package/lib/wind/index.js +9 -37
  372. package/lib/wind/models/index.js +0 -3
  373. package/lib/wind/models/utils.js +26 -62
  374. package/lib/wind/models/wind.js +101 -157
  375. package/lib/wind/models/windRender.js +53 -71
  376. package/lib/wind/models/windShader.js +0 -1
  377. package/package.json +7 -7
  378. package/es/line/models/half.js +0 -298
  379. package/es/line/shaders/half/line_half_frag.glsl +0 -53
  380. package/es/line/shaders/half/line_half_vert.glsl +0 -169
  381. package/es/utils/dataMappingStyle.d.ts +0 -31
  382. package/es/utils/dataMappingStyle.js +0 -147
  383. package/lib/line/models/half.js +0 -315
  384. package/lib/line/shaders/half/line_half_frag.glsl +0 -53
  385. package/lib/line/shaders/half/line_half_vert.glsl +0 -169
  386. package/lib/utils/dataMappingStyle.js +0 -151
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
@@ -10,66 +9,41 @@ exports.computeNormal = computeNormal;
10
9
  exports.default = void 0;
11
10
  exports.direction = direction;
12
11
  exports.getArrayUnique = getArrayUnique;
13
-
14
12
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
15
-
16
13
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
17
-
18
14
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
19
-
20
15
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
21
-
22
16
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
23
-
24
17
  var _l7Utils = require("@antv/l7-utils");
25
-
26
18
  var _glMatrix = require("gl-matrix");
27
-
28
- var tmp = _glMatrix.vec2.create(); // eslint-disable-next-line @typescript-eslint/no-unused-vars
29
-
30
-
19
+ var tmp = _glMatrix.vec2.create();
20
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
31
21
  var capEnd = _glMatrix.vec2.create();
32
-
33
22
  var lineA = _glMatrix.vec2.create();
34
-
35
23
  var lineB = _glMatrix.vec2.create();
36
-
37
24
  var tangent = _glMatrix.vec2.create();
38
-
39
25
  function computeMiter(lineTangent, miter, start, end, halfThick) {
40
26
  _glMatrix.vec2.add(lineTangent, start, end);
41
-
42
27
  _glMatrix.vec2.normalize(lineTangent, lineTangent);
43
-
44
28
  miter = _glMatrix.vec2.fromValues(-lineTangent[1], lineTangent[0]);
45
-
46
29
  var tmpvec = _glMatrix.vec2.fromValues(-start[1], start[0]);
47
-
48
30
  return [halfThick / _glMatrix.vec2.dot(miter, tmpvec), miter];
49
31
  }
50
-
51
32
  function computeNormal(out, dir) {
52
33
  return _glMatrix.vec2.set(out, -dir[1], dir[0]);
53
34
  }
54
-
55
35
  function direction(out, a, b) {
56
36
  _glMatrix.vec2.sub(out, a, b);
57
-
58
37
  _glMatrix.vec2.normalize(out, out);
59
-
60
38
  return out;
61
39
  }
62
-
63
40
  function isPointEqual(a, b) {
64
41
  return a[0] === b[0] && a[1] === b[1];
65
42
  }
66
-
67
43
  function getArrayUnique(matrix) {
68
44
  var map = new Map();
69
-
70
45
  for (var i = 0; i < matrix.length; i++) {
71
46
  var key = matrix[0].toString() + '-' + matrix[1].toString();
72
-
73
47
  if (map.get(key)) {
74
48
  matrix.splice(i, 1);
75
49
  i++;
@@ -77,10 +51,8 @@ function getArrayUnique(matrix) {
77
51
  map.set(key, key);
78
52
  }
79
53
  }
80
-
81
54
  return matrix;
82
55
  }
83
-
84
56
  var ExtrudePolyline = /*#__PURE__*/function () {
85
57
  function ExtrudePolyline() {
86
58
  var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
@@ -104,23 +76,19 @@ var ExtrudePolyline = /*#__PURE__*/function () {
104
76
  indexes: []
105
77
  };
106
78
  }
107
-
108
79
  (0, _createClass2.default)(ExtrudePolyline, [{
109
80
  key: "simpleExtrude",
110
81
  value: function simpleExtrude(points) {
111
82
  var complex = this.complex;
112
-
113
83
  if (points.length <= 1) {
114
84
  return complex;
115
85
  }
116
-
117
86
  this.lastFlip = -1;
118
87
  this.started = false;
119
88
  this.normal = null;
120
89
  this.totalDistance = 0;
121
90
  var total = points.length;
122
91
  var count = complex.startIndex;
123
-
124
92
  for (var i = 1; i < total; i++) {
125
93
  var last = points[i - 1];
126
94
  var cur = points[i];
@@ -128,13 +96,11 @@ var ExtrudePolyline = /*#__PURE__*/function () {
128
96
  var amt = this.simpleSegment(complex, count, last, cur, next);
129
97
  count += amt;
130
98
  }
131
-
132
99
  if (this.dash) {
133
100
  for (var _i = 0; _i < complex.positions.length / 6; _i++) {
134
101
  complex.positions[_i * 6 + 5] = this.totalDistance;
135
102
  }
136
103
  }
137
-
138
104
  complex.startIndex = complex.positions.length / 6;
139
105
  return complex;
140
106
  }
@@ -142,48 +108,47 @@ var ExtrudePolyline = /*#__PURE__*/function () {
142
108
  key: "simpleExtrude_gaode2",
143
109
  value: function simpleExtrude_gaode2(points, originPoints) {
144
110
  var complex = this.complex;
145
-
146
111
  if (points.length <= 1) {
147
112
  return complex;
148
113
  }
149
-
150
114
  this.lastFlip = -1;
151
115
  this.started = false;
152
116
  this.normal = null;
153
- this.totalDistance = 0; // 去除数组里重复的点
117
+ this.totalDistance = 0;
118
+ // 去除数组里重复的点
154
119
  // points = getArrayUnique(points);
155
-
156
120
  var total = points.length;
157
121
  var count = complex.startIndex;
158
-
159
122
  for (var i = 1; i < total; i++) {
160
123
  var _originPoints$, _originPoints$i$, _originPoints$2;
161
-
162
124
  var last = points[i - 1];
163
- last.push((_originPoints$ = originPoints[i - 1][2]) !== null && _originPoints$ !== void 0 ? _originPoints$ : 0); // @ts-ignore
164
-
125
+ last.push((_originPoints$ = originPoints[i - 1][2]) !== null && _originPoints$ !== void 0 ? _originPoints$ : 0);
126
+ // @ts-ignore
165
127
  var originLast = originPoints[i - 1];
166
128
  var cur = points[i];
167
- cur.push((_originPoints$i$ = originPoints[i][2]) !== null && _originPoints$i$ !== void 0 ? _originPoints$i$ : 0); // @ts-ignore
168
-
129
+ cur.push((_originPoints$i$ = originPoints[i][2]) !== null && _originPoints$i$ !== void 0 ? _originPoints$i$ : 0);
130
+ // @ts-ignore
169
131
  var originCur = originPoints[i];
170
132
  var next = i < points.length - 1 ? [].concat((0, _toConsumableArray2.default)(points[i + 1]), [(_originPoints$2 = originPoints[i + 1][2]) !== null && _originPoints$2 !== void 0 ? _originPoints$2 : 0]) : null;
171
133
  var originNext = i < originPoints.length - 1 ? originPoints[i + 1] : null;
172
- var amt = this.simpleSegment(complex, count, // @ts-ignore
173
- last, // @ts-ignore
174
- cur, // @ts-ignore
175
- next, // @ts-ignore
176
- originLast, originCur, // @ts-ignore
134
+ var amt = this.simpleSegment(complex, count,
135
+ // @ts-ignore
136
+ last,
137
+ // @ts-ignore
138
+ cur,
139
+ // @ts-ignore
140
+ next,
141
+ // @ts-ignore
142
+ originLast, originCur,
143
+ // @ts-ignore
177
144
  originNext);
178
145
  count += amt;
179
146
  }
180
-
181
147
  if (this.dash) {
182
148
  for (var _i2 = 0; _i2 < complex.positions.length / 6; _i2++) {
183
149
  complex.positions[_i2 * 6 + 5] = this.totalDistance;
184
150
  }
185
151
  }
186
-
187
152
  complex.startIndex = complex.positions.length / 6;
188
153
  return complex;
189
154
  }
@@ -191,48 +156,47 @@ var ExtrudePolyline = /*#__PURE__*/function () {
191
156
  key: "extrude_gaode2",
192
157
  value: function extrude_gaode2(points, originPoints) {
193
158
  var complex = this.complex;
194
-
195
159
  if (points.length <= 1) {
196
160
  return complex;
197
161
  }
198
-
199
162
  this.lastFlip = -1;
200
163
  this.started = false;
201
164
  this.normal = null;
202
- this.totalDistance = 0; // 去除数组里重复的点
165
+ this.totalDistance = 0;
166
+ // 去除数组里重复的点
203
167
  // points = getArrayUnique(points);
204
-
205
168
  var total = points.length;
206
169
  var count = complex.startIndex;
207
-
208
170
  for (var i = 1; i < total; i++) {
209
171
  var _originPoints$3, _originPoints$i$2, _originPoints$4;
210
-
211
172
  var last = points[i - 1];
212
- last.push((_originPoints$3 = originPoints[i - 1][2]) !== null && _originPoints$3 !== void 0 ? _originPoints$3 : 0); // @ts-ignore
213
-
173
+ last.push((_originPoints$3 = originPoints[i - 1][2]) !== null && _originPoints$3 !== void 0 ? _originPoints$3 : 0);
174
+ // @ts-ignore
214
175
  var originLast = originPoints[i - 1];
215
176
  var cur = points[i];
216
- cur.push((_originPoints$i$2 = originPoints[i][2]) !== null && _originPoints$i$2 !== void 0 ? _originPoints$i$2 : 0); // @ts-ignore
217
-
177
+ cur.push((_originPoints$i$2 = originPoints[i][2]) !== null && _originPoints$i$2 !== void 0 ? _originPoints$i$2 : 0);
178
+ // @ts-ignore
218
179
  var originCur = originPoints[i];
219
180
  var next = i < points.length - 1 ? [].concat((0, _toConsumableArray2.default)(points[i + 1]), [(_originPoints$4 = originPoints[i + 1][2]) !== null && _originPoints$4 !== void 0 ? _originPoints$4 : 0]) : null;
220
181
  var originNext = i < originPoints.length - 1 ? originPoints[i + 1] : null;
221
- var amt = this.segment_gaode2(complex, count, // @ts-ignore
222
- last, // @ts-ignore
223
- cur, // @ts-ignore
224
- next, // @ts-ignore
225
- originLast, originCur, // @ts-ignore
182
+ var amt = this.segment_gaode2(complex, count,
183
+ // @ts-ignore
184
+ last,
185
+ // @ts-ignore
186
+ cur,
187
+ // @ts-ignore
188
+ next,
189
+ // @ts-ignore
190
+ originLast, originCur,
191
+ // @ts-ignore
226
192
  originNext);
227
193
  count += amt;
228
194
  }
229
-
230
195
  if (this.dash) {
231
196
  for (var _i3 = 0; _i3 < complex.positions.length / 6; _i3++) {
232
197
  complex.positions[_i3 * 6 + 5] = this.totalDistance;
233
198
  }
234
199
  }
235
-
236
200
  complex.startIndex = complex.positions.length / 6;
237
201
  return complex;
238
202
  }
@@ -240,20 +204,17 @@ var ExtrudePolyline = /*#__PURE__*/function () {
240
204
  key: "extrude",
241
205
  value: function extrude(points) {
242
206
  var complex = this.complex;
243
-
244
207
  if (points.length <= 1) {
245
208
  return complex;
246
209
  }
247
-
248
210
  this.lastFlip = -1;
249
211
  this.started = false;
250
212
  this.normal = null;
251
- this.totalDistance = 0; // 去除数组里重复的点
213
+ this.totalDistance = 0;
214
+ // 去除数组里重复的点
252
215
  // points = getArrayUnique(points);
253
-
254
216
  var total = points.length;
255
217
  var count = complex.startIndex;
256
-
257
218
  for (var i = 1; i < total; i++) {
258
219
  var last = points[i - 1];
259
220
  var cur = points[i];
@@ -261,13 +222,11 @@ var ExtrudePolyline = /*#__PURE__*/function () {
261
222
  var amt = this.segment(complex, count, last, cur, next);
262
223
  count += amt;
263
224
  }
264
-
265
225
  if (this.dash) {
266
226
  for (var _i4 = 0; _i4 < complex.positions.length / 6; _i4++) {
267
227
  complex.positions[_i4 * 6 + 5] = this.totalDistance;
268
228
  }
269
229
  }
270
-
271
230
  complex.startIndex = complex.positions.length / 6;
272
231
  return complex;
273
232
  }
@@ -279,29 +238,24 @@ var ExtrudePolyline = /*#__PURE__*/function () {
279
238
  var positions = complex.positions;
280
239
  var normals = complex.normals;
281
240
  var flatCur = (0, _l7Utils.aProjectFlat)([cur[0], cur[1]]);
282
- var flatLast = (0, _l7Utils.aProjectFlat)([last[0], last[1]]); // @ts-ignore
283
-
241
+ var flatLast = (0, _l7Utils.aProjectFlat)([last[0], last[1]]);
242
+ // @ts-ignore
284
243
  direction(lineA, flatCur, flatLast);
285
244
  var segmentDistance = 0;
286
-
287
245
  if (this.dash) {
288
246
  // @ts-ignore
289
247
  segmentDistance = this.lineSegmentDistance(flatCur, flatLast);
290
248
  this.totalDistance += segmentDistance;
291
249
  }
292
-
293
250
  if (!this.normal) {
294
251
  this.normal = _glMatrix.vec2.create();
295
252
  computeNormal(this.normal, lineA);
296
253
  }
297
-
298
254
  if (!this.started) {
299
255
  this.started = true;
300
256
  this.extrusions(positions, normals, last, this.normal, this.thickness, this.totalDistance - segmentDistance);
301
257
  }
302
-
303
258
  indices.push(index + 0, index + 1, index + 2);
304
-
305
259
  if (!next) {
306
260
  computeNormal(this.normal, lineA);
307
261
  this.extrusions(positions, normals, cur, this.normal, this.thickness, this.totalDistance);
@@ -309,36 +263,36 @@ var ExtrudePolyline = /*#__PURE__*/function () {
309
263
  count += 2;
310
264
  } else {
311
265
  var flatNext = (0, _l7Utils.aProjectFlat)([next[0], next[1]]);
312
-
313
266
  if (isPointEqual(flatCur, flatNext)) {
314
267
  _glMatrix.vec2.add(flatNext, flatCur, _glMatrix.vec2.normalize(flatNext, _glMatrix.vec2.subtract(flatNext, flatCur, flatLast)));
315
268
  }
269
+ direction(lineB, flatNext, flatCur);
316
270
 
317
- direction(lineB, flatNext, flatCur); // stores tangent & miter
271
+ // stores tangent & miter
318
272
 
319
273
  var _computeMiter = computeMiter(tangent, _glMatrix.vec2.create(), lineA, lineB, this.thickness),
320
- _computeMiter2 = (0, _slicedToArray2.default)(_computeMiter, 2),
321
- miterLen = _computeMiter2[0],
322
- miter = _computeMiter2[1]; // normal(tmp, lineA)
323
- // get orientation
324
-
274
+ _computeMiter2 = (0, _slicedToArray2.default)(_computeMiter, 2),
275
+ miterLen = _computeMiter2[0],
276
+ miter = _computeMiter2[1];
277
+ // normal(tmp, lineA)
325
278
 
279
+ // get orientation
326
280
  var flip = _glMatrix.vec2.dot(tangent, this.normal) < 0 ? -1 : 1;
327
281
  this.extrusions(positions, normals, cur, miter, miterLen, this.totalDistance);
328
282
  indices.push.apply(indices, (0, _toConsumableArray2.default)(this.lastFlip === 1 ? [index, index + 2, index + 3] : [index + 2, index + 1, index + 3]));
329
- flip = -1; // the miter is now the normal for our next join
283
+ flip = -1;
330
284
 
285
+ // the miter is now the normal for our next join
331
286
  _glMatrix.vec2.copy(this.normal, miter);
332
-
333
287
  count += 2;
334
288
  this.lastFlip = flip;
335
289
  }
336
-
337
290
  return count;
338
291
  }
339
292
  }, {
340
293
  key: "segment_gaode2",
341
- value: function segment_gaode2(complex, index, last, cur, next, originLast, originCur, // eslint-disable-next-line @typescript-eslint/no-unused-vars
294
+ value: function segment_gaode2(complex, index, last, cur, next, originLast, originCur,
295
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
342
296
  originNext) {
343
297
  var count = 0;
344
298
  var indices = complex.indices;
@@ -347,35 +301,29 @@ var ExtrudePolyline = /*#__PURE__*/function () {
347
301
  var capSquare = this.cap === 'square';
348
302
  var joinBevel = this.join === 'bevel';
349
303
  var flatCur = (0, _l7Utils.aProjectFlat)([originCur[0], originCur[1]]);
350
- var flatLast = (0, _l7Utils.aProjectFlat)([originLast[0], originLast[1]]); // @ts-ignore
351
-
304
+ var flatLast = (0, _l7Utils.aProjectFlat)([originLast[0], originLast[1]]);
305
+ // @ts-ignore
352
306
  direction(lineA, cur, last);
353
307
  var segmentDistance = 0;
354
-
355
308
  if (this.dash) {
356
309
  // @ts-ignore
357
310
  segmentDistance = this.lineSegmentDistance(flatCur, flatLast);
358
311
  this.totalDistance += segmentDistance;
359
312
  }
360
-
361
313
  if (!this.normal) {
362
314
  this.normal = _glMatrix.vec2.create();
363
315
  computeNormal(this.normal, lineA);
364
316
  }
365
-
366
317
  if (!this.started) {
367
- this.started = true; // if the end cap is type square, we can just push the verts out a bit
318
+ this.started = true;
368
319
 
320
+ // if the end cap is type square, we can just push the verts out a bit
369
321
  if (capSquare) {
370
322
  // vec2.scaleAndAdd(capEnd, last, lineA, -this.thickness);
371
323
  var out1 = _glMatrix.vec2.create();
372
-
373
324
  var out2 = _glMatrix.vec2.create();
374
-
375
325
  _glMatrix.vec2.add(out1, this.normal, lineA);
376
-
377
326
  _glMatrix.vec2.add(out2, this.normal, lineA);
378
-
379
327
  normals.push(out2[0], out2[1], 0);
380
328
  normals.push(out1[0], out1[1], 0);
381
329
  positions.push(last[0], last[1], last[2] | 0, this.totalDistance - segmentDistance, -this.thickness, last[2] | 0);
@@ -387,21 +335,14 @@ var ExtrudePolyline = /*#__PURE__*/function () {
387
335
  this.extrusions(positions, normals, last, this.normal, this.thickness, this.totalDistance - segmentDistance);
388
336
  }
389
337
  }
390
-
391
338
  indices.push(index + 0, index + 1, index + 2);
392
-
393
339
  if (!next) {
394
340
  computeNormal(this.normal, lineA);
395
-
396
341
  if (capSquare) {
397
342
  var _out = _glMatrix.vec2.create();
398
-
399
343
  var _out2 = _glMatrix.vec2.create();
400
-
401
344
  _glMatrix.vec2.sub(_out2, lineA, this.normal);
402
-
403
345
  _glMatrix.vec2.add(_out, lineA, this.normal);
404
-
405
346
  normals.push(_out2[0], _out2[1], 0);
406
347
  normals.push(_out[0], _out[1], 0);
407
348
  positions.push(cur[0], cur[1], cur[2] | 0, this.totalDistance, this.thickness, cur[2] | 0);
@@ -412,40 +353,40 @@ var ExtrudePolyline = /*#__PURE__*/function () {
412
353
  } else {
413
354
  this.extrusions(positions, normals, cur, this.normal, this.thickness, this.totalDistance);
414
355
  }
415
-
416
356
  indices.push.apply(indices, (0, _toConsumableArray2.default)(this.lastFlip === 1 ? [index, index + 2, index + 3] : [index + 2, index + 1, index + 3]));
417
357
  count += 2;
418
358
  } else {
419
359
  // @ts-ignore
420
360
  if (isPointEqual(cur, next)) {
421
- _glMatrix.vec2.add( // @ts-ignore
422
- next, // @ts-ignore
423
- cur, _glMatrix.vec2.normalize( // @ts-ignore
424
- next, // @ts-ignore
361
+ _glMatrix.vec2.add(
362
+ // @ts-ignore
363
+ next,
364
+ // @ts-ignore
365
+ cur, _glMatrix.vec2.normalize(
366
+ // @ts-ignore
367
+ next,
368
+ // @ts-ignore
425
369
  _glMatrix.vec2.subtract(next, cur, last)));
426
- } // @ts-ignore
427
-
428
-
429
- direction(lineB, next, cur); // stores tangent & miter
370
+ }
371
+ // @ts-ignore
372
+ direction(lineB, next, cur);
373
+ // stores tangent & miter
430
374
 
431
375
  var _computeMiter3 = computeMiter(tangent, _glMatrix.vec2.create(), lineA, lineB, this.thickness),
432
- _computeMiter4 = (0, _slicedToArray2.default)(_computeMiter3, 2),
433
- miterLen = _computeMiter4[0],
434
- miter = _computeMiter4[1]; // normal(tmp, lineA)
435
- // get orientation
436
-
376
+ _computeMiter4 = (0, _slicedToArray2.default)(_computeMiter3, 2),
377
+ miterLen = _computeMiter4[0],
378
+ miter = _computeMiter4[1];
379
+ // normal(tmp, lineA)
437
380
 
381
+ // get orientation
438
382
  var flip = _glMatrix.vec2.dot(tangent, this.normal) < 0 ? -1 : 1;
439
383
  var bevel = joinBevel;
440
-
441
384
  if (!bevel && this.join === 'miter') {
442
385
  var limit = miterLen;
443
-
444
386
  if (limit > this.miterLimit) {
445
387
  bevel = true;
446
388
  }
447
389
  }
448
-
449
390
  if (bevel) {
450
391
  normals.push(this.normal[0], this.normal[1], 0);
451
392
  normals.push(miter[0], miter[1], 0);
@@ -454,14 +395,12 @@ var ExtrudePolyline = /*#__PURE__*/function () {
454
395
  positions.push(cur[0], cur[1], cur[2] | 0, this.totalDistance, this.thickness * flip, cur[2] | 0);
455
396
  this.complex.indexes.push(this.currentIndex);
456
397
  this.currentIndex++;
457
- indices.push.apply(indices, (0, _toConsumableArray2.default)(this.lastFlip !== -flip ? [index, index + 2, index + 3] : [index + 2, index + 1, index + 3])); // now add the bevel triangle
398
+ indices.push.apply(indices, (0, _toConsumableArray2.default)(this.lastFlip !== -flip ? [index, index + 2, index + 3] : [index + 2, index + 1, index + 3]));
458
399
 
400
+ // now add the bevel triangle
459
401
  indices.push(index + 2, index + 3, index + 4);
460
402
  computeNormal(tmp, lineB);
461
-
462
403
  _glMatrix.vec2.copy(this.normal, tmp); // store normal for next round
463
-
464
-
465
404
  normals.push(this.normal[0], this.normal[1], 0);
466
405
  positions.push(cur[0], cur[1], cur[2] | 0, this.totalDistance, -this.thickness * flip, cur[2] | 0);
467
406
  this.complex.indexes.push(this.currentIndex);
@@ -470,16 +409,14 @@ var ExtrudePolyline = /*#__PURE__*/function () {
470
409
  } else {
471
410
  this.extrusions(positions, normals, cur, miter, miterLen, this.totalDistance);
472
411
  indices.push.apply(indices, (0, _toConsumableArray2.default)(this.lastFlip === 1 ? [index, index + 2, index + 3] : [index + 2, index + 1, index + 3]));
473
- flip = -1; // the miter is now the normal for our next join
412
+ flip = -1;
474
413
 
414
+ // the miter is now the normal for our next join
475
415
  _glMatrix.vec2.copy(this.normal, miter);
476
-
477
416
  count += 2;
478
417
  }
479
-
480
418
  this.lastFlip = flip;
481
419
  }
482
-
483
420
  return count;
484
421
  }
485
422
  }, {
@@ -492,65 +429,53 @@ var ExtrudePolyline = /*#__PURE__*/function () {
492
429
  var capSquare = this.cap === 'square';
493
430
  var joinBevel = this.join === 'bevel';
494
431
  var flatCur = (0, _l7Utils.aProjectFlat)([cur[0], cur[1]]);
495
- var flatLast = (0, _l7Utils.aProjectFlat)([last[0], last[1]]); // @ts-ignore
496
-
432
+ var flatLast = (0, _l7Utils.aProjectFlat)([last[0], last[1]]);
433
+ // @ts-ignore
497
434
  direction(lineA, flatCur, flatLast);
498
435
  var segmentDistance = 0;
499
-
500
436
  if (this.dash) {
501
437
  // @ts-ignore
502
438
  segmentDistance = this.lineSegmentDistance(flatCur, flatLast);
503
439
  this.totalDistance += segmentDistance;
504
440
  }
505
-
506
441
  if (!this.normal) {
507
442
  this.normal = _glMatrix.vec2.create();
508
443
  computeNormal(this.normal, lineA);
509
444
  }
510
-
511
445
  if (!this.started) {
512
- this.started = true; // if the end cap is type square, we can just push the verts out a bit
446
+ this.started = true;
513
447
 
448
+ // if the end cap is type square, we can just push the verts out a bit
514
449
  if (capSquare) {
515
450
  // vec2.scaleAndAdd(capEnd, last, lineA, -this.thickness);
516
451
  var out1 = _glMatrix.vec2.create();
517
-
518
452
  var out2 = _glMatrix.vec2.create();
519
-
520
453
  _glMatrix.vec2.add(out1, this.normal, lineA);
521
-
522
454
  _glMatrix.vec2.add(out2, this.normal, lineA);
523
-
524
455
  normals.push(out2[0], out2[1], 0);
525
456
  normals.push(out1[0], out1[1], 0);
526
457
  positions.push(last[0], last[1], last[2] | 0, this.totalDistance - segmentDistance, -this.thickness, last[2] | 0);
527
458
  this.complex.indexes.push(this.currentIndex);
528
459
  positions.push(last[0], last[1], last[2] | 0, this.totalDistance - segmentDistance, this.thickness, last[2] | 0);
529
460
  this.complex.indexes.push(this.currentIndex);
530
- this.currentIndex++; // this.extrusions(positions, normals, last, out, this.thickness);
461
+ this.currentIndex++;
462
+ // this.extrusions(positions, normals, last, out, this.thickness);
531
463
  // last = capEnd;
532
464
  } else {
533
465
  this.extrusions(positions, normals, last, this.normal, this.thickness, this.totalDistance - segmentDistance);
534
466
  }
535
467
  }
536
-
537
468
  indices.push(index + 0, index + 1, index + 2);
538
-
539
469
  if (!next) {
540
470
  computeNormal(this.normal, lineA);
541
-
542
471
  if (capSquare) {
543
472
  // vec2.scaleAndAdd(capEnd, cur, lineA, this.thickness);
544
473
  // cur = capEnd;
545
474
  var _out3 = _glMatrix.vec2.create();
546
-
547
475
  var _out4 = _glMatrix.vec2.create();
548
-
549
476
  _glMatrix.vec2.sub(_out4, lineA, this.normal);
550
-
551
- _glMatrix.vec2.add(_out3, lineA, this.normal); // this.extrusions(positions, normals, cur, out, this.thickness);
552
-
553
-
477
+ _glMatrix.vec2.add(_out3, lineA, this.normal);
478
+ // this.extrusions(positions, normals, cur, out, this.thickness);
554
479
  normals.push(_out4[0], _out4[1], 0);
555
480
  normals.push(_out3[0], _out3[1], 0);
556
481
  positions.push(cur[0], cur[1], cur[2] | 0, this.totalDistance, this.thickness, cur[2] | 0);
@@ -560,38 +485,35 @@ var ExtrudePolyline = /*#__PURE__*/function () {
560
485
  this.currentIndex++;
561
486
  } else {
562
487
  this.extrusions(positions, normals, cur, this.normal, this.thickness, this.totalDistance);
563
- } // this.extrusions(positions, normals, cur, this.normal, this.thickness);
564
-
488
+ }
565
489
 
490
+ // this.extrusions(positions, normals, cur, this.normal, this.thickness);
566
491
  indices.push.apply(indices, (0, _toConsumableArray2.default)(this.lastFlip === 1 ? [index, index + 2, index + 3] : [index + 2, index + 1, index + 3]));
567
492
  count += 2;
568
493
  } else {
569
494
  var flatNext = (0, _l7Utils.aProjectFlat)([next[0], next[1]]);
570
-
571
495
  if (isPointEqual(flatCur, flatNext)) {
572
496
  _glMatrix.vec2.add(flatNext, flatCur, _glMatrix.vec2.normalize(flatNext, _glMatrix.vec2.subtract(flatNext, flatCur, flatLast)));
573
497
  }
498
+ direction(lineB, flatNext, flatCur);
574
499
 
575
- direction(lineB, flatNext, flatCur); // stores tangent & miter
500
+ // stores tangent & miter
576
501
 
577
502
  var _computeMiter5 = computeMiter(tangent, _glMatrix.vec2.create(), lineA, lineB, this.thickness),
578
- _computeMiter6 = (0, _slicedToArray2.default)(_computeMiter5, 2),
579
- miterLen = _computeMiter6[0],
580
- miter = _computeMiter6[1]; // normal(tmp, lineA)
581
- // get orientation
582
-
503
+ _computeMiter6 = (0, _slicedToArray2.default)(_computeMiter5, 2),
504
+ miterLen = _computeMiter6[0],
505
+ miter = _computeMiter6[1];
506
+ // normal(tmp, lineA)
583
507
 
508
+ // get orientation
584
509
  var flip = _glMatrix.vec2.dot(tangent, this.normal) < 0 ? -1 : 1;
585
510
  var bevel = joinBevel;
586
-
587
511
  if (!bevel && this.join === 'miter') {
588
512
  var limit = miterLen;
589
-
590
513
  if (limit > this.miterLimit) {
591
514
  bevel = true;
592
515
  }
593
516
  }
594
-
595
517
  if (bevel) {
596
518
  normals.push(this.normal[0], this.normal[1], 0);
597
519
  normals.push(miter[0], miter[1], 0);
@@ -600,14 +522,12 @@ var ExtrudePolyline = /*#__PURE__*/function () {
600
522
  positions.push(cur[0], cur[1], cur[2] | 0, this.totalDistance, this.thickness * flip, cur[2] | 0);
601
523
  this.complex.indexes.push(this.currentIndex);
602
524
  this.currentIndex++;
603
- indices.push.apply(indices, (0, _toConsumableArray2.default)(this.lastFlip !== -flip ? [index, index + 2, index + 3] : [index + 2, index + 1, index + 3])); // now add the bevel triangle
525
+ indices.push.apply(indices, (0, _toConsumableArray2.default)(this.lastFlip !== -flip ? [index, index + 2, index + 3] : [index + 2, index + 1, index + 3]));
604
526
 
527
+ // now add the bevel triangle
605
528
  indices.push(index + 2, index + 3, index + 4);
606
529
  computeNormal(tmp, lineB);
607
-
608
530
  _glMatrix.vec2.copy(this.normal, tmp); // store normal for next round
609
-
610
-
611
531
  normals.push(this.normal[0], this.normal[1], 0);
612
532
  positions.push(cur[0], cur[1], cur[2] | 0, this.totalDistance, -this.thickness * flip, cur[2] | 0);
613
533
  this.complex.indexes.push(this.currentIndex);
@@ -616,23 +536,24 @@ var ExtrudePolyline = /*#__PURE__*/function () {
616
536
  } else {
617
537
  this.extrusions(positions, normals, cur, miter, miterLen, this.totalDistance);
618
538
  indices.push.apply(indices, (0, _toConsumableArray2.default)(this.lastFlip === 1 ? [index, index + 2, index + 3] : [index + 2, index + 1, index + 3]));
619
- flip = -1; // the miter is now the normal for our next join
539
+ flip = -1;
620
540
 
541
+ // the miter is now the normal for our next join
621
542
  _glMatrix.vec2.copy(this.normal, miter);
622
-
623
543
  count += 2;
624
544
  }
625
-
626
545
  this.lastFlip = flip;
627
546
  }
628
-
629
547
  return count;
630
548
  }
631
549
  }, {
632
550
  key: "extrusions",
633
- value: function extrusions(positions, normals, point, // 顶点
634
- normal, // 法向量
635
- thickness, // 高度
551
+ value: function extrusions(positions, normals, point,
552
+ // 顶点
553
+ normal,
554
+ // 法向量
555
+ thickness,
556
+ // 高度
636
557
  distanceRadio) {
637
558
  normals.push(normal[0], normal[1], 0);
638
559
  normals.push(normal[0], normal[1], 0);
@@ -652,5 +573,4 @@ var ExtrudePolyline = /*#__PURE__*/function () {
652
573
  }]);
653
574
  return ExtrudePolyline;
654
575
  }();
655
-
656
576
  exports.default = ExtrudePolyline;