@visactor/vrender-core 0.19.19 → 0.20.0-alpha.1

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 (426) hide show
  1. package/cjs/allocator/bounds-allocate.js.map +1 -1
  2. package/cjs/allocator/matrix-allocate.d.ts +1 -1
  3. package/cjs/allocator/matrix-allocate.js +2 -4
  4. package/cjs/allocator/matrix-allocate.js.map +1 -1
  5. package/cjs/animate/config.js +2 -1
  6. package/cjs/animate/custom-animate.d.ts +0 -14
  7. package/cjs/animate/custom-animate.js +2 -61
  8. package/cjs/animate/custom-animate.js.map +1 -1
  9. package/cjs/animate/group-fade.d.ts +16 -0
  10. package/cjs/animate/group-fade.js +66 -0
  11. package/cjs/animate/group-fade.js.map +1 -0
  12. package/cjs/animate/index.d.ts +1 -0
  13. package/cjs/animate/index.js +2 -1
  14. package/cjs/animate/index.js.map +1 -1
  15. package/cjs/canvas/util.d.ts +0 -1
  16. package/cjs/canvas/util.js +7 -17
  17. package/cjs/canvas/util.js.map +1 -1
  18. package/cjs/common/3d-interceptor.d.ts +3 -0
  19. package/cjs/common/3d-interceptor.js +51 -0
  20. package/cjs/common/3d-interceptor.js.map +1 -0
  21. package/cjs/common/Reflect-metadata.js +2 -1
  22. package/cjs/common/bounds-context.js +1 -2
  23. package/cjs/common/canvas-utils.d.ts +1 -1
  24. package/cjs/common/canvas-utils.js +15 -30
  25. package/cjs/common/canvas-utils.js.map +1 -1
  26. package/cjs/common/matrix.d.ts +11 -3
  27. package/cjs/common/matrix.js +97 -19
  28. package/cjs/common/matrix.js.map +1 -1
  29. package/cjs/common/morphing-utils.js +1 -1
  30. package/cjs/common/path-svg.js +1 -1
  31. package/cjs/common/polygon.js +2 -2
  32. package/cjs/common/rect-utils.js +1 -1
  33. package/cjs/common/render-area.js +1 -1
  34. package/cjs/common/render-command-list.js +1 -1
  35. package/cjs/common/render-curve.js +24 -33
  36. package/cjs/common/render-curve.js.map +1 -1
  37. package/cjs/common/render-utils.js +1 -1
  38. package/cjs/common/seg-context.js +1 -1
  39. package/cjs/common/seg-context.js.map +1 -1
  40. package/cjs/common/segment/index.d.ts +2 -4
  41. package/cjs/common/segment/index.js.map +1 -1
  42. package/cjs/common/simplify.js +1 -1
  43. package/cjs/common/sort.js +16 -13
  44. package/cjs/common/sort.js.map +1 -1
  45. package/cjs/common/split-path.js +1 -1
  46. package/cjs/common/store.js +1 -1
  47. package/cjs/common/text.d.ts +0 -2
  48. package/cjs/common/text.js +4 -11
  49. package/cjs/common/text.js.map +1 -1
  50. package/cjs/core/application.js +1 -2
  51. package/cjs/core/camera.d.ts +1 -0
  52. package/cjs/core/camera.js +11 -5
  53. package/cjs/core/camera.js.map +1 -1
  54. package/cjs/core/constants.js +1 -1
  55. package/cjs/core/core-modules.js +1 -1
  56. package/cjs/core/global-module.js +0 -2
  57. package/cjs/core/global.js +1 -1
  58. package/cjs/core/graphic-utils.js +1 -1
  59. package/cjs/core/graphic-utils.js.map +1 -1
  60. package/cjs/core/index.js +1 -1
  61. package/cjs/core/layer-service.js +1 -1
  62. package/cjs/core/layer.js +1 -1
  63. package/cjs/core/light.d.ts +1 -0
  64. package/cjs/core/light.js +9 -3
  65. package/cjs/core/light.js.map +1 -1
  66. package/cjs/core/stage.d.ts +1 -1
  67. package/cjs/core/stage.js +17 -8
  68. package/cjs/core/stage.js.map +1 -1
  69. package/cjs/core/window.js +1 -1
  70. package/cjs/factory.d.ts +5 -0
  71. package/cjs/factory.js +17 -0
  72. package/cjs/factory.js.map +1 -0
  73. package/cjs/graphic/arc.d.ts +1 -2
  74. package/cjs/graphic/arc.js +0 -3
  75. package/cjs/graphic/arc.js.map +1 -1
  76. package/cjs/graphic/area.d.ts +1 -2
  77. package/cjs/graphic/area.js +0 -3
  78. package/cjs/graphic/area.js.map +1 -1
  79. package/cjs/graphic/builtin-symbol/utils.js +1 -5
  80. package/cjs/graphic/builtin-symbol/utils.js.map +1 -1
  81. package/cjs/graphic/circle.d.ts +1 -2
  82. package/cjs/graphic/circle.js +0 -3
  83. package/cjs/graphic/circle.js.map +1 -1
  84. package/cjs/graphic/glyph.d.ts +1 -2
  85. package/cjs/graphic/glyph.js +0 -3
  86. package/cjs/graphic/glyph.js.map +1 -1
  87. package/cjs/graphic/graphic-service/graphic-service.d.ts +2 -8
  88. package/cjs/graphic/graphic-service/graphic-service.js +11 -101
  89. package/cjs/graphic/graphic-service/graphic-service.js.map +1 -1
  90. package/cjs/graphic/graphic.d.ts +1 -4
  91. package/cjs/graphic/graphic.js +0 -3
  92. package/cjs/graphic/graphic.js.map +1 -1
  93. package/cjs/graphic/group.d.ts +1 -2
  94. package/cjs/graphic/group.js +0 -3
  95. package/cjs/graphic/group.js.map +1 -1
  96. package/cjs/graphic/image.d.ts +1 -2
  97. package/cjs/graphic/image.js +0 -3
  98. package/cjs/graphic/image.js.map +1 -1
  99. package/cjs/graphic/index.js.map +1 -1
  100. package/cjs/graphic/line.d.ts +1 -2
  101. package/cjs/graphic/line.js +0 -3
  102. package/cjs/graphic/line.js.map +1 -1
  103. package/cjs/graphic/path.d.ts +1 -2
  104. package/cjs/graphic/path.js +0 -3
  105. package/cjs/graphic/path.js.map +1 -1
  106. package/cjs/graphic/polygon.d.ts +1 -2
  107. package/cjs/graphic/polygon.js +0 -3
  108. package/cjs/graphic/polygon.js.map +1 -1
  109. package/cjs/graphic/rect.d.ts +1 -2
  110. package/cjs/graphic/rect.js +0 -3
  111. package/cjs/graphic/rect.js.map +1 -1
  112. package/cjs/graphic/richtext/utils.js +12 -21
  113. package/cjs/graphic/richtext/utils.js.map +1 -1
  114. package/cjs/graphic/richtext.d.ts +1 -2
  115. package/cjs/graphic/richtext.js +0 -3
  116. package/cjs/graphic/richtext.js.map +1 -1
  117. package/cjs/graphic/symbol.d.ts +0 -2
  118. package/cjs/graphic/symbol.js +0 -3
  119. package/cjs/graphic/symbol.js.map +1 -1
  120. package/cjs/graphic/text.d.ts +1 -2
  121. package/cjs/graphic/text.js +1 -4
  122. package/cjs/graphic/text.js.map +1 -1
  123. package/cjs/index.d.ts +4 -1
  124. package/cjs/index.js +16 -15
  125. package/cjs/index.js.map +1 -1
  126. package/cjs/interface/graphic.d.ts +1 -2
  127. package/cjs/interface/graphic.js.map +1 -1
  128. package/cjs/picker/pick-interceptor.d.ts +1 -1
  129. package/cjs/picker/pick-interceptor.js +2 -42
  130. package/cjs/picker/pick-interceptor.js.map +1 -1
  131. package/cjs/picker/picker-service.js +7 -7
  132. package/cjs/picker/picker-service.js.map +1 -1
  133. package/cjs/plugins/builtin-plugin/flex-layout-plugin.js +2 -2
  134. package/cjs/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
  135. package/cjs/plugins/builtin-plugin/html-attribute-plugin.d.ts +1 -0
  136. package/cjs/plugins/builtin-plugin/html-attribute-plugin.js +11 -5
  137. package/cjs/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
  138. package/cjs/plugins/builtin-plugin/react-attribute-plugin.d.ts +1 -0
  139. package/cjs/plugins/builtin-plugin/react-attribute-plugin.js +8 -2
  140. package/cjs/plugins/builtin-plugin/react-attribute-plugin.js.map +1 -1
  141. package/cjs/render/contributions/render/arc-render.js +1 -4
  142. package/cjs/render/contributions/render/arc-render.js.map +1 -1
  143. package/cjs/render/contributions/render/area-render.js +4 -32
  144. package/cjs/render/contributions/render/area-render.js.map +1 -1
  145. package/cjs/render/contributions/render/base-3d-render.d.ts +10 -0
  146. package/cjs/render/contributions/render/base-3d-render.js +63 -0
  147. package/cjs/render/contributions/render/base-3d-render.js.map +1 -0
  148. package/cjs/render/contributions/render/base-render.js +5 -5
  149. package/cjs/render/contributions/render/base-render.js.map +1 -1
  150. package/cjs/render/contributions/render/contributions/arc-contribution-render.js +14 -30
  151. package/cjs/render/contributions/render/contributions/arc-contribution-render.js.map +1 -1
  152. package/cjs/render/contributions/render/contributions/base-contribution-render.js +2 -2
  153. package/cjs/render/contributions/render/contributions/base-contribution-render.js.map +1 -1
  154. package/cjs/render/contributions/render/contributions/circle-contribution-render.js +11 -22
  155. package/cjs/render/contributions/render/contributions/circle-contribution-render.js.map +1 -1
  156. package/cjs/render/contributions/render/contributions/image-contribution-render.js +2 -2
  157. package/cjs/render/contributions/render/contributions/image-contribution-render.js.map +1 -1
  158. package/cjs/render/contributions/render/contributions/rect-contribution-render.js +11 -24
  159. package/cjs/render/contributions/render/contributions/rect-contribution-render.js.map +1 -1
  160. package/cjs/render/contributions/render/contributions/symbol-contribution-render.js +10 -21
  161. package/cjs/render/contributions/render/contributions/symbol-contribution-render.js.map +1 -1
  162. package/cjs/render/contributions/render/contributions/text-contribution-render.js +2 -2
  163. package/cjs/render/contributions/render/contributions/text-contribution-render.js.map +1 -1
  164. package/cjs/render/contributions/render/draw-contribution.js +4 -4
  165. package/cjs/render/contributions/render/draw-contribution.js.map +1 -1
  166. package/cjs/render/contributions/render/draw-interceptor.js +7 -51
  167. package/cjs/render/contributions/render/draw-interceptor.js.map +1 -1
  168. package/cjs/render/contributions/render/group-render.js +6 -6
  169. package/cjs/render/contributions/render/group-render.js.map +1 -1
  170. package/cjs/render/contributions/render/incremental-draw-contribution.js +4 -4
  171. package/cjs/render/contributions/render/incremental-draw-contribution.js.map +1 -1
  172. package/cjs/render/contributions/render/line-render.js.map +1 -1
  173. package/cjs/render/contributions/render/pyramid3d-render.d.ts +3 -5
  174. package/cjs/render/contributions/render/pyramid3d-render.js +4 -54
  175. package/cjs/render/contributions/render/pyramid3d-render.js.map +1 -1
  176. package/cjs/render/contributions/render/rect3d-render.d.ts +3 -5
  177. package/cjs/render/contributions/render/rect3d-render.js +4 -53
  178. package/cjs/render/contributions/render/rect3d-render.js.map +1 -1
  179. package/cjs/render/contributions/render/symbol-render.js +9 -18
  180. package/cjs/render/contributions/render/symbol-render.js.map +1 -1
  181. package/cjs/render/contributions/render/text-render.d.ts +3 -2
  182. package/cjs/render/contributions/render/text-render.js +13 -32
  183. package/cjs/render/contributions/render/text-render.js.map +1 -1
  184. package/cjs/render/contributions/render/utils.js +2 -5
  185. package/cjs/render/contributions/render/utils.js.map +1 -1
  186. package/dist/index.es.js +11316 -11831
  187. package/es/allocator/bounds-allocate.js.map +1 -1
  188. package/es/allocator/matrix-allocate.d.ts +1 -1
  189. package/es/allocator/matrix-allocate.js +3 -3
  190. package/es/allocator/matrix-allocate.js.map +1 -1
  191. package/es/animate/config.js +2 -1
  192. package/es/animate/custom-animate.d.ts +0 -14
  193. package/es/animate/custom-animate.js +1 -56
  194. package/es/animate/custom-animate.js.map +1 -1
  195. package/es/animate/group-fade.d.ts +16 -0
  196. package/es/animate/group-fade.js +56 -0
  197. package/es/animate/group-fade.js.map +1 -0
  198. package/es/animate/index.d.ts +1 -0
  199. package/es/animate/index.js +2 -0
  200. package/es/animate/index.js.map +1 -1
  201. package/es/canvas/util.d.ts +0 -1
  202. package/es/canvas/util.js +7 -17
  203. package/es/canvas/util.js.map +1 -1
  204. package/es/common/3d-interceptor.d.ts +3 -0
  205. package/es/common/3d-interceptor.js +47 -0
  206. package/es/common/3d-interceptor.js.map +1 -0
  207. package/es/common/Reflect-metadata.js +2 -1
  208. package/es/common/bounds-context.js +1 -2
  209. package/es/common/canvas-utils.d.ts +1 -1
  210. package/es/common/canvas-utils.js +15 -30
  211. package/es/common/canvas-utils.js.map +1 -1
  212. package/es/common/matrix.d.ts +11 -3
  213. package/es/common/matrix.js +90 -17
  214. package/es/common/matrix.js.map +1 -1
  215. package/es/common/morphing-utils.js +1 -1
  216. package/es/common/path-svg.js +1 -1
  217. package/es/common/polygon.js +1 -1
  218. package/es/common/rect-utils.js +1 -1
  219. package/es/common/render-area.js +1 -1
  220. package/es/common/render-command-list.js +1 -1
  221. package/es/common/render-curve.js +24 -33
  222. package/es/common/render-curve.js.map +1 -1
  223. package/es/common/render-utils.js +1 -1
  224. package/es/common/seg-context.js +1 -1
  225. package/es/common/seg-context.js.map +1 -1
  226. package/es/common/segment/index.d.ts +2 -4
  227. package/es/common/segment/index.js.map +1 -1
  228. package/es/common/simplify.js +1 -1
  229. package/es/common/sort.js +16 -13
  230. package/es/common/sort.js.map +1 -1
  231. package/es/common/split-path.js +1 -1
  232. package/es/common/store.js +1 -1
  233. package/es/common/text.d.ts +0 -2
  234. package/es/common/text.js +1 -7
  235. package/es/common/text.js.map +1 -1
  236. package/es/core/application.js +1 -2
  237. package/es/core/camera.d.ts +1 -0
  238. package/es/core/camera.js +12 -4
  239. package/es/core/camera.js.map +1 -1
  240. package/es/core/constants.js +1 -1
  241. package/es/core/core-modules.js +1 -1
  242. package/es/core/global-module.js +0 -2
  243. package/es/core/global.js +1 -1
  244. package/es/core/graphic-utils.js +1 -1
  245. package/es/core/graphic-utils.js.map +1 -1
  246. package/es/core/index.js +1 -1
  247. package/es/core/layer-service.js +1 -1
  248. package/es/core/layer.js +1 -1
  249. package/es/core/light.d.ts +1 -0
  250. package/es/core/light.js +7 -1
  251. package/es/core/light.js.map +1 -1
  252. package/es/core/stage.d.ts +1 -1
  253. package/es/core/stage.js +18 -13
  254. package/es/core/stage.js.map +1 -1
  255. package/es/core/window.js +1 -1
  256. package/es/factory.d.ts +5 -0
  257. package/es/factory.js +11 -0
  258. package/es/factory.js.map +1 -0
  259. package/es/graphic/arc.d.ts +1 -2
  260. package/es/graphic/arc.js +0 -3
  261. package/es/graphic/arc.js.map +1 -1
  262. package/es/graphic/area.d.ts +1 -2
  263. package/es/graphic/area.js +0 -3
  264. package/es/graphic/area.js.map +1 -1
  265. package/es/graphic/builtin-symbol/utils.js +1 -4
  266. package/es/graphic/builtin-symbol/utils.js.map +1 -1
  267. package/es/graphic/circle.d.ts +1 -2
  268. package/es/graphic/circle.js +0 -3
  269. package/es/graphic/circle.js.map +1 -1
  270. package/es/graphic/glyph.d.ts +1 -2
  271. package/es/graphic/glyph.js +0 -3
  272. package/es/graphic/glyph.js.map +1 -1
  273. package/es/graphic/graphic-service/graphic-service.d.ts +2 -8
  274. package/es/graphic/graphic-service/graphic-service.js +3 -91
  275. package/es/graphic/graphic-service/graphic-service.js.map +1 -1
  276. package/es/graphic/graphic.d.ts +1 -4
  277. package/es/graphic/graphic.js +0 -3
  278. package/es/graphic/graphic.js.map +1 -1
  279. package/es/graphic/group.d.ts +1 -2
  280. package/es/graphic/group.js +0 -3
  281. package/es/graphic/group.js.map +1 -1
  282. package/es/graphic/image.d.ts +1 -2
  283. package/es/graphic/image.js +0 -3
  284. package/es/graphic/image.js.map +1 -1
  285. package/es/graphic/index.js.map +1 -1
  286. package/es/graphic/line.d.ts +1 -2
  287. package/es/graphic/line.js +0 -3
  288. package/es/graphic/line.js.map +1 -1
  289. package/es/graphic/path.d.ts +1 -2
  290. package/es/graphic/path.js +0 -3
  291. package/es/graphic/path.js.map +1 -1
  292. package/es/graphic/polygon.d.ts +1 -2
  293. package/es/graphic/polygon.js +0 -3
  294. package/es/graphic/polygon.js.map +1 -1
  295. package/es/graphic/rect.d.ts +1 -2
  296. package/es/graphic/rect.js +0 -3
  297. package/es/graphic/rect.js.map +1 -1
  298. package/es/graphic/richtext/utils.js +9 -20
  299. package/es/graphic/richtext/utils.js.map +1 -1
  300. package/es/graphic/richtext.d.ts +1 -2
  301. package/es/graphic/richtext.js +0 -3
  302. package/es/graphic/richtext.js.map +1 -1
  303. package/es/graphic/symbol.d.ts +0 -2
  304. package/es/graphic/symbol.js +0 -3
  305. package/es/graphic/symbol.js.map +1 -1
  306. package/es/graphic/text.d.ts +1 -2
  307. package/es/graphic/text.js +2 -5
  308. package/es/graphic/text.js.map +1 -1
  309. package/es/index.d.ts +4 -1
  310. package/es/index.js +8 -2
  311. package/es/index.js.map +1 -1
  312. package/es/interface/graphic.d.ts +1 -2
  313. package/es/interface/graphic.js.map +1 -1
  314. package/es/picker/pick-interceptor.d.ts +1 -1
  315. package/es/picker/pick-interceptor.js +4 -44
  316. package/es/picker/pick-interceptor.js.map +1 -1
  317. package/es/picker/picker-service.js +5 -1
  318. package/es/picker/picker-service.js.map +1 -1
  319. package/es/plugins/builtin-plugin/flex-layout-plugin.js +1 -1
  320. package/es/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
  321. package/es/plugins/builtin-plugin/html-attribute-plugin.d.ts +1 -0
  322. package/es/plugins/builtin-plugin/html-attribute-plugin.js +9 -1
  323. package/es/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
  324. package/es/plugins/builtin-plugin/react-attribute-plugin.d.ts +1 -0
  325. package/es/plugins/builtin-plugin/react-attribute-plugin.js +6 -0
  326. package/es/plugins/builtin-plugin/react-attribute-plugin.js.map +1 -1
  327. package/es/render/contributions/render/arc-render.js +1 -4
  328. package/es/render/contributions/render/arc-render.js.map +1 -1
  329. package/es/render/contributions/render/area-render.js +1 -30
  330. package/es/render/contributions/render/area-render.js.map +1 -1
  331. package/es/render/contributions/render/base-3d-render.d.ts +10 -0
  332. package/es/render/contributions/render/base-3d-render.js +57 -0
  333. package/es/render/contributions/render/base-3d-render.js.map +1 -0
  334. package/es/render/contributions/render/base-render.js +3 -1
  335. package/es/render/contributions/render/base-render.js.map +1 -1
  336. package/es/render/contributions/render/contributions/arc-contribution-render.js +13 -28
  337. package/es/render/contributions/render/contributions/arc-contribution-render.js.map +1 -1
  338. package/es/render/contributions/render/contributions/base-contribution-render.js +1 -1
  339. package/es/render/contributions/render/contributions/base-contribution-render.js.map +1 -1
  340. package/es/render/contributions/render/contributions/circle-contribution-render.js +10 -20
  341. package/es/render/contributions/render/contributions/circle-contribution-render.js.map +1 -1
  342. package/es/render/contributions/render/contributions/image-contribution-render.js +1 -1
  343. package/es/render/contributions/render/contributions/image-contribution-render.js.map +1 -1
  344. package/es/render/contributions/render/contributions/rect-contribution-render.js +10 -20
  345. package/es/render/contributions/render/contributions/rect-contribution-render.js.map +1 -1
  346. package/es/render/contributions/render/contributions/symbol-contribution-render.js +9 -19
  347. package/es/render/contributions/render/contributions/symbol-contribution-render.js.map +1 -1
  348. package/es/render/contributions/render/contributions/text-contribution-render.js +1 -1
  349. package/es/render/contributions/render/contributions/text-contribution-render.js.map +1 -1
  350. package/es/render/contributions/render/draw-contribution.js +1 -1
  351. package/es/render/contributions/render/draw-contribution.js.map +1 -1
  352. package/es/render/contributions/render/draw-interceptor.js +7 -49
  353. package/es/render/contributions/render/draw-interceptor.js.map +1 -1
  354. package/es/render/contributions/render/group-render.js +5 -1
  355. package/es/render/contributions/render/group-render.js.map +1 -1
  356. package/es/render/contributions/render/incremental-draw-contribution.js +1 -1
  357. package/es/render/contributions/render/incremental-draw-contribution.js.map +1 -1
  358. package/es/render/contributions/render/line-render.js.map +1 -1
  359. package/es/render/contributions/render/pyramid3d-render.d.ts +3 -5
  360. package/es/render/contributions/render/pyramid3d-render.js +4 -56
  361. package/es/render/contributions/render/pyramid3d-render.js.map +1 -1
  362. package/es/render/contributions/render/rect3d-render.d.ts +3 -5
  363. package/es/render/contributions/render/rect3d-render.js +4 -55
  364. package/es/render/contributions/render/rect3d-render.js.map +1 -1
  365. package/es/render/contributions/render/symbol-render.js +9 -18
  366. package/es/render/contributions/render/symbol-render.js.map +1 -1
  367. package/es/render/contributions/render/text-render.d.ts +3 -2
  368. package/es/render/contributions/render/text-render.js +11 -30
  369. package/es/render/contributions/render/text-render.js.map +1 -1
  370. package/es/render/contributions/render/utils.js +2 -5
  371. package/es/render/contributions/render/utils.js.map +1 -1
  372. package/package.json +4 -4
  373. package/cjs/allocator/allocator-modules.d.ts +0 -1
  374. package/cjs/allocator/allocator-modules.js +0 -1
  375. package/cjs/allocator/allocator-modules.js.map +0 -1
  376. package/cjs/allocator/point-allocate.d.ts +0 -1
  377. package/cjs/allocator/point-allocate.js +0 -1
  378. package/cjs/allocator/point-allocate.js.map +0 -1
  379. package/cjs/graphic/graphic-service/arc-contribution.d.ts +0 -1
  380. package/cjs/graphic/graphic-service/arc-contribution.js +0 -3
  381. package/cjs/graphic/graphic-service/arc-contribution.js.map +0 -1
  382. package/cjs/graphic/graphic-service/area-contribution.d.ts +0 -1
  383. package/cjs/graphic/graphic-service/area-contribution.js +0 -3
  384. package/cjs/graphic/graphic-service/area-contribution.js.map +0 -1
  385. package/cjs/graphic/graphic-service/circle-contribution.d.ts +0 -1
  386. package/cjs/graphic/graphic-service/circle-contribution.js +0 -3
  387. package/cjs/graphic/graphic-service/circle-contribution.js.map +0 -1
  388. package/cjs/graphic/graphic-service/default-theme.d.ts +0 -1
  389. package/cjs/graphic/graphic-service/default-theme.js +0 -3
  390. package/cjs/graphic/graphic-service/default-theme.js.map +0 -1
  391. package/cjs/graphic/graphic-service/path-contribution.d.ts +0 -1
  392. package/cjs/graphic/graphic-service/path-contribution.js +0 -3
  393. package/cjs/graphic/graphic-service/path-contribution.js.map +0 -1
  394. package/cjs/graphic/graphic-service/rect-contribution.d.ts +0 -1
  395. package/cjs/graphic/graphic-service/rect-contribution.js +0 -3
  396. package/cjs/graphic/graphic-service/rect-contribution.js.map +0 -1
  397. package/cjs/interface/util.d.ts +0 -1
  398. package/cjs/interface/util.js +0 -3
  399. package/cjs/interface/util.js.map +0 -1
  400. package/es/allocator/allocator-modules.d.ts +0 -1
  401. package/es/allocator/allocator-modules.js +0 -1
  402. package/es/allocator/allocator-modules.js.map +0 -1
  403. package/es/allocator/point-allocate.d.ts +0 -1
  404. package/es/allocator/point-allocate.js +0 -1
  405. package/es/allocator/point-allocate.js.map +0 -1
  406. package/es/graphic/graphic-service/arc-contribution.d.ts +0 -1
  407. package/es/graphic/graphic-service/arc-contribution.js +0 -3
  408. package/es/graphic/graphic-service/arc-contribution.js.map +0 -1
  409. package/es/graphic/graphic-service/area-contribution.d.ts +0 -1
  410. package/es/graphic/graphic-service/area-contribution.js +0 -3
  411. package/es/graphic/graphic-service/area-contribution.js.map +0 -1
  412. package/es/graphic/graphic-service/circle-contribution.d.ts +0 -1
  413. package/es/graphic/graphic-service/circle-contribution.js +0 -3
  414. package/es/graphic/graphic-service/circle-contribution.js.map +0 -1
  415. package/es/graphic/graphic-service/default-theme.d.ts +0 -1
  416. package/es/graphic/graphic-service/default-theme.js +0 -3
  417. package/es/graphic/graphic-service/default-theme.js.map +0 -1
  418. package/es/graphic/graphic-service/path-contribution.d.ts +0 -1
  419. package/es/graphic/graphic-service/path-contribution.js +0 -3
  420. package/es/graphic/graphic-service/path-contribution.js.map +0 -1
  421. package/es/graphic/graphic-service/rect-contribution.d.ts +0 -1
  422. package/es/graphic/graphic-service/rect-contribution.js +0 -3
  423. package/es/graphic/graphic-service/rect-contribution.js.map +0 -1
  424. package/es/interface/util.d.ts +0 -1
  425. package/es/interface/util.js +0 -3
  426. package/es/interface/util.js.map +0 -1
@@ -13,56 +13,41 @@ function getScaledStroke(context, width, dpr) {
13
13
  strokeWidth);
14
14
  }
15
15
 
16
- function createColor(context, c, params, offsetX, offsetY) {
16
+ function createColor(context, c, params, offsetX = 0, offsetY = 0) {
17
17
  if (!c || !0 === c) return "black";
18
18
  let result, color;
19
19
  if ((0, vutils_1.isArray)(c)) for (let i = 0; i < c.length && (color = c[i], !color); i++) ; else color = c;
20
- return color = color_utils_1.GradientParser.Parse(color), "string" == typeof color ? color : ("linear" === color.gradient ? result = createLinearGradient(context, color, params, offsetX, offsetY) : "conical" === color.gradient ? result = createConicGradient(context, color, params, offsetX, offsetY) : "radial" === color.gradient && (result = createRadialGradient(context, color, params, offsetX, offsetY)),
21
- result || "orange");
20
+ if (color = color_utils_1.GradientParser.Parse(color), "string" == typeof color) return color;
21
+ if (params.AABBBounds && (!params.attribute || 0 !== params.attribute.scaleX || 0 !== params.attribute.scaleY)) {
22
+ const bounds = params.AABBBounds;
23
+ let w = bounds.x2 - bounds.x1, h = bounds.y2 - bounds.y1, x = bounds.x1 - offsetX, y = bounds.y1 - offsetY;
24
+ if (params.attribute) {
25
+ const {scaleX: scaleX = 1, scaleY: scaleY = 1} = params.attribute;
26
+ w /= scaleX, h /= scaleY, x /= scaleX, y /= scaleY;
27
+ }
28
+ "linear" === color.gradient ? result = createLinearGradient(context, color, x, y, w, h) : "conical" === color.gradient ? result = createConicGradient(context, color, x, y, w, h) : "radial" === color.gradient && (result = createRadialGradient(context, color, x, y, w, h));
29
+ }
30
+ return result || "orange";
22
31
  }
23
32
 
24
- function createLinearGradient(context, color, params, offsetX = 0, offsetY = 0) {
33
+ function createLinearGradient(context, color, x, y, w, h) {
25
34
  var _a, _b, _c, _d;
26
- const bounds = params.AABBBounds;
27
- if (!bounds) return;
28
- let w = bounds.x2 - bounds.x1, h = bounds.y2 - bounds.y1, x = bounds.x1 - offsetX, y = bounds.y1 - offsetY;
29
- if (params.attribute) {
30
- const {scaleX: scaleX = 1, scaleY: scaleY = 1} = params.attribute;
31
- if (scaleX * scaleY == 0) return;
32
- w /= scaleX, h /= scaleY, x /= scaleX, y /= scaleY;
33
- }
34
35
  const canvasGradient = context.createLinearGradient(x + (null !== (_a = color.x0) && void 0 !== _a ? _a : 0) * w, y + (null !== (_b = color.y0) && void 0 !== _b ? _b : 0) * h, x + (null !== (_c = color.x1) && void 0 !== _c ? _c : 1) * w, y + (null !== (_d = color.y1) && void 0 !== _d ? _d : 0) * h);
35
36
  return color.stops.forEach((stop => {
36
37
  canvasGradient.addColorStop(stop.offset, stop.color);
37
38
  })), canvasGradient;
38
39
  }
39
40
 
40
- function createRadialGradient(context, color, params, offsetX = 0, offsetY = 0) {
41
+ function createRadialGradient(context, color, x, y, w, h) {
41
42
  var _a, _b, _c, _d, _e, _f;
42
- const bounds = params.AABBBounds;
43
- if (!bounds) return;
44
- let w = bounds.x2 - bounds.x1, h = bounds.y2 - bounds.y1, x = bounds.x1 - offsetX, y = bounds.y1 - offsetY;
45
- if (params.attribute) {
46
- const {scaleX: scaleX = 1, scaleY: scaleY = 1} = params.attribute;
47
- if (scaleX * scaleY == 0) return;
48
- x /= scaleX, y /= scaleY, w /= scaleX, h /= scaleY;
49
- }
50
43
  const canvasGradient = context.createRadialGradient(x + (null !== (_a = color.x0) && void 0 !== _a ? _a : .5) * w, y + (null !== (_b = color.y0) && void 0 !== _b ? _b : .5) * h, Math.max(w, h) * (null !== (_c = color.r0) && void 0 !== _c ? _c : 0), x + (null !== (_d = color.x1) && void 0 !== _d ? _d : .5) * w, y + (null !== (_e = color.y1) && void 0 !== _e ? _e : .5) * h, Math.max(w, h) * (null !== (_f = color.r1) && void 0 !== _f ? _f : .5));
51
44
  return color.stops.forEach((stop => {
52
45
  canvasGradient.addColorStop(stop.offset, stop.color);
53
46
  })), canvasGradient;
54
47
  }
55
48
 
56
- function createConicGradient(context, color, params, offsetX = 0, offsetY = 0) {
49
+ function createConicGradient(context, color, x, y, w, h) {
57
50
  var _a, _b;
58
- const bounds = params.AABBBounds;
59
- if (!bounds) return;
60
- let w = bounds.x2 - bounds.x1, h = bounds.y2 - bounds.y1, x = bounds.x1 - offsetX, y = bounds.y1 - offsetY;
61
- if (params.attribute) {
62
- const {scaleX: scaleX = 1, scaleY: scaleY = 1} = params.attribute;
63
- if (scaleX * scaleY == 0) return;
64
- w /= scaleX, h /= scaleY, x /= scaleX, y /= scaleY;
65
- }
66
51
  const canvasGradient = context.createConicGradient(x + (null !== (_a = color.x) && void 0 !== _a ? _a : 0) * w, y + (null !== (_b = color.y) && void 0 !== _b ? _b : 0) * h, color.startAngle, color.endAngle);
67
52
  return color.stops.forEach((stop => {
68
53
  canvasGradient.addColorStop(stop.offset, stop.color);
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/common/canvas-utils.ts"],"names":[],"mappings":";;;AAIA,6CAAoD;AACpD,+CAA+C;AAE/C,SAAgB,eAAe,CAAC,OAAmB,EAAE,KAAa,EAAE,GAAW;IAC7E,IAAI,WAAW,GAAG,KAAK,CAAC;IACxB,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,OAAO,CAAC,aAAa,CAAC;IAC7C,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;IACvD,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAA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B,MAAM,EAAE,MAAM,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,EAAE,GAAG,MAAM,CAAC,SAAS,CAAC;QACpD,IAAI,MAAM,GAAG,MAAM,KAAK,CAAC,EAAE;YACzB,OAAO;SACR;QACD,CAAC,IAAI,MAAM,CAAC;QACZ,CAAC,IAAI,MAAM,CAAC;QACZ,CAAC,IAAI,MAAM,CAAC;QACZ,CAAC,IAAI,MAAM,CAAC;KACb;IAED,MAAM,cAAc,GAAG,OAAO,CAAC,mBAAmB,CAChD,CAAC,GAAG,CAAC,MAAA,KAAK,CAAC,CAAC,mCAAI,CAAC,CAAC,GAAG,CAAC,EACtB,CAAC,GAAG,CAAC,MAAA,KAAK,CAAC,CAAC,mCAAI,CAAC,CAAC,GAAG,CAAC,EACtB,KAAK,CAAC,UAAU,EAChB,KAAK,CAAC,QAAQ,CACf,CAAC;IACF,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;QACzB,cAAc,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;IAEH,IAAI,UAAU,CAAC;IACf,OAAQ,cAAsB,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,UAAU,CAAC,CAAC;AACtE,CAAC","file":"canvas-utils.js","sourcesContent":["import type { IColor, IConicalGradient, ILinearGradient, IRadialGradient } from '../interface/color';\nimport type { IContext2d, ITransform } from '../interface';\nimport { ICommonStyleParams } from '../interface';\nimport type { IBoundsLike } from '@visactor/vutils';\nimport { IMatrix, isArray } from '@visactor/vutils';\nimport { GradientParser } from './color-utils';\n\nexport function getScaledStroke(context: IContext2d, width: number, dpr: number) {\n let strokeWidth = width;\n const { a, b, c, d } = context.currentMatrix;\n const scaleX = Math.sign(a) * Math.sqrt(a * a + b * b);\n const scaleY = Math.sign(d) * Math.sqrt(c * c + d * d);\n // 如果没有scaleX和scaleY,那么认为什么都不用绘制\n if (scaleX + scaleY === 0) {\n return 0;\n }\n strokeWidth = (strokeWidth / Math.abs(scaleX + scaleY)) * 2 * dpr;\n return strokeWidth;\n}\n\nexport function createColor(\n context: IContext2d,\n c: string | IColor | Array<string | IColor> | boolean,\n params: { AABBBounds?: IBoundsLike; attribute?: Partial<ITransform> },\n offsetX: number,\n offsetY: number\n): string | CanvasGradient {\n if (!c || c === true) {\n return 'black';\n }\n let result: string | CanvasGradient | undefined;\n let color: string | IColor;\n if (isArray(c)) {\n for (let i = 0; i < c.length; i++) {\n color = c[i];\n if (color) {\n break;\n }\n }\n } else {\n color = c;\n }\n color = GradientParser.Parse(color);\n if (typeof color === 'string') {\n return color;\n }\n // TODO 不同scaleCenter有问题\n if (color.gradient === 'linear') {\n result = createLinearGradient(context, color, params, offsetX, offsetY);\n } else if (color.gradient === 'conical') {\n result = createConicGradient(context, color, params, offsetX, offsetY);\n } else if (color.gradient === 'radial') {\n result = createRadialGradient(context, color, params, offsetX, offsetY);\n }\n return result || 'orange';\n}\n\nfunction createLinearGradient(\n context: IContext2d,\n color: ILinearGradient,\n params: { AABBBounds?: IBoundsLike; attribute?: Partial<ITransform> },\n offsetX: number = 0,\n offsetY: number = 0\n) {\n const bounds = params.AABBBounds;\n if (!bounds) {\n return;\n }\n let w = bounds.x2 - bounds.x1;\n let h = bounds.y2 - bounds.y1;\n let x = bounds.x1 - offsetX;\n let y = bounds.y1 - offsetY;\n if (params.attribute) {\n const { scaleX = 1, scaleY = 1 } = params.attribute;\n if (scaleX * scaleY === 0) {\n return;\n }\n w /= scaleX;\n h /= scaleY;\n x /= scaleX;\n y /= scaleY;\n }\n\n const canvasGradient = context.createLinearGradient(\n x + (color.x0 ?? 0) * w,\n y + (color.y0 ?? 0) * h,\n x + (color.x1 ?? 1) * w,\n y + (color.y1 ?? 0) * h\n );\n color.stops.forEach(stop => {\n canvasGradient.addColorStop(stop.offset, stop.color);\n });\n return canvasGradient;\n}\n\nfunction createRadialGradient(\n context: IContext2d,\n color: IRadialGradient,\n params: { AABBBounds?: IBoundsLike; attribute?: Partial<ITransform> },\n offsetX: number = 0,\n offsetY: number = 0\n) {\n const bounds = params.AABBBounds;\n if (!bounds) {\n return;\n }\n let w = bounds.x2 - bounds.x1;\n let h = bounds.y2 - bounds.y1;\n let x = bounds.x1 - offsetX;\n let y = bounds.y1 - offsetY;\n if (params.attribute) {\n const { scaleX = 1, scaleY = 1 } = params.attribute;\n if (scaleX * scaleY === 0) {\n return;\n }\n x /= scaleX;\n y /= scaleY;\n w /= scaleX;\n h /= scaleY;\n }\n const canvasGradient = context.createRadialGradient(\n x + (color.x0 ?? 0.5) * w,\n y + (color.y0 ?? 0.5) * h,\n Math.max(w, h) * (color.r0 ?? 0),\n x + (color.x1 ?? 0.5) * w,\n y + (color.y1 ?? 0.5) * h,\n Math.max(w, h) * (color.r1 ?? 0.5)\n );\n color.stops.forEach(stop => {\n canvasGradient.addColorStop(stop.offset, stop.color);\n });\n return canvasGradient;\n}\n\nfunction createConicGradient(\n context: IContext2d,\n color: IConicalGradient,\n params: { AABBBounds?: IBoundsLike; attribute?: Partial<ITransform> },\n offsetX: number = 0,\n offsetY: number = 0\n) {\n const bounds = params.AABBBounds;\n if (!bounds) {\n return;\n }\n let w = bounds.x2 - bounds.x1;\n let h = bounds.y2 - bounds.y1;\n let x = bounds.x1 - offsetX;\n let y = bounds.y1 - offsetY;\n if (params.attribute) {\n const { scaleX = 1, scaleY = 1 } = params.attribute;\n if (scaleX * scaleY === 0) {\n return;\n }\n w /= scaleX;\n h /= scaleY;\n x /= scaleX;\n y /= scaleY;\n }\n\n const canvasGradient = context.createConicGradient(\n x + (color.x ?? 0) * w,\n y + (color.y ?? 0) * h,\n color.startAngle,\n color.endAngle\n );\n color.stops.forEach(stop => {\n canvasGradient.addColorStop(stop.offset, stop.color);\n });\n\n let deltaAngle;\n return (canvasGradient as any).GetPattern(w + x, h + y, deltaAngle);\n}\n"]}
1
+ {"version":3,"sources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AAC,EAAE,CAAC,GAAG,CAAC,EAAE,UAAU,CAAC,CAAC;AACtE,CAAC","file":"canvas-utils.js","sourcesContent":["import type { IColor, IConicalGradient, ILinearGradient, IRadialGradient } from '../interface/color';\nimport type { IContext2d, ITransform } from '../interface';\nimport type { IBoundsLike } from '@visactor/vutils';\nimport { isArray } from '@visactor/vutils';\nimport { GradientParser } from './color-utils';\n\nexport function getScaledStroke(context: IContext2d, width: number, dpr: number) {\n let strokeWidth = width;\n const { a, b, c, d } = context.currentMatrix;\n const scaleX = Math.sign(a) * Math.sqrt(a * a + b * b);\n const scaleY = Math.sign(d) * Math.sqrt(c * c + d * d);\n // 如果没有scaleX和scaleY,那么认为什么都不用绘制\n if (scaleX + scaleY === 0) {\n return 0;\n }\n strokeWidth = (strokeWidth / Math.abs(scaleX + scaleY)) * 2 * dpr;\n return strokeWidth;\n}\n\nexport function createColor(\n context: IContext2d,\n c: string | IColor | Array<string | IColor> | boolean,\n params: { AABBBounds?: IBoundsLike; attribute?: Partial<ITransform> },\n offsetX: number = 0,\n offsetY: number = 0\n): string | CanvasGradient {\n if (!c || c === true) {\n return 'black';\n }\n let result: string | CanvasGradient | undefined;\n let color: string | IColor;\n if (isArray(c)) {\n for (let i = 0; i < c.length; i++) {\n color = c[i];\n if (color) {\n break;\n }\n }\n } else {\n color = c;\n }\n color = GradientParser.Parse(color);\n if (typeof color === 'string') {\n return color;\n }\n if (params.AABBBounds && (!params.attribute || params.attribute.scaleX !== 0 || params.attribute.scaleY !== 0)) {\n const bounds = params.AABBBounds;\n let w = bounds.x2 - bounds.x1;\n let h = bounds.y2 - bounds.y1;\n let x = bounds.x1 - offsetX;\n let y = bounds.y1 - offsetY;\n if (params.attribute) {\n const { scaleX = 1, scaleY = 1 } = params.attribute;\n w /= scaleX;\n h /= scaleY;\n x /= scaleX;\n y /= scaleY;\n }\n // TODO 不同scaleCenter有问题\n if (color.gradient === 'linear') {\n result = createLinearGradient(context, color, x, y, w, h);\n } else if (color.gradient === 'conical') {\n result = createConicGradient(context, color, x, y, w, h);\n } else if (color.gradient === 'radial') {\n result = createRadialGradient(context, color, x, y, w, h);\n }\n }\n return result || 'orange';\n}\n\nfunction createLinearGradient(context: IContext2d, color: ILinearGradient, x: number, y: number, w: number, h: number) {\n const canvasGradient = context.createLinearGradient(\n x + (color.x0 ?? 0) * w,\n y + (color.y0 ?? 0) * h,\n x + (color.x1 ?? 1) * w,\n y + (color.y1 ?? 0) * h\n );\n color.stops.forEach(stop => {\n canvasGradient.addColorStop(stop.offset, stop.color);\n });\n return canvasGradient;\n}\n\nfunction createRadialGradient(context: IContext2d, color: IRadialGradient, x: number, y: number, w: number, h: number) {\n const canvasGradient = context.createRadialGradient(\n x + (color.x0 ?? 0.5) * w,\n y + (color.y0 ?? 0.5) * h,\n Math.max(w, h) * (color.r0 ?? 0),\n x + (color.x1 ?? 0.5) * w,\n y + (color.y1 ?? 0.5) * h,\n Math.max(w, h) * (color.r1 ?? 0.5)\n );\n color.stops.forEach(stop => {\n canvasGradient.addColorStop(stop.offset, stop.color);\n });\n return canvasGradient;\n}\n\nfunction createConicGradient(context: IContext2d, color: IConicalGradient, x: number, y: number, w: number, h: number) {\n const canvasGradient = context.createConicGradient(\n x + (color.x ?? 0) * w,\n y + (color.y ?? 0) * h,\n color.startAngle,\n color.endAngle\n );\n color.stops.forEach(stop => {\n canvasGradient.addColorStop(stop.offset, stop.color);\n });\n\n let deltaAngle;\n return (canvasGradient as any).GetPattern(w + x, h + y, deltaAngle);\n}\n"]}
@@ -1,5 +1,13 @@
1
- import type { mat4, vec3 } from '@visactor/vutils';
2
- export declare function lookAt(out: mat4, eye: vec3, center: vec3, up: vec3): Float32Array | [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number];
1
+ import type { IMatrix, mat4, vec3 } from '@visactor/vutils';
2
+ export declare function identityMat4(out: mat4): mat4;
3
+ export declare function rotateX(out: mat4, a: mat4, rad: number): mat4;
4
+ export declare function rotateY(out: mat4, a: mat4, rad: number): mat4;
5
+ export declare function rotateZ(out: mat4, a: mat4, rad: number): mat4;
6
+ export declare function translate(out: mat4, a: mat4, v: vec3): mat4;
7
+ export declare function mat3Tomat4(out: mat4, b: IMatrix): void;
8
+ export declare function multiplyMat4Mat3(out: mat4, a: mat4, b: IMatrix): mat4;
9
+ export declare function scaleMat4(out: mat4, a: mat4, v: vec3): mat4;
10
+ export declare function multiplyMat4Mat4(out: mat4, a: mat4, b: mat4): mat4;
11
+ export declare function lookAt(out: mat4, eye: vec3, center: vec3, up: vec3): mat4;
3
12
  export declare function ortho(out: mat4, left: number, right: number, bottom: number, top: number, near: number, far: number): mat4;
4
- export declare function multiply(out: mat4, a: mat4, b: mat4): mat4;
5
13
  export declare function transformMat4(out: vec3, a: vec3, m: mat4): vec3;
@@ -2,14 +2,104 @@
2
2
 
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
- }), exports.transformMat4 = exports.multiply = exports.ortho = exports.lookAt = void 0;
5
+ }), exports.transformMat4 = exports.ortho = exports.lookAt = exports.multiplyMat4Mat4 = exports.scaleMat4 = exports.multiplyMat4Mat3 = exports.mat3Tomat4 = exports.translate = exports.rotateZ = exports.rotateY = exports.rotateX = exports.identityMat4 = void 0;
6
6
 
7
- const vutils_1 = require("@visactor/vutils"), matrix_allocate_1 = require("../allocator/matrix-allocate");
7
+ const vutils_1 = require("@visactor/vutils");
8
+
9
+ function identityMat4(out) {
10
+ return out[0] = 1, out[1] = 0, out[2] = 0, out[3] = 0, out[4] = 0, out[5] = 1, out[6] = 0,
11
+ out[7] = 0, out[8] = 0, out[9] = 0, out[10] = 1, out[11] = 0, out[12] = 0, out[13] = 0,
12
+ out[14] = 0, out[15] = 1, out;
13
+ }
14
+
15
+ function rotateX(out, a, rad) {
16
+ const s = Math.sin(rad), c = Math.cos(rad), a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7], a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];
17
+ return a !== out && (out[0] = a[0], out[1] = a[1], out[2] = a[2], out[3] = a[3],
18
+ out[12] = a[12], out[13] = a[13], out[14] = a[14], out[15] = a[15]), out[4] = a10 * c + a20 * s,
19
+ out[5] = a11 * c + a21 * s, out[6] = a12 * c + a22 * s, out[7] = a13 * c + a23 * s,
20
+ out[8] = a20 * c - a10 * s, out[9] = a21 * c - a11 * s, out[10] = a22 * c - a12 * s,
21
+ out[11] = a23 * c - a13 * s, out;
22
+ }
23
+
24
+ function rotateY(out, a, rad) {
25
+ const s = Math.sin(rad), c = Math.cos(rad), a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3], a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];
26
+ return a !== out && (out[4] = a[4], out[5] = a[5], out[6] = a[6], out[7] = a[7],
27
+ out[12] = a[12], out[13] = a[13], out[14] = a[14], out[15] = a[15]), out[0] = a00 * c - a20 * s,
28
+ out[1] = a01 * c - a21 * s, out[2] = a02 * c - a22 * s, out[3] = a03 * c - a23 * s,
29
+ out[8] = a00 * s + a20 * c, out[9] = a01 * s + a21 * c, out[10] = a02 * s + a22 * c,
30
+ out[11] = a03 * s + a23 * c, out;
31
+ }
32
+
33
+ function rotateZ(out, a, rad) {
34
+ const s = Math.sin(rad), c = Math.cos(rad), a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3], a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];
35
+ return a !== out && (out[8] = a[8], out[9] = a[9], out[10] = a[10], out[11] = a[11],
36
+ out[12] = a[12], out[13] = a[13], out[14] = a[14], out[15] = a[15]), out[0] = a00 * c + a10 * s,
37
+ out[1] = a01 * c + a11 * s, out[2] = a02 * c + a12 * s, out[3] = a03 * c + a13 * s,
38
+ out[4] = a10 * c - a00 * s, out[5] = a11 * c - a01 * s, out[6] = a12 * c - a02 * s,
39
+ out[7] = a13 * c - a03 * s, out;
40
+ }
41
+
42
+ function translate(out, a, v) {
43
+ const x = v[0], y = v[1], z = v[2];
44
+ let a00, a01, a02, a03, a10, a11, a12, a13, a20, a21, a22, a23;
45
+ return a === out ? (out[12] = a[0] * x + a[4] * y + a[8] * z + a[12], out[13] = a[1] * x + a[5] * y + a[9] * z + a[13],
46
+ out[14] = a[2] * x + a[6] * y + a[10] * z + a[14], out[15] = a[3] * x + a[7] * y + a[11] * z + a[15]) : (a00 = a[0],
47
+ a01 = a[1], a02 = a[2], a03 = a[3], a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7],
48
+ a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11], out[0] = a00, out[1] = a01, out[2] = a02,
49
+ out[3] = a03, out[4] = a10, out[5] = a11, out[6] = a12, out[7] = a13, out[8] = a20,
50
+ out[9] = a21, out[10] = a22, out[11] = a23, out[12] = a00 * x + a10 * y + a20 * z + a[12],
51
+ out[13] = a01 * x + a11 * y + a21 * z + a[13], out[14] = a02 * x + a12 * y + a22 * z + a[14],
52
+ out[15] = a03 * x + a13 * y + a23 * z + a[15]), out;
53
+ }
54
+
55
+ function mat3Tomat4(out, b) {
56
+ out[0] = b.a, out[1] = b.b, out[2] = 0, out[3] = 0, out[4] = b.c, out[5] = b.d,
57
+ out[6] = 0, out[7] = 0, out[8] = 0, out[9] = 0, out[10] = 1, out[11] = 0, out[12] = b.e,
58
+ out[13] = b.f, out[14] = 0, out[15] = 1;
59
+ }
60
+
61
+ function multiplyMat4Mat3(out, a, b) {
62
+ const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3], a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7], a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11], a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];
63
+ let b0 = b.a, b1 = b.b, b2 = 0, b3 = 0;
64
+ return out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30, out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31,
65
+ out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32, out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33,
66
+ b0 = b.c, b1 = b.d, b2 = 0, b3 = 0, out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30,
67
+ out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31, out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32,
68
+ out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33, b0 = 0, b1 = 0, b2 = 1, b3 = 0,
69
+ out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30, out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31,
70
+ out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32, out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33,
71
+ b0 = b.e, b1 = b.f, b2 = 0, b3 = 1, out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30,
72
+ out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31, out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32,
73
+ out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33, out;
74
+ }
75
+
76
+ function scaleMat4(out, a, v) {
77
+ const x = v[0], y = v[1], z = v[2];
78
+ return out[0] = a[0] * x, out[1] = a[1] * x, out[2] = a[2] * x, out[3] = a[3] * x,
79
+ out[4] = a[4] * y, out[5] = a[5] * y, out[6] = a[6] * y, out[7] = a[7] * y, out[8] = a[8] * z,
80
+ out[9] = a[9] * z, out[10] = a[10] * z, out[11] = a[11] * z, out[12] = a[12], out[13] = a[13],
81
+ out[14] = a[14], out[15] = a[15], out;
82
+ }
83
+
84
+ function multiplyMat4Mat4(out, a, b) {
85
+ const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3], a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7], a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11], a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];
86
+ let b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3];
87
+ return out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30, out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31,
88
+ out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32, out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33,
89
+ b0 = b[4], b1 = b[5], b2 = b[6], b3 = b[7], out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30,
90
+ out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31, out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32,
91
+ out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33, b0 = b[8], b1 = b[9], b2 = b[10],
92
+ b3 = b[11], out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30, out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31,
93
+ out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32, out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33,
94
+ b0 = b[12], b1 = b[13], b2 = b[14], b3 = b[15], out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30,
95
+ out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31, out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32,
96
+ out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33, out;
97
+ }
8
98
 
9
99
  function lookAt(out, eye, center, up) {
10
100
  let x0, x1, x2, y0, y1, y2, z0, z1, z2, len;
11
101
  const eyex = eye[0], eyey = eye[1], eyez = eye[2], upx = up[0], upy = up[1], upz = up[2], centerx = center[0], centery = center[1], centerz = center[2];
12
- return Math.abs(eyex - centerx) < vutils_1.epsilon && Math.abs(eyey - centery) < vutils_1.epsilon && Math.abs(eyez - centerz) < vutils_1.epsilon ? matrix_allocate_1.DefaultMat4Allocate.identity(out) : (z0 = eyex - centerx,
102
+ return Math.abs(eyex - centerx) < vutils_1.epsilon && Math.abs(eyey - centery) < vutils_1.epsilon && Math.abs(eyez - centerz) < vutils_1.epsilon ? identityMat4(out) : (z0 = eyex - centerx,
13
103
  z1 = eyey - centery, z2 = eyez - centerz, len = 1 / Math.hypot(z0, z1, z2), z0 *= len,
14
104
  z1 *= len, z2 *= len, x0 = upy * z2 - upz * z1, x1 = upz * z0 - upx * z2, x2 = upx * z1 - upy * z0,
15
105
  len = Math.hypot(x0, x1, x2), len ? (len = 1 / len, x0 *= len, x1 *= len, x2 *= len) : (x0 = 0,
@@ -28,21 +118,6 @@ function ortho(out, left, right, bottom, top, near, far) {
28
118
  out[13] = (top + bottom) * bt, out[14] = (far + near) * nf, out[15] = 1, out;
29
119
  }
30
120
 
31
- function multiply(out, a, b) {
32
- const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3], a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7], a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11], a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];
33
- let b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3];
34
- return out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30, out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31,
35
- out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32, out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33,
36
- b0 = b[4], b1 = b[5], b2 = b[6], b3 = b[7], out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30,
37
- out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31, out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32,
38
- out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33, b0 = b[8], b1 = b[9], b2 = b[10],
39
- b3 = b[11], out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30, out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31,
40
- out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32, out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33,
41
- b0 = b[12], b1 = b[13], b2 = b[14], b3 = b[15], out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30,
42
- out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31, out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32,
43
- out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33, out;
44
- }
45
-
46
121
  function transformMat4(out, a, m) {
47
122
  const x = a[0], y = a[1], z = a[2];
48
123
  let w = m[3] * x + m[7] * y + m[11] * z + m[15];
@@ -50,5 +125,8 @@ function transformMat4(out, a, m) {
50
125
  out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w, out;
51
126
  }
52
127
 
53
- exports.lookAt = lookAt, exports.ortho = ortho, exports.multiply = multiply, exports.transformMat4 = transformMat4;
128
+ exports.identityMat4 = identityMat4, exports.rotateX = rotateX, exports.rotateY = rotateY,
129
+ exports.rotateZ = rotateZ, exports.translate = translate, exports.mat3Tomat4 = mat3Tomat4,
130
+ exports.multiplyMat4Mat3 = multiplyMat4Mat3, exports.scaleMat4 = scaleMat4, exports.multiplyMat4Mat4 = multiplyMat4Mat4,
131
+ exports.lookAt = lookAt, exports.ortho = ortho, exports.transformMat4 = transformMat4;
54
132
  //# sourceMappingURL=matrix.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/common/matrix.ts"],"names":[],"mappings":";;;AAKA,6CAA2C;AAC3C,kEAAmE;AA+TnE,SAAgB,MAAM,CAAC,GAAS,EAAE,GAAS,EAAE,MAAY,EAAE,EAAQ;IACjE,IAAI,EAAE,CAAC;IACP,IAAI,EAAE,CAAC;IACP,IAAI,EAAE,CAAC;IACP,IAAI,EAAE,CAAC;IACP,IAAI,EAAE,CAAC;IACP,IAAI,EAAE,CAAC;IACP,IAAI,EAAE,CAAC;IACP,IAAI,EAAE,CAAC;IACP,IAAI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AAC;IACf,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;IAChD,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC;IACb,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;IACtD,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;IACtD,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;IACvD,OAAO,GAAG,CAAC;AACb,CAAC;AAVD,sCAUC","file":"matrix.js","sourcesContent":["// import { abs, cos, epsilon, sin } from '@visactor/vutils';\n// import { IMatrix } from '../interface/matrix';\n// import { IBounds, IPoint } from '../interface/util';\n\nimport type { mat4, vec3 } from '@visactor/vutils';\nimport { epsilon } from '@visactor/vutils';\nimport { DefaultMat4Allocate } from '../allocator/matrix-allocate';\n\n// export type vec2 = [number, number] | Float32Array;\n// export type vec3 = [number, number, number] | Float32Array;\n// export type vec4 = [number, number, number, number] | Float32Array;\n// export type mat4 =\n// | [\n// number,\n// number,\n// number,\n// number,\n// number,\n// number,\n// number,\n// number,\n// number,\n// number,\n// number,\n// number,\n// number,\n// number,\n// number,\n// number\n// ]\n// | Float32Array;\n\n// export class Matrix implements IMatrix {\n// /**\n// * scale x\n// */\n// a: number;\n// /**\n// * skew y\n// */\n// b: number;\n// /**\n// * skewx\n// */\n// c: number;\n// /**\n// * scale y\n// */\n// d: number;\n// /**\n// * translate x\n// */\n// e: number;\n// /**\n// * translate y\n// */\n// f: number;\n\n// // todo setScale需要sx,sy初始值为1\n// constructor(a?: number, b?: number, c?: number, d?: number, e?: number, f?: number) {\n// // 暂时不需要初始化\n// this.a = a ?? 1;\n// this.b = b ?? 0;\n// this.c = c ?? 0;\n// this.d = d ?? 1;\n// this.e = e ?? 0;\n// this.f = f ?? 0;\n// }\n\n// setValue(a: number, b: number, c: number, d: number, e: number, f: number) {\n// this.a = a;\n// this.b = b;\n// this.c = c;\n// this.d = d;\n// this.e = e;\n// this.f = f;\n// return this;\n// }\n\n// reset(): this {\n// this.a = 1;\n// this.b = 0;\n// this.c = 0;\n// this.d = 1;\n// this.e = 0;\n// this.f = 0;\n// return this;\n// }\n\n// /**\n// * 获取当前矩阵的逆矩阵\n// */\n// getInverse() {\n// const a = this.a;\n// const b = this.b;\n// const c = this.c;\n// const d = this.d;\n// const e = this.e;\n// const f = this.f;\n// const m = new Matrix();\n// const dt = a * d - b * c;\n\n// m.a = d / dt;\n// m.b = -b / dt;\n// m.c = -c / dt;\n// m.d = a / dt;\n// m.e = (c * f - d * e) / dt;\n// m.f = -(a * f - b * e) / dt;\n\n// return m;\n// }\n\n// rotate(rad: number) {\n// const c = Math.cos(rad);\n// const s = Math.sin(rad);\n// const m11 = this.a * c + this.c * s;\n// const m12 = this.b * c + this.d * s;\n// const m21 = this.a * -s + this.c * c;\n// const m22 = this.b * -s + this.d * c;\n// this.a = m11;\n// this.b = m12;\n// this.c = m21;\n// this.d = m22;\n// return this;\n// }\n\n// scale(sx: number, sy: number) {\n// this.a *= sx;\n// this.b *= sx;\n// this.c *= sy;\n// this.d *= sy;\n// return this;\n// }\n\n// setScale(sx: number, sy: number) {\n// this.b = (this.b / this.a) * sx;\n// this.c = (this.c / this.d) * sy;\n// this.a = sx;\n// this.d = sy;\n// return this;\n// }\n\n// transform(a: number, b: number, c: number, d: number, e: number, f: number) {\n// this.multiply(a, b, c, d, e, f);\n// return this;\n// }\n// translate(x: number, y: number) {\n// this.e += this.a * x + this.c * y;\n// this.f += this.b * x + this.d * y;\n// return this;\n// }\n// /**\n// * 矩阵相乘\n// * @param matrix\n// */\n// multiply(a2: number, b2: number, c2: number, d2: number, e2: number, f2: number) {\n// const a1 = this.a;\n// const b1 = this.b;\n// const c1 = this.c;\n// const d1 = this.d;\n// const e1 = this.e;\n// const f1 = this.f;\n\n// const m11 = a1 * a2 + c1 * b2;\n// const m12 = b1 * a2 + d1 * b2;\n// const m21 = a1 * c2 + c1 * d2;\n// const m22 = b1 * c2 + d1 * d2;\n// const dx = a1 * e2 + c1 * f2 + e1;\n// const dy = b1 * e2 + d1 * f2 + f1;\n\n// this.a = m11;\n// this.b = m12;\n// this.c = m21;\n// this.d = m22;\n// this.e = dx;\n// this.f = dy;\n// return this;\n// }\n// /**\n// * 插值计算\n// * @param m2\n// * @param t\n// */\n// interpolate(m2: Matrix, t: number) {\n// const m = new Matrix();\n\n// m.a = this.a + (m2.a - this.a) * t;\n// m.b = this.b + (m2.b - this.b) * t;\n// m.c = this.c + (m2.c - this.c) * t;\n// m.d = this.d + (m2.d - this.d) * t;\n// m.e = this.e + (m2.e - this.e) * t;\n// m.f = this.f + (m2.f - this.f) * t;\n\n// return m;\n// }\n\n// /**\n// * 将point转到当前矩阵的坐标空间中\n// * @param source\n// * @param target\n// */\n// transformPoint(source: IPoint, target: IPoint) {\n// const { a, b, c, d, e, f } = this;\n// const dt = a * d - b * c;\n\n// const nextA = d / dt;\n// const nextB = -b / dt;\n// const nextC = -c / dt;\n// const nextD = a / dt;\n// const nextE = (c * f - d * e) / dt;\n// const nextF = -(a * f - b * e) / dt;\n\n// const { x, y } = source;\n// target.x = x * nextA + y * nextC + nextE;\n// target.y = x * nextB + y * nextD + nextF;\n// }\n\n// // 只有translate\n// onlyTranslate(): boolean {\n// return this.a === 1 && this.b === 0 && this.c === 0 && this.d === 1;\n// }\n\n// clone(): Matrix {\n// return new Matrix(this.a, this.b, this.c, this.d, this.e, this.f);\n// }\n// }\n\n// /**\n// * 依据graphic的属性对bounds进行变换\n// * @param bounds\n// * @param x\n// * @param y\n// * @param scaleX\n// * @param scaleY\n// * @param angle\n// * @param rotateCenter\n// */\n// export function transformBounds(\n// bounds: IBounds,\n// x: number,\n// y: number,\n// scaleX: number,\n// scaleY: number,\n// angle: number,\n// rotateCenter?: [number, number]\n// ) {\n// if (abs(scaleX) <= epsilon || abs(scaleY) <= epsilon) {\n// return;\n// }\n\n// scaleX !== 1 && bounds.scaleX(scaleX);\n// scaleY !== 1 && bounds.scaleY(scaleY);\n\n// if (isFinite(angle) && Math.abs(angle) > epsilon) {\n// let rx = 0;\n// let ry = 0;\n// if (rotateCenter !== undefined) {\n// rx = rotateCenter[0];\n// ry = rotateCenter[1];\n// }\n// bounds.rotate(angle, rx, ry);\n// }\n\n// bounds.translate(x, y);\n// }\n// export function transformBoundsWithMatrix(bounds: IBounds, matrix: IMatrix): IBounds {\n// const { x1, y1, x2, y2 } = bounds;\n// // 如果没有旋转和缩放,那就直接translate\n// if (matrix.onlyTranslate()) {\n// bounds.translate(matrix.e, matrix.f);\n// return bounds;\n// }\n// bounds.x1 = matrix.a * x1 + matrix.c * y1 + matrix.e;\n// bounds.y1 = matrix.b * x1 + matrix.d * y1 + matrix.f;\n// bounds.x2 = matrix.a * x2 + matrix.c * y2 + matrix.e;\n// bounds.y2 = matrix.b * x2 + matrix.d * y2 + matrix.f;\n// bounds.clear();\n// bounds.add(x1, y1);\n// bounds.add(x2, y2);\n// return bounds;\n// }\n\n// export function normalTransform(\n// out: Matrix,\n// origin: Matrix,\n// x: number,\n// y: number,\n// scaleX: number,\n// scaleY: number,\n// angle: number,\n// rotateCenter?: vec2\n// ) {\n// const oa = origin.a;\n// const ob = origin.b;\n// const oc = origin.c;\n// const od = origin.d;\n// const oe = origin.e;\n// const of = origin.f;\n// const cosTheta = cos(angle);\n// const sinTheta = sin(angle);\n// let rotateCenterX: number;\n// let rotateCenterY: number;\n// if (rotateCenter) {\n// rotateCenterX = rotateCenter[0];\n// rotateCenterY = rotateCenter[1];\n// } else {\n// rotateCenterX = x;\n// rotateCenterY = y;\n// }\n// const offsetX = rotateCenterX - x;\n// const offsetY = rotateCenterY - y;\n\n// const a1 = oa * cosTheta + oc * sinTheta;\n// const b1 = ob * cosTheta + od * sinTheta;\n// const c1 = oc * cosTheta - oa * sinTheta;\n// const d1 = od * cosTheta - ob * sinTheta;\n// out.a = scaleX * a1;\n// out.b = scaleX * b1;\n// out.c = scaleY * c1;\n// out.d = scaleY * d1;\n\n// out.e = oe + oa * rotateCenterX + oc * rotateCenterY - a1 * offsetX - c1 * offsetY;\n// out.f = of + ob * rotateCenterX + od * rotateCenterY - b1 * offsetX - d1 * offsetY;\n// }\n// 代码来自gl-matrix https://github.com/toji/gl-matrix\nexport function lookAt(out: mat4, eye: vec3, center: vec3, up: vec3) {\n let x0;\n let x1;\n let x2;\n let y0;\n let y1;\n let y2;\n let z0;\n let z1;\n let z2;\n let len;\n const eyex = eye[0];\n const eyey = eye[1];\n const eyez = eye[2];\n const upx = up[0];\n const upy = up[1];\n const upz = up[2];\n const centerx = center[0];\n const centery = center[1];\n const centerz = center[2];\n\n if (Math.abs(eyex - centerx) < epsilon && Math.abs(eyey - centery) < epsilon && Math.abs(eyez - centerz) < epsilon) {\n return DefaultMat4Allocate.identity(out);\n }\n\n z0 = eyex - centerx;\n z1 = eyey - centery;\n z2 = eyez - centerz;\n len = 1 / Math.hypot(z0, z1, z2);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n x0 = upy * z2 - upz * z1;\n x1 = upz * z0 - upx * z2;\n x2 = upx * z1 - upy * z0;\n len = Math.hypot(x0, x1, x2);\n\n if (!len) {\n x0 = 0;\n x1 = 0;\n x2 = 0;\n } else {\n len = 1 / len;\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n\n y0 = z1 * x2 - z2 * x1;\n y1 = z2 * x0 - z0 * x2;\n y2 = z0 * x1 - z1 * x0;\n len = Math.hypot(y0, y1, y2);\n\n if (!len) {\n y0 = 0;\n y1 = 0;\n y2 = 0;\n } else {\n len = 1 / len;\n y0 *= len;\n y1 *= len;\n y2 *= len;\n }\n\n out[0] = x0;\n out[1] = y0;\n out[2] = z0;\n out[3] = 0;\n out[4] = x1;\n out[5] = y1;\n out[6] = z1;\n out[7] = 0;\n out[8] = x2;\n out[9] = y2;\n out[10] = z2;\n out[11] = 0;\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\n out[15] = 1;\n return out;\n}\n\n/**\n * 代码来自gl-matrix https://github.com/toji/gl-matrix\n * Generates a orthogonal projection matrix with the given bounds\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {number} left Left bound of the frustum\n * @param {number} right Right bound of the frustum\n * @param {number} bottom Bottom bound of the frustum\n * @param {number} top Top bound of the frustum\n * @param {number} near Near bound of the frustum\n * @param {number} far Far bound of the frustum\n * @returns {mat4} out\n */\n\nexport function ortho(out: mat4, left: number, right: number, bottom: number, top: number, near: number, far: number) {\n const lr = 1 / (left - right);\n const bt = 1 / (bottom - top);\n const nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 2 * nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = (far + near) * nf;\n out[15] = 1;\n return out;\n}\n\n/**\n * 代码来自gl-matrix https://github.com/toji/gl-matrix\n * Multiplies two mat4s\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the first operand\n * @param {ReadonlyMat4} b the second operand\n * @returns {mat4} out\n */\n\nexport function multiply(out: mat4, a: mat4, b: mat4) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a03 = a[3];\n const a10 = a[4];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15]; // Cache only the current line of the second matrix\n\n let b0 = b[0];\n let b1 = b[1];\n let b2 = b[2];\n let b3 = b[3];\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[4];\n b1 = b[5];\n b2 = b[6];\n b3 = b[7];\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[8];\n b1 = b[9];\n b2 = b[10];\n b3 = b[11];\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[12];\n b1 = b[13];\n b2 = b[14];\n b3 = b[15];\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n return out;\n}\n\n/**\n * 代码来自gl-matrix https://github.com/toji/gl-matrix\n * Transforms the vec3 with a mat4.\n * 4th vector component is implicitly '1'\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the vector to transform\n * @param {ReadonlyMat4} m matrix to transform with\n * @returns {vec3} out\n */\n\nexport function transformMat4(out: vec3, a: vec3, m: mat4) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n let w = m[3] * x + m[7] * y + m[11] * z + m[15];\n w = w || 1.0;\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n return out;\n}\n"]}
1
+ {"version":3,"sources":["../src/common/matrix.ts"],"names":[],"mappings":";;;AAKA,6CAA2C;AA0B3C,SAAgB,YAAY,CAAC,GAAS;IACpC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACX,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACX,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACX,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACX,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACX,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACX,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACX,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACX,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACX,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACX,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IACZ,GAAG,CAAC,EA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AAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;IACvD,OAAO,GAAG,CAAC;AACb,CAAC;AAVD,sCAUC","file":"matrix.js","sourcesContent":["// import { abs, cos, epsilon, sin } from '@visactor/vutils';\n// import { IMatrix } from '../interface/matrix';\n// import { IBounds, IPoint } from '../interface/util';\n\nimport type { IMatrix, mat4, vec3 } from '@visactor/vutils';\nimport { epsilon } from '@visactor/vutils';\n\n/**\n * 部分代码参考 https://github.com/toji/gl-matrix\n * Copyright (c) 2015-2021, Brandon Jones, Colin MacKenzie IV.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n */\n\n// 代码来自gl-matrix https://github.com/toji/gl-matrix\nexport function identityMat4(out: mat4) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n\n/**\n * 代码来自gl-matrix https://github.com/toji/gl-matrix\n * Rotates a matrix by the given angle around the X axis\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\nexport function rotateX(out: mat4, a: mat4, rad: number) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const a10 = a[4];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n if (a !== out) {\n // If the source and destination differ, copy the unchanged rows\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n // Perform axis-specific matrix multiplication\n out[4] = a10 * c + a20 * s;\n out[5] = a11 * c + a21 * s;\n out[6] = a12 * c + a22 * s;\n out[7] = a13 * c + a23 * s;\n out[8] = a20 * c - a10 * s;\n out[9] = a21 * c - a11 * s;\n out[10] = a22 * c - a12 * s;\n out[11] = a23 * c - a13 * s;\n return out;\n}\n\n/**\n * 代码来自gl-matrix https://github.com/toji/gl-matrix\n * Rotates a matrix by the given angle around the Y axis\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\nexport function rotateY(out: mat4, a: mat4, rad: number) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a03 = a[3];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n if (a !== out) {\n // If the source and destination differ, copy the unchanged rows\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n // Perform axis-specific matrix multiplication\n out[0] = a00 * c - a20 * s;\n out[1] = a01 * c - a21 * s;\n out[2] = a02 * c - a22 * s;\n out[3] = a03 * c - a23 * s;\n out[8] = a00 * s + a20 * c;\n out[9] = a01 * s + a21 * c;\n out[10] = a02 * s + a22 * c;\n out[11] = a03 * s + a23 * c;\n return out;\n}\n\n/**\n * 代码来自gl-matrix https://github.com/toji/gl-matrix\n * Rotates a matrix by the given angle around the Z axis\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\nexport function rotateZ(out: mat4, a: mat4, rad: number) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a03 = a[3];\n const a10 = a[4];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged last row\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n } // Perform axis-specific matrix multiplication\n\n out[0] = a00 * c + a10 * s;\n out[1] = a01 * c + a11 * s;\n out[2] = a02 * c + a12 * s;\n out[3] = a03 * c + a13 * s;\n out[4] = a10 * c - a00 * s;\n out[5] = a11 * c - a01 * s;\n out[6] = a12 * c - a02 * s;\n out[7] = a13 * c - a03 * s;\n return out;\n}\n\n// 代码来自gl-matrix https://github.com/toji/gl-matrix\nexport function translate(out: mat4, a: mat4, v: vec3) {\n const x = v[0];\n const y = v[1];\n const z = v[2];\n let a00;\n let a01;\n let a02;\n let a03;\n let a10;\n let a11;\n let a12;\n let a13;\n let a20;\n let a21;\n let a22;\n let a23;\n if (a === out) {\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\n } else {\n a00 = a[0];\n a01 = a[1];\n a02 = a[2];\n a03 = a[3];\n a10 = a[4];\n a11 = a[5];\n a12 = a[6];\n a13 = a[7];\n a20 = a[8];\n a21 = a[9];\n a22 = a[10];\n a23 = a[11];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a03;\n out[4] = a10;\n out[5] = a11;\n out[6] = a12;\n out[7] = a13;\n out[8] = a20;\n out[9] = a21;\n out[10] = a22;\n out[11] = a23;\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\n }\n return out;\n}\n\nexport function mat3Tomat4(out: mat4, b: IMatrix) {\n out[0] = b.a;\n out[1] = b.b;\n out[2] = 0;\n out[3] = 0;\n out[4] = b.c;\n out[5] = b.d;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = b.e;\n out[13] = b.f;\n out[14] = 0;\n out[15] = 1;\n}\n\n/**\n * 代码来自gl-matrix https://github.com/toji/gl-matrix\n * Multiplies two mat4s\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the first operand\n * @param {ReadonlyMat4} b the second operand\n * @returns {mat4} out\n */\n\nexport function multiplyMat4Mat3(out: mat4, a: mat4, b: IMatrix) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a03 = a[3];\n const a10 = a[4];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15]; // Cache only the current line of the second matrix\n\n let b0 = b.a;\n let b1 = b.b;\n let b2 = 0;\n let b3 = 0;\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b.c;\n b1 = b.d;\n b2 = 0;\n b3 = 0;\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = 0;\n b1 = 0;\n b2 = 1;\n b3 = 0;\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b.e;\n b1 = b.f;\n b2 = 0;\n b3 = 1;\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n return out;\n}\n\n/**\n * 代码来自gl-matrix https://github.com/toji/gl-matrix\n * Scales the mat4 by the dimensions in the given vec3 not using vectorization\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to scale\n * @param {ReadonlyVec3} v the vec3 to scale the matrix by\n * @returns {mat4} out\n **/\nexport function scaleMat4(out: mat4, a: mat4, v: vec3) {\n const x = v[0];\n const y = v[1];\n const z = v[2];\n out[0] = a[0] * x;\n out[1] = a[1] * x;\n out[2] = a[2] * x;\n out[3] = a[3] * x;\n out[4] = a[4] * y;\n out[5] = a[5] * y;\n out[6] = a[6] * y;\n out[7] = a[7] * y;\n out[8] = a[8] * z;\n out[9] = a[9] * z;\n out[10] = a[10] * z;\n out[11] = a[11] * z;\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n}\n\n/**\n * 代码来自gl-matrix https://github.com/toji/gl-matrix\n * Multiplies two mat4s\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the first operand\n * @param {ReadonlyMat4} b the second operand\n * @returns {mat4} out\n */\nexport function multiplyMat4Mat4(out: mat4, a: mat4, b: mat4) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a03 = a[3];\n const a10 = a[4];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15]; // Cache only the current line of the second matrix\n\n let b0 = b[0];\n let b1 = b[1];\n let b2 = b[2];\n let b3 = b[3];\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[4];\n b1 = b[5];\n b2 = b[6];\n b3 = b[7];\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[8];\n b1 = b[9];\n b2 = b[10];\n b3 = b[11];\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[12];\n b1 = b[13];\n b2 = b[14];\n b3 = b[15];\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n return out;\n}\n\n// 代码来自gl-matrix https://github.com/toji/gl-matrix\nexport function lookAt(out: mat4, eye: vec3, center: vec3, up: vec3) {\n let x0;\n let x1;\n let x2;\n let y0;\n let y1;\n let y2;\n let z0;\n let z1;\n let z2;\n let len;\n const eyex = eye[0];\n const eyey = eye[1];\n const eyez = eye[2];\n const upx = up[0];\n const upy = up[1];\n const upz = up[2];\n const centerx = center[0];\n const centery = center[1];\n const centerz = center[2];\n\n if (Math.abs(eyex - centerx) < epsilon && Math.abs(eyey - centery) < epsilon && Math.abs(eyez - centerz) < epsilon) {\n return identityMat4(out);\n }\n\n z0 = eyex - centerx;\n z1 = eyey - centery;\n z2 = eyez - centerz;\n len = 1 / Math.hypot(z0, z1, z2);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n x0 = upy * z2 - upz * z1;\n x1 = upz * z0 - upx * z2;\n x2 = upx * z1 - upy * z0;\n len = Math.hypot(x0, x1, x2);\n\n if (!len) {\n x0 = 0;\n x1 = 0;\n x2 = 0;\n } else {\n len = 1 / len;\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n\n y0 = z1 * x2 - z2 * x1;\n y1 = z2 * x0 - z0 * x2;\n y2 = z0 * x1 - z1 * x0;\n len = Math.hypot(y0, y1, y2);\n\n if (!len) {\n y0 = 0;\n y1 = 0;\n y2 = 0;\n } else {\n len = 1 / len;\n y0 *= len;\n y1 *= len;\n y2 *= len;\n }\n\n out[0] = x0;\n out[1] = y0;\n out[2] = z0;\n out[3] = 0;\n out[4] = x1;\n out[5] = y1;\n out[6] = z1;\n out[7] = 0;\n out[8] = x2;\n out[9] = y2;\n out[10] = z2;\n out[11] = 0;\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\n out[15] = 1;\n return out;\n}\n\n/**\n * 代码来自gl-matrix https://github.com/toji/gl-matrix\n * Generates a orthogonal projection matrix with the given bounds\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {number} left Left bound of the frustum\n * @param {number} right Right bound of the frustum\n * @param {number} bottom Bottom bound of the frustum\n * @param {number} top Top bound of the frustum\n * @param {number} near Near bound of the frustum\n * @param {number} far Far bound of the frustum\n * @returns {mat4} out\n */\n\nexport function ortho(out: mat4, left: number, right: number, bottom: number, top: number, near: number, far: number) {\n const lr = 1 / (left - right);\n const bt = 1 / (bottom - top);\n const nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 2 * nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = (far + near) * nf;\n out[15] = 1;\n return out;\n}\n/**\n * 代码来自gl-matrix https://github.com/toji/gl-matrix\n * Transforms the vec3 with a mat4.\n * 4th vector component is implicitly '1'\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the vector to transform\n * @param {ReadonlyMat4} m matrix to transform with\n * @returns {vec3} out\n */\n\nexport function transformMat4(out: vec3, a: vec3, m: mat4) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n let w = m[3] * x + m[7] * y + m[11] * z + m[15];\n w = w || 1.0;\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n return out;\n}\n"]}
@@ -292,4 +292,4 @@ function bezierCurversToPath(bezierCurves) {
292
292
 
293
293
  exports.pathToBezierCurves = pathToBezierCurves, exports.applyTransformOnBezierCurves = applyTransformOnBezierCurves,
294
294
  exports.bezierCurversToPath = bezierCurversToPath;
295
- //# sourceMappingURL=morphing-utils.js.map
295
+ //# sourceMappingURL=morphing-utils.js.map
@@ -61,4 +61,4 @@ exports.enumCommandMap = {
61
61
  Q: 7,
62
62
  R: 8
63
63
  }, exports.parseSvgPath = parseSvgPath;
64
- //# sourceMappingURL=path-svg.js.map
64
+ //# sourceMappingURL=path-svg.js.map
@@ -39,8 +39,8 @@ function getProportionPoint(point, segment, length, dx, dy) {
39
39
  };
40
40
  }
41
41
 
42
- //# sourceMappingURL=polygon.js.map
43
42
  Object.defineProperty(exports, "__esModule", {
44
43
  value: !0
45
44
  }), exports.drawRoundedPolygon = exports.drawPolygon = void 0, exports.drawPolygon = drawPolygon,
46
- exports.drawRoundedPolygon = drawRoundedPolygon;
45
+ exports.drawRoundedPolygon = drawRoundedPolygon;
46
+ //# sourceMappingURL=polygon.js.map
@@ -24,4 +24,4 @@ const vutils_1 = require("@visactor/vutils"), normalizeRectAttributes = attribut
24
24
  };
25
25
 
26
26
  exports.normalizeRectAttributes = normalizeRectAttributes;
27
- //# sourceMappingURL=rect-utils.js.map
27
+ //# sourceMappingURL=rect-utils.js.map
@@ -121,5 +121,5 @@ function drawAreaBlock(path, topList, bottomList, params) {
121
121
  path.closePath();
122
122
  }
123
123
 
124
+ exports.drawAreaSegments = drawAreaSegments;
124
125
  //# sourceMappingURL=render-area.js.map
125
- exports.drawAreaSegments = drawAreaSegments;
@@ -14,4 +14,4 @@ function renderCommandList(commandList, context, x = 0, y = 0, sx = 1, sy = 1, z
14
14
  }
15
15
 
16
16
  exports.renderCommandList = renderCommandList;
17
- //# sourceMappingURL=render-command-list.js.map
17
+ //# sourceMappingURL=render-command-list.js.map
@@ -6,9 +6,26 @@ Object.defineProperty(exports, "__esModule", {
6
6
 
7
7
  const vutils_1 = require("@visactor/vutils"), enums_1 = require("./enums"), render_utils_1 = require("./render-utils");
8
8
 
9
- function drawSegments(path, segPath, percent, clipRangeByDimension, params) {
9
+ function drawEachCurve(path, curve, lastCurve, defined0, offsetX, offsetY, offsetZ) {
10
10
  var _a;
11
- const {offsetX: offsetX = 0, offsetY: offsetY = 0, offsetZ: offsetZ = 0, mode: mode = "none", drawConnect: drawConnect = !1, zeroX: zeroX = 0, zeroY: zeroY = 0} = params || {};
11
+ let p0 = curve.p0, newDefined0 = defined0;
12
+ if (lastCurve && lastCurve.originP1 === lastCurve.originP2 && (p0 = lastCurve.p0),
13
+ curve.defined) defined0 || (path.lineTo(p0.x + offsetX, p0.y + offsetY, offsetZ),
14
+ newDefined0 = !defined0); else {
15
+ const {originP1: originP1, originP2: originP2} = curve;
16
+ let validP;
17
+ if (originP1 && !1 !== originP1.defined ? validP = p0 : originP1 && !1 !== originP2.defined && (validP = null !== (_a = curve.p3) && void 0 !== _a ? _a : curve.p1),
18
+ defined0) {
19
+ newDefined0 = !defined0;
20
+ const x = validP ? validP.x : curve.p0.x, y = validP ? validP.y : curve.p0.y;
21
+ path.moveTo(x + offsetX, y + offsetY, offsetZ);
22
+ } else validP && (newDefined0 = !defined0, path.lineTo(validP.x + offsetX, validP.y + offsetY, offsetZ));
23
+ }
24
+ return newDefined0;
25
+ }
26
+
27
+ function drawSegments(path, segPath, percent, clipRangeByDimension, params) {
28
+ const {offsetX: offsetX = 0, offsetY: offsetY = 0, offsetZ: offsetZ = 0, mode: mode = "none", drawConnect: drawConnect = !1} = params || {};
12
29
  if (drawConnect && "none" === mode) return;
13
30
  if (!segPath) return;
14
31
  let needMoveTo = !0;
@@ -17,23 +34,8 @@ function drawSegments(path, segPath, percent, clipRangeByDimension, params) {
17
34
  if (drawConnect) {
18
35
  let lastCurve, defined0 = !0;
19
36
  curves.forEach(((curve, i) => {
20
- var _a;
21
- let p0 = curve.p0;
22
- if (curve.originP1 !== curve.originP2) {
23
- if (lastCurve && lastCurve.originP1 === lastCurve.originP2 && (p0 = lastCurve.p0),
24
- curve.defined) defined0 || (path.lineTo(p0.x + offsetX, p0.y + offsetY, offsetZ),
25
- defined0 = !defined0); else {
26
- const {originP1: originP1, originP2: originP2} = curve;
27
- let validP;
28
- if (originP1 && !1 !== originP1.defined ? validP = p0 : originP1 && !1 !== originP2.defined && (validP = null !== (_a = curve.p3) && void 0 !== _a ? _a : curve.p1),
29
- defined0) {
30
- defined0 = !defined0;
31
- const x = validP ? validP.x : curve.p0.x, y = validP ? validP.y : curve.p0.y;
32
- path.moveTo(x + offsetX, y + offsetY, offsetZ);
33
- } else validP && (defined0 = !defined0, path.lineTo(validP.x + offsetX, validP.y + offsetY, offsetZ));
34
- }
35
- lastCurve = curve;
36
- } else lastCurve = curve;
37
+ curve.originP1 !== curve.originP2 ? (defined0 = drawEachCurve(path, curve, lastCurve, defined0, offsetX, offsetY, offsetZ),
38
+ lastCurve = curve) : lastCurve = curve;
37
39
  }));
38
40
  } else curves.forEach((curve => {
39
41
  curve.defined ? (needMoveTo && path.moveTo(curve.p0.x + offsetX, curve.p0.y + offsetY, offsetZ),
@@ -50,23 +52,11 @@ function drawSegments(path, segPath, percent, clipRangeByDimension, params) {
50
52
  const curve = curves[i], curCurveLength = curve.getLength(direction), _p = (totalDrawLength - drawedLengthUntilLast) / curCurveLength;
51
53
  if (drawedLengthUntilLast += curCurveLength, _p < 0) break;
52
54
  if (drawConnect) {
53
- let p0 = curve.p0;
54
55
  if (curve.originP1 === curve.originP2) {
55
56
  lastCurve = curve;
56
57
  continue;
57
58
  }
58
- if (lastCurve && lastCurve.originP1 === lastCurve.originP2 && (p0 = lastCurve.p0),
59
- curve.defined) defined0 || (path.lineTo(p0.x + offsetX, p0.y + offsetY, offsetZ),
60
- defined0 = !defined0); else {
61
- const {originP1: originP1, originP2: originP2} = curve;
62
- let validP;
63
- if (originP1 && !1 !== originP1.defined ? validP = p0 : originP1 && !1 !== originP2.defined && (validP = null !== (_a = curve.p3) && void 0 !== _a ? _a : curve.p1),
64
- defined0) {
65
- defined0 = !defined0;
66
- const x = validP ? validP.x : curve.p0.x, y = validP ? validP.y : curve.p0.y;
67
- path.moveTo(x + offsetX, y + offsetY, offsetZ);
68
- } else validP && (defined0 = !defined0, path.lineTo(validP.x + offsetX, validP.y + offsetY, offsetZ));
69
- }
59
+ defined0 = drawEachCurve(path, curve, lastCurve, defined0, offsetX, offsetY, offsetZ),
70
60
  lastCurve = curve;
71
61
  } else {
72
62
  if (!curve.defined) {
@@ -108,4 +98,5 @@ function drawIncrementalAreaSegments(path, lastSeg, segments, params) {
108
98
  }
109
99
 
110
100
  exports.drawSegments = drawSegments, exports.drawIncrementalSegments = drawIncrementalSegments,
111
- exports.drawIncrementalAreaSegments = drawIncrementalAreaSegments;
101
+ exports.drawIncrementalAreaSegments = drawIncrementalAreaSegments;
102
+ //# sourceMappingURL=render-curve.js.map