Closed adam-grant-hendry closed 3 years ago
@banesullivan Would you be able to help with this?
@akaszynski Any ideas?
I don't have enough spare time conduct a through review of this, but I fixed this with
pts = np.stack((x.ravel(), y.ravel(), z.ravel()), axis=1) + 10
return np.unique(pts, axis=0) - 10
The problem appears to be a combination of unique and negative points.
Thank you @akaszynski I confirm!
I'll post on VTK discourse and SO to see if anyone has an idea as to why.
Closing as solution was found.
Problem
I am trying to implement Edelsbrunner's Algorithm for the alpha shape of a 3D point cloud in python as presented in this SO post. However, I'm having trouble plotting results. Half my sphere looks good, and the other half garbled.
I suspect it may have something to do with the fact that I have negative coordinates, but I'm not sure.
Definitions
I'm adding these so programmers can contribute without being bogged down by math. These are simplified definitions and not meant to be precise (Feel free to skip this part; for more, see see Introduction to Alpha Shapes and Discrete Differential Geometry):
Delaunay triangulation: for a 2D point set, a tesselation of the points into triangles (i.e. "triangulation") where the circumscribed circle (i.e. "circumcircle") about every triangle contains no other points in the set. For 3D points, replace "triangle" with "tetrahedron" and "circumcircle" with "circumsphere".
Affinely independent: a collection of points
p0, ..., pk
such that all vectorsvi := pi-p0
are linearly independent (i.e. in 2D not collinear, in 3D not coplanar); also called "points in general position"k-simplex: the convex hull of k+1 affinely-independent points; we call the points its vertices.
face: any simplex whose vertices are a subset of the vertices of another simplex; i.e. "a part of a simplex"
(geometric) simplicial complex: a collection of simplices where (1) the intersection of two simplices is a simplex, and (2) every face of a simplex is in the complex; i.e. "a bunch of simplices"
alpha-exposed: a simplex within a point set where the circle (2D) or ball (3D) of radius alpha through its vertices doesn't contain any other point in the point set
alpha shape: the boundary of all alpha-exposed simplices of a point set
Algorithm
Edelsbrunner's Algorithm is as follows:
Code
Output
Point Cloud:
Alpha Shape: