@xort/cga 0.0.92 → 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 +14209 -14318
  3. package/build/cga.d.ts +2284 -1958
  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 -79
  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
@@ -1,36 +0,0 @@
1
- /* Color palette */
2
- #define BLACK vec3(0.0, 0.0, 0.0)
3
- #define WHITE vec3(1.0, 1.0, 1.0)
4
- #define RED vec3(1.0, 0.0, 0.0)
5
- #define GREEN vec3(0.0, 1.0, 0.0)
6
- #define BLUE vec3(0.0, 0.0, 1.0)
7
- #define YELLOW vec3(1.0, 1.0, 0.0)
8
- #define CYAN vec3(0.0, 1.0, 1.0)
9
- #define MAGENTA vec3(1.0, 0.0, 1.0)
10
- #define ORANGE vec3(1.0, 0.5, 0.0)
11
- #define PURPLE vec3(1.0, 0.0, 0.5)
12
- #define LIME vec3(0.5, 1.0, 0.0)
13
- #define ACQUA vec3(0.0, 1.0, 0.5)
14
- #define VIOLET vec3(0.5, 0.0, 1.0)
15
- #define AZUR vec3(0.0, 0.5, 1.0)
16
-
17
- /* Signed distance drawing methods */
18
- float fill(in float d) { return 1.0 - smoothstep(0.0, rx * 2.0, d); }
19
- float stroke(in float d, in float t) { return 1.0 - smoothstep(t - rx * 1.5, t + rx * 1.5, abs(d)); }
20
- vec3 draw(in sampler2D t, in vec2 pos, in vec2 w) { vec2 s = w / 1.0; s.x *= -1.0; return texture2D(t, pos / s + 0.5).rgb; }
21
- /* Field Adapted from https://www.shadertoy.com/view/XsyGRW */
22
- vec3 field(float d){
23
- const vec3 c1=mix(WHITE,YELLOW,.4);
24
- const vec3 c2=mix(WHITE,AZUR,.7);
25
- const vec3 c3=mix(WHITE,ORANGE,.9);
26
- const vec3 c4=BLACK;
27
- float d0=abs(stroke(mod(d+.1,.2)-.1,.004));
28
- float d1=abs(stroke(mod(d+.025,.05)-.025,.004));
29
- float d2=abs(stroke(d,.004));
30
- float f=clamp(d*.85,0.,1.);
31
- vec3 gradient=mix(c1,c2,f);
32
- gradient=mix(gradient,c4,1.-clamp(1.25-d*.25,0.,1.));
33
- gradient=mix(gradient,c3,fill(d));
34
- gradient=mix(gradient,c4,max(d2*.85,max(d0*.25,d1*.06125))*clamp(1.25-d,0.,1.));
35
- return gradient;
36
- }
@@ -1,13 +0,0 @@
1
- /* Shape 2D arc */
2
- float sArc(in vec2 p,in float w,in float s,in float e){
3
- float a=distance(p,w*.5*vec2(cos(s),sin(s)));
4
- float x=-PI;
5
- p*=mat2(cos(x-s),-sin(x-s),sin(x-s),cos(x-s));
6
- float b=clamp(atan(p.y,p.x),x,x+e);
7
- b=distance(p,w*.5*vec2(cos(b),sin(b)));
8
- return min(a,b)*2.;
9
- }
10
- float arc(in vec2 p,in float w,in float s,in float e,in float t){
11
- float d=sArc(p,w,s,e);
12
- return stroke(d,t);
13
- }
@@ -1,13 +0,0 @@
1
- /* Shape 2D circle */
2
- float sCircle(in vec2 p,in float w){
3
- return length(p)*2.-w;
4
- }
5
- float circle(in vec2 p,in float w){
6
- float d=sCircle(p,w);
7
- return fill(d);
8
- }
9
- float circle(in vec2 p,in float w,float t){
10
- float d=sCircle(p,w);
11
- return stroke(d,t);
12
- }
13
-
@@ -1,42 +0,0 @@
1
- /* Shape 2D grid */
2
- vec2 tile(in vec2 p, vec2 w) { return fract(mod(p + w / 2.0, w)) - (w / 2.0); }
3
- vec2 tile(in vec2 p, float w) { return tile(p, vec2(w)); }
4
- float sLine(in vec2 a, in vec2 b) {
5
- vec2 p = b - a;
6
- float d = abs(dot(normalize(vec2(p.y, -p.x)), a));
7
- return d * 2.0;
8
- }
9
- float line(in vec2 a, in vec2 b) {
10
- float d = sLine(a, b);
11
- return fill(d);
12
- }
13
- float line(in vec2 a, in vec2 b, in float t) {
14
- float d = sLine(a, b);
15
- return stroke(d, t);
16
- }
17
- float line(in vec2 p, in float a, in float t) {
18
- vec2 b = p + vec2(sin(a), cos(a));
19
- return line(p, b, t);
20
- }
21
- float sSegment(in vec2 a, in vec2 b) {
22
- vec2 ba = a - b;
23
- float d = clamp(dot(a, ba) / dot(ba, ba), 0.0, 1.0);
24
- return length(a - ba * d) * 2.0;
25
- }
26
- float segment(in vec2 a, in vec2 b, float t) {
27
- float d = sSegment(a, b);
28
- return stroke(d, t);
29
- }
30
- float grid(in vec2 p, in float w) {
31
- vec2 l = tile(p, w);
32
- float d = 0.0;
33
- d += line(l, l + vec2(0.0, 0.1), 0.002);
34
- d += line(l, l + vec2(0.1, 0.0), 0.002);
35
- d *= 0.2;
36
- p = tile(p, vec2(w * 5.0));
37
- float s = w / 10.0;
38
- float g = 0.0;
39
- g += segment(p + vec2(-s, 0.0), p + vec2(s, 0.0), 0.004);
40
- g += segment(p + vec2(0.0, -s), p + vec2(0.0, s), 0.004);
41
- return d + g;
42
- }
@@ -1,18 +0,0 @@
1
- /* Shape 2D line */
2
- float sLine(in vec2 a,in vec2 b){
3
- vec2 p=b-a;
4
- float d=abs(dot(normalize(vec2(p.y,-p.x)),a));
5
- return d*2.;
6
- }
7
- float line(in vec2 a,in vec2 b){
8
- float d=sLine(a,b);
9
- return fill(d);
10
- }
11
- float line(in vec2 a,in vec2 b,in float t){
12
- float d=sLine(a,b);
13
- return stroke(d,t);
14
- }
15
- float line(in vec2 p,in float a,in float t){
16
- vec2 b=p+vec2(sin(a),cos(a));
17
- return line(p,b,t);
18
- }
@@ -1,18 +0,0 @@
1
- /* Shape 2D pie */
2
- float sPie(in vec2 p,in float near, in float w, in float s, in float e) {
3
- s = mod(s, TWO_PI);
4
- e = mod(s + e, TWO_PI);
5
- float a = mod(atan(p.y, p.x), TWO_PI);
6
- a = abs(step(s, a) - step(e, a));
7
- a = s < e ? a : 1.0 - a;
8
- float d = length(p);
9
- return 1.0 - (a - d * 2.0) - w - near;
10
- }
11
- float pie(in vec2 p,in float near, in float w, in float s, in float e) {
12
- float d = sPie(p, w, s, e);
13
- return fill(d);
14
- }
15
- float pie(in vec2 p,in float near, in float w, in float s, in float e, in float t) {
16
- float d = sPie(p, w, s, e);
17
- return stroke(d, t);
18
- }
@@ -1,10 +0,0 @@
1
-
2
- /* Shape 2D plot */
3
- float sPlot(vec2 p,float y){
4
- return p.y+y;
5
- }
6
- float plot(vec2 p,float y,float t){
7
- float d=sPlot(p,y);
8
- return 1.-smoothstep(t/2.-rx,t/2.+rx,abs(d));
9
- }
10
-
@@ -1,15 +0,0 @@
1
- /* Shape 2D poly */
2
- float sPoly(in vec2 p,in float w,in int sides){
3
- float a=atan(p.x,p.y)+PI;
4
- float r=TWO_PI/float(sides);
5
- float d=cos(floor(.5+a/r)*r-a)*length(max(abs(p)*1.,0.));
6
- return d*2.-w;
7
- }
8
- float poly(in vec2 p,in float w,in int sides){
9
- float d=sPoly(p,w,sides);
10
- return fill(d);
11
- }
12
- float poly(in vec2 p,in float w,in int sides,in float t){
13
- float d=sPoly(p,w,sides);
14
- return stroke(d,t);
15
- }
@@ -1,14 +0,0 @@
1
- /* Shape 2D rect */
2
- float sRect(in vec2 p,in vec2 w){
3
- float d=max(abs(p.x/w.x),abs(p.y/w.y))*2.;
4
- float m=max(w.x,w.y);
5
- return d*m-m;
6
- }
7
- float rect(in vec2 p,in vec2 w){
8
- float d=sRect(p,w);
9
- return fill(d);
10
- }
11
- float rect(in vec2 p,in vec2 w,in float t){
12
- float d=sRect(p,w);
13
- return stroke(d,t);
14
- }
@@ -1,15 +0,0 @@
1
-
2
- /* Shape 2D roundrect */
3
- float sRoundrect(in vec2 p,in vec2 w,in float corner){
4
- vec2 d=abs(p)-w*.5+corner;
5
- return(min(max(d.x,d.y),0.)+length(max(d,0.))-corner)*2.;
6
- }
7
- float roundrect(in vec2 p,in vec2 w,in float corner){
8
- float d=sRoundrect(p,w,corner);
9
- return fill(d);
10
- }
11
- float roundrect(in vec2 p,in vec2 w,in float corner,in float t){
12
- float d=sRoundrect(p,w,corner);
13
- return stroke(d,t);
14
- }
15
-
@@ -1,10 +0,0 @@
1
- /* Shape 2D segment */
2
- float sSegment(in vec2 a,in vec2 b){
3
- vec2 ba=a-b;
4
- float d=clamp(dot(a,ba)/dot(ba,ba),0.,1.);
5
- return length(a-ba*d)*2.;
6
- }
7
- float segment(in vec2 a,in vec2 b,float t){
8
- float d=sSegment(a,b);
9
- return stroke(d,t);
10
- }
@@ -1,12 +0,0 @@
1
- /* Shape 2D spiral */
2
- /* Spiral function by Patricio Gonzalez Vivo */
3
- float sSpiral(in vec2 p,in float turns){
4
- float r=dot(p,p);
5
- float a=atan(p.y,p.x);
6
- float d=abs(sin(fract(log(r)*(turns/5.)+a*.159)));
7
- return d-.5;
8
- }
9
- float spiral(in vec2 p,in float turns){
10
- float d=sSpiral(p,turns);
11
- return fill(d);
12
- }
@@ -1,16 +0,0 @@
1
- /* Shape 2D star */
2
- float sStar(in vec2 p,in float w,in int sides){
3
- float r=.5;float s=max(5.,float(sides));float m=.5/s;float x=PI_TWO/s*(2.-mod(s,2.));
4
- float segment=(atan(p.y,p.x)-x)/TWO_PI*s;
5
- float a=((floor(segment)+r)/s+mix(m,-m,step(r,fract(segment))))*TWO_PI;
6
- float d=abs(dot(vec2(cos(a+x),sin(a+x)),p))+m;
7
- return(d-rx)*2.-w;
8
- }
9
- float star(in vec2 p,in float w,in int sides){
10
- float d=sStar(p,w,sides);
11
- return fill(d);
12
- }
13
- float star(in vec2 p,in float w,in int sides,float t){
14
- float d=sStar(p,w,sides);
15
- return stroke(d,t);
16
- }
@@ -1,31 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
-
4
- <head>
5
- <meta charset="UTF-8">
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
- <meta http-equiv="X-UA-Compatible" content="ie=edge">
8
- <title>Document</title>
9
- <style>
10
- html,
11
- body {
12
- width: 100%;
13
- height: 100%;
14
- margin: 0;
15
- overflow: hidden;
16
- }
17
-
18
- .info_panel {
19
- position: absolute;
20
- z-index: 9;
21
- color: aliceblue;
22
- }
23
- </style>
24
- </head>
25
-
26
- <body>
27
- <script src="../build/cga.js"></script>
28
- <h1>测试案例</h1>
29
- </body>
30
-
31
- </html>
package/git.sh DELETED
@@ -1,12 +0,0 @@
1
- #!/usr/bin/env sh
2
-
3
- # 确保脚本抛出遇到的错误
4
- set -e
5
-
6
- cnpm sync @xort/cga
7
-
8
- git add -A
9
- # git add .
10
- git commit -m '@xort/cga'
11
-
12
- git push origin master
package/gitproxy.sh DELETED
@@ -1,6 +0,0 @@
1
- git config --global http.proxy 'socks5://127.0.0.1:5006'
2
- git config --global https.proxy 'socks5://127.0.0.1:5006'
3
-
4
-
5
- # git config --global --unset http.proxy
6
- # git config --global --unset https.proxy
Binary file
Binary file
package/index.html DELETED
@@ -1,14 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
-
4
- <head>
5
- <meta charset="UTF-8">
6
- <title>CGA.js</title>
7
- <!-- <link rel="stylesheet" href="./src/ui/codiconLabel/codicon/codicon.css"> -->
8
- </head>
9
-
10
- <body>
11
-
12
- </body>
13
-
14
- </html>
@@ -1,122 +0,0 @@
1
- # 数学表达式
2
-
3
- 1. 分数,平方
4
- $$
5
- \frac{7x+5}{1+y^2}
6
- $$
7
- 2. 下标
8
- $$
9
- z = z_l
10
- $$
11
- 3. 省略号
12
- $$
13
- \cdots \centerdot \circ \ddagger
14
- $$
15
- 4. 行间公式
16
- $$
17
- \frac{d}{dx}e^{ax}=ae^{ax}\quad\sum_{i=1}^{n}{(X_i - \overline{X})^2}
18
- $$
19
-
20
- 5. 开根号
21
- $$
22
- \sqrt{3} \sqrt[x]{3}
23
- $$
24
-
25
- 6. 矢量 点积
26
- $$
27
- \vec{a}\cdot \vec{b} = 0 \\ \vec{a} * \vec{b} = \vec{c}
28
- $$
29
-
30
- 7. 积分
31
- $$
32
- \int _x^y axbydx\\
33
- \int _x^y axby{\rm d}x
34
- $$
35
-
36
- 8. 累加
37
- $$
38
- \sum _{i=1} ^n \frac{1}{x_i^2}
39
- $$
40
-
41
- 8. 累成
42
- $$
43
- \prod _{i=1} ^n \frac{1}{x_i^2}
44
- $$
45
- 9. 希腊字母
46
- $$
47
- AB\Gamma\Delta\Epsilon\Sigma\\
48
- \alpha\beta\gamma
49
- $$
50
- 10. 矩阵
51
- $$
52
- \begin{matrix}
53
- a & b & c & d & e\\
54
- f & g & h & i & j \\
55
- k & l & m & n & o \\
56
- p & q & r & s & t
57
- \end{matrix} \\
58
- \left |
59
- \begin{matrix}
60
- a & b & c & d & e\\
61
- f & g & h & i & j \\
62
- k & l & m & n & o \\
63
- p & q & r & s & t
64
- \end{matrix}
65
- \right| \\
66
- \left[
67
- \begin{matrix}
68
- a & b & c & d & e\\
69
- f & g & h & i & j \\
70
- k & l & m & n & o \\
71
- p & q & r & s & t
72
- \end{matrix}
73
- \right] \\
74
- \left\{
75
- \begin{matrix}
76
- a & b & c & d & e\\
77
- f & g & h & i & j \\
78
- k & l & m & n & o \\
79
- p & q & r & s & t
80
- \end{matrix}
81
- \right\}\\
82
-
83
- \left\{
84
- \begin{matrix}
85
- a & b & \cdots & e\\
86
- f & g & \cdots & j \\
87
- \vdots & \vdots & \ddots & \vdots \\
88
- p & q & \cdots & t
89
- \end{matrix}
90
- \right\}\\
91
-
92
- \left\{
93
- \begin{array}{cccc|c}
94
- a & b & c & d & e\\
95
- f & g & h & i & j \\
96
- k & l & m & n & o \\
97
- p & q & r & s & t
98
- \end{array}
99
- \right\}
100
-
101
- \left\{
102
- \begin{array}{rrr|rr}
103
- a & b & c & d & e\\
104
- f & g & h & i & j \\
105
- k & l & m & n & o \\
106
- p & q & r & s & t
107
- \end{array}
108
- \right\}
109
- $$
110
-
111
- 11. 其他
112
- $$
113
- \|
114
- \sin()\\
115
- \pm\\
116
- \times
117
- \div
118
- \neq
119
- \ngeq
120
- \leq
121
- \geq
122
- $$
@@ -1,91 +0,0 @@
1
- # 矩阵
2
-
3
- ## 矩阵的各种
4
- 1. **行矩阵,列矩阵**
5
- ```
6
- m×n阶矩阵中,m=1,称为行矩阵,也称为n维行向量;n=1,称为列矩阵,也称为m维列向量。
7
-
8
- ```
9
- ***
10
- 2. **零矩阵**
11
- ```
12
- 矩阵中所有元素都为 0
13
- ```
14
-
15
- $$
16
- a^2+b^2=c^2
17
- $$
18
- $$
19
- \left|
20
- \begin{matrix}
21
- 0 & 0 & 0 & 0 & 0\\
22
- 0 & 0 & 0 & 0 & 0\\
23
- 0 & 0 & 0 & 0 & 0\\
24
- 0 & 0 & 0 & 0 & 0
25
- \end{matrix}
26
- \right|
27
- $$
28
- * **可逆矩阵**:
29
- $$
30
- | A |≠0
31
- $$
32
-
33
- * **对称矩阵**:
34
- $$
35
- A^T = A
36
- $$
37
-
38
- * **正交矩阵**
39
- $$
40
- A^TA=AA^T=E
41
- $$
42
-
43
- * **等价矩阵**
44
- 如果这两个矩阵满足
45
- $$ B=QAP $$
46
- ($P$是n×n阶可逆矩阵,$Q$是m×m阶可逆矩阵),那么这两个矩阵之间是等价关系
47
-
48
- * **初等矩阵**:由单位矩阵E经过一次初等变换得到的矩阵称为初等矩阵。
49
-
50
- * **正定矩阵**:
51
- $$z^TMz> 0$$
52
- 其中$z^T$ 表示$z$的转置,就称$M$为正定矩阵。
53
- 1. 正定矩阵的行列式恒为正;
54
- $$ |M|>0 $$
55
- 2. 实对称矩阵$A$正定当且仅当$A$与单位矩阵合同;
56
- 3. 若$A$是正定矩阵,则$A$的逆矩阵也是正定矩阵;
57
- 4. 两个正定矩阵的和是正定矩阵;
58
- 5. 正实数与正定矩阵的乘积是正定矩阵。
59
-
60
- * **合同矩阵**:设$A$,$B$是两个$n$阶方阵,若存在可逆矩阵$C$,使得
61
- $$ C^TAC=B $$
62
- 则称方阵$A$与$B$合同,记作 $A$≃$B$。
63
-
64
- 合同关系是一个等价关系,也就是说满足:
65
- 1. 反身性:任意矩阵都与其自身合同;
66
- 2. 对称性:$A$合同于$B$,则可以推出$B$合同于$A$;
67
- 3. 传递性:$A$合同于$B$,$B$合同于$C$,则可以推出$A$合同于$C$;
68
- 4. 合同矩阵的秩相同。
69
- 矩阵合同的主要判别法:
70
- 设$A$,$B$均为复数域上的n阶对称矩阵,则$A$与$B$在复数域上合同等价于$A$与$B$的秩相同.
71
-   设$A$,$B$均为实数域上的n阶对称矩阵,则$A$与$B$在实数域上合同等价于$A$与$B$有相同的正、负惯性指数(即正、负特征值的个数相等)。
72
-
73
- * **相似矩阵**:
74
- > 在线性代数中,相似矩阵是指存在相似关系的矩阵。设$A$,$B$为$n$阶矩阵,如果有$n$阶可逆> 矩阵$P$存在,使得
75
- > $$ P^{-1}AP=B \\$$
76
- > 则称矩阵$A$与$B$相似,记为 $A$~ $B$。
77
- >对于 设$A$,$B$和$C$是任意同阶方阵,则有:
78
- >>1. 反身性:$A$ ~ $A$
79
- >>2. 对称性:若$A$~ $B$,则 $B$~ $A$
80
- >>3. 传递性:若$A$~ $B$,$B$~ $C$,则$A$~ $C$
81
- >>4. 若$A$~ $B$,则$r(A)=r(B)$,$|A|=|B|$,$tr(A)=tr(B)$。
82
- >>5. 若$A$~ $B$,且$A$可逆,则$B$也可逆,且$B$~ $A$。
83
- >>6. 若$A$~ $B$,则$A$与$B$
84
- 两者的秩相等;
85
- 两者的行列式值相等;
86
- 两者的迹数相等;
87
- 两者拥有同样的特征值,尽管相应的特征向量一般不同;
88
- 两者拥有同样的特征多项式;
89
- 两者拥有同样的初等因子。
90
- 7. 若$A$与对角矩阵相似,则称$A$为可对角化矩阵,若$n$阶方阵$A$有$n$个线性无关的特征向量,则称$A$为单纯矩阵。
91
- 8. 相似矩阵具有相同的可逆性,当它们可逆时,则它们的逆矩阵也相似。
package/rollup.config.js DELETED
@@ -1,79 +0,0 @@
1
- /*
2
- * @Description :
3
- * @Author : 赵耀圣
4
- * @Q群 : 632839661
5
- * @Date : 2020-12-10 14:57:48
6
- * @LastEditTime : 2021-03-12 09:31:54
7
- * @FilePath : \cga.js\rollup.config.js
8
- */
9
- // Libs
10
- import babel from 'rollup-plugin-babel';
11
- import commonjs from 'rollup-plugin-commonjs';
12
- import gzip from 'rollup-plugin-gzip';
13
- import nodeResolve from 'rollup-plugin-node-resolve';
14
- import path from 'path';
15
- import { uglify } from 'rollup-plugin-uglify';
16
- import dts from "rollup-plugin-dts";
17
-
18
- // Read package config
19
- const pkgConfig = require('./package.json');
20
-
21
- // Constants
22
- const DIST = process.env.DIST || false;
23
- const MIN = process.env.MIN || false;
24
-
25
- const banner = `/**
26
- * https://github.com/yszhao91/cga.js
27
- *CGA Lib |cga.js |alex Zhao | Zhao yaosheng
28
- *@license free for all
29
- */`;
30
-
31
- const plugins = [
32
- babel({
33
- exclude: 'node_modules/**'
34
- }),
35
- nodeResolve({
36
- browser: true
37
- }),
38
- commonjs({
39
- sourceMap: false,
40
- // namedExports: {
41
- // 'node_modules/eventemitter2/lib/eventemitter2.js': ['EventEmitter2']
42
- // }
43
- // 'namedExports': {
44
- // './dist/src/index.js': ['__moduleExports']
45
- // }
46
- })
47
- ];
48
-
49
- if (MIN) {
50
- plugins.push(uglify({
51
- output: {
52
- comments: /@license/
53
- }
54
- }));
55
- plugins.push(gzip());
56
- }
57
-
58
- export default {
59
- // input: path.join('dist', 'index.js'),
60
- // external: ['lodash'],
61
- // plugins: plugins,
62
- // output: {
63
- // file: path.join(DIST ? 'dist' : 'build', '@xort_cga' + (MIN ? '.min' : '') + '.js'),
64
- // format: 'umd',
65
- // // format: 'umd',
66
- // name: 'cga',
67
- // banner: banner,
68
- // globals: {
69
- // lodash: '_'
70
- // }
71
- // }
72
-
73
- input: "dist/index.d.ts",
74
- output: [{
75
- file: "build/cga.d.ts", format: "es",
76
- name: 'cga'
77
- }],
78
- plugins: [dts()],
79
- }
package/scripttest.html DELETED
@@ -1,23 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
-
4
- <head>
5
- <meta charset="UTF-8">
6
- <title>CGA</title>
7
- <!-- <link rel="stylesheet" href="./src/ui/codiconLabel/codicon/codicon.css"> -->
8
- <script src="./build/cga.js"></script>
9
- </head>
10
-
11
- <body>
12
- <script>
13
- var point = new CGA.Point(1, 2, 3);
14
- var line = new CGA.Line(
15
- new CGA.Vector3(10, 10, 20),
16
- new CGA.Vector3(20, 15, 10)
17
- );
18
- var result = point.distanceLine(line);
19
- console.log(result);
20
- </script>
21
- </body>
22
-
23
- </html>
@@ -1,20 +0,0 @@
1
- import { Mat4 } from "src/math/Mat4";
2
- import { TypedConstraint } from "./constaint/constraint";
3
-
4
- /*
5
- * @Description :
6
- * @Author : 赵耀圣
7
- * @QQ : 549184003
8
- * @Date : 2021-03-22 17:41:30
9
- * @LastEditTime : 2021-03-23 16:19:09
10
- * @FilePath : \cga.js\src\IKanimation\Bone.ts
11
- */
12
- export class Bone {
13
- contraints: TypedConstraint[] = []
14
- matrix: Mat4 = Mat4.Identity;
15
-
16
- constructor() {
17
- }
18
-
19
-
20
- }