Skip to content

Commit

Permalink
Upgrade dependencies (poisson-disk-sampling v2, api changed)
Browse files Browse the repository at this point in the history
  • Loading branch information
redblobgames committed Feb 25, 2021
1 parent 640a94d commit eb9cf1a
Show file tree
Hide file tree
Showing 4 changed files with 350 additions and 143 deletions.
5 changes: 4 additions & 1 deletion create.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,10 @@ class MeshBuilder {

/** Pass in the constructor from the poisson-disk-sampling module */
addPoisson(Poisson, spacing, random=Math.random) {
let generator = new Poisson([1000, 1000], spacing, undefined, undefined, random);
let generator = new Poisson({
shape: [1000, 1000],
minDistance: spacing,
}, random);
this.points.forEach(p => generator.addPoint(p));
this.points = generator.fill();
return this;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"devDependencies": {
"@rollup/plugin-commonjs": "^11",
"@rollup/plugin-node-resolve": "^7",
"poisson-disk-sampling": "*",
"poisson-disk-sampling": "^2",
"rollup": "^1.0.0",
"tape": "*"
},
Expand Down
2 changes: 1 addition & 1 deletion tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ tape("delaunator: properly connected halfedges, random set", function(test) {
// NOTE: this is not a great test because the input data is
// different each time; need to switch to a deterministic random
// number generator
let generator = new Poisson([1000, 1000], 50.0);
let generator = new Poisson({shape: [1000, 1000], minDistance: 50.0});
let points = generator.fill();
let delaunator = Delaunator.from(points);
for (let e1 = 0; e1 < delaunator.halfedges.length; e1++) {
Expand Down
Loading

0 comments on commit eb9cf1a

Please sign in to comment.