@thi.ng/geom 7.0.1 → 8.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (251) hide show
  1. package/CHANGELOG.md +196 -1
  2. package/README.md +357 -114
  3. package/aabb.d.ts +26 -1
  4. package/api/aabb.d.ts +5 -4
  5. package/api/aabb.js +10 -7
  6. package/api/apc.d.ts +5 -3
  7. package/api/arc.d.ts +6 -5
  8. package/api/arc.js +3 -4
  9. package/api/bpatch.d.ts +6 -3
  10. package/api/bpatch.js +5 -3
  11. package/api/circle.d.ts +4 -3
  12. package/api/circle.js +9 -6
  13. package/api/complex-polygon.d.ts +7 -3
  14. package/api/complex-polygon.js +14 -4
  15. package/api/cubic.d.ts +8 -5
  16. package/api/cubic.js +12 -6
  17. package/api/cubic3.d.ts +15 -0
  18. package/api/cubic3.js +38 -0
  19. package/api/ellipse.d.ts +4 -3
  20. package/api/ellipse.js +7 -8
  21. package/api/extra.d.ts +15 -0
  22. package/api/extra.js +19 -0
  23. package/api/group.d.ts +12 -11
  24. package/api/group.js +4 -5
  25. package/api/group3.d.ts +30 -0
  26. package/api/group3.js +48 -0
  27. package/api/line.d.ts +8 -5
  28. package/api/line.js +8 -8
  29. package/api/line3.d.ts +15 -0
  30. package/api/line3.js +29 -0
  31. package/api/path.d.ts +14 -11
  32. package/api/path.js +17 -12
  33. package/api/path3.d.ts +28 -0
  34. package/api/path3.js +91 -0
  35. package/api/plane.d.ts +4 -3
  36. package/api/plane.js +7 -4
  37. package/api/points.d.ts +8 -10
  38. package/api/points.js +7 -20
  39. package/api/points3.d.ts +13 -0
  40. package/api/points3.js +21 -0
  41. package/api/polygon.d.ts +7 -4
  42. package/api/polygon.js +5 -3
  43. package/api/polygon3.d.ts +14 -0
  44. package/api/polygon3.js +24 -0
  45. package/api/polyline.d.ts +18 -4
  46. package/api/polyline.js +8 -5
  47. package/api/polyline3.d.ts +28 -0
  48. package/api/polyline3.js +31 -0
  49. package/api/quad.d.ts +7 -4
  50. package/api/quad.js +5 -3
  51. package/api/quad3.d.ts +7 -4
  52. package/api/quad3.js +6 -4
  53. package/api/quadratic.d.ts +8 -5
  54. package/api/quadratic.js +12 -6
  55. package/api/quadratic3.d.ts +15 -0
  56. package/api/quadratic3.js +38 -0
  57. package/api/ray.d.ts +4 -3
  58. package/api/ray.js +6 -7
  59. package/api/ray3.d.ts +14 -0
  60. package/api/ray3.js +33 -0
  61. package/api/rect.d.ts +5 -3
  62. package/api/rect.js +11 -8
  63. package/api/sphere.d.ts +4 -3
  64. package/api/sphere.js +8 -5
  65. package/api/text.d.ts +4 -3
  66. package/api/text.js +8 -5
  67. package/api/triangle.d.ts +7 -4
  68. package/api/triangle.js +5 -3
  69. package/api/triangle3.d.ts +14 -0
  70. package/api/triangle3.js +26 -0
  71. package/api.d.ts +193 -0
  72. package/api.js +10 -0
  73. package/apply-transforms.d.ts +33 -11
  74. package/apply-transforms.js +24 -4
  75. package/arc-length.d.ts +18 -4
  76. package/arc-length.js +18 -3
  77. package/arc.d.ts +1 -1
  78. package/area.d.ts +6 -10
  79. package/area.js +3 -3
  80. package/as-cubic.d.ts +31 -5
  81. package/as-cubic.js +86 -24
  82. package/as-path.d.ts +14 -7
  83. package/as-path.js +49 -24
  84. package/as-polygon.d.ts +20 -5
  85. package/as-polygon.js +46 -12
  86. package/as-polyline.d.ts +18 -5
  87. package/as-polyline.js +29 -23
  88. package/as-sector.d.ts +13 -0
  89. package/as-sector.js +18 -0
  90. package/as-svg.d.ts +31 -9
  91. package/as-svg.js +21 -18
  92. package/bounds.d.ts +12 -2
  93. package/bounds.js +15 -0
  94. package/bpatch.d.ts +26 -1
  95. package/center-of-weight.d.ts +22 -0
  96. package/center-of-weight.js +23 -0
  97. package/center.d.ts +11 -5
  98. package/center.js +9 -4
  99. package/centroid-of-bounds.d.ts +12 -0
  100. package/centroid-of-bounds.js +9 -0
  101. package/centroid.d.ts +14 -4
  102. package/centroid.js +16 -17
  103. package/circle.d.ts +1 -1
  104. package/classify-point.d.ts +3 -1
  105. package/classify-point.js +7 -4
  106. package/clip-convex.d.ts +27 -8
  107. package/clip-convex.js +52 -17
  108. package/closest-point.d.ts +1 -1
  109. package/complex-polygon-from-path.d.ts +1 -1
  110. package/complex-polygon.d.ts +1 -1
  111. package/convex-hull.d.ts +9 -2
  112. package/convex-hull.js +3 -3
  113. package/convolve.d.ts +72 -0
  114. package/convolve.js +33 -0
  115. package/cubic.d.ts +1 -1
  116. package/cubic.js +7 -7
  117. package/cubic3.d.ts +8 -0
  118. package/cubic3.js +14 -0
  119. package/edges.d.ts +2 -2
  120. package/ellipse.d.ts +1 -1
  121. package/extra.d.ts +14 -0
  122. package/extra.js +5 -0
  123. package/fit-into-bounds.d.ts +14 -4
  124. package/fit-into-bounds.js +6 -6
  125. package/flip.d.ts +21 -5
  126. package/flip.js +19 -12
  127. package/from-tessellation.d.ts +81 -0
  128. package/from-tessellation.js +27 -0
  129. package/group.d.ts +2 -2
  130. package/group3.d.ts +16 -0
  131. package/group3.js +5 -0
  132. package/index.d.ts +36 -1
  133. package/index.js +36 -1
  134. package/internal/bounds.d.ts +3 -4
  135. package/internal/copy.d.ts +8 -7
  136. package/internal/copy.js +3 -7
  137. package/internal/dispatch.d.ts +1 -1
  138. package/internal/error.d.ts +3 -0
  139. package/internal/error.js +6 -0
  140. package/internal/pclike.d.ts +3 -2
  141. package/internal/pclike.js +6 -0
  142. package/internal/points-as-shape.d.ts +11 -2
  143. package/internal/points-as-shape.js +10 -1
  144. package/internal/split.d.ts +2 -2
  145. package/internal/split.js +13 -8
  146. package/internal/transform.d.ts +6 -22
  147. package/internal/transform.js +2 -21
  148. package/internal/vertices.d.ts +3 -2
  149. package/internal/vertices.js +3 -1
  150. package/intersects.d.ts +5 -4
  151. package/intersects.js +6 -4
  152. package/line.d.ts +1 -1
  153. package/line3.d.ts +6 -0
  154. package/line3.js +9 -0
  155. package/map-point.d.ts +1 -1
  156. package/normalized-path.d.ts +17 -0
  157. package/normalized-path.js +23 -0
  158. package/offset.d.ts +16 -2
  159. package/offset.js +2 -2
  160. package/package.json +149 -35
  161. package/path-builder.d.ts +42 -13
  162. package/path-builder.js +68 -42
  163. package/path-from-cubics.d.ts +26 -0
  164. package/path-from-cubics.js +39 -0
  165. package/path-from-svg.d.ts +1 -1
  166. package/path-from-svg.js +29 -29
  167. package/path.d.ts +2 -52
  168. package/path.js +1 -58
  169. package/path3.d.ts +16 -0
  170. package/path3.js +5 -0
  171. package/plane.d.ts +11 -1
  172. package/plane.js +3 -0
  173. package/point-at.d.ts +1 -1
  174. package/point-inside.d.ts +3 -1
  175. package/point-inside.js +4 -1
  176. package/points.d.ts +2 -3
  177. package/points.js +2 -4
  178. package/points3.d.ts +5 -0
  179. package/points3.js +5 -0
  180. package/polygon.d.ts +5 -5
  181. package/polygon3.d.ts +5 -0
  182. package/polygon3.js +5 -0
  183. package/polyline.d.ts +2 -2
  184. package/polyline3.d.ts +5 -0
  185. package/polyline3.js +5 -0
  186. package/proximity.d.ts +5 -3
  187. package/proximity.js +2 -2
  188. package/quad.d.ts +2 -7
  189. package/quad.js +1 -29
  190. package/quad3.d.ts +8 -0
  191. package/quad3.js +30 -0
  192. package/quadratic.d.ts +1 -1
  193. package/quadratic3.d.ts +7 -0
  194. package/quadratic3.js +11 -0
  195. package/ray.d.ts +1 -1
  196. package/ray.js +2 -2
  197. package/ray3.d.ts +5 -0
  198. package/ray3.js +6 -0
  199. package/rect.d.ts +1 -1
  200. package/resample.d.ts +45 -4
  201. package/resample.js +26 -16
  202. package/rotate-around-axis.d.ts +33 -0
  203. package/rotate-around-axis.js +57 -0
  204. package/rotate.d.ts +15 -2
  205. package/rotate.js +47 -45
  206. package/rounded-rect.d.ts +25 -0
  207. package/rounded-rect.js +18 -0
  208. package/scale-with-center.d.ts +2 -2
  209. package/scale.d.ts +24 -2
  210. package/scale.js +59 -43
  211. package/scatter.d.ts +1 -1
  212. package/simplify.d.ts +8 -2
  213. package/simplify.js +7 -4
  214. package/smooth-poly.d.ts +27 -0
  215. package/smooth-poly.js +11 -0
  216. package/sphere.d.ts +1 -1
  217. package/split-arclength.d.ts +6 -2
  218. package/split-at.d.ts +18 -2
  219. package/split-at.js +66 -34
  220. package/split-near.d.ts +13 -2
  221. package/split-near.js +23 -27
  222. package/subdiv-curve.d.ts +81 -27
  223. package/subdiv-curve.js +44 -28
  224. package/tangent-at.d.ts +1 -1
  225. package/tessellate.d.ts +72 -18
  226. package/tessellate.js +53 -8
  227. package/text.d.ts +1 -1
  228. package/transform-vertices.d.ts +30 -6
  229. package/transform-vertices.js +36 -38
  230. package/transform.d.ts +30 -2
  231. package/transform.js +54 -40
  232. package/translate.d.ts +12 -2
  233. package/translate.js +42 -43
  234. package/triangle.d.ts +1 -1
  235. package/triangle3.d.ts +6 -0
  236. package/triangle3.js +8 -0
  237. package/union.d.ts +11 -2
  238. package/union.js +6 -7
  239. package/unmap-point.d.ts +1 -1
  240. package/vertices.d.ts +3 -3
  241. package/vertices.js +14 -4
  242. package/volume.d.ts +1 -1
  243. package/warp-points.d.ts +35 -4
  244. package/warp-points.js +2 -0
  245. package/with-attribs.d.ts +4 -5
  246. package/internal/rotate.d.ts +0 -5
  247. package/internal/rotate.js +0 -8
  248. package/internal/scale.d.ts +0 -5
  249. package/internal/scale.js +0 -12
  250. package/internal/translate.d.ts +0 -5
  251. package/internal/translate.js +0 -8
package/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
  [![Mastodon Follow](https://img.shields.io/mastodon/follow/109331703950160316?domain=https%3A%2F%2Fmastodon.thi.ng&style=social)](https://mastodon.thi.ng/@toxi)
8
8
 
9
9
  > [!NOTE]
10
- > This is one of 192 standalone projects, maintained as part
10
+ > This is one of 189 standalone projects, maintained as part
11
11
  > of the [@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo
12
12
  > and anti-framework.
13
13
  >
@@ -21,6 +21,26 @@ For the Clojure version, please visit: [thi.ng/geom-clj](https://thi.ng/geom-clj
21
21
  - [Hiccup support](#hiccup-support)
22
22
  - [SVG support](#svg-support)
23
23
  - [Polymorphic operations](#polymorphic-operations)
24
+ - [Shape factory functions](#shape-factory-functions)
25
+ - [AABB](#aabb)
26
+ - [Arc](#arc)
27
+ - [Bezier patch](#bezier-patch)
28
+ - [Circle](#circle)
29
+ - [Cubic](#cubic)
30
+ - [Group](#group)
31
+ - [Line](#line)
32
+ - [Path](#path)
33
+ - [Plane](#plane)
34
+ - [Polygon](#polygon)
35
+ - [Polyline](#polyline)
36
+ - [Quad](#quad)
37
+ - [Rect](#rect)
38
+ - [Sphere](#sphere)
39
+ - [Triangle](#triangle)
40
+ - [Constants & presets](#constants--presets)
41
+ - [Curve subdivision kernels](#curve-subdivision-kernels)
42
+ - [Polygon tessellation algorithms](#polygon-tessellation-algorithms)
43
+ - [Vertex convolution kernels](#vertex-convolution-kernels)
24
44
  - [Support packages](#support-packages)
25
45
  - [Related packages](#related-packages)
26
46
  - [Status](#status)
@@ -41,46 +61,71 @@ name](http://thi.ng/geom-clj). All polymorphic operations built on
41
61
 
42
62
  ### Shape types
43
63
 
44
- The following shape primitives are provided. For many there're multiple ways to
45
- create them, please check linked sources and/or docs.
46
-
47
- | Shape/Form | Description | Hiccup support |
48
- |--------------------------------------------------------------------------------------------------------|---------------------------------------|-----------------|
49
- | [AABB](https://github.com/thi-ng/umbrella/blob/develop/packages/geom/src/aabb.ts) | 3D Axis-aligned bounding box | ✅<sup>(2)</sup> |
50
- | [Arc](https://github.com/thi-ng/umbrella/blob/develop/packages/geom/src/arc.ts) | 2D elliptic arc | ✅ |
51
- | [Circle](https://github.com/thi-ng/umbrella/blob/develop/packages/geom/src/circle.ts) | 2D circle | ✅ |
52
- | [ComplexPolygon](https://github.com/thi-ng/umbrella/blob/develop/packages/geom/src/complex-polygon.ts) | 2D polygon w/ holes | ✅ |
53
- | [Cubic](https://github.com/thi-ng/umbrella/blob/develop/packages/geom/src/cubic.ts) | nD cubic bezier | ✅<sup>(1)</sup> |
54
- | [Ellipse](https://github.com/thi-ng/umbrella/blob/develop/packages/geom/src/ellipse.ts) | 2D ellipse | ✅ |
55
- | [Group](https://github.com/thi-ng/umbrella/blob/develop/packages/geom/src/group.ts) | group of 2D shapes | ✅ |
56
- | [Line](https://github.com/thi-ng/umbrella/blob/develop/packages/geom/src/line.ts) | 2D line segment | ✅ |
57
- | [Path](https://github.com/thi-ng/umbrella/blob/develop/packages/geom/src/path-builder.ts) | 2D path (w/ optional holes/sub-paths) | ✅ |
58
- | [Path (from SVG)](https://github.com/thi-ng/umbrella/blob/develop/packages/geom/src/path-from-svg.ts) | 2D path from SVG | ✅ |
59
- | [Plane](https://github.com/thi-ng/umbrella/blob/develop/packages/geom/src/plane.ts) | 3D plane | ✅<sup>(2)</sup> |
60
- | [Point cloud](https://github.com/thi-ng/umbrella/blob/develop/packages/geom/src/points.ts) | nD point cloud | ✅<sup>(1)</sup> |
61
- | [Polygon](https://github.com/thi-ng/umbrella/blob/develop/packages/geom/src/polygon.ts) | 2D simple polygon (no holes) | ✅ |
62
- | [Polyline](https://github.com/thi-ng/umbrella/blob/develop/packages/geom/src/polyline.ts) | 2D polyline | ✅ |
63
- | [Quad](https://github.com/thi-ng/umbrella/blob/develop/packages/geom/src/quad.ts) | 2D/3D quad (4-gon) | ✅<sup>(1)</sup> |
64
- | [Quadratic](https://github.com/thi-ng/umbrella/blob/develop/packages/geom/src/quadratic.ts) | nD quadratic bezier | ✅<sup>(1)</sup> |
65
- | [Ray](https://github.com/thi-ng/umbrella/blob/develop/packages/geom/src/ray.ts) | nD ray | ✅<sup>(1)</sup> |
66
- | [Rectangle](https://github.com/thi-ng/umbrella/blob/develop/packages/geom/src/rect.ts) | 2D rectangle | ✅ |
67
- | [Sphere](https://github.com/thi-ng/umbrella/blob/develop/packages/geom/src/sphere.ts) | 3D sphere | ✅<sup>(2)</sup> |
68
- | [Text](https://github.com/thi-ng/umbrella/blob/develop/packages/geom/src/text.ts) | Basic stub for text labels | ✅<sup>(3)</sup> |
69
- | [Triangle](https://github.com/thi-ng/umbrella/blob/develop/packages/geom/src/triangle.ts) | 2D triangle | |
70
-
71
- - <sup>(1)</sup> valid hiccup format, currently only useable/supported if 2D geometry
72
- - <sup>(2)</sup> valid hiccup format, currently unused/unsupported elsewhere
64
+ The following 2D/3D shape primitives are provided. All these types are implemented as
65
+ basic data container classes with additional eponymous factory functions (e.g.
66
+ `Circle` (class) => `circle()` (function)), which are encouraged to be used
67
+ instead of calling class constructors directly. For many shapes there're
68
+ [multiple ways to create them](#shape-factory-functions), please also check
69
+ linked sources and/or docs.
70
+
71
+ > [!IMPORTANT]
72
+ > Support for 3D shapes is WIP and currently limited to the various operations
73
+ > provided by this package, but does not _yet_ find any usage outside (e.g. for
74
+ > visualization). Sill, even the ops supported so far can be useful for many
75
+ > use cases...
76
+
77
+ | Shape/Form | Description | Hiccup support |
78
+ |--------------------------------------------------------------------------------------------------------|---------------------------------------|---------------------|
79
+ | [AABB](https://github.com/thi-ng/umbrella/blob/develop/packages/geom/src/aabb.ts) | 3D Axis-aligned bounding box | ✅<sup>(1)</sup> |
80
+ | [Arc](https://github.com/thi-ng/umbrella/blob/develop/packages/geom/src/arc.ts) | 2D elliptic arc | |
81
+ | [BPatch](https://github.com/thi-ng/umbrella/blob/develop/packages/geom/src/bpatch.ts) | 2D cubic bezier patch (4x4 points) | ✅ |
82
+ | [Circle](https://github.com/thi-ng/umbrella/blob/develop/packages/geom/src/circle.ts) | 2D circle | ✅ |
83
+ | [ComplexPolygon](https://github.com/thi-ng/umbrella/blob/develop/packages/geom/src/complex-polygon.ts) | 2D polygon w/ holes | |
84
+ | [Cubic](https://github.com/thi-ng/umbrella/blob/develop/packages/geom/src/cubic.ts) | 2D cubic bezier | |
85
+ | [Cubic3](https://github.com/thi-ng/umbrella/blob/develop/packages/geom/src/cubic3.ts) | 3D cubic bezier | ✅<sup>(1)</sup> |
86
+ | [Ellipse](https://github.com/thi-ng/umbrella/blob/develop/packages/geom/src/ellipse.ts) | 2D ellipse | ✅ |
87
+ | [Extra](https://github.com/thi-ng/umbrella/blob/develop/packages/geom/src/extra.ts) | Custom embedded hiccup/SVG data | ✅ |
88
+ | [Group](https://github.com/thi-ng/umbrella/blob/develop/packages/geom/src/group.ts) | group of 2D shapes | |
89
+ | [Group3](https://github.com/thi-ng/umbrella/blob/develop/packages/geom/src/group3.ts) | group of 3D shapes | ✅<sup>(1)</sup> |
90
+ | [Line](https://github.com/thi-ng/umbrella/blob/develop/packages/geom/src/line.ts) | 2D line segment | ✅ |
91
+ | [Line3](https://github.com/thi-ng/umbrella/blob/develop/packages/geom/src/line3.ts) | 3D line segment | ✅<sup>(1)</sup> |
92
+ | [Path](https://github.com/thi-ng/umbrella/blob/develop/packages/geom/src/path.ts) | 2D path (w/ optional holes/sub-paths) | ✅ |
93
+ | [Path3](https://github.com/thi-ng/umbrella/blob/develop/packages/geom/src/path3.ts) | 3D path (w/ optional holes/sub-paths) | ✅<sup>(1),(2)</sup> |
94
+ | [Plane](https://github.com/thi-ng/umbrella/blob/develop/packages/geom/src/plane.ts) | 3D plane | ✅<sup>(1)</sup> |
95
+ | [Points](https://github.com/thi-ng/umbrella/blob/develop/packages/geom/src/points.ts) | 2D point cloud | ✅ |
96
+ | [Points3](https://github.com/thi-ng/umbrella/blob/develop/packages/geom/src/points3.ts) | 3D point cloud | ✅<sup>(1)</sup> |
97
+ | [Polygon](https://github.com/thi-ng/umbrella/blob/develop/packages/geom/src/polygon.ts) | 2D simple polygon (no holes) | ✅ |
98
+ | [Polygon3](https://github.com/thi-ng/umbrella/blob/develop/packages/geom/src/polygon3.ts) | 3D simple polygon (no holes) | ✅ |
99
+ | [Polyline](https://github.com/thi-ng/umbrella/blob/develop/packages/geom/src/polyline.ts) | 2D polyline | ✅ |
100
+ | [Polyline3](https://github.com/thi-ng/umbrella/blob/develop/packages/geom/src/polyline3.ts) | 3D polyline | ✅<sup>(1)</sup> |
101
+ | [Quad](https://github.com/thi-ng/umbrella/blob/develop/packages/geom/src/quad.ts) | 2D quad (4-gon) | ✅ |
102
+ | [Quad3](https://github.com/thi-ng/umbrella/blob/develop/packages/geom/src/quad3.ts) | 2D quad (4-gon) | ✅<sup>(1)</sup> |
103
+ | [Quadratic](https://github.com/thi-ng/umbrella/blob/develop/packages/geom/src/quadratic.ts) | 2D quadratic bezier | ✅ |
104
+ | [Quadratic3](https://github.com/thi-ng/umbrella/blob/develop/packages/geom/src/quadratic3.ts) | 3D quadratic bezier | ✅<sup>(1)</sup> |
105
+ | [Ray](https://github.com/thi-ng/umbrella/blob/develop/packages/geom/src/ray.ts) | 2D ray | ✅ |
106
+ | [Ray3](https://github.com/thi-ng/umbrella/blob/develop/packages/geom/src/ray3.ts) | 3D ray | ✅<sup>(1)</sup> |
107
+ | [Rectangle](https://github.com/thi-ng/umbrella/blob/develop/packages/geom/src/rect.ts) | 2D rectangle | ✅ |
108
+ | [Sphere](https://github.com/thi-ng/umbrella/blob/develop/packages/geom/src/sphere.ts) | 3D sphere | ✅<sup>(1)</sup> |
109
+ | [Text](https://github.com/thi-ng/umbrella/blob/develop/packages/geom/src/text.ts) | Basic stub for text labels | ✅<sup>(3)</sup> |
110
+ | [Triangle](https://github.com/thi-ng/umbrella/blob/develop/packages/geom/src/triangle.ts) | 2D triangle | ✅ |
111
+ | [Triangle3](https://github.com/thi-ng/umbrella/blob/develop/packages/geom/src/triangle3.ts) | 3D triangle | ✅<sup>(1)</sup> |
112
+
113
+ - <sup>(1)</sup> valid hiccup format, but currently still missing **external** tool/library support
114
+ - <sup>(2)</sup> only lines, cubic & quadratic curve segments supported
73
115
  - <sup>(3)</sup> merely treated as a point in space (e.g. used for placing text labels), no geometry of text itself
74
116
 
75
117
  ### Hiccup support
76
118
 
119
+ > [!NOTE]
120
+ > Sidebar with background information for advanced usage only. Most users can safely ignore this.
121
+
77
122
  With very few exceptions these all are implementing the [`IToHiccup`
78
123
  interface](https://docs.thi.ng/umbrella/api/interfaces/IToHiccup.html) and so
79
124
  can be easily converted (via
80
125
  [hiccup](https://github.com/thi-ng/umbrella/tree/develop/packages/hiccup)) to a
81
126
  variety of other formats, incl. [conversion to SVG](#svg-support).
82
127
 
83
- By design, for better flexibility and performance reasons, the hiccup flavor
128
+ By design, for more flexibility and for performance reasons, the hiccup flavor
84
129
  used by this package is **not** compatible with that used by
85
130
  [thi.ng/hiccup-svg](https://github.com/thi-ng/umbrella/tree/develop/packages/hiccup-svg),
86
131
  though the latter provides a
@@ -88,9 +133,36 @@ though the latter provides a
88
133
  function for that purpose. This is only needed for some cases of dynamic
89
134
  in-browser SVG DOM creation...
90
135
 
136
+ Instead, the hiccup format used here for interim interop is compatible with that
137
+ used by the
138
+ [thi.ng/hiccup-canvas](https://github.com/thi-ng/umbrella/tree/develop/packages/hiccup-canvas)
139
+ package (see its readme for details) and avoids extraneous stringification of
140
+ geometry data and attrib values. A brief example to illustrate some differences:
141
+
142
+ ```ts tangle:export/readme-hiccup.ts
143
+ import { circle, asSvg } from "@thi.ng/geom";
144
+ import { convertTree } from "@thi.ng/hiccup-svg";
145
+
146
+ // a circle with RGBA color attrib
147
+ const a = circle([100, 200], 300, { fill: [1, 0.5, 0, 1] });
148
+
149
+ // invocation of the IToHiccup interface (all shapes support it)
150
+ console.log(a.toHiccup());
151
+ // [ "circle", { fill: [ 1, 0, 0, 1 ] }, [ 100, 200 ], 300 ]
152
+
153
+ // convert shape into to a SVG compatible hiccup format
154
+ // (i.e. stringify attributes, convert colors etc.)
155
+ console.log(convertTree(a));
156
+ // [ "circle", { fill: "#ff8000", cx: "100", cy: "200", r: "300" } ]
157
+
158
+ // asSvg() automatically uses convertTree() when serializing shape(s) to SVG
159
+ console.log(asSvg(a));
160
+ // <circle fill="#ff8000" cx="100" cy="200" r="300"/>
161
+ ```
162
+
91
163
  ### SVG support
92
164
 
93
- SVG conversion is included via the
165
+ For 2D shape types only, SVG conversion is included via the
94
166
  [`asSvg()`](https://docs.thi.ng/umbrella/geom/functions/asSvg.html) and
95
167
  [`svgDoc()`](https://docs.thi.ng/umbrella/geom/functions/svgDoc.html) functions.
96
168
 
@@ -99,51 +171,217 @@ SVG conversion is included via the
99
171
  The following operations are provided (many also applicable to shape groups
100
172
  directly and/or perform automatic resampling/conversion if needed).
101
173
 
102
- | Operation | Description |
103
- |---------------------------------------------------------------------------------------------|--------------------------------------------------------------|
104
- | [`applyTransforms()`](https://docs.thi.ng/umbrella/geom/functions/applyTransforms.html) | applies any spatial transformation attributes |
105
- | [`arcLength()`](https://docs.thi.ng/umbrella/geom/functions/arcLength.html) | compute arc length / perimeter of shape boundary |
106
- | [`area()`](https://docs.thi.ng/umbrella/geom/functions/area.html) | signed/unsigned surface area |
107
- | [`asCubic()`](https://docs.thi.ng/umbrella/geom/functions/asCubic.html) | convert shape boundary to cubic bezier segments |
108
- | [`asPath()`](https://docs.thi.ng/umbrella/geom/functions/asPath.html) | convert shape to path |
109
- | [`asPolygon()`](https://docs.thi.ng/umbrella/geom/functions/asPolygon.html) | convert shape to polygon(s) |
110
- | [`asPolyline()`](https://docs.thi.ng/umbrella/geom/functions/asPolyline.html) | convert shape to polyline(s) |
111
- | [`asSvg()`](https://docs.thi.ng/umbrella/geom/functions/asSvg.html) | serialize shape/group/hierarchy to SVG |
112
- | [`bounds()`](https://docs.thi.ng/umbrella/geom/functions/bounds.html) | compute bounding box |
113
- | [`center()`](https://docs.thi.ng/umbrella/geom/functions/center.html) | center shape around origin or point |
114
- | [`centroid()`](https://docs.thi.ng/umbrella/geom/functions/centroid.html) | compute shape centroid |
115
- | [`classifyPoint()`](https://docs.thi.ng/umbrella/geom/functions/classifyPoint.html) | classify point in relation to shape boundary (in/out) |
116
- | [`clipConvex()`](https://docs.thi.ng/umbrella/geom/functions/clipConvex.html) | clip shape against convex boundary |
117
- | [`closestPoint()`](https://docs.thi.ng/umbrella/geom/functions/closestPoint.html) | compute closest point on shape boundary |
118
- | [`convexHull()`](https://docs.thi.ng/umbrella/geom/functions/convexHull.html) | compute convex hull (2d only) |
119
- | [`edges()`](https://docs.thi.ng/umbrella/geom/functions/edges.html) | extract edges |
120
- | [`fitIntoBounds()`](https://docs.thi.ng/umbrella/geom/functions/fitIntoBounds.html) | rescale/reposition shapes into a destination boundary |
121
- | [`flip()`](https://docs.thi.ng/umbrella/geom/functions/flip.html) | reverse order (vertices or direction) |
122
- | [`intersects()`](https://docs.thi.ng/umbrella/geom/functions/intersects.html) | pairwise shape intersection (various types) |
123
- | [`mapPoint()`](https://docs.thi.ng/umbrella/geom/functions/mapPoint.html) | transform world space point into local shape space |
124
- | [`offset()`](https://docs.thi.ng/umbrella/geom/functions/offset.html) | shape/path offsetting |
125
- | [`pointAt()`](https://docs.thi.ng/umbrella/geom/functions/pointAt.html) | compute point on shape boundary at parametric position |
126
- | [`pointInside()`](https://docs.thi.ng/umbrella/geom/functions/pointInside.html) | check if point is inside shape |
127
- | [`proximity()`](https://docs.thi.ng/umbrella/geom/functions/proximity.html) | distance from point to shape boundary |
128
- | [`resample()`](https://docs.thi.ng/umbrella/geom/functions/resample.html) | resample/convert shape |
129
- | [`rotate()`](https://docs.thi.ng/umbrella/geom/functions/rotate.html) | rotate shape |
130
- | [`scale()`](https://docs.thi.ng/umbrella/geom/functions/scale.html) | scale shape (uniformly/non-uniformly) |
131
- | [`scatter()`](https://docs.thi.ng/umbrella/geom/functions/scatter.html) | create random points inside a shape boundary |
132
- | [`simplify()`](https://docs.thi.ng/umbrella/geom/functions/simplify.html) | simplify shape/boundary (Douglas-Peucker) |
133
- | [`splitArcLength()`](https://docs.thi.ng/umbrella/geom/functions/splitArcLength.html) | split shapes & groups based on max. arc length |
134
- | [`splitAt()`](https://docs.thi.ng/umbrella/geom/functions/splitAt.html) | split shape/boundary at parametric position |
135
- | [`splitNear()`](https://docs.thi.ng/umbrella/geom/functions/splitNear.html) | split shape/boundary near world position |
136
- | [`subdivCurve()`](https://docs.thi.ng/umbrella/geom/functions/subdivCurve.html) | recursively apply curve subdivision kernel |
137
- | [`tangentAt()`](https://docs.thi.ng/umbrella/geom/functions/tangentAt.html) | compute tangent at parametric position |
138
- | [`tessellate()`](https://docs.thi.ng/umbrella/geom/functions/tessellate.html) | (recursively) tessellate shape |
139
- | [`transformVertices()`](https://docs.thi.ng/umbrella/geom/functions/transformVertices.html) | apply custom function to each vertex |
140
- | [`transform()`](https://docs.thi.ng/umbrella/geom/functions/transform.html) | apply transformation matrix |
141
- | [`translate()`](https://docs.thi.ng/umbrella/geom/functions/translate.html) | translate shape |
142
- | [`union()`](https://docs.thi.ng/umbrella/geom/functions/union.html) | compute shape union |
143
- | [`vertices()`](https://docs.thi.ng/umbrella/geom/functions/vertices.html) | extract/sample vertices from shape boundary |
144
- | [`volume()`](https://docs.thi.ng/umbrella/geom/functions/volume.html) | compute shape volume (3D only) |
145
- | [`warpPoints()`](https://docs.thi.ng/umbrella/geom/functions/warpPoints.html) | transfer points between the local spaces defined by 2 shapes |
146
- | [`withAttribs()`](https://docs.thi.ng/umbrella/geom/functions/withAttribs.html) | shallow copy of given shape with new `attribs` assigned |
174
+ | Operation | Description |
175
+ |-----------------------------------------------------------------------------------------------------|--------------------------------------------------------------------|
176
+ | [`applyTransforms()`](https://docs.thi.ng/umbrella/geom/functions/applyTransforms.html) | applies any spatial transformation attributes |
177
+ | [`arcLength()`](https://docs.thi.ng/umbrella/geom/functions/arcLength.html) | compute arc length / perimeter of shape boundary |
178
+ | [`area()`](https://docs.thi.ng/umbrella/geom/functions/area.html) | signed/unsigned surface area |
179
+ | [`asCubic()`](https://docs.thi.ng/umbrella/geom/functions/asCubic.html) | convert shape boundary to cubic bezier segments |
180
+ | [`asPath()`](https://docs.thi.ng/umbrella/geom/functions/asPath.html) | convert shape to path |
181
+ | [`asPolygon()`](https://docs.thi.ng/umbrella/geom/functions/asPolygon.html) | convert shape to polygon(s) |
182
+ | [`asPolyline()`](https://docs.thi.ng/umbrella/geom/functions/asPolyline.html) | convert shape to polyline(s) |
183
+ | [`asSector()`](https://docs.thi.ng/umbrella/geom/functions/asSector.html) | convert arc to sector (path) |
184
+ | [`asSvg()`](https://docs.thi.ng/umbrella/geom/functions/asSvg.html) | serialize shape/group/hierarchy to SVG |
185
+ | [`bounds()`](https://docs.thi.ng/umbrella/geom/functions/bounds.html) | compute bounding box |
186
+ | [`center()`](https://docs.thi.ng/umbrella/geom/functions/center.html) | center shape around origin or point |
187
+ | [`centroid()`](https://docs.thi.ng/umbrella/geom/functions/centroid.html) | compute shape centroid |
188
+ | [`classifyPoint()`](https://docs.thi.ng/umbrella/geom/functions/classifyPoint.html) | classify point in relation to shape boundary (in/out) |
189
+ | [`clipConvex()`](https://docs.thi.ng/umbrella/geom/functions/clipConvex.html) | clip shape against convex boundary |
190
+ | [`closestPoint()`](https://docs.thi.ng/umbrella/geom/functions/closestPoint.html) | compute closest point on shape boundary |
191
+ | [`convexHull()`](https://docs.thi.ng/umbrella/geom/functions/convexHull.html) | compute convex hull (2d only) |
192
+ | [`convolve()`](https://docs.thi.ng/umbrella/geom/functions/convolve.html) | kernel based vertex convolution/filtering |
193
+ | [`edges()`](https://docs.thi.ng/umbrella/geom/functions/edges.html) | extract edges |
194
+ | [`edgesFromTessellation()`](https://docs.thi.ng/umbrella/geom/functions/edgesFromTessellation.html) | extract unique edges from tessellation results |
195
+ | [`fitIntoBounds2()`](https://docs.thi.ng/umbrella/geom/functions/fitIntoBounds2.html) | rescale/reposition a 2D shape into a destination boundary |
196
+ | [`fitIntoBounds3()`](https://docs.thi.ng/umbrella/geom/functions/fitIntoBounds3.html) | rescale/reposition a 3D shape into a destination boundary |
197
+ | [`fitAllIntoBounds2()`](https://docs.thi.ng/umbrella/geom/functions/fitAllIntoBounds2.html) | rescale/reposition multiple 2D shapes into a boundary |
198
+ | [`flip()`](https://docs.thi.ng/umbrella/geom/functions/flip.html) | reverse order (vertices or direction) |
199
+ | [`graphFromTessellation()`](https://docs.thi.ng/umbrella/geom/functions/graphFromTessellation.html) | create graph from tessellation results |
200
+ | [`intersects()`](https://docs.thi.ng/umbrella/geom/functions/intersects.html) | pairwise shape intersection (various types) |
201
+ | [`mapPoint()`](https://docs.thi.ng/umbrella/geom/functions/mapPoint.html) | transform world space point into local shape UV space |
202
+ | [`offset()`](https://docs.thi.ng/umbrella/geom/functions/offset.html) | shape/path offsetting |
203
+ | [`pointAt()`](https://docs.thi.ng/umbrella/geom/functions/pointAt.html) | compute point on shape boundary at parametric position |
204
+ | [`pointInside()`](https://docs.thi.ng/umbrella/geom/functions/pointInside.html) | check if point is inside shape |
205
+ | [`proximity()`](https://docs.thi.ng/umbrella/geom/functions/proximity.html) | distance from point to shape boundary |
206
+ | [`resample()`](https://docs.thi.ng/umbrella/geom/functions/resample.html) | resample/convert shape |
207
+ | [`rotate()`](https://docs.thi.ng/umbrella/geom/functions/rotate.html) | rotate shape (2D only) |
208
+ | [`rotateAroundAxis()`](https://docs.thi.ng/umbrella/geom/functions/rotateAroundAxis.html) | rotate shape (3D only) |
209
+ | [`rotateX()`](https://docs.thi.ng/umbrella/geom/functions/rotateX.html) | rotate shape (3D only) |
210
+ | [`rotateY()`](https://docs.thi.ng/umbrella/geom/functions/rotateY.html) | rotate shape (3D only) |
211
+ | [`rotateZ()`](https://docs.thi.ng/umbrella/geom/functions/rotateZ.html) | rotate shape (3D only) |
212
+ | [`scale()`](https://docs.thi.ng/umbrella/geom/functions/scale.html) | scale shape (uniformly/non-uniformly) |
213
+ | [`scaleWithCenter()`](https://docs.thi.ng/umbrella/geom/functions/scaleWithCenter.html) | scale shape with pivot point |
214
+ | [`scatter()`](https://docs.thi.ng/umbrella/geom/functions/scatter.html) | create random points inside a shape boundary |
215
+ | [`simplify()`](https://docs.thi.ng/umbrella/geom/functions/simplify.html) | simplify shape/boundary (Douglas-Peucker) |
216
+ | [`splitArcLength()`](https://docs.thi.ng/umbrella/geom/functions/splitArcLength.html) | split shapes & groups based on max. arc length |
217
+ | [`splitAt()`](https://docs.thi.ng/umbrella/geom/functions/splitAt.html) | split shape/boundary at parametric position |
218
+ | [`splitNearPoint()`](https://docs.thi.ng/umbrella/geom/functions/splitNearPoint.html) | split shape/boundary near world position |
219
+ | [`subdivCurve()`](https://docs.thi.ng/umbrella/geom/functions/subdivCurve.html) | recursively apply curve subdivision kernel |
220
+ | [`tangentAt()`](https://docs.thi.ng/umbrella/geom/functions/tangentAt.html) | compute tangent at parametric position |
221
+ | [`tessellate()`](https://docs.thi.ng/umbrella/geom/functions/tessellate.html) | (recursively) tessellate shape |
222
+ | [`transformVertices()`](https://docs.thi.ng/umbrella/geom/functions/transformVertices.html) | apply custom function to each vertex |
223
+ | [`transform()`](https://docs.thi.ng/umbrella/geom/functions/transform.html) | apply transformation matrix |
224
+ | [`translate()`](https://docs.thi.ng/umbrella/geom/functions/translate.html) | translate shape |
225
+ | [`union()`](https://docs.thi.ng/umbrella/geom/functions/union.html) | compute shape union |
226
+ | [`unmapPoint()`](https://docs.thi.ng/umbrella/geom/functions/unmapPoint.html) | transform local shape UV point into world space |
227
+ | [`vertices()`](https://docs.thi.ng/umbrella/geom/functions/vertices.html) | extract/sample vertices from shape boundary |
228
+ | [`volume()`](https://docs.thi.ng/umbrella/geom/functions/volume.html) | compute shape volume (3D only) |
229
+ | [`warpPoint()`](https://docs.thi.ng/umbrella/geom/functions/warpPoint.html) | transfer single point between the local spaces defined by 2 shapes |
230
+ | [`warpPoints()`](https://docs.thi.ng/umbrella/geom/functions/warpPoints.html) | transfer points between the local spaces defined by 2 shapes |
231
+ | [`warpPointsBPatch()`](https://docs.thi.ng/umbrella/geom/functions/warpPointsBPatch.html) | transfer points to the local spaces of a bezier patch |
232
+ | [`withAttribs()`](https://docs.thi.ng/umbrella/geom/functions/withAttribs.html) | shallow copy of given shape with new `attribs` assigned |
233
+
234
+ ### Shape factory functions
235
+
236
+ In addition to the [above listed direct shape type functions](#shape-types),
237
+ the following additional shape creation helpers are provided:
238
+
239
+ #### AABB
240
+
241
+ - [aabbFromMinMax()](https://docs.thi.ng/umbrella/geom/functions/aabbFromMinMax.html)
242
+ - [aabbFromMinMaxWithMargin()](https://docs.thi.ng/umbrella/geom/functions/aabbFromMinMaxWithMargin.html)
243
+ - [aabbFromCentroid()](https://docs.thi.ng/umbrella/geom/functions/aabbFromCentroid.html)
244
+ - [aabbWithCentroidAndMargin()](https://docs.thi.ng/umbrella/geom/functions/aabbWithCentroidAndMargin.html)
245
+ - [intersectionAABB()](https://docs.thi.ng/umbrella/geom/functions/intersectionAABB.html)
246
+ - [inscribedAABB()](https://docs.thi.ng/umbrella/geom/functions/inscribedAABB.html)
247
+
248
+ #### Arc
249
+
250
+ - [arcFrom2Points()](https://docs.thi.ng/umbrella/geom/functions/arcFrom2Points.html)
251
+
252
+ #### Bezier patch
253
+
254
+ - [bpatchFromQuad()](https://docs.thi.ng/umbrella/geom/functions/bpatchFromQuad.html)
255
+ - [bpatchFromHex()](https://docs.thi.ng/umbrella/geom/functions/bpatchFromHex.html)
256
+
257
+ #### Circle
258
+
259
+ - [circleFrom2Points()](https://docs.thi.ng/umbrella/geom/functions/circleFrom2Points.html)
260
+ - [circleFrom3Points()](https://docs.thi.ng/umbrella/geom/functions/circleFrom3Points.html)
261
+
262
+ #### Cubic
263
+
264
+ - [cubicFromArc()](https://docs.thi.ng/umbrella/geom/functions/cubicFromArc.html)
265
+ - [cubicFromLine()](https://docs.thi.ng/umbrella/geom/functions/cubicFromLine.html)
266
+ - [cubicFromLine3()](https://docs.thi.ng/umbrella/geom/functions/cubicFromLine3.html)
267
+ - [cubicFromQuadratic()](https://docs.thi.ng/umbrella/geom/functions/cubicFromQuadratic.html)
268
+ - [cubicFromQuadratic3()](https://docs.thi.ng/umbrella/geom/functions/cubicFromQuadratic3.html)
269
+
270
+ #### Group
271
+
272
+ - [groupFromTessellation()](https://docs.thi.ng/umbrella/geom/functions/groupFromTessellation.html)
273
+
274
+ #### Line
275
+
276
+ - [clippedLine()](https://docs.thi.ng/umbrella/geom/functions/clippedLine.html)
277
+
278
+ #### Path
279
+
280
+ - [pathBuilder()](https://docs.thi.ng/umbrella/geom/functions/pathBuilder-1.html)
281
+ - [pathBuilder3()](https://docs.thi.ng/umbrella/geom/functions/pathBuilder3.html)
282
+ - [pathFromSvg()](https://docs.thi.ng/umbrella/geom/functions/pathFromSvg.html)
283
+ - [pathFromCubics()](https://docs.thi.ng/umbrella/geom/functions/pathFromCubics.html)
284
+ - [normalizedPath()](https://docs.thi.ng/umbrella/geom/functions/normalizedPath.html)
285
+ - [roundedRect()](https://docs.thi.ng/umbrella/geom/functions/roundedRect.html)
286
+
287
+ #### Plane
288
+
289
+ - [planeWithPoint()](https://docs.thi.ng/umbrella/geom/functions/planeWithPoint.html)
290
+ - [planeFrom3Points()](https://docs.thi.ng/umbrella/geom/functions/planeFrom3Points.html)
291
+ - [planeFromRay()](https://docs.thi.ng/umbrella/geom/functions/planeFromRay.html)
292
+
293
+ #### Polygon
294
+
295
+ - [smoothPolygon()](https://docs.thi.ng/umbrella/geom/functions/smoothPolygon.html)
296
+ - [star()](https://docs.thi.ng/umbrella/geom/functions/star.html)
297
+ - [starWithCentroid()](https://docs.thi.ng/umbrella/geom/functions/starWithCentroid.html)
298
+
299
+ #### Polyline
300
+
301
+ - [smoothPolyline()](https://docs.thi.ng/umbrella/geom/functions/smoothPolyline.html)
302
+ - [spiral()](https://docs.thi.ng/umbrella/geom/functions/spiral.html)
303
+
304
+ #### Quad
305
+
306
+ - [quadOnPlane()](https://docs.thi.ng/umbrella/geom/functions/quadOnPlane.html)
307
+
308
+ #### Rect
309
+
310
+ - [rectFromMinMax()](https://docs.thi.ng/umbrella/geom/functions/rectFromMinMax.html)
311
+ - [rectFromMinMaxWithMargin()](https://docs.thi.ng/umbrella/geom/functions/rectFromMinMaxWithMargin.html)
312
+ - [rectWithCentroid()](https://docs.thi.ng/umbrella/geom/functions/rectWithCentroid.html)
313
+ - [rectWithCentroidAndMargin()](https://docs.thi.ng/umbrella/geom/functions/rectWithCentroidAndMargin.html)
314
+ - [intersectionRect()](https://docs.thi.ng/umbrella/geom/functions/intersectionRect.html)
315
+ - [inscribedSquare()](https://docs.thi.ng/umbrella/geom/functions/inscribedSquare.html)
316
+ - [inscribedSquareHex()](https://docs.thi.ng/umbrella/geom/functions/inscribedSquareHex.html)
317
+
318
+ #### Sphere
319
+
320
+ - [sphereFrom2Points()](https://docs.thi.ng/umbrella/geom/functions/sphereFrom2Points.html)
321
+
322
+ #### Triangle
323
+
324
+ - [equilateralTriangle()](https://docs.thi.ng/umbrella/geom/functions/equilateralTriangle.html)
325
+
326
+ ### Constants & presets
327
+
328
+ Some of the shape operations require configuration with specific algorithms
329
+ and/or constants. In all cases this relies on a completely extensible mechanism,
330
+ but the package provides presets for common options/implementations:
331
+
332
+ #### Curve subdivision kernels
333
+
334
+ To be used with [`subdivideCurve()`](https://docs.thi.ng/umbrella/geom/functions/subdivCurve.html):
335
+
336
+ - [SUBDIV_CHAIKIN_CLOSED](https://docs.thi.ng/umbrella/geom/variables/SUBDIV_CHAIKIN_CLOSED.html)
337
+ - [SUBDIV_CHAIKIN_OPEN](https://docs.thi.ng/umbrella/geom/variables/SUBDIV_CHAIKIN_OPEN.html)
338
+ - [SUBDIV_CUBIC_CLOSED](https://docs.thi.ng/umbrella/geom/variables/SUBDIV_CUBIC_CLOSED.html)
339
+ - [SUBDIV_DISPLACE](https://docs.thi.ng/umbrella/geom/variables/SUBDIV_DISPLACE.html)
340
+ - [SUBDIV_MID_CLOSED](https://docs.thi.ng/umbrella/geom/variables/SUBDIV_MID_CLOSED.html)
341
+ - [SUBDIV_MID_OPEN](https://docs.thi.ng/umbrella/geom/variables/SUBDIV_MID_OPEN.html)
342
+ - [SUBDIV_THIRDS_CLOSED](https://docs.thi.ng/umbrella/geom/variables/SUBDIV_THIRDS_CLOSED.html)
343
+ - [SUBDIV_THIRDS_OPEN](https://docs.thi.ng/umbrella/geom/variables/SUBDIV_THIRDS_OPEN.html)
344
+
345
+ #### Polygon tessellation algorithms
346
+
347
+ To be used with [`tessellate()`](https://docs.thi.ng/umbrella/geom/functions/tessellate.html):
348
+
349
+ See [thi.ng/geom-tessellate
350
+ readme](https://github.com/thi-ng/umbrella/blob/develop/packages/geom-tessellate/README.md#tessellators)
351
+ for diagrams/illustrations of each algorithm!
352
+
353
+ - [TESSELLATE_EARCUT](https://docs.thi.ng/umbrella/geom/variables/TESSELLATE_EARCUT.html)
354
+ - [TESSELLATE_EARCUT_COMPLEX](https://docs.thi.ng/umbrella/geom/variables/TESSELLATE_EARCUT_COMPLEX.html)
355
+ - [TESSELLATE_EDGE_SPLIT](https://docs.thi.ng/umbrella/geom/variables/TESSELLATE_EDGE_SPLIT.html)
356
+ - [TESSELLATE_INSET](https://docs.thi.ng/umbrella/geom/variables/TESSELLATE_INSET.html)
357
+ - [TESSELLATE_QUAD_FAN](https://docs.thi.ng/umbrella/geom/variables/TESSELLATE_QUAD_FAN.html)
358
+ - [TESSELLATE_RIM_TRIS](https://docs.thi.ng/umbrella/geom/variables/TESSELLATE_RIM_TRIS.html)
359
+ - [TESSELLATE_TRI_FAN](https://docs.thi.ng/umbrella/geom/variables/TESSELLATE_TRI_FAN.html)
360
+ - [TESSELLATE_TRI_FAN_BOUNDARY](https://docs.thi.ng/umbrella/geom/variables/TESSELLATE_TRI_FAN_BOUNDARY.html)
361
+ - [TESSELLATE_TRI_FAN_SPLIT](https://docs.thi.ng/umbrella/geom/variables/TESSELLATE_TRI_FAN_SPLIT.html)
362
+
363
+ Tessellation behaviors:
364
+
365
+ - [`basicTessellation()`](https://docs.thi.ng/umbrella/geom/functions/basicTessellation.html):
366
+ default impl
367
+ - [`meshTessellation()`](https://docs.thi.ng/umbrella/geom/functions/meshTessellation.html):
368
+ uses kD-tree to deduplicate result points
369
+
370
+ Tessellation post-processing:
371
+
372
+ - [edgesFromTessellation()](https://docs.thi.ng/umbrella/geom/functions/edgesFromTessellation.html)
373
+ - [edgePointsFromTessellation()](https://docs.thi.ng/umbrella/geom/functions/edgePointsFromTessellation.html)
374
+ - [graphFromTessellation()](https://docs.thi.ng/umbrella/geom/functions/graphFromTessellation.html)
375
+ - [groupFromTessellation()](https://docs.thi.ng/umbrella/geom/functions/groupFromTessellation.html)
376
+
377
+ #### Vertex convolution kernels
378
+
379
+ To be used with [`convolve()`](https://docs.thi.ng/umbrella/geom/functions/convolve.html):
380
+
381
+ - [KERNEL_BOX](https://docs.thi.ng/umbrella/geom/functions/KERNEL_BOX.html)
382
+ - [KERNEL_GAUSSIAN](https://docs.thi.ng/umbrella/geom/functions/KERNEL_GAUSSIAN.html)
383
+ - [KERNEL_TRIANGLE](https://docs.thi.ng/umbrella/geom/functions/KERNEL_TRIANGLE.html)
384
+ ---
147
385
 
148
386
  This package acts as a higher-level frontend for most of the following related
149
387
  packages (which are more low-level, lightweight and usable by themselves too):
@@ -151,7 +389,6 @@ packages (which are more low-level, lightweight and usable by themselves too):
151
389
  ## Support packages
152
390
 
153
391
  - [@thi.ng/geom-accel](https://github.com/thi-ng/umbrella/tree/develop/packages/geom-accel) - n-D spatial indexing data structures with a shared ES6 Map/Set-like API
154
- - [@thi.ng/geom-api](https://github.com/thi-ng/umbrella/tree/develop/packages/geom-api) - Shared type & interface declarations for [@thi.ng/geom](https://github.com/thi-ng/umbrella/tree/develop/packages/geom) packages
155
392
  - [@thi.ng/geom-arc](https://github.com/thi-ng/umbrella/tree/develop/packages/geom-arc) - 2D circular / elliptic arc operations
156
393
  - [@thi.ng/geom-axidraw](https://github.com/thi-ng/umbrella/tree/develop/packages/geom-axidraw) - Conversion and preparation of thi.ng/geom shapes & shape groups to/from AxiDraw pen plotter draw commands
157
394
  - [@thi.ng/geom-clip-line](https://github.com/thi-ng/umbrella/tree/develop/packages/geom-clip-line) - 2D line clipping (Liang-Barsky)
@@ -170,6 +407,7 @@ packages (which are more low-level, lightweight and usable by themselves too):
170
407
  - [@thi.ng/geom-tessellate](https://github.com/thi-ng/umbrella/tree/develop/packages/geom-tessellate) - 2D/3D convex polygon tessellators
171
408
  - [@thi.ng/geom-trace-bitmap](https://github.com/thi-ng/umbrella/tree/develop/packages/geom-trace-bitmap) - Bitmap image to hairline vector and point cloud conversions
172
409
  - [@thi.ng/geom-voronoi](https://github.com/thi-ng/umbrella/tree/develop/packages/geom-voronoi) - Fast, incremental 2D Delaunay & Voronoi mesh implementation
410
+ - [@thi.ng/geom-webgl](https://github.com/thi-ng/umbrella/tree/develop/packages/geom-webgl) - WebGL geometry/shape conversion & interop
173
411
 
174
412
  ## Related packages
175
413
 
@@ -213,10 +451,11 @@ For Node.js REPL:
213
451
  const geom = await import("@thi.ng/geom");
214
452
  ```
215
453
 
216
- Package sizes (brotli'd, pre-treeshake): ESM: 14.61 KB
454
+ Package sizes (brotli'd, pre-treeshake): ESM: 17.37 KB
217
455
 
218
456
  ## Dependencies
219
457
 
458
+ - [@thi.ng/adjacency](https://github.com/thi-ng/umbrella/tree/develop/packages/adjacency)
220
459
  - [@thi.ng/api](https://github.com/thi-ng/umbrella/tree/develop/packages/api)
221
460
  - [@thi.ng/arrays](https://github.com/thi-ng/umbrella/tree/develop/packages/arrays)
222
461
  - [@thi.ng/associative](https://github.com/thi-ng/umbrella/tree/develop/packages/associative)
@@ -224,7 +463,6 @@ Package sizes (brotli'd, pre-treeshake): ESM: 14.61 KB
224
463
  - [@thi.ng/defmulti](https://github.com/thi-ng/umbrella/tree/develop/packages/defmulti)
225
464
  - [@thi.ng/equiv](https://github.com/thi-ng/umbrella/tree/develop/packages/equiv)
226
465
  - [@thi.ng/errors](https://github.com/thi-ng/umbrella/tree/develop/packages/errors)
227
- - [@thi.ng/geom-api](https://github.com/thi-ng/umbrella/tree/develop/packages/geom-api)
228
466
  - [@thi.ng/geom-arc](https://github.com/thi-ng/umbrella/tree/develop/packages/geom-arc)
229
467
  - [@thi.ng/geom-clip-line](https://github.com/thi-ng/umbrella/tree/develop/packages/geom-clip-line)
230
468
  - [@thi.ng/geom-clip-poly](https://github.com/thi-ng/umbrella/tree/develop/packages/geom-clip-poly)
@@ -251,45 +489,50 @@ Several projects in this repo's
251
489
  [/examples](https://github.com/thi-ng/umbrella/tree/develop/examples)
252
490
  directory are using this package:
253
491
 
254
- | Screenshot | Description | Live demo | Source |
255
- |:-----------------------------------------------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------|:------------------------------------------------------------|:-----------------------------------------------------------------------------------------|
256
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/boid-basics.png" width="240"/> | Basic 2D boid simulation and spatial indexing neighbor lookups | [Demo](https://demo.thi.ng/umbrella/boid-basics/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/boid-basics) |
257
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/canvas-recorder.png" width="240"/> | Self-modifying, animated typographic grid with emergent complex patterns | [Demo](https://demo.thi.ng/umbrella/canvas-recorder/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/canvas-recorder) |
258
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/fiber-basics.png" width="240"/> | Fiber-based cooperative multitasking basics | [Demo](https://demo.thi.ng/umbrella/fiber-basics/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/fiber-basics) |
259
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/geom-complex-poly.png" width="240"/> | Shape conversions & operations using polygons with holes | [Demo](https://demo.thi.ng/umbrella/geom-complex-poly/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/geom-complex-poly) |
260
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/geom-convex-hull.png" width="240"/> | Convex hull & shape clipping of 2D polygons | [Demo](https://demo.thi.ng/umbrella/geom-convex-hull/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/geom-convex-hull) |
261
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/geom/geom-fuzz.png" width="240"/> | geom-fuzz basic shape & fill examples | [Demo](https://demo.thi.ng/umbrella/geom-fuzz-basics/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/geom-fuzz-basics) |
262
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/geom-sdf-logo.jpg" width="240"/> | (Re)Constructing the thi.ng logo using a 2D signed-distance field | [Demo](https://demo.thi.ng/umbrella/geom-sdf-logo/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/geom-sdf-logo) |
263
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/geom-sdf-path.png" width="240"/> | SVG path to SDF, applying deformation and converting back to SVG | [Demo](https://demo.thi.ng/umbrella/geom-sdf-path/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/geom-sdf-path) |
264
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/geom-terrain-viz.jpg" width="240"/> | 2.5D hidden line visualization of digital elevation files (DEM) | [Demo](https://demo.thi.ng/umbrella/geom-terrain-viz/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/geom-terrain-viz) |
265
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/geom/tessel.png" width="240"/> | Animated, recursive polygon tessellations | [Demo](https://demo.thi.ng/umbrella/geom-tessel/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/geom-tessel) |
266
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/geom-voronoi-mst.jpg" width="240"/> | Poisson-disk shape-aware sampling, Voronoi & Minimum Spanning Tree visualization | [Demo](https://demo.thi.ng/umbrella/geom-voronoi-mst/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/geom-voronoi-mst) |
267
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/gesture-analysis.png" width="240"/> | Mouse gesture / stroke analysis, simplification, corner detection | [Demo](https://demo.thi.ng/umbrella/gesture-analysis/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/gesture-analysis) |
268
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/hdom-canvas-particles.jpg" width="240"/> | 2D Bezier curve-guided particle system | [Demo](https://demo.thi.ng/umbrella/hdom-canvas-particles/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/hdom-canvas-particles) |
269
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/hiccup-canvas-arcs.jpg" width="240"/> | Animated arcs & drawing using hiccup-canvas | [Demo](https://demo.thi.ng/umbrella/hiccup-canvas-arcs/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/hiccup-canvas-arcs) |
270
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/imgui/imgui-all.png" width="240"/> | Canvas based Immediate Mode GUI components | [Demo](https://demo.thi.ng/umbrella/imgui/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/imgui) |
271
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/geom/geom-isoline.png" width="240"/> | Animated sine plasma effect visualized using contour lines | [Demo](https://demo.thi.ng/umbrella/iso-plasma/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/iso-plasma) |
272
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/kmeans-viz.jpg" width="240"/> | k-means clustering visualization | [Demo](https://demo.thi.ng/umbrella/kmeans-viz/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/kmeans-viz) |
273
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/pointfree-geom.jpg" width="240"/> | Live coding playground for 2D geometry generation using @thi.ng/pointfree-lang | [Demo](https://demo.thi.ng/umbrella/pointfree-geom/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/pointfree-geom) |
274
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/poisson/poisson.jpg" width="240"/> | 2D Poisson-disc sampler with procedural gradient map | [Demo](https://demo.thi.ng/umbrella/poisson-circles/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/poisson-circles) |
275
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/poly-spline.png" width="240"/> | Polygon to cubic curve conversion & visualization | [Demo](https://demo.thi.ng/umbrella/poly-spline/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/poly-spline) |
276
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/poly-subdiv.jpg" width="240"/> | Animated, iterative polygon subdivisions & visualization | [Demo](https://demo.thi.ng/umbrella/poly-subdiv/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/poly-subdiv) |
277
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/quasi-lattice.png" width="240"/> | Quasi-random lattice generator | [Demo](https://demo.thi.ng/umbrella/quasi-lattice/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/quasi-lattice) |
278
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/rdom-canvas-basics.jpg" width="240"/> | Minimal rdom-canvas animation | [Demo](https://demo.thi.ng/umbrella/rdom-canvas-basics/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/rdom-canvas-basics) |
279
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/rotating-voronoi.jpg" width="240"/> | Animated Voronoi diagram, cubic splines & SVG download | [Demo](https://demo.thi.ng/umbrella/rotating-voronoi/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/rotating-voronoi) |
280
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/scenegraph.png" width="240"/> | 2D scenegraph & shape picking | [Demo](https://demo.thi.ng/umbrella/scenegraph/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/scenegraph) |
281
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/scenegraph-image.png" width="240"/> | 2D scenegraph & image map based geometry manipulation | [Demo](https://demo.thi.ng/umbrella/scenegraph-image/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/scenegraph-image) |
282
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/spline-tangent.png" width="240"/> | Compute cubic spline position & tangent using Dual Numbers | [Demo](https://demo.thi.ng/umbrella/spline-tangent/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/spline-tangent) |
283
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/svg-resample.png" width="240"/> | SVG path parsing & dynamic resampling | [Demo](https://demo.thi.ng/umbrella/svg-resample/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/svg-resample) |
284
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/text-canvas.png" width="240"/> | 3D wireframe textmode demo | [Demo](https://demo.thi.ng/umbrella/text-canvas/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/text-canvas) |
285
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/trace-bitmap.jpg" width="240"/> | Multi-layer vectorization & dithering of bitmap images | [Demo](https://demo.thi.ng/umbrella/trace-bitmap/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/trace-bitmap) |
492
+ | Screenshot | Description | Live demo | Source |
493
+ |:------------------------------------------------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------|:-------------------------------------------------------------|:------------------------------------------------------------------------------------------|
494
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/boid-basics.png" width="240"/> | Basic 2D boid simulation and spatial indexing neighbor lookups | [Demo](https://demo.thi.ng/umbrella/boid-basics/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/boid-basics) |
495
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/canvas-recorder.png" width="240"/> | Self-modifying, animated typographic grid with emergent complex patterns | [Demo](https://demo.thi.ng/umbrella/canvas-recorder/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/canvas-recorder) |
496
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/fiber-basics.png" width="240"/> | Fiber-based cooperative multitasking basics | [Demo](https://demo.thi.ng/umbrella/fiber-basics/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/fiber-basics) |
497
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/geom-classify-point.png" width="240"/> | Polygon point classification (inside/boundary/outside) | [Demo](https://demo.thi.ng/umbrella/geom-classify-point/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/geom-classify-point) |
498
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/geom-complex-poly.png" width="240"/> | Shape conversions & operations using polygons with holes | [Demo](https://demo.thi.ng/umbrella/geom-complex-poly/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/geom-complex-poly) |
499
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/geom-convex-hull.png" width="240"/> | Convex hull & shape clipping of 2D polygons | [Demo](https://demo.thi.ng/umbrella/geom-convex-hull/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/geom-convex-hull) |
500
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/geom-csv-piechart.png" width="240"/> | Piechart visualization of CSV data | [Demo](https://demo.thi.ng/umbrella/geom-csv-piechart/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/geom-csv-piechart) |
501
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/geom-extra-hiccup.jpg" width="240"/> | Embedding thi.ng/hiccup data/elements in thi.ng/geom shape hierarchies | [Demo](https://demo.thi.ng/umbrella/geom-extra-hiccup/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/geom-extra-hiccup) |
502
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/geom/geom-fuzz.png" width="240"/> | geom-fuzz basic shape & fill examples | [Demo](https://demo.thi.ng/umbrella/geom-fuzz-basics/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/geom-fuzz-basics) |
503
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/geom-hexgrid.png" width="240"/> | Hex grid generation & tessellations | [Demo](https://demo.thi.ng/umbrella/geom-hexgrid/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/geom-hexgrid) |
504
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/geom-sdf-logo.jpg" width="240"/> | (Re)Constructing the thi.ng logo using a 2D signed-distance field | [Demo](https://demo.thi.ng/umbrella/geom-sdf-logo/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/geom-sdf-logo) |
505
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/geom-sdf-path.png" width="240"/> | SVG path to SDF, applying deformation and converting back to SVG | [Demo](https://demo.thi.ng/umbrella/geom-sdf-path/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/geom-sdf-path) |
506
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/geom-terrain-viz.jpg" width="240"/> | 2.5D hidden line visualization of digital elevation files (DEM) | [Demo](https://demo.thi.ng/umbrella/geom-terrain-viz/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/geom-terrain-viz) |
507
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/geom/tessel.png" width="240"/> | Animated, recursive polygon tessellations | [Demo](https://demo.thi.ng/umbrella/geom-tessel/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/geom-tessel) |
508
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/geom-unique-edges.png" width="240"/> | Iterating the unique edges of a tessellation | [Demo](https://demo.thi.ng/umbrella/geom-unique-edges/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/geom-unique-edges) |
509
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/geom-voronoi-mst.jpg" width="240"/> | Poisson-disk shape-aware sampling, Voronoi & Minimum Spanning Tree visualization | [Demo](https://demo.thi.ng/umbrella/geom-voronoi-mst/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/geom-voronoi-mst) |
510
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/geom-webgl-attrib-pool.jpg" width="240"/> | Augmenting thi.ng/geom shapes for WebGL, using instancing & attribute buffers | [Demo](https://demo.thi.ng/umbrella/geom-webgl-attrib-pool/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/geom-webgl-attrib-pool) |
511
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/geom-webgl-basics.jpg" width="240"/> | Converting thi.ng/geom shape types for WebGL | [Demo](https://demo.thi.ng/umbrella/geom-webgl-basics/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/geom-webgl-basics) |
512
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/gesture-analysis.png" width="240"/> | Mouse gesture / stroke analysis, simplification, corner detection | [Demo](https://demo.thi.ng/umbrella/gesture-analysis/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/gesture-analysis) |
513
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/hdom-canvas-particles.jpg" width="240"/> | 2D Bezier curve-guided particle system | [Demo](https://demo.thi.ng/umbrella/hdom-canvas-particles/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/hdom-canvas-particles) |
514
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/hiccup-canvas-arcs.jpg" width="240"/> | Animated arcs & drawing using hiccup-canvas | [Demo](https://demo.thi.ng/umbrella/hiccup-canvas-arcs/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/hiccup-canvas-arcs) |
515
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/imgui/imgui-all.png" width="240"/> | Canvas based Immediate Mode GUI components | [Demo](https://demo.thi.ng/umbrella/imgui/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/imgui) |
516
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/geom/geom-isoline.png" width="240"/> | Animated sine plasma effect visualized using contour lines | [Demo](https://demo.thi.ng/umbrella/iso-plasma/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/iso-plasma) |
517
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/kmeans-viz.jpg" width="240"/> | k-means clustering visualization | [Demo](https://demo.thi.ng/umbrella/kmeans-viz/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/kmeans-viz) |
518
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/pointfree-geom.jpg" width="240"/> | Live coding playground for 2D geometry generation using @thi.ng/pointfree-lang | [Demo](https://demo.thi.ng/umbrella/pointfree-geom/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/pointfree-geom) |
519
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/poisson/poisson.jpg" width="240"/> | 2D Poisson-disc sampler with procedural gradient map | [Demo](https://demo.thi.ng/umbrella/poisson-circles/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/poisson-circles) |
520
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/poly-spline.png" width="240"/> | Polygon to cubic curve conversion & visualization | [Demo](https://demo.thi.ng/umbrella/poly-spline/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/poly-spline) |
521
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/poly-subdiv.jpg" width="240"/> | Animated, iterative polygon subdivisions & visualization | [Demo](https://demo.thi.ng/umbrella/poly-subdiv/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/poly-subdiv) |
522
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/quasi-lattice.png" width="240"/> | Quasi-random lattice generator | [Demo](https://demo.thi.ng/umbrella/quasi-lattice/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/quasi-lattice) |
523
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/rdom-canvas-basics.jpg" width="240"/> | Minimal rdom-canvas animation | [Demo](https://demo.thi.ng/umbrella/rdom-canvas-basics/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/rdom-canvas-basics) |
524
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/rotating-voronoi.jpg" width="240"/> | Animated Voronoi diagram, cubic splines & SVG download | [Demo](https://demo.thi.ng/umbrella/rotating-voronoi/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/rotating-voronoi) |
525
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/scenegraph.png" width="240"/> | 2D scenegraph & shape picking | [Demo](https://demo.thi.ng/umbrella/scenegraph/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/scenegraph) |
526
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/scenegraph-image.png" width="240"/> | 2D scenegraph & image map based geometry manipulation | [Demo](https://demo.thi.ng/umbrella/scenegraph-image/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/scenegraph-image) |
527
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/spline-tangent.png" width="240"/> | Compute cubic spline position & tangent using Dual Numbers | [Demo](https://demo.thi.ng/umbrella/spline-tangent/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/spline-tangent) |
528
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/svg-resample.png" width="240"/> | SVG path parsing & dynamic resampling | [Demo](https://demo.thi.ng/umbrella/svg-resample/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/svg-resample) |
529
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/text-canvas.png" width="240"/> | 3D wireframe textmode demo | [Demo](https://demo.thi.ng/umbrella/text-canvas/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/text-canvas) |
530
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/trace-bitmap.jpg" width="240"/> | Multi-layer vectorization & dithering of bitmap images | [Demo](https://demo.thi.ng/umbrella/trace-bitmap/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/trace-bitmap) |
286
531
 
287
532
  ## API
288
533
 
289
534
  [Generated API docs](https://docs.thi.ng/umbrella/geom/)
290
535
 
291
- TODO
292
-
293
536
  ## Authors
294
537
 
295
538
  - [Karsten Schmidt](https://thi.ng)