Skip to content

Commit

Permalink
feat(poisson): update to use ISpatialSet
Browse files Browse the repository at this point in the history
BREAKING CHANGE: update to use latest geom-accel API
  • Loading branch information
postspectacular committed Dec 18, 2019
1 parent 7f30ee0 commit 32a20fe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/poisson/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { isNumber } from "@thi.ng/checks";
import { ISpatialAccel } from "@thi.ng/geom-api";
import { ISpatialSet } from "@thi.ng/geom-api";
import { IRandom, SYSTEM } from "@thi.ng/random";
import { jitter as _jitter, ReadonlyVec, Vec } from "@thi.ng/vectors";

Expand Down Expand Up @@ -42,7 +42,7 @@ export interface PoissonOpts {
* distributing the process over multiple invocations of smaller
* sample sizes (see `max` option) to avoid long delays.
*/
index: ISpatialAccel<ReadonlyVec, number>;
index: ISpatialSet<ReadonlyVec>;
/**
* Max number of samples to produce. Must be given, no default.
*/
Expand Down Expand Up @@ -107,7 +107,7 @@ export const samplePoisson = (_opts: PoissonOpts) => {
i = iter;
while (i-- > 0) {
if (!index.has(pos, d)) {
index.add(pos, d);
index.add(pos, 0);
samples.push(pos);
failed = 0;
num--;
Expand Down

0 comments on commit 32a20fe

Please sign in to comment.