@thi.ng/geom 8.0.0 → 8.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -1
- package/README.md +92 -88
- package/from-tessellation.d.ts +30 -3
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/package.json +32 -32
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
- **Last updated**: 2024-
|
|
3
|
+
- **Last updated**: 2024-07-06T12:02:19Z
|
|
4
4
|
- **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
|
|
5
5
|
|
|
6
6
|
All notable changes to this project will be documented in this file.
|
|
@@ -9,6 +9,12 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
|
|
|
9
9
|
**Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
|
|
10
10
|
and/or version bumps of transitive dependencies.
|
|
11
11
|
|
|
12
|
+
### [8.0.1](https://github.com/thi-ng/umbrella/tree/@thi.ng/geom@8.0.1) (2024-06-29)
|
|
13
|
+
|
|
14
|
+
#### 🩹 Bug fixes
|
|
15
|
+
|
|
16
|
+
- add missing pkg exports ([7ec144f](https://github.com/thi-ng/umbrella/commit/7ec144f))
|
|
17
|
+
|
|
12
18
|
# [8.0.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/geom@8.0.0) (2024-06-21)
|
|
13
19
|
|
|
14
20
|
#### 🛑 Breaking changes
|
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
[](https://mastodon.thi.ng/@toxi)
|
|
8
8
|
|
|
9
9
|
> [!NOTE]
|
|
10
|
-
> This is one of
|
|
10
|
+
> This is one of 188 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
|
>
|
|
@@ -61,13 +61,19 @@ name](http://thi.ng/geom-clj). All polymorphic operations built on
|
|
|
61
61
|
|
|
62
62
|
### Shape types
|
|
63
63
|
|
|
64
|
-
The following shape primitives are provided. All these types are implemented as
|
|
64
|
+
The following 2D/3D shape primitives are provided. All these types are implemented as
|
|
65
65
|
basic data container classes with additional eponymous factory functions (e.g.
|
|
66
66
|
`Circle` (class) => `circle()` (function)), which are encouraged to be used
|
|
67
67
|
instead of calling class constructors directly. For many shapes there're
|
|
68
68
|
[multiple ways to create them](#shape-factory-functions), please also check
|
|
69
69
|
linked sources and/or docs.
|
|
70
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
|
+
|
|
71
77
|
| Shape/Form | Description | Hiccup support |
|
|
72
78
|
|--------------------------------------------------------------------------------------------------------|---------------------------------------|---------------------|
|
|
73
79
|
| [AABB](https://github.com/thi-ng/umbrella/blob/develop/packages/geom/src/aabb.ts) | 3D Axis-aligned bounding box | ✅<sup>(1)</sup> |
|
|
@@ -156,7 +162,7 @@ console.log(asSvg(a));
|
|
|
156
162
|
|
|
157
163
|
### SVG support
|
|
158
164
|
|
|
159
|
-
SVG conversion is included via the
|
|
165
|
+
For 2D shape types only, SVG conversion is included via the
|
|
160
166
|
[`asSvg()`](https://docs.thi.ng/umbrella/geom/functions/asSvg.html) and
|
|
161
167
|
[`svgDoc()`](https://docs.thi.ng/umbrella/geom/functions/svgDoc.html) functions.
|
|
162
168
|
|
|
@@ -165,63 +171,65 @@ SVG conversion is included via the
|
|
|
165
171
|
The following operations are provided (many also applicable to shape groups
|
|
166
172
|
directly and/or perform automatic resampling/conversion if needed).
|
|
167
173
|
|
|
168
|
-
| Operation
|
|
169
|
-
|
|
170
|
-
| [`applyTransforms()`](https://docs.thi.ng/umbrella/geom/functions/applyTransforms.html)
|
|
171
|
-
| [`arcLength()`](https://docs.thi.ng/umbrella/geom/functions/arcLength.html)
|
|
172
|
-
| [`area()`](https://docs.thi.ng/umbrella/geom/functions/area.html)
|
|
173
|
-
| [`asCubic()`](https://docs.thi.ng/umbrella/geom/functions/asCubic.html)
|
|
174
|
-
| [`asPath()`](https://docs.thi.ng/umbrella/geom/functions/asPath.html)
|
|
175
|
-
| [`asPolygon()`](https://docs.thi.ng/umbrella/geom/functions/asPolygon.html)
|
|
176
|
-
| [`asPolyline()`](https://docs.thi.ng/umbrella/geom/functions/asPolyline.html)
|
|
177
|
-
| [`asSector()`](https://docs.thi.ng/umbrella/geom/functions/asSector.html)
|
|
178
|
-
| [`asSvg()`](https://docs.thi.ng/umbrella/geom/functions/asSvg.html)
|
|
179
|
-
| [`bounds()`](https://docs.thi.ng/umbrella/geom/functions/bounds.html)
|
|
180
|
-
| [`center()`](https://docs.thi.ng/umbrella/geom/functions/center.html)
|
|
181
|
-
| [`centroid()`](https://docs.thi.ng/umbrella/geom/functions/centroid.html)
|
|
182
|
-
| [`classifyPoint()`](https://docs.thi.ng/umbrella/geom/functions/classifyPoint.html)
|
|
183
|
-
| [`clipConvex()`](https://docs.thi.ng/umbrella/geom/functions/clipConvex.html)
|
|
184
|
-
| [`closestPoint()`](https://docs.thi.ng/umbrella/geom/functions/closestPoint.html)
|
|
185
|
-
| [`convexHull()`](https://docs.thi.ng/umbrella/geom/functions/convexHull.html)
|
|
186
|
-
| [`convolve()`](https://docs.thi.ng/umbrella/geom/functions/convolve.html)
|
|
187
|
-
| [`edges()`](https://docs.thi.ng/umbrella/geom/functions/edges.html)
|
|
188
|
-
| [`
|
|
189
|
-
| [`
|
|
190
|
-
| [`
|
|
191
|
-
| [`
|
|
192
|
-
| [`
|
|
193
|
-
| [`
|
|
194
|
-
| [`
|
|
195
|
-
| [`
|
|
196
|
-
| [`
|
|
197
|
-
| [`
|
|
198
|
-
| [`
|
|
199
|
-
| [`
|
|
200
|
-
| [`
|
|
201
|
-
| [`
|
|
202
|
-
| [`
|
|
203
|
-
| [`
|
|
204
|
-
| [`
|
|
205
|
-
| [`
|
|
206
|
-
| [`
|
|
207
|
-
| [`
|
|
208
|
-
| [`
|
|
209
|
-
| [`
|
|
210
|
-
| [`
|
|
211
|
-
| [`
|
|
212
|
-
| [`
|
|
213
|
-
| [`
|
|
214
|
-
| [`
|
|
215
|
-
| [`
|
|
216
|
-
| [`
|
|
217
|
-
| [`
|
|
218
|
-
| [`
|
|
219
|
-
| [`
|
|
220
|
-
| [`
|
|
221
|
-
| [`
|
|
222
|
-
| [`
|
|
223
|
-
| [`
|
|
224
|
-
| [`
|
|
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 |
|
|
225
233
|
|
|
226
234
|
### Shape factory functions
|
|
227
235
|
|
|
@@ -230,7 +238,7 @@ the following additional shape creation helpers are provided:
|
|
|
230
238
|
|
|
231
239
|
#### AABB
|
|
232
240
|
|
|
233
|
-
- [aabbFromMinMax()](https://docs.thi.ng/umbrella/geom/functions
|
|
241
|
+
- [aabbFromMinMax()](https://docs.thi.ng/umbrella/geom/functions/aabbFromMinMax.html)
|
|
234
242
|
- [aabbFromMinMaxWithMargin()](https://docs.thi.ng/umbrella/geom/functions/aabbFromMinMaxWithMargin.html)
|
|
235
243
|
- [aabbFromCentroid()](https://docs.thi.ng/umbrella/geom/functions/aabbFromCentroid.html)
|
|
236
244
|
- [aabbWithCentroidAndMargin()](https://docs.thi.ng/umbrella/geom/functions/aabbWithCentroidAndMargin.html)
|
|
@@ -269,12 +277,11 @@ the following additional shape creation helpers are provided:
|
|
|
269
277
|
|
|
270
278
|
#### Path
|
|
271
279
|
|
|
272
|
-
- [pathBuilder()](https://docs.thi.ng/umbrella/geom/functions/pathBuilder.html)
|
|
280
|
+
- [pathBuilder()](https://docs.thi.ng/umbrella/geom/functions/pathBuilder-1.html)
|
|
281
|
+
- [pathBuilder3()](https://docs.thi.ng/umbrella/geom/functions/pathBuilder3.html)
|
|
273
282
|
- [pathFromSvg()](https://docs.thi.ng/umbrella/geom/functions/pathFromSvg.html)
|
|
274
283
|
- [pathFromCubics()](https://docs.thi.ng/umbrella/geom/functions/pathFromCubics.html)
|
|
275
|
-
- [pathFromCubics3()](https://docs.thi.ng/umbrella/geom/functions/pathFromCubics3.html)
|
|
276
284
|
- [normalizedPath()](https://docs.thi.ng/umbrella/geom/functions/normalizedPath.html)
|
|
277
|
-
- [normalizedPath3()](https://docs.thi.ng/umbrella/geom/functions/normalizedPath3.html)
|
|
278
285
|
- [roundedRect()](https://docs.thi.ng/umbrella/geom/functions/roundedRect.html)
|
|
279
286
|
|
|
280
287
|
#### Plane
|
|
@@ -326,14 +333,12 @@ but the package provides presets for common options/implementations:
|
|
|
326
333
|
|
|
327
334
|
To be used with [`subdivideCurve()`](https://docs.thi.ng/umbrella/geom/functions/subdivCurve.html):
|
|
328
335
|
|
|
329
|
-
- [
|
|
330
|
-
- [
|
|
331
|
-
- [
|
|
332
|
-
- [
|
|
333
|
-
- [
|
|
334
|
-
- [
|
|
335
|
-
- [`SUBDIV_THIRDS_CLOSED`](https://docs.thi.ng/umbrella/geom/variables/SUBDIV_THIRDS_CLOSED.html)
|
|
336
|
-
- [`SUBDIV_THIRDS_OPEN`](https://docs.thi.ng/umbrella/geom/variables/SUBDIV_THIRDS_OPEN.html)
|
|
336
|
+
- [SUBDIV_CHAIKIN](https://docs.thi.ng/umbrella/geom/variables/SUBDIV_CHAIKIN.html)
|
|
337
|
+
- [SUBDIV_CUBIC](https://docs.thi.ng/umbrella/geom/variables/SUBDIV_CUBIC.html)
|
|
338
|
+
- [SUBDIV_DISPLACE](https://docs.thi.ng/umbrella/geom/functions/SUBDIV_DISPLACE.html)
|
|
339
|
+
- [SUBDIV_DLG](https://docs.thi.ng/umbrella/geom/variables/SUBDIV_DLG.html)
|
|
340
|
+
- [SUBDIV_MID](https://docs.thi.ng/umbrella/geom/variables/SUBDIV_MID.html)
|
|
341
|
+
- [SUBDIV_THIRDS](https://docs.thi.ng/umbrella/geom/variables/SUBDIV_THIRDS.html)
|
|
337
342
|
|
|
338
343
|
#### Polygon tessellation algorithms
|
|
339
344
|
|
|
@@ -343,21 +348,21 @@ See [thi.ng/geom-tessellate
|
|
|
343
348
|
readme](https://github.com/thi-ng/umbrella/blob/develop/packages/geom-tessellate/README.md#tessellators)
|
|
344
349
|
for diagrams/illustrations of each algorithm!
|
|
345
350
|
|
|
346
|
-
- [
|
|
347
|
-
- [
|
|
348
|
-
- [
|
|
349
|
-
- [
|
|
350
|
-
- [
|
|
351
|
-
- [
|
|
352
|
-
- [
|
|
353
|
-
- [
|
|
354
|
-
- [
|
|
351
|
+
- [TESSELLATE_EARCUT](https://docs.thi.ng/umbrella/geom/functions/TESSELLATE_EARCUT.html)
|
|
352
|
+
- [TESSELLATE_EARCUT_COMPLEX](https://docs.thi.ng/umbrella/geom/functions/TESSELLATE_EARCUT_COMPLEX.html)
|
|
353
|
+
- [TESSELLATE_EDGE_SPLIT](https://docs.thi.ng/umbrella/geom/functions/TESSELLATE_EDGE_SPLIT.html)
|
|
354
|
+
- [TESSELLATE_INSET](https://docs.thi.ng/umbrella/geom/functions/TESSELLATE_INSET.html)
|
|
355
|
+
- [TESSELLATE_QUAD_FAN](https://docs.thi.ng/umbrella/geom/functions/TESSELLATE_QUAD_FAN.html)
|
|
356
|
+
- [TESSELLATE_RIM_TRIS](https://docs.thi.ng/umbrella/geom/functions/TESSELLATE_RIM_TRIS.html)
|
|
357
|
+
- [TESSELLATE_TRI_FAN](https://docs.thi.ng/umbrella/geom/functions/TESSELLATE_TRI_FAN.html)
|
|
358
|
+
- [TESSELLATE_TRI_FAN_BOUNDARY](https://docs.thi.ng/umbrella/geom/functions/TESSELLATE_TRI_FAN_BOUNDARY.html)
|
|
359
|
+
- [TESSELLATE_TRI_FAN_SPLIT](https://docs.thi.ng/umbrella/geom/functions/TESSELLATE_TRI_FAN_SPLIT.html)
|
|
355
360
|
|
|
356
361
|
Tessellation behaviors:
|
|
357
362
|
|
|
358
|
-
- [
|
|
363
|
+
- [basicTessellation()](https://docs.thi.ng/umbrella/geom/functions/basicTessellation.html):
|
|
359
364
|
default impl
|
|
360
|
-
- [
|
|
365
|
+
- [meshTessellation()](https://docs.thi.ng/umbrella/geom/functions/meshTessellation.html):
|
|
361
366
|
uses kD-tree to deduplicate result points
|
|
362
367
|
|
|
363
368
|
Tessellation post-processing:
|
|
@@ -371,9 +376,9 @@ Tessellation post-processing:
|
|
|
371
376
|
|
|
372
377
|
To be used with [`convolve()`](https://docs.thi.ng/umbrella/geom/functions/convolve.html):
|
|
373
378
|
|
|
374
|
-
- [
|
|
375
|
-
- [
|
|
376
|
-
- [
|
|
379
|
+
- [KERNEL_BOX](https://docs.thi.ng/umbrella/geom/functions/KERNEL_BOX.html)
|
|
380
|
+
- [KERNEL_GAUSSIAN](https://docs.thi.ng/umbrella/geom/functions/KERNEL_GAUSSIAN.html)
|
|
381
|
+
- [KERNEL_TRIANGLE](https://docs.thi.ng/umbrella/geom/functions/KERNEL_TRIANGLE.html)
|
|
377
382
|
---
|
|
378
383
|
|
|
379
384
|
This package acts as a higher-level frontend for most of the following related
|
|
@@ -382,7 +387,6 @@ packages (which are more low-level, lightweight and usable by themselves too):
|
|
|
382
387
|
## Support packages
|
|
383
388
|
|
|
384
389
|
- [@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
|
|
385
|
-
- [@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
|
|
386
390
|
- [@thi.ng/geom-arc](https://github.com/thi-ng/umbrella/tree/develop/packages/geom-arc) - 2D circular / elliptic arc operations
|
|
387
391
|
- [@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
|
|
388
392
|
- [@thi.ng/geom-clip-line](https://github.com/thi-ng/umbrella/tree/develop/packages/geom-clip-line) - 2D line clipping (Liang-Barsky)
|
|
@@ -445,7 +449,7 @@ For Node.js REPL:
|
|
|
445
449
|
const geom = await import("@thi.ng/geom");
|
|
446
450
|
```
|
|
447
451
|
|
|
448
|
-
Package sizes (brotli'd, pre-treeshake): ESM: 17.
|
|
452
|
+
Package sizes (brotli'd, pre-treeshake): ESM: 17.37 KB
|
|
449
453
|
|
|
450
454
|
## Dependencies
|
|
451
455
|
|
package/from-tessellation.d.ts
CHANGED
|
@@ -5,6 +5,14 @@ import { Group } from "./api/group.js";
|
|
|
5
5
|
* Creates a group of polygons from the given tessellation. If `attribs` are
|
|
6
6
|
* given, they will be used as the group's attribs.
|
|
7
7
|
*
|
|
8
|
+
* @remarks
|
|
9
|
+
* Also see:
|
|
10
|
+
*
|
|
11
|
+
* - [ITessellation](https://docs.thi.ng/umbrella/geom-tessellate/interfaces/ITessellation.html)
|
|
12
|
+
* - {@link edgesFromTessellation}
|
|
13
|
+
* - {@link edgePointsFromTessellation}
|
|
14
|
+
* - {@link graphFromTessellation}
|
|
15
|
+
*
|
|
8
16
|
* @param tess
|
|
9
17
|
* @param attribs
|
|
10
18
|
*/
|
|
@@ -16,7 +24,12 @@ export declare const groupFromTessellation: (tess: ITessellation, attribs?: Grou
|
|
|
16
24
|
* and can be edited, queried, and analyzed further.
|
|
17
25
|
*
|
|
18
26
|
* @remarks
|
|
19
|
-
* Also see
|
|
27
|
+
* Also see:
|
|
28
|
+
*
|
|
29
|
+
* - [ITessellation](https://docs.thi.ng/umbrella/geom-tessellate/interfaces/ITessellation.html)
|
|
30
|
+
* - {@link edgesFromTessellation}
|
|
31
|
+
* - {@link edgePointsFromTessellation}
|
|
32
|
+
* - {@link groupFromTessellation}
|
|
20
33
|
*
|
|
21
34
|
* @param tessel
|
|
22
35
|
*/
|
|
@@ -27,16 +40,22 @@ export declare const graphFromTessellation: ({ points, faces }: ITessellation, d
|
|
|
27
40
|
* tessellation's `points` array.
|
|
28
41
|
*
|
|
29
42
|
* @remarks
|
|
43
|
+
* Also see:
|
|
44
|
+
*
|
|
45
|
+
* - [ITessellation](https://docs.thi.ng/umbrella/geom-tessellate/interfaces/ITessellation.html)
|
|
46
|
+
* - {@link edgePointsFromTessellation}
|
|
47
|
+
* - {@link graphFromTessellation}
|
|
48
|
+
* - {@link groupFromTessellation}
|
|
30
49
|
*
|
|
31
50
|
* @example
|
|
32
|
-
*
|
|
51
|
+
* ```ts
|
|
33
52
|
* import * as g from "@thi.ng/geom";
|
|
34
53
|
*
|
|
35
54
|
* // tessellate rect into a triangle fan
|
|
36
55
|
* const tess = g.tessellate(g.rect(100), [g.TESSELLATE_TRI_FAN]);
|
|
37
56
|
*
|
|
38
57
|
* // extract unique edges (ignoring direction)
|
|
39
|
-
* console.log([...g.
|
|
58
|
+
* console.log([...g.edgesFromTessellation(tess)]);
|
|
40
59
|
* // [[ 3, 4 ], [ 2, 3 ], [ 2, 4 ], [ 1, 2 ],
|
|
41
60
|
* // [ 1, 4 ], [ 0, 1 ], [ 0, 3 ], [ 0, 4 ]]
|
|
42
61
|
* ```
|
|
@@ -48,6 +67,14 @@ export declare const edgesFromTessellation: (tess: ITessellation) => Generator<E
|
|
|
48
67
|
* Similar to {@link edgesFromTessellation}, but returns edges as pairs of
|
|
49
68
|
* points (instead of point IDs).
|
|
50
69
|
*
|
|
70
|
+
* @remarks
|
|
71
|
+
* Also see:
|
|
72
|
+
*
|
|
73
|
+
* - [ITessellation](https://docs.thi.ng/umbrella/geom-tessellate/interfaces/ITessellation.html)
|
|
74
|
+
* - {@link edgesFromTessellation}
|
|
75
|
+
* - {@link graphFromTessellation}
|
|
76
|
+
* - {@link groupFromTessellation}
|
|
77
|
+
*
|
|
51
78
|
* @param tess
|
|
52
79
|
*/
|
|
53
80
|
export declare const edgePointsFromTessellation: (tess: ITessellation) => IterableIterator<import("@thi.ng/vectors").ReadonlyVec[]>;
|
package/index.d.ts
CHANGED
|
@@ -108,6 +108,7 @@ export * from "./scale.js";
|
|
|
108
108
|
export * from "./scale-with-center.js";
|
|
109
109
|
export * from "./scatter.js";
|
|
110
110
|
export * from "./simplify.js";
|
|
111
|
+
export * from "./sphere.js";
|
|
111
112
|
export * from "./split-arclength.js";
|
|
112
113
|
export * from "./split-at.js";
|
|
113
114
|
export * from "./split-near.js";
|
package/index.js
CHANGED
|
@@ -108,6 +108,7 @@ export * from "./scale.js";
|
|
|
108
108
|
export * from "./scale-with-center.js";
|
|
109
109
|
export * from "./scatter.js";
|
|
110
110
|
export * from "./simplify.js";
|
|
111
|
+
export * from "./sphere.js";
|
|
111
112
|
export * from "./split-arclength.js";
|
|
112
113
|
export * from "./split-at.js";
|
|
113
114
|
export * from "./split-near.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/geom",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.2",
|
|
4
4
|
"description": "Functional, polymorphic API for 2D geometry types & SVG generation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -37,39 +37,39 @@
|
|
|
37
37
|
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@thi.ng/adjacency": "^2.5.
|
|
41
|
-
"@thi.ng/api": "^8.11.
|
|
42
|
-
"@thi.ng/arrays": "^2.9.
|
|
43
|
-
"@thi.ng/associative": "^6.3.
|
|
44
|
-
"@thi.ng/checks": "^3.6.
|
|
45
|
-
"@thi.ng/defmulti": "^3.0.
|
|
46
|
-
"@thi.ng/equiv": "^2.1.
|
|
47
|
-
"@thi.ng/errors": "^2.5.
|
|
48
|
-
"@thi.ng/geom-arc": "^2.1.
|
|
49
|
-
"@thi.ng/geom-clip-line": "^2.3.
|
|
50
|
-
"@thi.ng/geom-clip-poly": "^2.1.
|
|
51
|
-
"@thi.ng/geom-closest-point": "^2.1.
|
|
52
|
-
"@thi.ng/geom-hull": "^2.1.
|
|
53
|
-
"@thi.ng/geom-isec": "^4.0.
|
|
54
|
-
"@thi.ng/geom-poly-utils": "^3.0.
|
|
55
|
-
"@thi.ng/geom-resample": "^3.0.
|
|
56
|
-
"@thi.ng/geom-splines": "^2.3.
|
|
57
|
-
"@thi.ng/geom-subdiv-curve": "^3.0.
|
|
58
|
-
"@thi.ng/geom-tessellate": "^3.0.
|
|
59
|
-
"@thi.ng/hiccup": "^5.2.
|
|
60
|
-
"@thi.ng/hiccup-svg": "^5.3.
|
|
61
|
-
"@thi.ng/math": "^5.11.
|
|
62
|
-
"@thi.ng/matrices": "^2.4.
|
|
63
|
-
"@thi.ng/random": "^3.8.
|
|
64
|
-
"@thi.ng/strings": "^3.7.
|
|
65
|
-
"@thi.ng/transducers": "^9.0.
|
|
66
|
-
"@thi.ng/vectors": "^7.11.
|
|
40
|
+
"@thi.ng/adjacency": "^2.5.54",
|
|
41
|
+
"@thi.ng/api": "^8.11.5",
|
|
42
|
+
"@thi.ng/arrays": "^2.9.9",
|
|
43
|
+
"@thi.ng/associative": "^6.3.63",
|
|
44
|
+
"@thi.ng/checks": "^3.6.7",
|
|
45
|
+
"@thi.ng/defmulti": "^3.0.42",
|
|
46
|
+
"@thi.ng/equiv": "^2.1.61",
|
|
47
|
+
"@thi.ng/errors": "^2.5.10",
|
|
48
|
+
"@thi.ng/geom-arc": "^2.1.135",
|
|
49
|
+
"@thi.ng/geom-clip-line": "^2.3.92",
|
|
50
|
+
"@thi.ng/geom-clip-poly": "^2.1.134",
|
|
51
|
+
"@thi.ng/geom-closest-point": "^2.1.130",
|
|
52
|
+
"@thi.ng/geom-hull": "^2.1.130",
|
|
53
|
+
"@thi.ng/geom-isec": "^4.0.2",
|
|
54
|
+
"@thi.ng/geom-poly-utils": "^3.0.2",
|
|
55
|
+
"@thi.ng/geom-resample": "^3.0.2",
|
|
56
|
+
"@thi.ng/geom-splines": "^2.3.2",
|
|
57
|
+
"@thi.ng/geom-subdiv-curve": "^3.0.2",
|
|
58
|
+
"@thi.ng/geom-tessellate": "^3.0.2",
|
|
59
|
+
"@thi.ng/hiccup": "^5.2.4",
|
|
60
|
+
"@thi.ng/hiccup-svg": "^5.3.2",
|
|
61
|
+
"@thi.ng/math": "^5.11.2",
|
|
62
|
+
"@thi.ng/matrices": "^2.4.2",
|
|
63
|
+
"@thi.ng/random": "^3.8.3",
|
|
64
|
+
"@thi.ng/strings": "^3.7.36",
|
|
65
|
+
"@thi.ng/transducers": "^9.0.8",
|
|
66
|
+
"@thi.ng/vectors": "^7.11.2"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"@microsoft/api-extractor": "^7.47.0",
|
|
70
|
-
"esbuild": "^0.
|
|
71
|
-
"typedoc": "^0.
|
|
72
|
-
"typescript": "^5.5.
|
|
70
|
+
"esbuild": "^0.23.0",
|
|
71
|
+
"typedoc": "^0.26.3",
|
|
72
|
+
"typescript": "^5.5.3"
|
|
73
73
|
},
|
|
74
74
|
"keywords": [
|
|
75
75
|
"2d",
|
|
@@ -527,5 +527,5 @@
|
|
|
527
527
|
],
|
|
528
528
|
"year": 2013
|
|
529
529
|
},
|
|
530
|
-
"gitHead": "
|
|
530
|
+
"gitHead": "70f493d9ccc97c5df5dda7e808e96cd1691097fc\n"
|
|
531
531
|
}
|