@thi.ng/geom-voronoi 2.3.73 → 2.3.75
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 +1 -1
- package/index.js +10 -15
- package/package.json +17 -17
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
- **Last updated**: 2024-
|
|
3
|
+
- **Last updated**: 2024-06-21T19:34:38Z
|
|
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
|
+
### [2.3.75](https://github.com/thi-ng/umbrella/tree/@thi.ng/geom-voronoi@2.3.75) (2024-06-21)
|
|
13
|
+
|
|
14
|
+
#### ♻️ Refactoring
|
|
15
|
+
|
|
16
|
+
- enforce uniform naming convention of internal functions ([56992b2](https://github.com/thi-ng/umbrella/commit/56992b2))
|
|
17
|
+
|
|
12
18
|
### [2.3.64](https://github.com/thi-ng/umbrella/tree/@thi.ng/geom-voronoi@2.3.64) (2024-03-21)
|
|
13
19
|
|
|
14
20
|
#### ♻️ Refactoring
|
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 193 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
|
>
|
package/index.js
CHANGED
|
@@ -56,8 +56,7 @@ class DVMesh {
|
|
|
56
56
|
*/
|
|
57
57
|
add(p, val, eps = EPS, update = true) {
|
|
58
58
|
let [e, exists] = this.locate(p, eps);
|
|
59
|
-
if (exists)
|
|
60
|
-
return false;
|
|
59
|
+
if (exists) return false;
|
|
61
60
|
if (pointInSegment(p, e.origin.pos, e.dest.pos)) {
|
|
62
61
|
e = e.oprev;
|
|
63
62
|
e.onext.remove();
|
|
@@ -77,7 +76,7 @@ class DVMesh {
|
|
|
77
76
|
} while (e.lnext !== first);
|
|
78
77
|
do {
|
|
79
78
|
const t = e.oprev;
|
|
80
|
-
if (
|
|
79
|
+
if (__isRightOf(t.dest.pos, e) && pointInCircumCircle(p, e.origin.pos, t.dest.pos, e.dest.pos)) {
|
|
81
80
|
e.swap();
|
|
82
81
|
e = e.oprev;
|
|
83
82
|
} else if (e.onext !== first) {
|
|
@@ -112,11 +111,11 @@ class DVMesh {
|
|
|
112
111
|
while (true) {
|
|
113
112
|
if (eqDelta2(p, e.origin.pos, eps) || eqDelta2(p, e.dest.pos, eps)) {
|
|
114
113
|
return [e, true];
|
|
115
|
-
} else if (
|
|
114
|
+
} else if (__isRightOf(p, e)) {
|
|
116
115
|
e = e.sym;
|
|
117
|
-
} else if (!
|
|
116
|
+
} else if (!__isRightOf(p, e.onext)) {
|
|
118
117
|
e = e.onext;
|
|
119
|
-
} else if (!
|
|
118
|
+
} else if (!__isRightOf(p, e.dprev)) {
|
|
120
119
|
e = e.dprev;
|
|
121
120
|
} else {
|
|
122
121
|
return [e, false];
|
|
@@ -133,8 +132,7 @@ class DVMesh {
|
|
|
133
132
|
const visitedVerts = {};
|
|
134
133
|
while (work.length) {
|
|
135
134
|
const e = work.pop();
|
|
136
|
-
if (visitedEdges[e.id])
|
|
137
|
-
continue;
|
|
135
|
+
if (visitedEdges[e.id]) continue;
|
|
138
136
|
visitedEdges[e.id] = true;
|
|
139
137
|
if (!e.origin || !visitedVerts[e.origin.id]) {
|
|
140
138
|
let t = e.rot;
|
|
@@ -224,8 +222,7 @@ class DVMesh {
|
|
|
224
222
|
} while ((e = e.lnext) !== first);
|
|
225
223
|
if (needsClip) {
|
|
226
224
|
verts = sutherlandHodgeman(verts, bounds, bc);
|
|
227
|
-
if (verts.length < 3)
|
|
228
|
-
return;
|
|
225
|
+
if (verts.length < 3) return;
|
|
229
226
|
}
|
|
230
227
|
cells.push(verts);
|
|
231
228
|
} : (e) => {
|
|
@@ -266,8 +263,7 @@ class DVMesh {
|
|
|
266
263
|
const edges = [];
|
|
267
264
|
this.traverse(
|
|
268
265
|
(e, visitedEdges) => {
|
|
269
|
-
if (visitedEdges.at(e.sym.id))
|
|
270
|
-
return;
|
|
266
|
+
if (visitedEdges.at(e.sym.id)) return;
|
|
271
267
|
if (e.origin.id > 2 && e.dest.id > 2) {
|
|
272
268
|
const a = e.origin.pos;
|
|
273
269
|
const b = e.dest.pos;
|
|
@@ -296,8 +292,7 @@ class DVMesh {
|
|
|
296
292
|
const visitedVerts = defBitField(this.nextVID);
|
|
297
293
|
while (work.length) {
|
|
298
294
|
e = work.pop();
|
|
299
|
-
if (visitedEdges.at(e.id))
|
|
300
|
-
continue;
|
|
295
|
+
if (visitedEdges.at(e.id)) continue;
|
|
301
296
|
visitedEdges.setAt(e.id);
|
|
302
297
|
const eoID = e.origin.id;
|
|
303
298
|
if (eoID > 2 && e.rot.origin.id > 2) {
|
|
@@ -310,7 +305,7 @@ class DVMesh {
|
|
|
310
305
|
}
|
|
311
306
|
}
|
|
312
307
|
}
|
|
313
|
-
const
|
|
308
|
+
const __isRightOf = (p, e) => signedArea2(p, e.dest.pos, e.origin.pos) > 0;
|
|
314
309
|
export {
|
|
315
310
|
DVMesh
|
|
316
311
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/geom-voronoi",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.75",
|
|
4
4
|
"description": "Fast, incremental 2D Delaunay & Voronoi mesh implementation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"type": "git",
|
|
11
11
|
"url": "https://github.com/thi-ng/umbrella.git"
|
|
12
12
|
},
|
|
13
|
-
"homepage": "https://
|
|
13
|
+
"homepage": "https://thi.ng/geom-voronoi",
|
|
14
14
|
"funding": [
|
|
15
15
|
{
|
|
16
16
|
"type": "github",
|
|
@@ -36,22 +36,22 @@
|
|
|
36
36
|
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@thi.ng/api": "^8.11.
|
|
40
|
-
"@thi.ng/bitfield": "^2.3.
|
|
41
|
-
"@thi.ng/checks": "^3.6.
|
|
42
|
-
"@thi.ng/geom-clip-line": "^2.3.
|
|
43
|
-
"@thi.ng/geom-clip-poly": "^2.1.
|
|
44
|
-
"@thi.ng/geom-isec": "^
|
|
45
|
-
"@thi.ng/geom-poly-utils": "^
|
|
46
|
-
"@thi.ng/math": "^5.
|
|
47
|
-
"@thi.ng/quad-edge": "^3.1.
|
|
48
|
-
"@thi.ng/vectors": "^7.
|
|
39
|
+
"@thi.ng/api": "^8.11.3",
|
|
40
|
+
"@thi.ng/bitfield": "^2.3.42",
|
|
41
|
+
"@thi.ng/checks": "^3.6.5",
|
|
42
|
+
"@thi.ng/geom-clip-line": "^2.3.90",
|
|
43
|
+
"@thi.ng/geom-clip-poly": "^2.1.132",
|
|
44
|
+
"@thi.ng/geom-isec": "^4.0.0",
|
|
45
|
+
"@thi.ng/geom-poly-utils": "^3.0.0",
|
|
46
|
+
"@thi.ng/math": "^5.11.0",
|
|
47
|
+
"@thi.ng/quad-edge": "^3.1.66",
|
|
48
|
+
"@thi.ng/vectors": "^7.11.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@microsoft/api-extractor": "^7.
|
|
52
|
-
"esbuild": "^0.
|
|
53
|
-
"typedoc": "^0.25.
|
|
54
|
-
"typescript": "^5.
|
|
51
|
+
"@microsoft/api-extractor": "^7.47.0",
|
|
52
|
+
"esbuild": "^0.21.5",
|
|
53
|
+
"typedoc": "^0.25.13",
|
|
54
|
+
"typescript": "^5.5.2"
|
|
55
55
|
},
|
|
56
56
|
"keywords": [
|
|
57
57
|
"2d",
|
|
@@ -91,5 +91,5 @@
|
|
|
91
91
|
],
|
|
92
92
|
"year": 2016
|
|
93
93
|
},
|
|
94
|
-
"gitHead": "
|
|
94
|
+
"gitHead": "154c95cf9d6bab32174498ec3b5b5d87e42be7f9\n"
|
|
95
95
|
}
|