@xort/cga 0.0.93 → 0.1.0

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 (369) hide show
  1. package/THIRD_PARTY_NOTICES.md +47 -0
  2. package/build/@xort_cga.js +14187 -12097
  3. package/build/cga.d.ts +2284 -1983
  4. package/build/cga.esm.js +14179 -0
  5. package/dist/THIRD_PARTY_NOTICES.md +47 -0
  6. package/dist/index.cjs +14320 -0
  7. package/dist/index.cjs.map +1 -0
  8. package/dist/index.d.cts +2358 -0
  9. package/dist/index.d.ts +2358 -38
  10. package/dist/index.js +14181 -56
  11. package/dist/index.js.map +1 -0
  12. package/package.json +59 -47
  13. package/readme.md +162 -247
  14. package/.github/FUNDING.yml +0 -12
  15. package/cga/1./347/202/271/344/270/216/347/272/277/346/200/247/345/205/203/347/264/240/347/232/204/350/267/235/347/246/273.html +0 -601
  16. package/cga/1./347/202/271/344/270/216/347/272/277/346/200/247/345/205/203/347/264/240/347/232/204/350/267/235/347/246/273.md +0 -111
  17. package/cga/2./347/202/271/344/270/216/351/235/242/346/200/247/345/205/203/347/264/240.md +0 -4
  18. package/cga/img//347/202/271/344/270/216/345/260/204/347/272/277.png +0 -0
  19. package/cga/img//347/202/271/344/270/216/347/233/264/347/272/277.png +0 -0
  20. package/cga/img//347/202/271/344/270/216/347/272/277/346/256/265.png +0 -0
  21. package/cga/img//347/233/264/347/272/277/347/232/204/350/241/250/350/276/276/345/274/217.png +0 -0
  22. package/deploy.sh +0 -39
  23. package/dist/IKanimation/Bone.d.ts +0 -7
  24. package/dist/IKanimation/Bone.js +0 -20
  25. package/dist/IKanimation/CCDSolver.d.ts +0 -37
  26. package/dist/IKanimation/CCDSolver.js +0 -93
  27. package/dist/IKanimation/Joint.d.ts +0 -3
  28. package/dist/IKanimation/Joint.js +0 -17
  29. package/dist/IKanimation/constaint/constraint.d.ts +0 -10
  30. package/dist/IKanimation/constaint/constraint.js +0 -25
  31. package/dist/IKanimation/constaint/hinge.d.ts +0 -12
  32. package/dist/IKanimation/constaint/hinge.js +0 -46
  33. package/dist/IKanimation/constaint/slider.d.ts +0 -12
  34. package/dist/IKanimation/constaint/slider.js +0 -44
  35. package/dist/IKanimation/index.d.ts +0 -0
  36. package/dist/IKanimation/index.js +0 -9
  37. package/dist/IKanimation/isolver.d.ts +0 -4
  38. package/dist/IKanimation/isolver.js +0 -10
  39. package/dist/IKanimation/skeleton.d.ts +0 -13
  40. package/dist/IKanimation/skeleton.js +0 -31
  41. package/dist/alg/common.d.ts +0 -114
  42. package/dist/alg/common.js +0 -302
  43. package/dist/alg/curve.d.ts +0 -4
  44. package/dist/alg/curve.js +0 -11
  45. package/dist/alg/delaunator.d.ts +0 -29
  46. package/dist/alg/delaunator.js +0 -442
  47. package/dist/alg/delaunay.d.ts +0 -20
  48. package/dist/alg/delaunay.js +0 -199
  49. package/dist/alg/delaunayslow.d.ts +0 -18
  50. package/dist/alg/delaunayslow.js +0 -140
  51. package/dist/alg/extrude/extrude.d.ts +0 -3
  52. package/dist/alg/extrude/extrude.js +0 -17
  53. package/dist/alg/extrude.d.ts +0 -199
  54. package/dist/alg/extrude.js +0 -728
  55. package/dist/alg/offset/index.d.ts +0 -0
  56. package/dist/alg/offset/index.js +0 -9
  57. package/dist/alg/offset.d.ts +0 -0
  58. package/dist/alg/offset.js +0 -472
  59. package/dist/alg/pointset.d.ts +0 -94
  60. package/dist/alg/pointset.js +0 -223
  61. package/dist/alg/recognition.d.ts +0 -14
  62. package/dist/alg/recognition.js +0 -37
  63. package/dist/alg/result.d.ts +0 -22
  64. package/dist/alg/result.js +0 -2
  65. package/dist/alg/segmentset.d.ts +0 -11
  66. package/dist/alg/segmentset.js +0 -45
  67. package/dist/alg/sort.d.ts +0 -2
  68. package/dist/alg/sort.js +0 -14
  69. package/dist/alg/split.d.ts +0 -8
  70. package/dist/alg/split.js +0 -10
  71. package/dist/alg/trianglution.d.ts +0 -15
  72. package/dist/alg/trianglution.js +0 -70
  73. package/dist/alg/vol.d.ts +0 -6
  74. package/dist/alg/vol.js +0 -18
  75. package/dist/alg/voronoi.d.ts +0 -31
  76. package/dist/alg/voronoi.js +0 -418
  77. package/dist/app.d.ts +0 -1
  78. package/dist/app.js +0 -248
  79. package/dist/basic/distance.d.ts +0 -12
  80. package/dist/basic/distance.js +0 -39
  81. package/dist/csg/bsp.d.ts +0 -9
  82. package/dist/csg/bsp.js +0 -22
  83. package/dist/csg/node.d.ts +0 -12
  84. package/dist/csg/node.js +0 -75
  85. package/dist/csg/polygon.d.ts +0 -43
  86. package/dist/csg/polygon.js +0 -161
  87. package/dist/diamondMaterialShader.d.ts +0 -92
  88. package/dist/diamondMaterialShader.js +0 -118
  89. package/dist/effect/breath-light.d.ts +0 -4
  90. package/dist/effect/breath-light.js +0 -39
  91. package/dist/extends/geometryaid.d.ts +0 -28
  92. package/dist/extends/geometryaid.js +0 -71
  93. package/dist/extends/split.d.ts +0 -3
  94. package/dist/extends/split.js +0 -13
  95. package/dist/glview.d.ts +0 -112
  96. package/dist/glview.js +0 -564
  97. package/dist/math/Color.d.ts +0 -33
  98. package/dist/math/Color.js +0 -235
  99. package/dist/math/Euler.d.ts +0 -46
  100. package/dist/math/Euler.js +0 -225
  101. package/dist/math/HVec3.d.ts +0 -43
  102. package/dist/math/HVec3.js +0 -176
  103. package/dist/math/Mat3.d.ts +0 -29
  104. package/dist/math/Mat3.js +0 -244
  105. package/dist/math/Mat4.d.ts +0 -85
  106. package/dist/math/Mat4.js +0 -791
  107. package/dist/math/Math.d.ts +0 -130
  108. package/dist/math/Math.js +0 -198
  109. package/dist/math/Quat.d.ts +0 -82
  110. package/dist/math/Quat.js +0 -418
  111. package/dist/math/Vec2.d.ts +0 -68
  112. package/dist/math/Vec2.js +0 -328
  113. package/dist/math/Vec3.d.ts +0 -240
  114. package/dist/math/Vec3.js +0 -1082
  115. package/dist/math/Vec4.d.ts +0 -81
  116. package/dist/math/Vec4.js +0 -475
  117. package/dist/math/vecs.d.ts +0 -134
  118. package/dist/math/vecs.js +0 -464
  119. package/dist/render/bufferAttribute.d.ts +0 -104
  120. package/dist/render/bufferAttribute.js +0 -344
  121. package/dist/render/geometry.d.ts +0 -87
  122. package/dist/render/geometry.js +0 -769
  123. package/dist/render/mesh.d.ts +0 -30
  124. package/dist/render/mesh.js +0 -87
  125. package/dist/render/types.d.ts +0 -3
  126. package/dist/render/types.js +0 -8
  127. package/dist/robust/plane.d.ts +0 -7
  128. package/dist/robust/plane.js +0 -17
  129. package/dist/robust/vec.d.ts +0 -15
  130. package/dist/robust/vec.js +0 -71
  131. package/dist/struct/3d/Box.d.ts +0 -23
  132. package/dist/struct/3d/Box.js +0 -109
  133. package/dist/struct/3d/Capsule.d.ts +0 -12
  134. package/dist/struct/3d/Capsule.js +0 -36
  135. package/dist/struct/3d/Circle.d.ts +0 -52
  136. package/dist/struct/3d/Circle.js +0 -138
  137. package/dist/struct/3d/Disk.d.ts +0 -10
  138. package/dist/struct/3d/Disk.js +0 -22
  139. package/dist/struct/3d/Frustum.d.ts +0 -35
  140. package/dist/struct/3d/Frustum.js +0 -159
  141. package/dist/struct/3d/Line.d.ts +0 -40
  142. package/dist/struct/3d/Line.js +0 -340
  143. package/dist/struct/3d/Path.d.ts +0 -75
  144. package/dist/struct/3d/Path.js +0 -308
  145. package/dist/struct/3d/Plane.d.ts +0 -74
  146. package/dist/struct/3d/Plane.js +0 -298
  147. package/dist/struct/3d/Point.d.ts +0 -4
  148. package/dist/struct/3d/Point.js +0 -30
  149. package/dist/struct/3d/Polygon.d.ts +0 -8
  150. package/dist/struct/3d/Polygon.js +0 -55
  151. package/dist/struct/3d/Polyline.d.ts +0 -34
  152. package/dist/struct/3d/Polyline.js +0 -130
  153. package/dist/struct/3d/Ray.d.ts +0 -21
  154. package/dist/struct/3d/Ray.js +0 -262
  155. package/dist/struct/3d/Rectangle.d.ts +0 -7
  156. package/dist/struct/3d/Rectangle.js +0 -35
  157. package/dist/struct/3d/Segment.d.ts +0 -32
  158. package/dist/struct/3d/Segment.js +0 -334
  159. package/dist/struct/3d/Shape.d.ts +0 -4
  160. package/dist/struct/3d/Shape.js +0 -27
  161. package/dist/struct/3d/Sphere.d.ts +0 -11
  162. package/dist/struct/3d/Sphere.js +0 -30
  163. package/dist/struct/3d/Triangle.d.ts +0 -8
  164. package/dist/struct/3d/Triangle.js +0 -53
  165. package/dist/struct/bsp.d.ts +0 -9
  166. package/dist/struct/bsp.js +0 -44
  167. package/dist/struct/btree.d.ts +0 -0
  168. package/dist/struct/btree.js +0 -1
  169. package/dist/struct/data/ArrayList.d.ts +0 -42
  170. package/dist/struct/data/ArrayList.js +0 -172
  171. package/dist/struct/data/ArrayObject.d.ts +0 -30
  172. package/dist/struct/data/ArrayObject.js +0 -131
  173. package/dist/struct/data/type.d.ts +0 -13
  174. package/dist/struct/data/type.js +0 -18
  175. package/dist/struct/kdtree.d.ts +0 -0
  176. package/dist/struct/kdtree.js +0 -1
  177. package/dist/struct/polyTree.d.ts +0 -4
  178. package/dist/struct/polyTree.js +0 -27
  179. package/dist/struct/quatTree.d.ts +0 -0
  180. package/dist/struct/quatTree.js +0 -1
  181. package/dist/struct/tree.d.ts +0 -11
  182. package/dist/struct/tree.js +0 -26
  183. package/dist/utils/array.d.ts +0 -24
  184. package/dist/utils/array.js +0 -89
  185. package/dist/utils/types.d.ts +0 -24
  186. package/dist/utils/types.js +0 -20
  187. package/docs/.vuepress/components/distance.vue +0 -125
  188. package/docs/.vuepress/components/intersect.vue +0 -0
  189. package/docs/.vuepress/components/trianglution.vue +0 -121
  190. package/docs/.vuepress/components/utils.js +0 -314
  191. package/docs/.vuepress/config.js +0 -99
  192. package/docs/.vuepress/enhanceApp.js +0 -13
  193. package/docs/.vuepress/public/delaunay.png +0 -0
  194. package/docs/.vuepress/public/logo.png +0 -0
  195. package/docs/.vuepress/public/plane-set-convex.png +0 -0
  196. package/docs/.vuepress/public/sponsor/alipay.jpg +0 -0
  197. package/docs/.vuepress/public/sponsor/wechat.png +0 -0
  198. package/docs/README.md +0 -14
  199. package/docs/demo/README.md +0 -9
  200. package/docs/guide/README.md +0 -94
  201. package/docs/guide/array.md +0 -10
  202. package/docs/guide/cy/trianglution.html +0 -2
  203. package/docs/guide/distLineAll.md +0 -85
  204. package/docs/guide/distPointAll.md +0 -137
  205. package/docs/guide/distRayAll.md +0 -69
  206. package/docs/guide/distSegmentAll.md +0 -19
  207. package/docs/guide/point.vue +0 -12
  208. package/docs/guide/vector.md +0 -10
  209. package/docs/guide//345/270/270/347/224/250.md +0 -156
  210. package/docs/sponsor/README.md +0 -15
  211. package/docs//345/274/200/345/217/221/346/227/245/345/277/227/2020/345/271/2643/346/234/21013/346/227/245.md +0 -6
  212. package/effect/common.glsl +0 -34
  213. package/effect/drawing.glsl +0 -36
  214. package/effect/shape.arc.glsl +0 -13
  215. package/effect/shape.circle.glsl +0 -13
  216. package/effect/shape.grid.glsl +0 -42
  217. package/effect/shape.line.glsl +0 -18
  218. package/effect/shape.pie.glsl +0 -18
  219. package/effect/shape.plot.glsl +0 -10
  220. package/effect/shape.poly.glsl +0 -15
  221. package/effect/shape.rect.glsl +0 -14
  222. package/effect/shape.rectround.glsl +0 -15
  223. package/effect/shape.segment.glsl +0 -10
  224. package/effect/shape.spiral.glsl +0 -12
  225. package/effect/shape.star.glsl +0 -16
  226. package/examples/index.html +0 -31
  227. package/git.sh +0 -12
  228. package/gitproxy.sh +0 -6
  229. package/image/readme/1640758500266.png +0 -0
  230. package/image/readme/1640758513361.png +0 -0
  231. package/index.html +0 -14
  232. package/linear algorithm//346/225/260/345/255/246/350/241/250/350/276/276/345/274/217.md" +0 -122
  233. package/linear algorithm//347/237/251/351/230/265.md" +0 -91
  234. package/rollup.config.js +0 -82
  235. package/scripttest.html +0 -23
  236. package/src/IKanimation/Bone.ts +0 -20
  237. package/src/IKanimation/CCDSolver.ts +0 -114
  238. package/src/IKanimation/Joint.ts +0 -13
  239. package/src/IKanimation/constaint/constraint.ts +0 -23
  240. package/src/IKanimation/constaint/hinge.ts +0 -29
  241. package/src/IKanimation/constaint/slider.ts +0 -25
  242. package/src/IKanimation/index.ts +0 -8
  243. package/src/IKanimation/isolver.ts +0 -13
  244. package/src/IKanimation/skeleton.ts +0 -30
  245. package/src/alg/common.ts +0 -304
  246. package/src/alg/curve.ts +0 -9
  247. package/src/alg/delaunator.ts +0 -519
  248. package/src/alg/delaunay.ts +0 -163
  249. package/src/alg/delaunayslow.ts +0 -183
  250. package/src/alg/extrude/extrude.ts +0 -19
  251. package/src/alg/extrude.ts +0 -941
  252. package/src/alg/offset/index.ts +0 -8
  253. package/src/alg/offset.ts +0 -501
  254. package/src/alg/pointset.ts +0 -219
  255. package/src/alg/recognition.ts +0 -43
  256. package/src/alg/result.ts +0 -24
  257. package/src/alg/segmentset.ts +0 -44
  258. package/src/alg/sort.ts +0 -11
  259. package/src/alg/split.ts +0 -15
  260. package/src/alg/trianglution.ts +0 -53
  261. package/src/alg/vol.ts +0 -18
  262. package/src/alg/voronoi.ts +0 -303
  263. package/src/app.css +0 -12
  264. package/src/app.ts +0 -285
  265. package/src/assets/color.jpg +0 -0
  266. package/src/basic/distance.ts +0 -40
  267. package/src/clipper/clipper.d.ts +0 -323
  268. package/src/clipper/clipper.js +0 -7626
  269. package/src/clipper/clipper_float.js +0 -185
  270. package/src/clipper/clipper_float_unminified.js +0 -5639
  271. package/src/clipper/clipperint.js +0 -7626
  272. package/src/csg/bsp.ts +0 -24
  273. package/src/csg/csg.js +0 -583
  274. package/src/csg/node.ts +0 -91
  275. package/src/csg/polygon.ts +0 -177
  276. package/src/diamondMaterialShader.ts +0 -93
  277. package/src/effect/breath-light.ts +0 -24
  278. package/src/extends/geometryaid.ts +0 -86
  279. package/src/extends/split.ts +0 -15
  280. package/src/glview.ts +0 -570
  281. package/src/index.ts +0 -47
  282. package/src/math/Color.ts +0 -225
  283. package/src/math/Euler.ts +0 -238
  284. package/src/math/HVec3.ts +0 -1144
  285. package/src/math/Mat3.ts +0 -365
  286. package/src/math/Mat4.ts +0 -1134
  287. package/src/math/Math.ts +0 -213
  288. package/src/math/Quat.ts +0 -536
  289. package/src/math/Vec2.ts +0 -408
  290. package/src/math/Vec3.ts +0 -1307
  291. package/src/math/Vec4.ts +0 -587
  292. package/src/math/vecs.ts +0 -486
  293. package/src/render/bufferAttribute.ts +0 -491
  294. package/src/render/geometry.ts +0 -1329
  295. package/src/render/mesh.ts +0 -82
  296. package/src/render/types.ts +0 -17
  297. package/src/robust/plane.ts +0 -12
  298. package/src/robust/readme.md +0 -1
  299. package/src/robust/vec.ts +0 -61
  300. package/src/shader/cga.glsl +0 -202
  301. package/src/shader/common.glsl +0 -87
  302. package/src/shader/noise/GLSL-Noise.md +0 -1108
  303. package/src/shader/noise/cellular2D.glsl +0 -69
  304. package/src/shader/noise/cellular2x2.glsl +0 -64
  305. package/src/shader/noise/cellular2x2x2.glsl +0 -88
  306. package/src/shader/noise/cellular3D.glsl +0 -187
  307. package/src/shader/noise/classicnoise2D.glsl +0 -113
  308. package/src/shader/noise/classicnoise3D.glsl +0 -177
  309. package/src/shader/noise/classicnoise4D.glsl +0 -302
  310. package/src/shader/noise/noise2D.glsl +0 -71
  311. package/src/shader/noise/noise3D.glsl +0 -103
  312. package/src/shader/noise/noise3Dgrad.glsl +0 -111
  313. package/src/shader/noise/noise4D.glsl +0 -129
  314. package/src/shader/noise/psrdnoise2D.glsl +0 -462
  315. package/src/struct/3d/Box.ts +0 -124
  316. package/src/struct/3d/Capsule.ts +0 -18
  317. package/src/struct/3d/Circle.ts +0 -149
  318. package/src/struct/3d/Disk.ts +0 -22
  319. package/src/struct/3d/Frustum.ts +0 -189
  320. package/src/struct/3d/Line.ts +0 -378
  321. package/src/struct/3d/Path.ts +0 -314
  322. package/src/struct/3d/Plane.ts +0 -341
  323. package/src/struct/3d/Point.ts +0 -7
  324. package/src/struct/3d/PolyLine.ts +0 -115
  325. package/src/struct/3d/Polygon.ts +0 -46
  326. package/src/struct/3d/Ray.ts +0 -285
  327. package/src/struct/3d/Rectangle.ts +0 -18
  328. package/src/struct/3d/Segment.ts +0 -330
  329. package/src/struct/3d/Shape.ts +0 -7
  330. package/src/struct/3d/Sphere.ts +0 -31
  331. package/src/struct/3d/Triangle.ts +0 -28
  332. package/src/struct/bsp.ts +0 -18
  333. package/src/struct/btree.ts +0 -0
  334. package/src/struct/data/ArrayList.ts +0 -144
  335. package/src/struct/data/ArrayObject.ts +0 -105
  336. package/src/struct/data/type.ts +0 -14
  337. package/src/struct/kdtree.ts +0 -0
  338. package/src/struct/polyTree.ts +0 -8
  339. package/src/struct/quatTree.ts +0 -0
  340. package/src/struct/tree.ts +0 -30
  341. package/src/utils/array.ts +0 -106
  342. package/src/utils/types.ts +0 -42
  343. package/src-gis/app.ts +0 -7
  344. package/src-gis/core/Cartographic.ts +0 -48
  345. package/src-gis/core/EllipsoidGeodesic.ts +0 -56
  346. package/src-gis/core/EllipsoidTerrainProvider.ts +0 -35
  347. package/src-gis/core/HeightmapTerrainData.ts +0 -5
  348. package/src-gis/core/Rectangle.ts +0 -112
  349. package/src-gis/core/TaskProcessor.ts +0 -222
  350. package/src-gis/gis.ts +0 -25
  351. package/src-gis/globe.ts +0 -54
  352. package/src-gis/math/Cartographic.ts +0 -24
  353. package/src-gis/math/GVec3.ts +0 -55
  354. package/src-gis/math/ellipsoid.ts +0 -13
  355. package/src-gis/provider/DcTerrainProvider.ts +0 -36
  356. package/src-gis/provider/TerrainProvider.ts +0 -12
  357. package/src-gis/scene/DcImageryProvider.ts +0 -36
  358. package/src-gis/scene/GeographicTilingScheme.ts +0 -65
  359. package/src-gis/scene/Globe.ts +0 -76
  360. package/src-gis/scene/GlobeSurfaceShaderSet.ts +0 -9
  361. package/src-gis/scene/GlobeSurfaceTileProvider.ts +0 -25
  362. package/src-gis/scene/ImageryLayerCollection.ts +0 -75
  363. package/src-gis/scene/ImageryProvider.ts +0 -28
  364. package/src-gis/scene/QuadtreeTile.ts +0 -162
  365. package/src-gis/scene/UrlTemplateImageryProvider.ts +0 -32
  366. package/src-gis/scene/quadtree_primitive.ts +0 -58
  367. package/tsconfig.json +0 -77
  368. package/webpack.config.js +0 -112
  369. package//350/256/241/347/256/227/345/207/240/344/275/225/351/227/256/351/242/230.md +0 -26
package/dist/index.d.ts CHANGED
@@ -1,38 +1,2358 @@
1
- export * from "./utils/array";
2
- export * from "./math/Vec2";
3
- export * from "./math/Vec3";
4
- export * from "./math/Vec4";
5
- export * from "./math/Mat3";
6
- export * from "./math/Mat4";
7
- export * from "./math/Quat";
8
- export * from "./math/Math";
9
- export * from "./math/Euler";
10
- export * from "./math/Color";
11
- export * from "./math/vecs";
12
- export * from "./alg/common";
13
- export * from "./alg/result";
14
- export * from "./alg/extrude";
15
- export * from "./alg/delaunay";
16
- export * from "./alg/trianglution";
17
- export * from "./render/mesh";
18
- export * from "./struct/3d/Box";
19
- export * from "./struct/3d/Capsule";
20
- export * from "./struct/3d/Circle";
21
- export * from "./struct/3d/Disk";
22
- export * from "./struct/3d/Line";
23
- export * from "./struct/3d/Path";
24
- export * from "./struct/3d/Plane";
25
- export * from "./struct/3d/Point";
26
- export * from "./struct/3d/Polyline";
27
- export * from "./struct/3d/Polygon";
28
- export * from "./struct/3d/Ray";
29
- export * from "./struct/3d/Segment";
30
- export * from "./struct/3d/Triangle";
31
- export * from "./struct/3d/Frustum";
32
- export * from "./struct/3d/Sphere";
33
- export * from "./alg/delaunator";
34
- export * from "./alg/voronoi";
35
- export * from "./extends/geometryaid";
36
- export * from "./render/bufferAttribute";
37
- export * from "./render/geometry";
38
- export * from "./render/mesh";
1
+ declare class Quat {
2
+ _x: number;
3
+ _y: number;
4
+ _z: number;
5
+ _w: number;
6
+ isQuat: boolean;
7
+ constructor(_x?: number, _y?: number, _z?: number, _w?: number);
8
+ get x(): number;
9
+ set x(value: number);
10
+ get y(): number;
11
+ set y(value: number);
12
+ get z(): number;
13
+ set z(value: number);
14
+ get w(): number;
15
+ set w(value: number);
16
+ static slerp(qa: any, qb: any, qm: {
17
+ copy: (arg0: any) => {
18
+ (): any;
19
+ new (): any;
20
+ slerp: {
21
+ (arg0: any, arg1: any): any;
22
+ new (): any;
23
+ };
24
+ };
25
+ }, t: any): any;
26
+ static slerpFlat(dst: {
27
+ [x: string]: any;
28
+ }, dstOffset: number, src0: {
29
+ [x: string]: any;
30
+ }, srcOffset0: number, src1: {
31
+ [x: string]: any;
32
+ }, srcOffset1: number, t: number): void;
33
+ static multiplyQuatsFlat(dst: {
34
+ [x: string]: number;
35
+ }, dstOffset: number, src0: {
36
+ [x: string]: any;
37
+ }, srcOffset0: number, src1: {
38
+ [x: string]: any;
39
+ }, srcOffset1: number): {
40
+ [x: string]: number;
41
+ };
42
+ set(x: number, y: number, z: number, w: number): this;
43
+ clone(): Quat;
44
+ copy(quat: Quat): this;
45
+ setFromEuler(euler: Euler, update?: boolean): this;
46
+ setFromAxisAngle(axis: {
47
+ x: number;
48
+ y: number;
49
+ z: number;
50
+ }, angle: number): this;
51
+ setFromRotationMat(m: {
52
+ elements: any;
53
+ }): this;
54
+ setFromUnitVecs(vFrom: {
55
+ dot: (arg0: any) => number;
56
+ x: number;
57
+ z: number;
58
+ y: number;
59
+ }, vTo: {
60
+ z: number;
61
+ y: number;
62
+ x: number;
63
+ }): this;
64
+ angleTo(q: any): number;
65
+ rotateTowards(q: any, step: number): this;
66
+ inverse(): this;
67
+ invert(): this;
68
+ conjugate(): this;
69
+ dot(v: Quat): number;
70
+ lengthSq(): number;
71
+ length(): number;
72
+ normalize(): this;
73
+ multiply(q: Quat, p?: Quat): this;
74
+ premultiply(q: Quat): this;
75
+ multiplyQuats(a: Quat, b: Quat): this;
76
+ slerp(qb: Quat, t: number): this;
77
+ equals(quat: Quat): boolean;
78
+ fromArray(array: Array<number>, offset?: number): this;
79
+ toArray(array?: number[], offset?: number): number[];
80
+ }
81
+ declare function quat(x?: number, y?: number, z?: number, w?: number): Quat;
82
+
83
+ type DistanceParameter = number | number[];
84
+ interface DistanceResult {
85
+ rayParameter?: number;
86
+ lineParameter?: number;
87
+ closests: [Vec3, Vec3];
88
+ parameters: [DistanceParameter, DistanceParameter];
89
+ distance: number;
90
+ distanceSqr: number;
91
+ equidistant?: boolean;
92
+ interior?: boolean;
93
+ triangleParameters?: number[];
94
+ rectangleParameters?: number[];
95
+ circleClosest?: Vec3;
96
+ signedDistance?: number;
97
+ segmentIndex?: number;
98
+ diskClosest?: Vec3;
99
+ }
100
+ interface IntersectResult extends DistanceResult {
101
+ interserct?: boolean;
102
+ equals?: boolean;
103
+ intersetctPts: Array<Array<Vec3>>;
104
+ }
105
+
106
+ /** Shared contract of the basic geometric primitives. Set/copy mutate and chain;
107
+ * clone owns its coordinates; queries do not mutate either operand. */
108
+ interface GeometryQuery<T> {
109
+ readonly kind: GeometryKind;
110
+ copy(source: T): this;
111
+ clone(): T;
112
+ distancePoint(point: Vec3): DistanceResult;
113
+ toJSON(): GeometryData;
114
+ }
115
+ type GeometryKind = 'Point' | 'Line' | 'Ray' | 'Segment' | 'Triangle' | 'Plane' | 'Rectangle' | 'Circle' | 'Disk' | 'Sphere' | 'Capsule' | 'Box' | 'Polyline' | 'Polygon';
116
+ interface GeometryData {
117
+ kind: GeometryKind;
118
+ vertices: number[][];
119
+ normal?: number[];
120
+ radius?: number;
121
+ w?: number;
122
+ startAngle?: number;
123
+ lengthAngle?: number;
124
+ empty?: boolean;
125
+ }
126
+
127
+ type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array;
128
+ type TypedArrayLike = number[] | Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array;
129
+
130
+ declare enum IntersectType {
131
+ None = 0,
132
+ Parallel = 1,
133
+ Perpendicular = 2,
134
+ Collineation = 3
135
+ }
136
+ declare enum Orientation {
137
+ None = -1,
138
+ Positive = 1,
139
+ Negative = 2,
140
+ Common = 3,//共面
141
+ Intersect = 3
142
+ }
143
+
144
+ interface ISplitResult {
145
+ negative: Vec3[];
146
+ positive: Vec3[];
147
+ common: Vec3[];
148
+ orientation: Orientation;
149
+ }
150
+
151
+ declare class Mat3 {
152
+ elements: number[];
153
+ isMat3: boolean;
154
+ constructor();
155
+ set(n11: number, n12: number, n13: number, n21: number, n22: number, n23: number, n31: number, n32: number, n33: number): this;
156
+ identity(): this;
157
+ clone(): Mat3;
158
+ copy(m: Mat3): this;
159
+ setFromMat4(m: Mat4): this;
160
+ applyToBufferAttribute(attribute: any): any;
161
+ multiply(m: Mat3): this;
162
+ premultiply(m: Mat3): this;
163
+ multiplyMatrices(a: Mat3, b: Mat3): this;
164
+ multiplyScalar(s: number): this;
165
+ determinant(): number;
166
+ getInverse(matrix: Mat3 | Mat4 | any, throwOnDegenerate?: boolean): this;
167
+ transpose(): this;
168
+ getNormalMat(mat4: Mat4): this;
169
+ transposeIntoArray(r: number[]): this;
170
+ setUvTransform(tx: any, ty: any, sx: number, sy: number, rotation: number, cx: number, cy: number): void;
171
+ scale(sx: number, sy: number): this;
172
+ rotate(theta: number): this;
173
+ translate(tx: number, ty: number): this;
174
+ equals(matrix: Mat3): boolean;
175
+ fromArray(array: number[], offset?: number): this;
176
+ toArray(array?: number[], offset?: number): number[];
177
+ }
178
+ declare function m3(): Mat3;
179
+
180
+ declare class Vec2 {
181
+ private _x;
182
+ private _y;
183
+ isVec2: boolean;
184
+ constructor(_x?: number, _y?: number);
185
+ get x(): number;
186
+ set x(value: number);
187
+ get y(): number;
188
+ set y(value: number);
189
+ static isVec2(v: any): boolean;
190
+ get width(): number;
191
+ set width(value: number);
192
+ get height(): number;
193
+ set height(value: number);
194
+ static get UnitX(): Vec2;
195
+ static get UnitY(): Vec2;
196
+ set(x: number, y: number): this;
197
+ setScalar(scalar: number): this;
198
+ setX(x: number): this;
199
+ setY(y: number): this;
200
+ setComponent(index: number, value: number): this;
201
+ getComponent(index: number): number;
202
+ clone(): Vec2;
203
+ copy(v: Vec2): Vec2;
204
+ add(v: Vec2, w?: Vec2): this;
205
+ addScalar(s: number): this;
206
+ addVecs(a: Vec2, b: Vec2): this;
207
+ addScaledVec(v: Vec2, s: number): this;
208
+ sub(v: Vec2, w: Vec2): this;
209
+ subScalar(s: number): this;
210
+ subVecs(a: Vec2, b: Vec2): this;
211
+ multiply(v: Vec2): this;
212
+ multiplyScalar(scalar: number): this;
213
+ divide(v: Vec2): this;
214
+ divideScalar(scalar: number): this;
215
+ applyMat3(m: Mat3): this;
216
+ min(v: Vec2): this;
217
+ max(v: Vec2): this;
218
+ clamp(min: Vec2, max: Vec2): this;
219
+ clampScalar(minVal: number, maxVal: number): this;
220
+ clampLength(min: number, max: number): this;
221
+ floor(): this;
222
+ ceil(): this;
223
+ round(): this;
224
+ roundToZero(): this;
225
+ negate(): this;
226
+ dot(v: Vec2): number;
227
+ cross(v: Vec2): number;
228
+ lengthSq(): number;
229
+ length(): number;
230
+ manhattanLength(): number;
231
+ normalize(): this;
232
+ angle(): number;
233
+ distanceTo(v: Vec2): number;
234
+ distanceToSquared(v: Vec2): number;
235
+ manhattanDistanceTo(v: Vec2): number;
236
+ setLength(length: number): this;
237
+ lerp(v: Vec2, alpha: number): this;
238
+ lerpVecs(v1: Vec2, v2: Vec2, alpha: number): this;
239
+ equals(v: Vec2): boolean;
240
+ fromArray(array: TypedArrayLike, offset?: number): this;
241
+ toArray(array?: TypedArrayLike, offset?: number): TypedArrayLike;
242
+ fromBufferAttribute(attribute: any, index: number, offset: any): this;
243
+ rotateAround(center: Vec2, angle: number): this;
244
+ }
245
+ declare function v2(): Vec2;
246
+
247
+ declare class Vec4 {
248
+ private _x;
249
+ private _y;
250
+ private _z;
251
+ private _w;
252
+ isVec4: boolean;
253
+ constructor(_x?: number, _y?: number, _z?: number, _w?: number);
254
+ get x(): number;
255
+ set x(value: number);
256
+ get y(): number;
257
+ set y(value: number);
258
+ get z(): number;
259
+ set z(value: number);
260
+ get w(): number;
261
+ set w(value: number);
262
+ static isVec4(v: Vec4): boolean;
263
+ get width(): number;
264
+ set width(value: number);
265
+ get height(): number;
266
+ set height(value: number);
267
+ set(x: number, y: number, z: number, w: number): this;
268
+ setScalar(scalar: number): this;
269
+ setX(x: number): this;
270
+ setY(y: number): this;
271
+ setZ(z: number): this;
272
+ setW(w: number): this;
273
+ setComponent(index: number, value: number): this;
274
+ getComponent(index: number): number;
275
+ clone(): Vec4;
276
+ copy(v: {
277
+ x: number;
278
+ y: number;
279
+ z: number;
280
+ w: number | undefined;
281
+ }): this;
282
+ add(v: Vec4, w?: Vec4): Vec4;
283
+ addScalar(s: number): this;
284
+ addVecs(a: Vec4, b: Vec4): this;
285
+ addScaledVec(v: Vec4, s: number): this;
286
+ sub(v: Vec4, w?: Vec4): this;
287
+ subScalar(s: number): this;
288
+ subVecs(a: Vec4, b: Vec4): this;
289
+ multiplyScalar(scalar: number): this;
290
+ applyMat4(m: {
291
+ elements: any;
292
+ }): this;
293
+ divideScalar(scalar: number): this;
294
+ setAxisAngleFromQuat(q: {
295
+ w: number;
296
+ x: number;
297
+ y: number;
298
+ z: number;
299
+ }): this;
300
+ setAxisAngleFromRotationMat(m: {
301
+ elements: any;
302
+ }): this;
303
+ min(v: Vec4): this;
304
+ max(v: Vec4): this;
305
+ clamp(min: Vec4, max: Vec4): this;
306
+ clampScalar(minVal: number, maxVal: number): this;
307
+ clampLength(min: number, max: number): this;
308
+ floor(): this;
309
+ ceil(): this;
310
+ round(): this;
311
+ roundToZero(): this;
312
+ negate(): this;
313
+ dot(v: Vec4): number;
314
+ lengthSq(): number;
315
+ length(): number;
316
+ manhattanLength(): number;
317
+ normalize(): this;
318
+ setLength(length: any): this;
319
+ lerp(v: Vec4, alpha: number): this;
320
+ lerpVecs(v1: Vec4, v2: any, alpha: any): Vec4;
321
+ equals(v: Vec4): boolean;
322
+ fromArray(array: TypedArrayLike, offset?: number): this;
323
+ toArray(array?: TypedArrayLike, offset?: number): TypedArrayLike;
324
+ fromBufferAttribute(attribute: any, index: any, offset: undefined): this;
325
+ }
326
+ declare function v4(x?: number, y?: number, z?: number, w?: number): Vec4;
327
+
328
+ declare class ArrayList<T> {
329
+ protected _array: Array<T>;
330
+ isArrayList: boolean;
331
+ constructor(data?: Array<T> | ArrayList<T>);
332
+ get array(): T[];
333
+ set array(val: T[]);
334
+ get length(): number;
335
+ get last(): any;
336
+ get first(): T;
337
+ map(callbackfn: (value: T, index: number, array: T[]) => unknown): unknown[];
338
+ push(...values: any[]): void;
339
+ reverse(): this;
340
+ pop(): any;
341
+ unshift(...items: any[]): number;
342
+ insertAt(i: number, ...value: T[]): void;
343
+ splice(start: number, deleteCount: number, ...items: any[]): void;
344
+ get(index: number): any;
345
+ /**
346
+ * 遍历
347
+ * @param {*} method
348
+ */
349
+ forall(method: (arg0: any) => void): void;
350
+ /**
351
+ * 克隆
352
+ */
353
+ clone(): any;
354
+ /**
355
+ * 分类
356
+ * example:
357
+ * var arry = [1,2,3,4,5,6]
358
+ * var result = classify(this._array,(a)={return a%2===0})
359
+ *
360
+ * @param {Function} classifyMethod 分类方法
361
+ */
362
+ classify(classifyMethod: (value: T, representative: T, group: T[]) => boolean): T[][];
363
+ /**
364
+ * 去掉重复元素
365
+ * @param {Function} uniqueMethod 去重复
366
+ * @param {Function} sortMethod 排序
367
+ */
368
+ unique(uniqueMethod: (arg0: T, arg1: T) => boolean, sortMethod?: (a: T, b: T) => number): this;
369
+ }
370
+
371
+ type AxisPlane = 'xy' | 'xz' | 'yz' | 'xyz';
372
+ interface ITriangulationOption {
373
+ feature?: AxisPlane;
374
+ dim?: number;
375
+ normal?: Vec3;
376
+ }
377
+ /**
378
+ * 三角剖分 earcut.js
379
+ * @param {Array} boundary 边界
380
+ * @param {Array<Array>} holes 洞的数组
381
+ * @param {options:{feature,dim,normal}} feature 选择平平面
382
+ * @returns {Array<Number>} 三角形索引数组
383
+ */
384
+ declare function triangulation(boundary: Vec3[], holes?: Vec3[][], options?: ITriangulationOption): number[];
385
+
386
+ interface ILinkSideOption {
387
+ side0: {
388
+ x: number;
389
+ y: number;
390
+ z: number;
391
+ index?: number;
392
+ }[] | number[];
393
+ side1: {
394
+ x: number;
395
+ y: number;
396
+ z: number;
397
+ index?: number;
398
+ }[] | number[];
399
+ holes0?: Array<Array<Vec3>>;
400
+ holes1?: Array<Array<Vec3>>;
401
+ shapeClosed?: boolean;
402
+ autoUV?: boolean;
403
+ uvScalars?: number[];
404
+ segs?: [];
405
+ }
406
+ /**
407
+ * 常用shape几何操作
408
+ */
409
+ /**
410
+ * @description : 缝合两个边 不提供uv生成 uv有@linkSides 生成
411
+ * @param { ILinkSideOption } options
412
+ * @returns { Array<Vec3>} 三角形数组,每三个为一个三角形
413
+ * @example :
414
+ */
415
+ declare function linkSide(options: ILinkSideOption): number[];
416
+ /**
417
+ * 缝合shape集合
418
+ * @param {Array<Array<Point|Vec3>} shapes 路基 点集的集合, 每个shape的点数量一致
419
+ * @param {Boolean} sealStart 每一个shape是否是封闭的界面 默认false
420
+ * @param {Boolean} isClosed 每一个shape是否是封闭的界面 默认false
421
+ * @param {Boolean} isClosed2 每一个shape是否是封闭的首尾 默认false
422
+ * @returns {Array} 返回三角形集合 如果有所用范围索引,否则返回顶点
423
+ */
424
+ interface ILinkSideOptions {
425
+ shapes: Array<Array<IVec3 | any | IVec3>>;
426
+ orgShape?: Array<IVec3 | any | IVec3>;
427
+ orgHoles?: any;
428
+ sealStart?: boolean;
429
+ sealEnd?: boolean;
430
+ shapeClosed?: boolean;
431
+ pathClosed?: boolean;
432
+ index?: {
433
+ index: number;
434
+ };
435
+ autoIndex?: boolean;
436
+ generateUV?: boolean;
437
+ axisPlane?: AxisPlane;
438
+ holes?: Array<Array<IVec3 | any | IVec3>>[];
439
+ }
440
+ /**
441
+ * @description : 链接多个shape 生成几何体
442
+ * @param {ILinkSideOptions} optionsILinkSideOptions {
443
+ * shapes: Array<Array<IVec3 | number | any>>;
444
+ * sealStart?: boolean,//开始封面
445
+ * sealEnd?: boolean;//结束封面
446
+ * shapeClosed?: boolean,//shape是否闭合
447
+ * pathClosed?: boolean,//路径是否闭合
448
+ * index?: { index: number },
449
+ * generateUV?: boolean
450
+ * }
451
+ *
452
+ * @return {*}
453
+ * @example :
454
+ *
455
+ */
456
+ declare function linkSides(options: ILinkSideOptions): IGeometry;
457
+ interface IExtrudeOptions {
458
+ fixedY?: boolean;
459
+ shapeClosed?: boolean;
460
+ isClosed2?: boolean;
461
+ textureEnable?: boolean;
462
+ textureScale?: Vec2;
463
+ smoothAngle?: number;
464
+ sealStart?: boolean;
465
+ sealEnd?: boolean;
466
+ normal?: Vec3;
467
+ }
468
+ interface IExtrudeOptionsEx {
469
+ shape: Array<Vec3 | IVec3 | Vec2 | IVec2>;
470
+ path: Array<Vec3 | IVec3>;
471
+ ups?: Array<Vec3 | IVec3>;
472
+ up?: Vec3 | IVec3;
473
+ right?: Vec3;
474
+ shapeClosed?: boolean;
475
+ pathClosed?: boolean;
476
+ textureEnable?: boolean;
477
+ smoothAngle?: number;
478
+ enableSmooth?: boolean;
479
+ sealStart?: boolean;
480
+ sealEnd?: boolean;
481
+ normal?: Vec3;
482
+ autoIndex?: boolean;
483
+ axisPlane?: AxisPlane;
484
+ generateUV?: boolean;
485
+ index?: {
486
+ index: number;
487
+ };
488
+ holes?: Array<Vec3 | IVec3 | Vec2 | IVec2>[];
489
+ }
490
+ /**
491
+ * @description : 挤压形状生成几何体
492
+ * @param {IExtrudeOptionsEx} options
493
+ * IExtrudeOptionsEx {
494
+ * shape: Array<Vec3 | IVec3 | Vec2 | IVec2>;//shape默认的矩阵为正交矩阵
495
+ * path: Array<Vec3 | IVec3>;//挤压路径
496
+ * ups?: Array<Vec3 | IVec3>;
497
+ * up?: Vec3 | IVec3;
498
+ * shapeClosed?: boolean;//闭合为多边形 界面
499
+ * pathClosed?: boolean;//首尾闭合为圈
500
+ * textureEnable?: boolean;
501
+ * smoothAngle?: number;
502
+ * sealStart?: boolean;
503
+ * sealEnd?: boolean;
504
+ * normal?: Vec3,//面的法线
505
+ * autoIndex?: boolean,
506
+ * index?: { index: number }
507
+ * holes?: Array<Vec3 | IVec3 | Vec2 | IVec2>[]
508
+ *}
509
+ * @return {IGeometry}
510
+ * @example :
511
+ *
512
+ */
513
+ declare function extrude(options: IExtrudeOptionsEx): IGeometry;
514
+ /**
515
+ * 挤压
516
+ * @param {Polygon|Array<Point|Vec3> } shape 多边形或顶点数组
517
+ * @param {Path|Array<Point|Vec3> } path 路径或者或顶点数组
518
+ * @param {Object} options {
519
+ * isClosed: false,闭合为多边形 界面
520
+ * isClosed2: false, 闭合为圈
521
+ * textureEnable: true, 计算纹理坐标
522
+ * textureScale: new Vec2(1, 1),纹理坐标缩放
523
+ * smoothAngle: Math.PI / 180 * 30,大于这个角度则不平滑
524
+ * sealStart: true, 是否密封开始面
525
+ * sealEnd: true,是否密封结束面}
526
+ */
527
+ declare function extrude_obsolete<T extends Vec3>(shape: ArrayList<T>, arg_path: Array<Vec3> | any, options?: IExtrudeOptions): {
528
+ vertices: any[];
529
+ index: number[] | undefined;
530
+ uvs: any[];
531
+ };
532
+ declare enum JoinType {
533
+ Square = 0,
534
+ Round = 1,
535
+ Miter = 2,
536
+ Bevel = 0
537
+ }
538
+ declare enum EndType {
539
+ Square = 0,
540
+ Round = 1,
541
+ Butt = 2,
542
+ etClosedLine = 3,
543
+ etClosedPolygon = 4,
544
+ etOpenButt = 5,
545
+ etOpenSquare = 6
546
+ }
547
+ interface IExtrudeOptionsNext {
548
+ shape: Array<Vec3>;
549
+ path: Array<Vec3 | IVec3>;
550
+ up?: Array<Vec3 | IVec3> | Vec3 | IVec3;
551
+ right?: Array<Vec3> | Vec3;
552
+ shapeClosed?: boolean;
553
+ pathClosed?: boolean;
554
+ textureEnable?: boolean;
555
+ shapeCenter?: Vec3;
556
+ smoothAngle?: number;
557
+ enableSmooth?: boolean;
558
+ sealStart?: boolean;
559
+ sealEnd?: boolean;
560
+ normal?: Vec3;
561
+ autoIndex?: boolean;
562
+ axisPlane?: AxisPlane;
563
+ generateUV?: boolean;
564
+ index?: {
565
+ index: number;
566
+ };
567
+ holes?: Array<Vec3 | IVec3 | Vec2 | IVec2>[];
568
+ jtType?: JoinType;
569
+ etType?: EndType;
570
+ bevelSize?: any;
571
+ }
572
+ /**
573
+ * 将路径看做挤压操作中心
574
+ *
575
+ * @param shape
576
+ * @param followPath
577
+ * @param options
578
+ */
579
+ declare function extrudeNext(options: IExtrudeOptionsNext): IGeometry;
580
+
581
+ declare class Polygon<T> extends Polyline<T> {
582
+ readonly kind: GeometryKind;
583
+ isPolygon: boolean;
584
+ constructor(vs?: any[], normal?: Vec3);
585
+ offset(distance: number, normal?: Vec3): Polygon<T>;
586
+ containPoint(point: Vec3, tolerance?: number): boolean;
587
+ containsPoint(point: Vec3, tolerance?: number): boolean;
588
+ distancePoint(point: Vec3): DistanceResult;
589
+ }
590
+
591
+ declare enum ClipType {
592
+ Intersection = 0,
593
+ Union = 1,
594
+ Difference = 2,
595
+ Xor = 3
596
+ }
597
+ /**
598
+ * 线段正反原则:右手坐标系中,所在平面为XZ平面,把指向方向看着负Z轴,x正为正方向,x负为负方向
599
+ */
600
+ declare class Polyline<T> extends ArrayList<T> implements GeometryQuery<Polyline<T>> {
601
+ readonly kind: GeometryKind;
602
+ isCoPlanar: boolean;
603
+ isPolyline: boolean;
604
+ normal: Vec3;
605
+ constructor(vs?: Array<T> | Polyline<T> | Polygon<T>, normal?: Vec3);
606
+ static CleanPolygon(points: Vec3[], delta?: number): Vec3[];
607
+ static OffsetPaths(paths: Vec3[][], delta: number, jointype?: JoinType, endtype?: EndType, limit?: number): Vec3[][];
608
+ static SimplifyPolygon(points: Vec3[]): Vec3[][];
609
+ /**
610
+ * 偏移
611
+ * @param {Number} distance 偏移距离
612
+ * @param {Vector3} normal 折线所在平面法线
613
+ */
614
+ offset(distance: number, normal?: Vec3, endtype?: EndType, jointype?: JoinType): Polyline<T>;
615
+ /**
616
+ * 圆角 将折线拐点圆角化
617
+ * @param {Number} useDistance 圆角段距离
618
+ * @param {Number} segments 分切割段数
619
+ */
620
+ corner(useDistance: number, normal?: Vec3): Polyline<T>;
621
+ set(points: T[]): this;
622
+ copy(source: Polyline<T>): this;
623
+ clone(): this;
624
+ distancePoint(point: Vec3): DistanceResult;
625
+ toJSON(): GeometryData;
626
+ }
627
+
628
+ /** A fixed-size geometry owns its vertices; array operations cannot change its arity. */
629
+ declare abstract class FixedVertices implements Iterable<Vec3> {
630
+ readonly [index: number]: Vec3;
631
+ protected readonly vertices: Vec3[];
632
+ protected constructor(points: readonly Vec3[]);
633
+ get length(): number;
634
+ [Symbol.iterator](): IterableIterator<Vec3>;
635
+ map<T>(callback: (point: Vec3, index: number) => T): T[];
636
+ forEach(callback: (point: Vec3, index: number) => void): void;
637
+ slice(start?: number, end?: number): Vec3[];
638
+ toArray(): Vec3[];
639
+ }
640
+
641
+ declare class Triangle extends FixedVertices implements GeometryQuery<Triangle> {
642
+ constructor(a: Vec3, b: Vec3, c: Vec3);
643
+ get p0(): Vec3;
644
+ get p1(): Vec3;
645
+ get p2(): Vec3;
646
+ distanceTriangle(triangle: Triangle): DistanceResult;
647
+ distancePoint(point: Vec3): DistanceResult;
648
+ distanceSegment(segment: Segment): DistanceResult;
649
+ distancePlane(plane: Plane): DistanceResult;
650
+ set(a: Vec3, b: Vec3, c: Vec3): this;
651
+ copy(source: Triangle): this;
652
+ clone(): Triangle;
653
+ distanceLine(line: Line): DistanceResult;
654
+ distanceRay(ray: Ray): DistanceResult;
655
+ readonly kind: GeometryKind;
656
+ distanceSphere(sphere: Sphere): DistanceResult;
657
+ distanceCapsule(capsule: Capsule): DistanceResult;
658
+ distanceRectangle(rectangle: Rectangle): DistanceResult;
659
+ toJSON(): GeometryData;
660
+ }
661
+
662
+ declare class Segment extends FixedVertices implements GeometryQuery<Segment> {
663
+ normal: Vec3 | undefined;
664
+ /**
665
+ * 线段
666
+ * @param {Point|Vec3} p0
667
+ * @param {Point|Vec3} p1
668
+ */
669
+ constructor(p0?: Vec3, p1?: Vec3);
670
+ set(p0: Vec3, p1: Vec3): this;
671
+ get center(): Vec3;
672
+ get extentDirection(): Vec3;
673
+ get extentSqr(): number;
674
+ get extent(): number;
675
+ get direction(): Vec3;
676
+ get p0(): Vec3;
677
+ set p0(v: Vec3);
678
+ get p1(): Vec3;
679
+ set p1(v: Vec3);
680
+ offset(distance: number, normal?: Vec3): this;
681
+ /**
682
+ * 线段到线段的距离
683
+ * @param {Segment} segment
684
+ */
685
+ distanceSegment(segment: Segment): DistanceResult;
686
+ distancePlane(plane: Plane): DistanceResult;
687
+ intersectSegment(segment: Segment, tolerance?: number): {
688
+ colinear: boolean;
689
+ intersected: boolean;
690
+ points: Vec3[];
691
+ rayParameter?: number;
692
+ lineParameter?: number;
693
+ closests: [Vec3, Vec3];
694
+ parameters: [DistanceParameter, DistanceParameter];
695
+ distance: number;
696
+ distanceSqr: number;
697
+ equidistant?: boolean;
698
+ interior?: boolean;
699
+ triangleParameters?: number[];
700
+ rectangleParameters?: number[];
701
+ circleClosest?: Vec3;
702
+ signedDistance?: number;
703
+ segmentIndex?: number;
704
+ diskClosest?: Vec3;
705
+ };
706
+ distancePoint(point: Vec3): DistanceResult;
707
+ distanceLine(line: Line): DistanceResult;
708
+ distanceRay(ray: Ray): DistanceResult;
709
+ distanceTriangle(triangle: Triangle): DistanceResult;
710
+ intersectPlane(plane: Plane): Vec3 | Vec3[] | null;
711
+ distanceSphere(sphere: Sphere): DistanceResult;
712
+ distanceCapsule(capsule: Capsule): DistanceResult;
713
+ copy(source: Segment): this;
714
+ clone(): Segment;
715
+ readonly kind: GeometryKind;
716
+ distanceBox(box: Box): DistanceResult;
717
+ distanceRectangle(rectangle: Rectangle): DistanceResult;
718
+ toJSON(): GeometryData;
719
+ }
720
+ declare function segment(p0: Vec3, p1: Vec3): Segment;
721
+
722
+ declare class Rectangle extends FixedVertices implements GeometryQuery<Rectangle> {
723
+ constructor(a: Vec3, b: Vec3, c: Vec3, d?: Vec3);
724
+ set(a: Vec3, b: Vec3, c: Vec3, d?: Vec3): this;
725
+ get center(): Vec3;
726
+ get axis(): Vec3[];
727
+ get extent(): number[];
728
+ copy(source: Rectangle): this;
729
+ clone(): Rectangle;
730
+ distancePoint(point: Vec3): DistanceResult;
731
+ private query;
732
+ distanceLine(line: Line): DistanceResult;
733
+ distanceRay(ray: Ray): DistanceResult;
734
+ distanceSegment(segment: Segment): DistanceResult;
735
+ distanceTriangle(triangle: Triangle): DistanceResult;
736
+ distancePlane(plane: Plane): DistanceResult;
737
+ distanceRectangle(rectangle: Rectangle): DistanceResult;
738
+ readonly kind: GeometryKind;
739
+ toJSON(): GeometryData;
740
+ }
741
+
742
+ declare class Ray implements GeometryQuery<Ray> {
743
+ origin: Vec3;
744
+ direction: Vec3;
745
+ constructor(origin: Vec3, direction: Vec3);
746
+ /**
747
+ * 射线到射线的距离
748
+ * @param {Ray} ray
749
+ */
750
+ distanceRay(ray: Ray): DistanceResult;
751
+ /**
752
+ * 射线到线段的距离
753
+ * @param segment
754
+ */
755
+ distanceSegment(segment: Segment): DistanceResult;
756
+ distanceTriangle(triangle: Triangle): DistanceResult;
757
+ /** @deprecated Use distancePolyline. */
758
+ distancePloyline(polyline: Polyline<Vec3> | Vec3[]): DistanceResult;
759
+ distancePolyline(polyline: Polyline<Vec3> | Vec3[]): DistanceResult;
760
+ distancePoint(point: Vec3): DistanceResult;
761
+ intersectPlane(plane: Plane, result?: Vec3): Vec3 | undefined;
762
+ distancePlane(plane: Plane): DistanceResult;
763
+ distanceSphere(sphere: Sphere): DistanceResult;
764
+ distanceCapsule(capsule: Capsule): DistanceResult;
765
+ set(origin: Vec3, direction: Vec3): this;
766
+ copy(source: Ray): this;
767
+ clone(): Ray;
768
+ distanceLine(line: Line): DistanceResult;
769
+ readonly kind: GeometryKind;
770
+ distanceBox(box: Box): DistanceResult;
771
+ distanceRectangle(rectangle: Rectangle): DistanceResult;
772
+ toJSON(): GeometryData;
773
+ }
774
+
775
+ declare class Sphere implements GeometryQuery<Sphere> {
776
+ applyMat4(mat: Mat4): this;
777
+ center: Vec3;
778
+ radius: number;
779
+ constructor(center?: Vec3, radius?: number);
780
+ setComponents(cx: number, cy: number, cz: number, radius: number): this;
781
+ copy(sphere: Sphere): this;
782
+ clone(): Sphere;
783
+ set(center: Vec3, radius: number): this;
784
+ distancePoint(point: Vec3): DistanceResult;
785
+ distanceLine(line: Line): DistanceResult;
786
+ distanceRay(ray: Ray): DistanceResult;
787
+ distanceSegment(segment: Segment): DistanceResult;
788
+ distancePlane(plane: Plane): DistanceResult;
789
+ distanceTriangle(triangle: Triangle): DistanceResult;
790
+ distanceSphere(sphere: Sphere): DistanceResult;
791
+ distanceCapsule(capsule: Capsule): DistanceResult;
792
+ containsPoint(point: Vec3): boolean;
793
+ readonly kind: GeometryKind;
794
+ distanceBox(box: Box): DistanceResult;
795
+ distanceRectangle(rectangle: Rectangle): DistanceResult;
796
+ toJSON(): GeometryData;
797
+ }
798
+
799
+ /**
800
+ * 几何体buffer属性
801
+ * 记录每个几何数据属性的细节
802
+ */
803
+ declare class BufferAttribute {
804
+ name: string;
805
+ itemSize: number;
806
+ array: TypedArray;
807
+ version: number;
808
+ normalized: boolean;
809
+ count: number;
810
+ updateRange: {
811
+ offset: number;
812
+ count: number;
813
+ };
814
+ readonly isBufferAttribute: true;
815
+ /**
816
+ *
817
+ * @param array {BufferArray} Buffer数据
818
+ * @param itemSize 单元长度,vec3是3,vec4是4
819
+ * @param normalized
820
+ */
821
+ constructor(array: TypedArray, itemSize: number, normalized?: boolean);
822
+ set needsUpdate(value: boolean);
823
+ onUploadCallback?: () => void;
824
+ onUpload(callback: () => void): this;
825
+ setUsage(usage: any): this;
826
+ copy(source: BufferAttribute): this;
827
+ copyAt(index1: number, attribute: BufferAttribute, index2: number): this;
828
+ copyArray(array: ArrayLike<number>): this;
829
+ copyColorsArray(colors: {
830
+ r: number;
831
+ g: number;
832
+ b: number;
833
+ }[]): this;
834
+ copyVec2sArray(vectors: {
835
+ x: number;
836
+ y: number;
837
+ }[]): this;
838
+ copyVec3sArray(vectors: {
839
+ x: number;
840
+ y: number;
841
+ z: number;
842
+ }[]): this;
843
+ copyVec4sArray(vectors: {
844
+ x: number;
845
+ y: number;
846
+ z: number;
847
+ w: number;
848
+ }[]): this;
849
+ applyMat3(m: Mat3): this;
850
+ applyMat4(m: Mat4): this;
851
+ applyNormalMat(m: Mat3): this;
852
+ transformDirection(m: Mat4): this;
853
+ set(value: ArrayLike<number>, offset: number): this;
854
+ getX(index: number): number;
855
+ setX(index: number, x: number): this;
856
+ getY(index: number): number;
857
+ setY(index: number, y: number): this;
858
+ getZ(index: number): number;
859
+ setZ(index: number, z: number): this;
860
+ getW(index: number): number;
861
+ setW(index: number, w: number): this;
862
+ setXY(index: number, x: number, y: number): this;
863
+ setXYZ(index: number, x: number, y: number, z: number): this;
864
+ setXYZW(index: number, x: number, y: number, z: number, w: number): this;
865
+ clone(): BufferAttribute;
866
+ toJSON(): {
867
+ itemSize: number;
868
+ type: string;
869
+ array: number[];
870
+ normalized: boolean;
871
+ };
872
+ }
873
+ declare class Int8BufferAttribute extends BufferAttribute {
874
+ constructor(array: any, itemSize: number, normalized?: boolean);
875
+ }
876
+ declare class Uint8BufferAttribute extends BufferAttribute {
877
+ constructor(array: any, itemSize: number, normalized?: boolean);
878
+ }
879
+ declare class Uint8ClampedBufferAttribute extends BufferAttribute {
880
+ constructor(array: any, itemSize: number, normalized?: boolean);
881
+ }
882
+ declare class Int16BufferAttribute extends BufferAttribute {
883
+ constructor(array: any, itemSize: number, normalized?: boolean);
884
+ }
885
+ declare class Uint16BufferAttribute extends BufferAttribute {
886
+ constructor(array: any, itemSize: number, normalized?: boolean);
887
+ }
888
+ declare class Int32BufferAttribute extends BufferAttribute {
889
+ constructor(array: any, itemSize: number, normalized?: boolean);
890
+ }
891
+ declare class Uint32BufferAttribute extends BufferAttribute {
892
+ constructor(array: any, itemSize: number, normalized?: boolean);
893
+ }
894
+ declare class Float32BufferAttribute extends BufferAttribute {
895
+ constructor(array: any, itemSize: number, normalized?: boolean);
896
+ }
897
+ declare class Float64BufferAttribute extends BufferAttribute {
898
+ constructor(array: any, itemSize: number, normalized?: boolean);
899
+ }
900
+
901
+ interface IGeometry {
902
+ position: number[];
903
+ normal?: number[];
904
+ index?: number[];
905
+ uv?: number[];
906
+ uv2?: number[];
907
+ tangent?: number[];
908
+ }
909
+ interface IBufferGeometry {
910
+ position: Float32Array | undefined;
911
+ index?: Uint32Array | Uint16Array;
912
+ normal?: Float32Array;
913
+ uv?: Float32Array;
914
+ uv2?: Float32Array;
915
+ tangent?: Float32Array;
916
+ }
917
+ /**
918
+ * BufferType 几何体,用于独立计算几何体
919
+ */
920
+ declare class BufferGeometry {
921
+ name: string;
922
+ boundingBox: Box | undefined;
923
+ boundingSphere: Sphere | undefined;
924
+ morphAttributes: any;
925
+ morphTargetsRelative: boolean;
926
+ index: BufferAttribute | undefined;
927
+ attributes: {
928
+ [key: string]: BufferAttribute;
929
+ };
930
+ groups: {
931
+ start: number;
932
+ count: number;
933
+ materialIndex?: number;
934
+ }[];
935
+ drawRange: {
936
+ start: number;
937
+ count: number;
938
+ };
939
+ parameters: any;
940
+ readonly isBufferGeometry: true;
941
+ constructor();
942
+ /**
943
+ * 转化成BufferArray来计算
944
+ * @param geo
945
+ */
946
+ setFromGeometry(geo: IGeometry | IBufferGeometry): this;
947
+ getIndex(): BufferAttribute | undefined;
948
+ setIndex(index: BufferAttribute | TypedArray | number[]): void;
949
+ getAttribute(name: string): BufferAttribute;
950
+ setAttribute(name: string, attribute: BufferAttribute): this;
951
+ addAttribute(name: string, attribute: BufferAttribute | TypedArray | Array<number | Vec2 | Vec3 | Vec4>, itemSize?: number): this;
952
+ deleteAttribute(name: string): this;
953
+ addGroup(start: number, count: number, materialIndex?: number): void;
954
+ clearGroups(): void;
955
+ setDrawRange(start: number, count: number): void;
956
+ applyMat4(matrix: Mat4): this;
957
+ rotateX(angle: number): this;
958
+ rotateY(angle: number): this;
959
+ rotateZ(angle: number): this;
960
+ translate(x: number, y: number, z: number): this;
961
+ scale(x: number, y: number, z: number): this;
962
+ lookAt(vector: Vec3): this;
963
+ center(): this;
964
+ setFromObject(object: any): this;
965
+ setFromPoints(points: Vec3[]): this;
966
+ updateFromObject(object: any): this;
967
+ computeBoundingBox(): void;
968
+ computeBoundingSphere(): void;
969
+ computeFaceNormals(): this;
970
+ computeVertexNormals(): void;
971
+ merge(geometry: BufferGeometry, offset: number): this | undefined;
972
+ normalizeNormals(): void;
973
+ toFlat(): BufferGeometry;
974
+ toNonIndexed(): BufferGeometry;
975
+ toJSON(): any;
976
+ userData(userData: any): void;
977
+ clone(): BufferGeometry;
978
+ copy(source: BufferGeometry): this;
979
+ }
980
+
981
+ /** Plane equation: normal.dot(point) + w = 0. */
982
+ declare class Plane implements GeometryQuery<Plane> {
983
+ normal: Vec3;
984
+ w: number;
985
+ constructor(normal?: Vec3, w?: number);
986
+ private validate;
987
+ get origin(): Vec3;
988
+ static setFromPointNormal(point: Vec3, normal: Vec3): Plane;
989
+ setFromPointNormal(point: Vec3, normal: Vec3): this;
990
+ set(normal: Vec3, w: number): this;
991
+ copy(plane: Plane): this;
992
+ clone(): Plane;
993
+ setComponents(x: number, y: number, z: number, w: number): this;
994
+ normalize(): this;
995
+ setFromThreePoint(a: Vec3, b: Vec3, c: Vec3): this;
996
+ negate(): this;
997
+ signedDistanceToPoint(point: Vec3): number;
998
+ frontback(point: Vec3): number;
999
+ distancePoint(point: Vec3): DistanceResult;
1000
+ distanceRay(ray: Ray): DistanceResult;
1001
+ distanceLine(line: Line): DistanceResult;
1002
+ distanceSegment(segment: Segment): DistanceResult;
1003
+ distanceTriangle(triangle: Triangle): DistanceResult;
1004
+ distancePlane(plane: Plane): DistanceResult;
1005
+ intersectSegmentLw(segment: Segment | Vec3[]): Vec3 | Vec3[] | null;
1006
+ intersectLine(line: Line, result?: Vec3): Vec3 | undefined;
1007
+ intersectRay(ray: Ray, result?: Vec3): Vec3 | undefined;
1008
+ splitSegment(segment: Segment | Vec3[]): {
1009
+ intersectPoint: Vec3 | undefined;
1010
+ negative: Vec3[];
1011
+ positive: Vec3[];
1012
+ common: Vec3[];
1013
+ orientation: Orientation;
1014
+ };
1015
+ splitTriangle(triangle: Triangle | Vec3[]): ISplitResult;
1016
+ /** Ordered polygons on either side; cut vertices are included in both. */
1017
+ splitConvexPolygon(polygon: Vec3[]): ISplitResult;
1018
+ orientationPoint(point: Vec3): Orientation;
1019
+ /** Split a triangle mesh surface, interpolating attributes. Does not cap cuts. */
1020
+ static splitGeometry(plane: Plane, geometry: IGeometry): {
1021
+ positive: IGeometry;
1022
+ negative: IGeometry;
1023
+ common: IGeometry;
1024
+ };
1025
+ readonly kind: GeometryKind;
1026
+ toJSON(): GeometryData;
1027
+ }
1028
+
1029
+ declare class Line implements GeometryQuery<Line> {
1030
+ origin: Vec3;
1031
+ end: Vec3;
1032
+ direction: Vec3;
1033
+ constructor(origin?: Vec3, end?: Vec3);
1034
+ set(origin: Vec3, end: Vec3): this;
1035
+ distancePoint(point: Vec3): DistanceResult;
1036
+ distanceSegment(segment: Segment): DistanceResult;
1037
+ /**
1038
+ * 直线到直线的距离
1039
+ * 参数与最近点顺序一致
1040
+ * @param {Line} line
1041
+ */
1042
+ distanceLine(line: Line): DistanceResult;
1043
+ /**
1044
+ * 直线与射线的距离
1045
+ * @param {Ray} ray
1046
+ */
1047
+ distanceRay(ray: Ray): DistanceResult;
1048
+ /**
1049
+ *
1050
+ * @param triangle
1051
+ */
1052
+ distanceTriangle(triangle: Triangle): DistanceResult;
1053
+ distancePolyline(polyline: Polyline<Vec3> | Vec3[]): DistanceResult;
1054
+ /**
1055
+ * 线与平面相交
1056
+ * @param plane
1057
+ * @param result
1058
+ */
1059
+ intersectPlane(plane: Plane, result?: Vec3): Vec3 | undefined;
1060
+ distancePlane(plane: Plane): DistanceResult;
1061
+ distanceSphere(sphere: Sphere): DistanceResult;
1062
+ distanceCapsule(capsule: Capsule): DistanceResult;
1063
+ copy(source: Line): this;
1064
+ clone(): Line;
1065
+ readonly kind: GeometryKind;
1066
+ distanceBox(box: Box): DistanceResult;
1067
+ distanceRectangle(rectangle: Rectangle): DistanceResult;
1068
+ toJSON(): GeometryData;
1069
+ }
1070
+ declare function line(start?: Vec3, end?: Vec3): Line;
1071
+
1072
+ declare class Capsule extends Segment implements GeometryQuery<Capsule> {
1073
+ radius: number;
1074
+ /**
1075
+ * 胶囊体
1076
+ * @param {Point|Vec3} p0 点0
1077
+ * @param {Point|Vec3} p1 点1
1078
+ * @param {Number} radius 半径
1079
+ */
1080
+ constructor(p0: Vec3, p1: Vec3, radius?: number);
1081
+ copy(source: Capsule): this;
1082
+ clone(): Capsule;
1083
+ set(p0: Vec3, p1: Vec3, radius?: number): this;
1084
+ distancePoint(point: Vec3): DistanceResult;
1085
+ distanceSphere(sphere: Sphere): DistanceResult;
1086
+ distanceCapsule(capsule: Capsule): DistanceResult;
1087
+ distanceSegment(segment: Segment): DistanceResult;
1088
+ distanceLine(line: Line): DistanceResult;
1089
+ distanceRay(ray: Ray): DistanceResult;
1090
+ distancePlane(plane: Plane): DistanceResult;
1091
+ distanceTriangle(triangle: Triangle): DistanceResult;
1092
+ containsPoint(point: Vec3): boolean;
1093
+ readonly kind: GeometryKind;
1094
+ distanceBox(box: Box): DistanceResult;
1095
+ distanceRectangle(rectangle: Rectangle): DistanceResult;
1096
+ toJSON(): GeometryData;
1097
+ }
1098
+
1099
+ declare class Box implements GeometryQuery<Box> {
1100
+ min: Vec3;
1101
+ max: Vec3;
1102
+ _center: Vec3;
1103
+ constructor(min?: Vec3, max?: Vec3);
1104
+ get center(): Vec3;
1105
+ /**
1106
+ *
1107
+ * @param {Array<Vec3>} points
1108
+ */
1109
+ setFromPoints(points: any): this;
1110
+ expand(...points: any[]): this;
1111
+ makeEmpty(): this;
1112
+ clone(): Box;
1113
+ copy(box: Box): this;
1114
+ setFromCenterAndSize(center: Vec3, size: Vec3): this;
1115
+ setFromBufferAttribute(attribute: BufferAttribute): this;
1116
+ expandByPoint(point: Vec3): this;
1117
+ isEmpty(): boolean;
1118
+ getCenter(target: Vec3): Vec3;
1119
+ set(min: Vec3, max: Vec3): this;
1120
+ containsPoint(point: Vec3): boolean;
1121
+ distancePoint(point: Vec3): DistanceResult;
1122
+ distanceBox(box: Box): DistanceResult;
1123
+ readonly kind: GeometryKind;
1124
+ distanceLine(line: Line): DistanceResult;
1125
+ distanceRay(ray: Ray): DistanceResult;
1126
+ distanceSegment(segment: Segment): DistanceResult;
1127
+ distanceSphere(sphere: Sphere): DistanceResult;
1128
+ distanceCapsule(capsule: Capsule): DistanceResult;
1129
+ distancePlane(plane: Plane): DistanceResult;
1130
+ distanceTriangle(triangle: Triangle): DistanceResult;
1131
+ distanceRectangle(rectangle: Rectangle): DistanceResult;
1132
+ toJSON(): GeometryData;
1133
+ }
1134
+
1135
+ declare class Circle implements GeometryQuery<Circle> {
1136
+ center: Vec3;
1137
+ radius: number;
1138
+ normal: Vec3;
1139
+ startAngle: number;
1140
+ lengthAngle: number;
1141
+ radiusSqr: number;
1142
+ /**
1143
+ * 圆圈
1144
+ * @param {Vec3} center 中心点
1145
+ * @param {Vec3} normal 法线
1146
+ * @param {Number} radius 半径
1147
+ */
1148
+ constructor(center?: Vec3, radius?: number, startAngle?: number, lengthAngle?: number, normal?: Vec3);
1149
+ area(): number;
1150
+ /**
1151
+ * 两个点
1152
+ * @param fixp0
1153
+ * @param fixp1
1154
+ * @param movep
1155
+ * @param normal
1156
+ */
1157
+ arc1(fixp0: Vec3, fixp1: Vec3, movep: Vec3, normal?: Vec3): void;
1158
+ /**
1159
+ * 全两个点确定半径,后面点确定 弧度 ,只需要检测鼠标移动时鼠标是否跨过第一条半径即可确定顺逆时针
1160
+ * @param fixp0
1161
+ * @param fixp1
1162
+ * @param movep
1163
+ */
1164
+ arc2(center: Vec3, fixp1: Vec3, movep: Vec3, ccw?: boolean, normal?: Vec3): this;
1165
+ setFrom3Points(p0: Vec3, p1: Vec3, p2: Vec3, normal?: Vec3): this;
1166
+ /**
1167
+ * 将圆环或者圆弧转化为路径点,生成XY平面上得三维点
1168
+ * @param center 中心点
1169
+ * @param radius 半径
1170
+ * @param startAngle 起始角 右手坐标系 以X正坐标轴为起点 单位弧度
1171
+ * @param lengthAngle 弧度长度 单位弧度
1172
+ * @param segment 分段
1173
+ */
1174
+ static toVecs(center: Vec3, radius: number, startAngle?: number, lengthAngle?: number, up?: Vec3, segment?: number): Vec3[];
1175
+ /**
1176
+ * 在p点延伸a,b两个方向,生成半径为r的圆弧,圆弧所在位置在a,b向量的内夹角
1177
+ * @param p 位置
1178
+ * @param a a方向
1179
+ * @param b b方向
1180
+ * @param r 圆弧半径
1181
+ */
1182
+ static PAdBdtoVecs(p: Vec3, a: Vec3, b: Vec3, r: number, segment?: number): Vec3[];
1183
+ static PApBptoVecs(p: Vec3, a: Vec3, b: Vec3, r: number, segment?: number): Vec3[];
1184
+ set(center: Vec3, radius: number, normal?: Vec3): this;
1185
+ copy(source: Circle): this;
1186
+ clone(): Circle;
1187
+ distancePoint(point: Vec3): DistanceResult;
1188
+ readonly kind: GeometryKind;
1189
+ toJSON(): GeometryData;
1190
+ }
1191
+ declare function circle(center?: Vec3, radius?: number): Circle;
1192
+
1193
+ declare class Disk implements GeometryQuery<Disk> {
1194
+ center: Vec3;
1195
+ normal: Vec3;
1196
+ radius: number;
1197
+ w: number;
1198
+ constructor(center: Vec3, radius: number, normal?: Vec3);
1199
+ area(): number;
1200
+ set(center: Vec3, radius: number, normal?: Vec3): this;
1201
+ copy(source: Disk): this;
1202
+ clone(): Disk;
1203
+ distancePoint(point: Vec3): DistanceResult;
1204
+ readonly kind: GeometryKind;
1205
+ toJSON(): GeometryData;
1206
+ }
1207
+ declare function disk(center: Vec3, radius: number, normal: Vec3): Disk;
1208
+
1209
+ interface IVec2 {
1210
+ x: number;
1211
+ y: number;
1212
+ }
1213
+ interface IVec3 extends IVec2 {
1214
+ z: number;
1215
+ }
1216
+ interface IVec4 extends IVec3 {
1217
+ w: number;
1218
+ }
1219
+ declare class Vec3 implements IVec3 {
1220
+ private _x;
1221
+ private _y;
1222
+ private _z;
1223
+ constructor(_x?: number, _y?: number, _z?: number);
1224
+ get x(): number;
1225
+ set x(value: number);
1226
+ get y(): number;
1227
+ set y(value: number);
1228
+ get z(): number;
1229
+ set z(value: number);
1230
+ static isVec3(v: any): boolean;
1231
+ get isVec3(): boolean;
1232
+ static get Up(): Vec3;
1233
+ static get Down(): Vec3;
1234
+ static get UnitX(): Vec3;
1235
+ static get UnitY(): Vec3;
1236
+ static get UnitZ(): Vec3;
1237
+ set(x: number, y: number, z: number): this;
1238
+ setScalar(scalar: number): this;
1239
+ setComponent(index: number, value: number): this;
1240
+ getComponent(index: number): number;
1241
+ clone(): Vec3;
1242
+ copy(v: Vec3): this;
1243
+ add(v: Vec3, w?: Vec3): this;
1244
+ addScalar(s: number): this;
1245
+ addVecs(a: Vec3, b: Vec3): this;
1246
+ addScaledVec(v: Vec3, s: number): this;
1247
+ sub(v: Vec3, w?: Vec3): this;
1248
+ subScalar(s: number): this;
1249
+ subVecs(a: Vec3, b: Vec3): this;
1250
+ multiply(v: Vec3, w?: Vec3): this;
1251
+ multiplyScalar(scalar: number): this;
1252
+ multiplyVecs(a: Vec3, b: Vec3): this;
1253
+ applyEuler(euler: Euler): this;
1254
+ applyAxisAngle(axis: any, angle: any): this;
1255
+ applyNormalMat(m: Mat3): this;
1256
+ applyMat3(m: Mat3): this;
1257
+ applyMat4(m: Mat4): this;
1258
+ applyQuat(q: Quat): this;
1259
+ project(camera: {
1260
+ matrixWorldInverse: any;
1261
+ projectionMat: any;
1262
+ }): this;
1263
+ unproject(camera: {
1264
+ projectionMatInverse: any;
1265
+ matrixWorld: any;
1266
+ }): this;
1267
+ transformDirection(m: Mat4): this;
1268
+ divide(v: Vec3): this;
1269
+ divideScalar(scalar: number): this;
1270
+ min(v: Vec3): this;
1271
+ max(v: Vec3): this;
1272
+ clamp(min: Vec3, max: Vec3): this;
1273
+ clampScalar(minVal: number, maxVal: number): this;
1274
+ clampLength(min: number, max: number): this;
1275
+ floor(): this;
1276
+ ceil(): this;
1277
+ round(): this;
1278
+ roundToZero(): this;
1279
+ negate(): this;
1280
+ dot(v: Vec3): number;
1281
+ lengthSq(): number;
1282
+ length(): number;
1283
+ manhattanLength(): number;
1284
+ normalize(robust?: boolean): this;
1285
+ setLength(length: any): this;
1286
+ lerp(v: Vec3, alpha: number): this;
1287
+ lerpVecs(v1: Vec3, v2: any, alpha: any): this;
1288
+ slerp(v2: any, radian: number): void;
1289
+ /**
1290
+ * v1 到 v2 选择angle弧度 v1,v2构成一个平面
1291
+ * @param v1
1292
+ * @param v2
1293
+ * @param alpha
1294
+ * @returns
1295
+ */
1296
+ slerpVecs(v1: Vec3, v2: any, radian: number): void;
1297
+ cross(v: Vec3, w?: Vec3): this;
1298
+ crossVecs(a: Vec3, b: Vec3): this;
1299
+ projectOnVec(vec: Vec3): this;
1300
+ /**
1301
+ * 投影到法线的所在平面 相当于平面上距离点最近的点
1302
+ * @param planeNormal
1303
+ * @returns
1304
+ */
1305
+ projectOnPlaneNormal(normal: Vec3, w?: number): this;
1306
+ /**
1307
+ * 投影到平面
1308
+ * @param normal 正交化的法线
1309
+ * @param w 距离
1310
+ * @returns
1311
+ */
1312
+ projectOnPlaneNormalDis(normal: Vec3, w: number): this;
1313
+ /**
1314
+ * 投影到平面
1315
+ * @param plane 平面
1316
+ * @returns
1317
+ */
1318
+ projectOnPlane(plane: Plane): this;
1319
+ /**
1320
+ * 从指定方向线(斜线,也可能是法线)上投影到平面
1321
+ * @param planeNormal
1322
+ * @param dir
1323
+ */
1324
+ projectDirectionOnPlane(plane: Plane, dir: Vec3): this;
1325
+ reflect(normal: any): this;
1326
+ /**
1327
+ * 两个向量的夹角
1328
+ * @param v
1329
+ * @param normal
1330
+ * @returns
1331
+ */
1332
+ angleTo(v: Vec3, normal?: Vec3 | any): number;
1333
+ /**
1334
+ * 一个向量到另一个向量的角度
1335
+ * @param v
1336
+ * @param normal
1337
+ * @returns
1338
+ */
1339
+ angleToEx(v: Vec3, normal: Vec3): number;
1340
+ distanceTo(v: any): number;
1341
+ distanceToSquared(v: Vec3): number;
1342
+ manhattanDistanceTo(v: Vec3): number;
1343
+ setFromSpherical(s: {
1344
+ radius: number;
1345
+ phi: number;
1346
+ theta: number;
1347
+ }): this;
1348
+ setFromSphericalCoords(radius: number, phi: number, theta: number): this;
1349
+ setFromCylindrical(c: {
1350
+ radius: any;
1351
+ theta: any;
1352
+ y: any;
1353
+ }): this;
1354
+ setFromCylindricalCoords(radius: number, theta: number, y: number): this;
1355
+ setFromMatPosition(m: {
1356
+ elements: any;
1357
+ }): this;
1358
+ setFromMatScale(m: any): this;
1359
+ setFromMatColumn(m: {
1360
+ elements: any;
1361
+ }, index: number): this;
1362
+ equals(v: Vec3): boolean;
1363
+ fromArray(array: ArrayLike<number>, offset?: number): this;
1364
+ toArray(): number[];
1365
+ toArray<T extends TypedArrayLike>(array: T, offset?: number): T;
1366
+ fromBufferAttribute(attribute: {
1367
+ getX: (arg0: any) => number;
1368
+ getY: (arg0: any) => number;
1369
+ getZ: (arg0: any) => number;
1370
+ }, index: any, offset?: number): this;
1371
+ toFixed(fractionDigits: number | undefined): this;
1372
+ distancePoint(point: Vec3): DistanceResult;
1373
+ distanceVec3(point: Vec3): DistanceResult;
1374
+ /**
1375
+ * 点到直线的距离 point distance to Line
1376
+ * @param line
1377
+ */
1378
+ distanceLine(line: Line): DistanceResult;
1379
+ /**
1380
+ * Test success
1381
+ * 到射线的距离
1382
+ * @param {Line} line
1383
+ * @returns {Object} lineParameter 最近点的参数 lineClosest 最近点 distanceSqr 到最近点距离的平方 distance 到最近点距离
1384
+ */
1385
+ distanceRay(ray: Ray): DistanceResult;
1386
+ /**
1387
+ * Test success
1388
+ * 到线段的距离
1389
+ * @param {Line} line
1390
+ * @returns {Object} lineParameter 最近点的参数 lineClosest 最近点 distanceSqr 到最近点距离的平方 distance 到最近点距离
1391
+ */
1392
+ distanceSegment(segment: Segment): DistanceResult;
1393
+ /**
1394
+ * 点与线段的距离
1395
+ * @param plane
1396
+ */
1397
+ distancePlane(plane: Plane): DistanceResult;
1398
+ /**
1399
+ * 点与圆圈的距离
1400
+ * @param {*} circle
1401
+ * @param {*} disk
1402
+ * @returns {} result
1403
+ */
1404
+ distanceCircle(circle: Circle): DistanceResult;
1405
+ /**
1406
+ * 点与圆盘的距离
1407
+ * @param {*} Disk
1408
+ * @returns {} result
1409
+ */
1410
+ distanceDisk(disk: Disk): DistanceResult;
1411
+ /**
1412
+ * 点与线段的距离
1413
+ * 点与折线的距离 测试排除法,平均比线性检索(暴力法)要快两倍以上
1414
+ * @param { Polyline | Vec3[]} polyline
1415
+ */
1416
+ distancePolyline(polyline: Polyline<Vec3> | Vec3[]): DistanceResult;
1417
+ /**
1418
+ * 点到三角形的距离
1419
+ * @param {Triangle} triangle
1420
+ */
1421
+ distanceTriangle(triangle: Triangle): DistanceResult;
1422
+ /**
1423
+ * 点到矩形的距离
1424
+ * @param {Rectangle} rectangle
1425
+ */
1426
+ distanceRectangle(rectangle: Rectangle): DistanceResult;
1427
+ /**
1428
+ * 点到胶囊的距离
1429
+ * @param {Capsule} capsule
1430
+ */
1431
+ distanceCapsule(capsule: Capsule): DistanceResult;
1432
+ distanceSphere(sphere: Sphere): DistanceResult;
1433
+ distanceBox(box: Box): DistanceResult;
1434
+ readonly kind: "Point";
1435
+ toJSON(): GeometryData;
1436
+ }
1437
+ declare function v3(x?: number, y?: number, z?: number): Vec3;
1438
+
1439
+ declare class Mat4 {
1440
+ elements: number[];
1441
+ isMat4: boolean;
1442
+ constructor();
1443
+ set(n11: number, n12: number, n13: number, n14: number, n21: number, n22: number, n23: number, n24: number, n31: number, n32: number, n33: number, n34: number, n41: number, n42: number, n43: number, n44: number): this;
1444
+ static get Identity(): Mat4;
1445
+ identity(): this;
1446
+ clone(): Mat4;
1447
+ copy(m: Mat4): this;
1448
+ copyPosition(m: {
1449
+ elements: any;
1450
+ }): this;
1451
+ extractBasis(xAxis: Vec3, yAxis: Vec3, zAxis: Vec3): this;
1452
+ makeBasis(xAxis: Vec3, yAxis: Vec3, zAxis: Vec3): this;
1453
+ extractRotation(m: Mat4): this;
1454
+ makeRotationFromEuler(euler: Euler): this;
1455
+ makeRotationFromQuat(q: any): this;
1456
+ lookAt(eye: Vec3, target: Vec3, up: Vec3): this;
1457
+ multiply(m: Mat4, n?: Mat4): this;
1458
+ premultiply(m: Mat4): this;
1459
+ multiplyMats(a: Mat4, b: Mat4): this;
1460
+ multiplyScalar(s: number): this;
1461
+ applyToBufferAttribute(attribute: {
1462
+ count: any;
1463
+ getX: (arg0: number) => number;
1464
+ getY: (arg0: number) => number;
1465
+ getZ: (arg0: number) => number;
1466
+ setXYZ: (arg0: number, arg1: number, arg2: number, arg3: number) => void;
1467
+ }): {
1468
+ count: any;
1469
+ getX: (arg0: number) => number;
1470
+ getY: (arg0: number) => number;
1471
+ getZ: (arg0: number) => number;
1472
+ setXYZ: (arg0: number, arg1: number, arg2: number, arg3: number) => void;
1473
+ };
1474
+ determinant(): number;
1475
+ transpose(): this;
1476
+ setPosition(x: number | Vec3 | any, y?: number, z?: number): this;
1477
+ /**
1478
+ * 矩阵求逆
1479
+ * @returns 自己
1480
+ */
1481
+ invert(): Mat4;
1482
+ getInverse(m: Mat4, throwOnDegenerate?: boolean): this;
1483
+ scale(v: {
1484
+ x: any;
1485
+ y: any;
1486
+ z: any;
1487
+ }): this;
1488
+ getMaxScaleOnAxis(): number;
1489
+ makeTranslation(x: number, y: number, z: number): this;
1490
+ makeRotationX(theta: number): this;
1491
+ makeRotationY(theta: number): this;
1492
+ makeRotationZ(theta: number): this;
1493
+ makeRotationAxis(axis: {
1494
+ x: any;
1495
+ y: any;
1496
+ z: any;
1497
+ }, angle: number): this;
1498
+ makeScale(x: number, y: number, z: number): this;
1499
+ /**
1500
+ * 6个参数 都是由两个值来影响 [v1][v2] v1表示v2轴在v1轴产生效果
1501
+ * @param xy
1502
+ * @param xz
1503
+ * @param yx
1504
+ * @param yz
1505
+ * @param zx
1506
+ * @param zy
1507
+ * @returns
1508
+ */
1509
+ makeShear(xy: number, xz: number, yx: number, yz: number, zx: number, zy: number): this;
1510
+ compose(position: Vec3, quat: Quat, scale: Euler | Vec3): this;
1511
+ decompose(position: Vec3, quat: Quat, scale: Vec3): this;
1512
+ makePerspective(left: number, right: number, top: number, bottom: number, near: number, far: number): this;
1513
+ makeOrthographic(left: number, right: number, top: number, bottom: number, near: number, far: number): this;
1514
+ equals(matrix: {
1515
+ elements: any;
1516
+ }): boolean;
1517
+ fromArray(array: number[], offset?: number): this;
1518
+ toArray(array?: number[], offset?: number): number[];
1519
+ }
1520
+ declare function m4(): Mat4;
1521
+
1522
+ declare class Euler {
1523
+ _x: number;
1524
+ _y: number;
1525
+ _z: number;
1526
+ _order: string;
1527
+ isEuler: boolean;
1528
+ constructor(_x?: number, _y?: number, _z?: number, _order?: string);
1529
+ get x(): number;
1530
+ set x(value: number);
1531
+ get y(): number;
1532
+ set y(value: number);
1533
+ get z(): number;
1534
+ set z(value: number);
1535
+ get order(): string;
1536
+ set order(value: string);
1537
+ set(x: number, y: number, z: number, order: string): this;
1538
+ clone(): Euler;
1539
+ copy(Euler: {
1540
+ _x: number;
1541
+ _y: number;
1542
+ _z: number;
1543
+ _order: string;
1544
+ }): this;
1545
+ setFromRotationMat(m: Mat4, order: string, update: boolean | undefined): this | undefined;
1546
+ setFromQuat(q: Quat, order?: any, update?: boolean): this | undefined;
1547
+ setFromVec3(v: {
1548
+ x: any;
1549
+ y: any;
1550
+ z: any;
1551
+ }, order: any): this;
1552
+ reorder(newOrder: any): this | undefined;
1553
+ equals(Euler: {
1554
+ _x: number;
1555
+ _y: number;
1556
+ _z: number;
1557
+ _order: string;
1558
+ }): boolean;
1559
+ fromArray(array: any[]): this;
1560
+ toArray(array?: any[], offset?: number): any[];
1561
+ toVec3(optionalResult: {
1562
+ set: (arg0: number, arg1: number, arg2: number) => any;
1563
+ }): any;
1564
+ }
1565
+ declare function euler(x?: number, y?: number, z?: number): Euler;
1566
+
1567
+ declare const delta4 = 0.0001;
1568
+ declare const delta5 = 0.00001;
1569
+ declare const delta6 = 0.000001;
1570
+ declare const delta7 = 1e-7;
1571
+ declare const delta8 = 1e-8;
1572
+ declare const delta9 = 1e-9;
1573
+ /**
1574
+ * pi
1575
+ *
1576
+ * @type {Number}
1577
+ * @constant
1578
+ */
1579
+ declare const PI: number;
1580
+ /**
1581
+ * 1/pi
1582
+ *
1583
+ * @type {Number}
1584
+ * @constant
1585
+ */
1586
+ declare const ONE_OVER_PI: number;
1587
+ /**
1588
+ * pi/2
1589
+ *
1590
+ * @type {Number}
1591
+ * @constant
1592
+ */
1593
+ declare const PI_OVER_TWO: number;
1594
+ /**
1595
+ * pi/3
1596
+ *
1597
+ * @type {Number}
1598
+ * @constant
1599
+ */
1600
+ declare const PI_OVER_THREE: number;
1601
+ /**
1602
+ * pi/4
1603
+ *
1604
+ * @type {Number}
1605
+ * @constant
1606
+ */
1607
+ declare const PI_OVER_FOUR: number;
1608
+ /**
1609
+ * pi/6
1610
+ *
1611
+ * @type {Number}
1612
+ * @constant
1613
+ */
1614
+ declare const PI_OVER_SIX: number;
1615
+ /**
1616
+ * 3pi/2
1617
+ *
1618
+ * @type {Number}
1619
+ * @constant
1620
+ */
1621
+ declare const THREE_PI_OVER_TWO: number;
1622
+ /**
1623
+ * 2pi
1624
+ *
1625
+ * @type {Number}
1626
+ * @constant
1627
+ */
1628
+ declare const PI_TWO: number;
1629
+ /**
1630
+ * 1/2pi
1631
+ *
1632
+ * @type {Number}
1633
+ * @constant
1634
+ */
1635
+ declare const ONE_OVER_TWO_PI: number;
1636
+ /**
1637
+ * The number of radians in a degree.
1638
+ *
1639
+ * @type {Number}
1640
+ * @constant
1641
+ */
1642
+ declare const RADIANS_PER_DEGREE: number;
1643
+ /**
1644
+ * The number of degrees in a radian.
1645
+ *
1646
+ * @type {Number}
1647
+ * @constant
1648
+ */
1649
+ declare const DEGREES_PER_RADIAN: number;
1650
+ /**
1651
+ * The number of radians in an arc second.
1652
+ *
1653
+ * @type {Number}
1654
+ * @constant
1655
+ */
1656
+ declare const RADIANS_PER_ARCSECOND: number;
1657
+ declare function sign(value: number): 1 | -1;
1658
+ declare function approximateEqual(v1: number, v2: number, precision?: number): boolean;
1659
+ declare function clamp(value: number, min: number, max: number): number;
1660
+ declare function lerp(x: number, y: number, t: number): number;
1661
+ declare function smoothstep(x: number, min: number, max: number): number;
1662
+ declare function smootherstep(x: number, min: number, max: number): number;
1663
+ declare function randInt(low: number, high: number): number;
1664
+ /**
1665
+ * 生成一个low~high之间的浮点数
1666
+ * @param {*} low
1667
+ * @param {*} high
1668
+ */
1669
+ declare function randFloat(low: number, high: number): number;
1670
+ declare function isPowerOfTwo(value: number): boolean;
1671
+ declare function ceilPowerOfTwo(value: number): number;
1672
+ declare function floorPowerOfTwo(value: number): number;
1673
+ declare function toRadians(degrees: number): number;
1674
+ declare function ToDegrees(radians: number): number;
1675
+ /**
1676
+ * 数字或者向量固定位数
1677
+ * @param {Object} obj 数字或者向量
1678
+ * @param {*} fractionDigits
1679
+ */
1680
+ declare function toFixed(obj: {
1681
+ toFixed: (arg0: any) => string;
1682
+ x: number | undefined;
1683
+ y: number | undefined;
1684
+ z: number | undefined;
1685
+ }, fractionDigits: number | undefined): number | {
1686
+ toFixed: (arg0: any) => string;
1687
+ x: number | undefined;
1688
+ y: number | undefined;
1689
+ z: number | undefined;
1690
+ };
1691
+ /**
1692
+ * 数组中所有数字或者向量固定位数
1693
+ * @param {Array} array
1694
+ * @param {Number} precision
1695
+ */
1696
+ declare function toFixedAry(array: Array<any>, precision?: number): void;
1697
+
1698
+ /**
1699
+ * 遍历多级数组中所有对象
1700
+ * @param {Array} array
1701
+ * @param {Function} method
1702
+ */
1703
+ declare function forall(array: Array<any>, method: (arg0: any, index?: number, that?: Array<any>) => void): void;
1704
+ declare function flat(array: any[]): any[];
1705
+ /**
1706
+ * 分类
1707
+ * example:
1708
+ * var arry = [1,2,3,4,5,6]
1709
+ * var result = classify(array,(a)={return a%2===0})
1710
+ *
1711
+ * @param {Array} array
1712
+ * @param {Function} classifyMethod 分类方法
1713
+ */
1714
+ declare function classify(array: Array<any>, classifyMethod: (arg0: any, arg1: any, arg2: any[]) => any): any;
1715
+ /**
1716
+ * 去掉重复元素
1717
+ * @param {Array} array
1718
+ * @param {Function} uniqueMethod 去重复
1719
+ * @param {Function} sortMethod 排序 存在就先排序再去重复
1720
+ */
1721
+ declare function unique(array: any[], uniqueMethod: (arg0: any, arg1: any) => boolean, sortMethod?: (a: any, b: any) => number): any[];
1722
+
1723
+ declare class Color {
1724
+ _r: number;
1725
+ _g: number;
1726
+ _b: number;
1727
+ _a: number;
1728
+ constructor(r?: number, g?: number, b?: number, a?: number);
1729
+ get isColor(): boolean;
1730
+ get r(): number;
1731
+ set r(value: number);
1732
+ get g(): number;
1733
+ set g(value: number);
1734
+ get b(): number;
1735
+ set b(value: number);
1736
+ get a(): number;
1737
+ set a(value: number);
1738
+ set(value: any): this;
1739
+ setHex(hex: number): this;
1740
+ setHexCssString(style: string): this | undefined;
1741
+ setRGB(r: number, g: number, b: number, a?: number): this;
1742
+ clone(): any;
1743
+ copy(color: this): this;
1744
+ equals(c: this): boolean;
1745
+ toArray(array?: number[], offset?: number): number[];
1746
+ fromArray(array?: number[], offset?: number): number[];
1747
+ private byteToFloat;
1748
+ private floatToByte;
1749
+ getHexCssString(): string;
1750
+ toJSON(): string;
1751
+ static get White(): Readonly<Color>;
1752
+ static get Red(): Color;
1753
+ static get Green(): Color;
1754
+ static get Blue(): Color;
1755
+ }
1756
+
1757
+ /**
1758
+ * 当向量以数组的方式出现,一个计算单元库
1759
+ * @Description : 向量数组
1760
+ * @Author : 赵耀圣
1761
+ * @QQ : 549184003
1762
+ * @Date : 2021-08-02 15:09:33
1763
+ * @LastEditTime : 2021-08-02 15:50:16
1764
+ * @FilePath : \cga.js\src\math\VecArray.ts
1765
+ */
1766
+
1767
+ /**
1768
+ * 矢量几何操作,数字数组/矢量数组,常用工具集合
1769
+ */
1770
+ declare class vecs {
1771
+ /**
1772
+ * 去除相邻的重复向量
1773
+ * @param vs 矢量集合
1774
+ * @param delta 误差
1775
+ * @returns
1776
+ */
1777
+ static uniqueNeighborVecs(vs: Array<Vec3>, delta?: number): Vec3[];
1778
+ /**
1779
+ * 找到最大值
1780
+ * @param array
1781
+ * @returns
1782
+ */
1783
+ static max(array: ArrayLike<number>): number;
1784
+ /**
1785
+ * 找到最小值
1786
+ * @param array
1787
+ * @returns
1788
+ */
1789
+ static min(array: ArrayLike<number>): number;
1790
+ /**
1791
+ * 去除相邻没有重复点
1792
+ */
1793
+ static uniqueNeighbor(vs: number[], component?: number, delta?: number): number[];
1794
+ /**
1795
+ * 去除任意重复点
1796
+ * @param vs 向量数组
1797
+ * @param component 向量组件数量
1798
+ * @returns 无重复向量数组
1799
+ */
1800
+ static unique(vs: number[], component?: number): number[];
1801
+ /**
1802
+ * 翻转向量数组
1803
+ * @param vecs 向量数组
1804
+ * @param component 组件数量
1805
+ * @returns
1806
+ */
1807
+ static reverse(vecs: number[], component?: number): number[];
1808
+ /**
1809
+ * 点积
1810
+ * @param vecs
1811
+ * @returns
1812
+ */
1813
+ static dot(...vecs: number[]): number;
1814
+ /**
1815
+ * 长度平方
1816
+ * @param vecs
1817
+ * @returns
1818
+ */
1819
+ static distanceSq(...vecs: number[]): number;
1820
+ /**
1821
+ * 长度
1822
+ * @param vecs
1823
+ * @returns
1824
+ */
1825
+ static distance(...vecs: number[]): number;
1826
+ /**
1827
+ * 相加
1828
+ * @param vecs
1829
+ * @returns
1830
+ */
1831
+ static add(...vecs: number[]): number[] | (number & any[]);
1832
+ /**
1833
+ * 相减
1834
+ * @param vecs
1835
+ * @returns
1836
+ */
1837
+ static sub(...vecs: number[]): number[];
1838
+ /**
1839
+ * 相乘
1840
+ * @param vecs
1841
+ * @returns
1842
+ */
1843
+ static mul(...vecs: number[]): number[] | (number & any[]);
1844
+ /**
1845
+ * 获取矢量数组的i个矢量
1846
+ * @param vecs
1847
+ * @param i
1848
+ * @param component
1849
+ * @returns
1850
+ */
1851
+ static getVecAt(vecs: number[], i: number, component?: number): number[];
1852
+ /**
1853
+ * 在第 i 个位置插入一个向量
1854
+ * @param vecs
1855
+ * @param i
1856
+ * @param vec
1857
+ */
1858
+ static insertAt(vecs: number[], i: number, ...vec: number[]): void;
1859
+ /**
1860
+ * 是否逆时针
1861
+ * counterclockwise
1862
+ */
1863
+ static isCCW<T>(shape: Array<T> | ArrayList<T>, component?: number): boolean;
1864
+ /**
1865
+ * 将向量深度拆解为数字
1866
+ * @param {Array} Array<Vec4 | Vec3 | Vec2 | any> | any
1867
+ * @param {String} comSort 'x','y','z','w' 按顺序选取后自由组合
1868
+ * @returns {Array<Number>} 数字数组
1869
+ */
1870
+ static verctorToNumbers(vectors: Array<Vec4 | Vec3 | Vec2 | any> | any, comSort?: string): number[];
1871
+ static vec(component?: number): Vec3 | Vec2 | Vec4;
1872
+ /**
1873
+ * 数字数组 转 适量数组
1874
+ * @param vss 数字数组
1875
+ * @param component 矢量维度,默认为3
1876
+ * @returns
1877
+ */
1878
+ static numbersToVecs(vss: TypedArrayLike, component?: number): Vec2[] | Vec3[] | Vec4[];
1879
+ static applyQuat(vss: TypedArrayLike, quat: Quat, component?: number): void;
1880
+ static applyMat4(vss: TypedArrayLike, mat: Mat4, component?: number): void;
1881
+ static translate(vss: TypedArrayLike, distance: number[], component?: number): void;
1882
+ static rotate(vss: TypedArrayLike, axis: Vec3, angle: number): void;
1883
+ static scale(vss: TypedArrayLike, _scale: number[], component?: number): void;
1884
+ }
1885
+
1886
+ /**
1887
+ * 数组深度复制
1888
+ * @param {Array} array
1889
+ */
1890
+ declare function clone(array: any | any[]): any;
1891
+ /**
1892
+ * 点排序函数 xyz 有序排序回调
1893
+ * @param {Vector*} a
1894
+ * @param {Vector*} b
1895
+ */
1896
+ declare function vectorCompare(a: any | Vec3, b: any | Vec3): number;
1897
+ /**
1898
+ * 计算包围盒
1899
+ * @param {*} points 点集
1900
+ * @returns {Array[min,max]} 返回最小最大值
1901
+ */
1902
+ declare function boundingBox(points: Vec3[]): Vec3[];
1903
+ /**
1904
+ *
1905
+ * @param {*} points
1906
+ * @param {*} quat
1907
+ * @param {Boolean} ref 是否是引用
1908
+ */
1909
+ declare function applyQuat(points: any | Vec3[], quat: Quat, ref?: boolean): Vec3 | any;
1910
+ /**
1911
+ * 平移
1912
+ * @param {*} points
1913
+ * @param {*} distance
1914
+ * @param {*} ref
1915
+ */
1916
+ declare function translate(points: any | Vec3[], distance: Vec3, ref?: boolean): Vec3[] | any;
1917
+ /**
1918
+ * 旋转
1919
+ * @param {*} points
1920
+ * @param {*} axis
1921
+ * @param {*} angle
1922
+ * @param {*} ref
1923
+ */
1924
+ declare function rotate(points: any | Vec3[], axis: Vec3, angle: number, ref?: boolean): any;
1925
+ /**
1926
+ * 两个向量之间存在的旋转量来旋转点集
1927
+ * @param {*} points
1928
+ * @param {*} axis
1929
+ * @param {*} angle
1930
+ * @param {*} ref
1931
+ */
1932
+ declare function rotateByUnitVectors(points: any | Vec3[], vFrom: Vec3, vTo: Vec3, ref?: boolean): any;
1933
+ /**
1934
+ * 缩放
1935
+ * @param {*} points
1936
+ * @param {*} axis
1937
+ * @param {*} angle
1938
+ * @param {*} ref
1939
+ */
1940
+ declare function scale(points: any | Vec3[], _scale: Vec3, ref?: boolean): Vec3[] | any;
1941
+ /**
1942
+ * 响应矩阵
1943
+ * @param {*} points
1944
+ * @param {*} axis
1945
+ * @param {*} angle
1946
+ * @param {*} ref
1947
+ */
1948
+ declare function applyMatrix4(points: any | Vec3[], matrix: Mat4, ref?: boolean): Vec3[] | any;
1949
+ /**
1950
+ * 简化点集数组,折线,路径
1951
+ * @param {*} points 点集数组,折线,路径 ,继承Array
1952
+ * @param {*} maxDistance 简化最大距离
1953
+ * @param {*} maxAngle 简化最大角度
1954
+ */
1955
+ declare function simplifyPointList(points: any | Vec3[], maxDistance?: number, maxAngle?: number): any;
1956
+ /**
1957
+ * 以某个平面生成对称镜像
1958
+ * @param {*} points 点集
1959
+ * @param {*} plane 对称镜像平面
1960
+ */
1961
+ declare function reverseOnPlane(points: Vec3[], plane: Plane, ref?: boolean): Vec3[];
1962
+ /**
1963
+ * 投影到平面
1964
+ * @param {*} points 点集
1965
+ * @param {*} plane 投影平面
1966
+ * @param {*} projectDirect 默认是法线的方向
1967
+ */
1968
+ declare function projectOnPlane(points: Vec3[], plane: Plane, direction?: Vec3, ref?: boolean): Vec3[];
1969
+ /**
1970
+ * 计算共面点集所在的平面
1971
+ * @param {Array<Vec3|Point>} points
1972
+ */
1973
+ declare function recognitionPlane(points: Vec3[]): Plane;
1974
+ /**
1975
+ * 判断所有点是否在同一个平面
1976
+ * @param {Array<Vec3|Point>} points
1977
+ * @param {*} precision
1978
+ * @returns {Boolean|Plane} 如果在同一个平面返回所在平面,否则返回false
1979
+ */
1980
+ declare function isInOnePlane(points: Vec3[], precision?: number): Plane | false;
1981
+ /**
1982
+ * 判断多边是否共线:
1983
+ * 考虑情况点之间的距离应该大于最小容忍值
1984
+ * @param {...Vec3[]} ps
1985
+ */
1986
+ declare function pointsCollinear(...points: Vec3[]): boolean;
1987
+ /**
1988
+ * 三点计算圆
1989
+ * @param p0
1990
+ * @param p1
1991
+ * @param p2
1992
+ */
1993
+ declare function calcCircleFromThreePoint(p0: Vec3, p1: Vec3, p2: Vec3): Circle;
1994
+ declare function angle(v0: Vec3, v1: Vec3, normal?: Vec3): number;
1995
+
1996
+ declare class Delaunator {
1997
+ coords: Float64Array;
1998
+ _triangles: Uint32Array;
1999
+ _halfedges: Int32Array;
2000
+ _hashSize: number;
2001
+ _hullPrev: Uint32Array;
2002
+ _hullNext: Uint32Array;
2003
+ _hullTri: Uint32Array;
2004
+ _hullHash: Int32Array;
2005
+ _ids: Uint32Array;
2006
+ _dists: Float64Array;
2007
+ hull: Uint32Array;
2008
+ triangles: Uint32Array;
2009
+ halfedges: any;
2010
+ _cx: any;
2011
+ _cy: any;
2012
+ _hullStart: number;
2013
+ trianglesLen: number;
2014
+ static from(points: number[]): Delaunator;
2015
+ static fromVecs(points: Vec2[] | Vec3[]): Delaunator;
2016
+ constructor(coords: Float64Array);
2017
+ update(): void;
2018
+ _hashKey(x: number, y: number): number;
2019
+ _legalize(a: number): number;
2020
+ _link(a: number, b: number): void;
2021
+ _addTriangle(i0: number, i1: number, i2: number, a: number, b: number, c: number): number;
2022
+ }
2023
+
2024
+ declare class Voronoi {
2025
+ delaunay: any;
2026
+ _circumcenters: Float64Array;
2027
+ vectors: Float64Array;
2028
+ xmax: number;
2029
+ xmin: number;
2030
+ ymax: number;
2031
+ ymin: number;
2032
+ circumcenters: any;
2033
+ constructor(delaunay: Delaunay, [xmin, ymin, xmax, ymax]?: [number, number, number, number]);
2034
+ update(): this;
2035
+ _init(): void;
2036
+ cellPolygons(): Generator<any, void, unknown>;
2037
+ cellPolygon(i: number): number[][] | null;
2038
+ _renderSegment(x0: any, y0: any, x1: any, y1: any, context: {
2039
+ moveTo: (arg0: any, arg1: any) => void;
2040
+ lineTo: (arg0: any, arg1: any) => void;
2041
+ }): void;
2042
+ contains(i: any, x: number | any, y: number | any): boolean;
2043
+ neighbors(i: any): Generator<any, void, unknown>;
2044
+ _cell(i: string | number): any[] | null;
2045
+ _clip(i: number): any;
2046
+ _clipFinite(i: any, points: string | any[]): any;
2047
+ _clipSegment(x0: number, y0: number, x1: number, y1: number, c0: number, c1: number): number[] | null;
2048
+ _clipInfinite(i: any, points: any, vx0: number, vy0: number, vxn: number, vyn: number): unknown[];
2049
+ _edge(i: any, e0: number, e1: number, P: any[], j: number): number;
2050
+ _project(x0: any, y0: any, vx: number, vy: number): any[] | null;
2051
+ _edgecode(x: unknown, y: unknown): number;
2052
+ _regioncode(x: number, y: number): number;
2053
+ }
2054
+
2055
+ declare class Delaunay {
2056
+ _delaunator: Delaunator;
2057
+ inedges: Int32Array;
2058
+ _hullIndex: Int32Array;
2059
+ points: Float64Array;
2060
+ collinear?: Int32Array;
2061
+ halfedges: any;
2062
+ hull: Uint32Array;
2063
+ triangles: Uint32Array;
2064
+ static from(points: number[]): Delaunay;
2065
+ constructor(points: Float64Array);
2066
+ update(): this;
2067
+ _init(): void;
2068
+ voronoi(bounds: [number, number, number, number] | undefined): Voronoi;
2069
+ neighbors(i: number): Generator<number, void, unknown>;
2070
+ find(x: number, y: number, i?: number): number;
2071
+ _step(i: number, x: number, y: number): number;
2072
+ }
2073
+
2074
+ /** Monotone-chain convex hull of coplanar points, without a repeated end point. */
2075
+ declare function convexHull(points: Vec3[], normal?: Vec3): Vec3[];
2076
+ /** Compatibility wrapper for the class historically shown in the README. */
2077
+ declare class ConvexHull {
2078
+ hull: Vec3[];
2079
+ constructor(points: Vec3[], options?: {
2080
+ planeNormal?: Vec3;
2081
+ });
2082
+ }
2083
+ /** Exact 3D closest pair. Sweep pruning; worst-case O(n²), O(n) storage. */
2084
+ declare function closestPair(points: Vec3[]): DistanceResult;
2085
+
2086
+ /** Uniform entry point; also resolves symmetric queries defined on one operand. */
2087
+ declare function distance(a: GeometryQuery<any>, b: GeometryQuery<any>): DistanceResult;
2088
+ declare function intersects(a: GeometryQuery<any>, b: GeometryQuery<any>, tolerance?: number): boolean;
2089
+
2090
+ /**
2091
+ * 计算体积
2092
+ * @param faces 一个几何体的所有三角面
2093
+ */
2094
+ declare function calculateVolume(faces: Vec3[][]): number;
2095
+
2096
+ declare class Distance {
2097
+ static Point2Point_Number(x0: number, y0: number, z0: number, x1: number, y1: number, z1: number): number;
2098
+ static Point2Line_Number(x: number, y: number, z: number, ox: number, oy: number, oz: number, dx: number, dy: number, dz: number): number;
2099
+ /**
2100
+ *
2101
+ * @param point
2102
+ * @param origin
2103
+ * @param dir 默认已经正交化
2104
+ */
2105
+ static Point2Line_Vec3(point: Vec3, origin: Vec3, dir: Vec3, result?: Vec3): Vec3;
2106
+ }
2107
+
2108
+ /**
2109
+ * 网格工具
2110
+ */
2111
+ declare class MeshTool {
2112
+ static indexable(obj: any[] | any, refIndexInfo?: {
2113
+ index: number;
2114
+ }, force?: boolean): void;
2115
+ static triangListToBuffer(vertices: Vec3[], triangleList: Vec3[]): BufferGeometry;
2116
+ /**
2117
+ * 顶点纹理坐标所以转化为buffer数据
2118
+ * @param {Array<Verctor3|Number>} vertices
2119
+ * @param {Array<Number>} indices
2120
+ * @param {Array<Verctor2|Number>} uvs
2121
+ */
2122
+ static toGeoBuffer(vertices: BufferAttribute | Array<number | Vec2 | Vec3 | Vec4> | TypedArray, indices: number[] | Uint32Array | Uint16Array, uvs?: BufferAttribute | TypedArray | Array<Vec2 | number>): BufferGeometry;
2123
+ /**
2124
+ * 三角剖分后转成几何体
2125
+ * 只考虑XY平面
2126
+ * @param {*} boundary
2127
+ * @param {*} hole
2128
+ * @param {*} options
2129
+ */
2130
+ static trianglutionToGeometryBuffer(boundary: any, holes?: any[], options?: any): BufferGeometry;
2131
+ }
2132
+
2133
+ /**
2134
+ * 视锥体
2135
+ */
2136
+ declare class Frustum {
2137
+ planes: Plane[];
2138
+ constructor();
2139
+ get front(): Plane;
2140
+ get back(): Plane;
2141
+ get top(): Plane;
2142
+ get bottom(): Plane;
2143
+ get left(): Plane;
2144
+ get right(): Plane;
2145
+ /**
2146
+ * 从投影矩阵计算视锥体
2147
+ * @param m
2148
+ * @returns
2149
+ */
2150
+ setFromProjectionMatrix(m: Mat4): this;
2151
+ static fromProjectionMatrix(m: Mat4): Frustum;
2152
+ setFromPerspective(position: Vec3, target: Vec3, up: Vec3, fov: number, aspect: number, near: number, far: number): void;
2153
+ intersectsObject(geometry: BufferGeometry, mat: Mat4): boolean;
2154
+ intersectsSphere(sphere: Sphere): boolean;
2155
+ intersectsSphereComponents(cx: number, cy: number, cz: number, radius: number): boolean;
2156
+ containsPoint(point: Vec3): boolean;
2157
+ intersectSegment(segment: Segment | Vec3[]): Vec3 | Vec3[] | null;
2158
+ simpleIntersectVS(vs: Vec3[]): Vec3[];
2159
+ copy(frustum: Frustum): this;
2160
+ clone(): any;
2161
+ }
2162
+
2163
+ declare class Point extends Vec3 implements GeometryQuery<Point> {
2164
+ constructor(_x?: number, _y?: number, _z?: number);
2165
+ clone(): Point;
2166
+ }
2167
+
2168
+ interface IDistanceResut {
2169
+ isNode: boolean;
2170
+ point: Vec3;
2171
+ direction: Vec3;
2172
+ }
2173
+ declare class Path<T extends Vec3> extends ArrayList<T> {
2174
+ _closed: boolean;
2175
+ _calcNoraml: boolean;
2176
+ /**
2177
+ *
2178
+ * @param vs 假定是没有重复的点集
2179
+ * @param closed
2180
+ * @param calcNormal
2181
+ */
2182
+ constructor(vs: Array<T> | ArrayList<T>, closed?: boolean, calcNormal?: boolean);
2183
+ init(calcNormal: boolean): void;
2184
+ set closed(val: boolean);
2185
+ get closed(): boolean;
2186
+ get tlen(): number;
2187
+ applyMat4(mat4: Mat4): void;
2188
+ scale(x: number, y: number, z: number): void;
2189
+ /**
2190
+ * 截取一段从from到to的path
2191
+ * @param {Number} from
2192
+ * @param {Number} to
2193
+ */
2194
+ splitByFromToDistance(from?: number, to?: number): Path<never> | null;
2195
+ /**
2196
+ * 从起点出发到距离等于distance位置 的坐标 二分查找
2197
+ * @param {Number} distance
2198
+ */
2199
+ getPointByDistance(arg_distance: number, left?: number, right?: number): IDistanceResut | null;
2200
+ /**
2201
+ * 从起点出发到距离等于distance位置 的坐标 二分查找
2202
+ * @param {Number} distance
2203
+ */
2204
+ getPointByDistancePure(arg_distance: number, left?: number, right?: number): Vec3 | null;
2205
+ /**
2206
+ * 平均切割为 splitCount 段
2207
+ * @param {Number} splitCount
2208
+ * @returns {Path} 新的path
2209
+ */
2210
+ splitAverage(splitCount: number): Path<T>;
2211
+ /**
2212
+ * 通过测试
2213
+ * 平均切割为 splitCount 段
2214
+ * @param {Number} splitCount
2215
+ * @param {Boolean} integer 是否取整
2216
+ * @returns {Path} 新的path
2217
+ */
2218
+ splitAverageLength(splitLength: number, integer?: boolean): Path<T>;
2219
+ /**
2220
+ *
2221
+ * @param {...any} ps
2222
+ */
2223
+ add(...ps: Vec3[] | Point[]): void;
2224
+ /**
2225
+ * @description : 计算一段线段的总长度
2226
+ * @param {ArrayLike} ps
2227
+ * @return {number} 总长度
2228
+ */
2229
+ static totalMileages(ps: ArrayLike<Vec3>): number;
2230
+ /**
2231
+ * @description : 获取没一点的里程 里程是指从第一个点出发的长度
2232
+ * @param {ArrayLike} ps 里程上的点集
2233
+ * @param {boolean} normalize 是否归一化
2234
+ * @return {number[]} 每一个点的里程数组
2235
+ * @example :
2236
+ */
2237
+ static getPerMileages(ps: ArrayLike<Vec3>, normalize?: boolean, totalMileage?: number): number[];
2238
+ }
2239
+
2240
+ declare function toGeometryBuffer(geo: IGeometry): BufferGeometry;
2241
+ /**
2242
+ * shape 挤压后转几何体
2243
+ * @param {*} shape
2244
+ * @param {*} arg_path
2245
+ * @param {*} options
2246
+ */
2247
+ declare function extrudeToGeometryBuffer(shape: ArrayList<Vec3>, arg_path: Array<Vec3>, options: IExtrudeOptions): BufferGeometry;
2248
+ /**
2249
+ * 两个轮廓缝合
2250
+ * @param {*} shape
2251
+ * @param {*} arg_path
2252
+ * @param {*} options
2253
+ * @param {*} material
2254
+ */
2255
+ declare function linkToGeometry(shape: Array<Vec3>, shape1: Array<Vec3>, axisPlane?: AxisPlane, shapeClose?: boolean): BufferGeometry;
2256
+ /**
2257
+ * 多个轮廓缝合
2258
+ * @param shapes
2259
+ * @param isClose
2260
+ * @param material
2261
+ */
2262
+ declare function linksToGeometry(shapes: Array<Vec3>[], pathClosed?: boolean, shapeClosed?: boolean): BufferGeometry;
2263
+
2264
+ declare class Tree<T = any> {
2265
+ /**
2266
+ * N个子节点
2267
+ */
2268
+ N: number;
2269
+ /**
2270
+ * 最大深度
2271
+ */
2272
+ maxDepth: number;
2273
+ /**
2274
+ * 子节点
2275
+ */
2276
+ children: Array<Tree<T> | undefined>;
2277
+ /**
2278
+ * 容器,用来放满足该层级条件的数据
2279
+ */
2280
+ protected readonly items: T[];
2281
+ get objects(): readonly T[];
2282
+ constructor(N?: number);
2283
+ add(obj: T): this;
2284
+ remove(obj: T): boolean;
2285
+ find(condition: T | ((obj: T) => boolean)): T[];
2286
+ }
2287
+
2288
+ /**
2289
+ *
2290
+ */
2291
+ declare class BSP extends Tree {
2292
+ constructor();
2293
+ get pos(): Tree<any> | undefined;
2294
+ get neg(): Tree<any> | undefined;
2295
+ add(obj: any): this;
2296
+ remove(obj: any): boolean;
2297
+ find(condition: any): any[];
2298
+ }
2299
+
2300
+ /** Balanced binary search tree, rebuilt after edits. Equal keys retain duplicates. */
2301
+ declare class BTree<T = number> extends Tree<T> {
2302
+ private readonly compare;
2303
+ private root?;
2304
+ private dirty;
2305
+ constructor(compare?: (a: T, b: T) => number);
2306
+ add(value: T): this;
2307
+ remove(value: T): boolean;
2308
+ find(condition: T | ((value: T) => boolean)): T[];
2309
+ }
2310
+
2311
+ /** Lazily rebuilt balanced 3D k-d tree. Coordinates are copied on insertion. */
2312
+ declare class KdTree extends Tree<Vec3> {
2313
+ private root?;
2314
+ private dirty;
2315
+ constructor(points?: readonly Vec3[]);
2316
+ get size(): number;
2317
+ get objects(): readonly Vec3[];
2318
+ add(point: Vec3): this;
2319
+ remove(point: Vec3): boolean;
2320
+ find(condition: Vec3 | ((point: Vec3) => boolean)): Vec3[];
2321
+ private rebuild;
2322
+ nearest(point: Vec3, count?: number): Vec3[];
2323
+ range(min: Vec3, max: Vec3): Vec3[];
2324
+ }
2325
+
2326
+ declare class PolyTree extends Tree {
2327
+ constructor();
2328
+ add(obj: any): this;
2329
+ remove(obj: any): boolean;
2330
+ find(condition: any): any[];
2331
+ }
2332
+
2333
+ /** Balanced-by-subdivision XY quadtree, with lazy rebuilds after edits. */
2334
+ declare class QuadTree extends Tree<Vec3> {
2335
+ private readonly capacity;
2336
+ private root?;
2337
+ private dirty;
2338
+ constructor(points?: readonly Vec3[], capacity?: number);
2339
+ get size(): number;
2340
+ get objects(): readonly Vec3[];
2341
+ add(point: Vec3): this;
2342
+ remove(point: Vec3): boolean;
2343
+ find(condition: Vec3 | ((point: Vec3) => boolean)): Vec3[];
2344
+ private rebuild;
2345
+ range(min: Vec3, max: Vec3): Vec3[];
2346
+ nearest(point: Vec3, count?: number): Vec3[];
2347
+ }
2348
+
2349
+ declare function clipPolygons(subject: Vec3[][], clip: Vec3[][], operation?: 'intersection' | 'union' | 'difference' | 'xor', normal?: Vec3, scale?: number): Vec3[][];
2350
+ declare function offsetPaths(rings: Vec3[][], delta: number, normal?: Vec3, join?: number, end?: number, miterLimit?: number, scale?: number): Vec3[][];
2351
+ declare function cleanPolygon(points: Vec3[], tolerance?: number, normal?: Vec3): Vec3[];
2352
+ declare function simplifyPolygon(points: Vec3[], normal?: Vec3): Vec3[][];
2353
+
2354
+ /** Restore owned geometry from plain data. Never trusts a serialized prototype. */
2355
+ declare function geometryFromJSON(data: GeometryData): GeometryQuery<any>;
2356
+
2357
+ export { BSP, BTree, Box, BufferAttribute, BufferGeometry, Capsule, Circle, ClipType, Color, ConvexHull, DEGREES_PER_RADIAN, Delaunator, Delaunay, Disk, Distance, EndType, Euler, Float32BufferAttribute, Float64BufferAttribute, Frustum, Int16BufferAttribute, Int32BufferAttribute, Int8BufferAttribute, IntersectType, JoinType, KdTree, Line, Mat3, Mat4, MeshTool, ONE_OVER_PI, ONE_OVER_TWO_PI, Orientation, PI, PI_OVER_FOUR, PI_OVER_SIX, PI_OVER_THREE, PI_OVER_TWO, PI_TWO, Path, Plane, Point, PolyTree, Polygon, Polyline, QuadTree, Quat, QuadTree as QuatTree, RADIANS_PER_ARCSECOND, RADIANS_PER_DEGREE, Ray, Rectangle, Segment, Sphere, THREE_PI_OVER_TWO, ToDegrees, Tree, Triangle, Uint16BufferAttribute, Uint32BufferAttribute, Uint8BufferAttribute, Uint8ClampedBufferAttribute, Vec2, Vec3, Vec4, Voronoi, angle, applyMatrix4, applyQuat, approximateEqual, boundingBox, calcCircleFromThreePoint, calculateVolume, ceilPowerOfTwo, circle, clamp, classify, cleanPolygon, clipPolygons, clone, closestPair, convexHull, delta4, delta5, delta6, delta7, delta8, delta9, disk, distance, euler, extrude, extrudeNext, extrudeToGeometryBuffer, extrude_obsolete, flat, floorPowerOfTwo, forall, geometryFromJSON, intersects, isInOnePlane, isPowerOfTwo, lerp, line, linkSide, linkSides, linkToGeometry, linksToGeometry, m3, m4, offsetPaths, pointsCollinear, projectOnPlane, quat, randFloat, randInt, recognitionPlane, reverseOnPlane, rotate, rotateByUnitVectors, scale, segment, sign, simplifyPointList, simplifyPolygon, smootherstep, smoothstep, toFixed, toFixedAry, toGeometryBuffer, toRadians, translate, triangulation, unique, v2, v3, v4, vecs, vectorCompare };
2358
+ export type { AxisPlane, DistanceParameter, DistanceResult, GeometryData, GeometryKind, GeometryQuery, IBufferGeometry, IDistanceResut, IExtrudeOptions, IExtrudeOptionsEx, IExtrudeOptionsNext, IGeometry, ILinkSideOption, ILinkSideOptions, ITriangulationOption, IVec2, IVec3, IVec4, IntersectResult };