-
Notifications
You must be signed in to change notification settings - Fork 30
Closed
Description
was looking at the code and found an unexpected behaviour here:
Line 129 in 0ca9085
| return shape.find_simplex((x, y)) > 0 |
I'd expect that it should check for simplex >= 0.
example:
from pointpats.random import poisson
from scipy.spatial import delaunay_plot_2d, Delaunay, ConvexHull
import numpy as np
import matplotlib.pyplot as plt
rng = np.random.default_rng(10)
points = rng.uniform(0, 10, size=(30, 2))
hull = ConvexHull(points)
vxs = hull.points[hull.vertices]
deln = Delaunay(vxs)
ppp = poisson(hull, size=(100, 1))
fig, ax = plt.subplots(1, 1)
ax.scatter(
points[..., 0],
points[..., 1],
edgecolor="b",
facecolor="none",
alpha=0.5,
)
ax.scatter(ppp[:, 0], ppp[:, 1], edgecolor="r", facecolor="none", alpha=0.5)
delaunay_plot_2d(deln)looks like the first triangle is never covered, cause it is indexed as 0:
deln.find_simplex((2,8))
>>> array(0, dtype=int32)Metadata
Metadata
Assignees
Labels
No labels