You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary:
(1) Differences for alpha shape from pyvista and alphashape. And (2) questions about PolyData faces.
I tried to use PolyData.delaunay_3d(alpha= <alpha value>) to generate alphashapes. And have two main questions.
1. The alpha shape from pyvista is different from the alpha shape from alphashape package. From the test I did, pyvista one always has more faces than alphashape one. From the visualisation, it looks like pyvista one seems to have some "interior faces".
My questions are: (1) Why the face numbers are different and (2) If there are interior faces, any way to find them?
2. While I was trying to look at the normals, I found out that in some cases, the PolyData.face_normals, mesh_alpha.n_faces} and mesh_alpha.n_faces_strict are different, and the number of PolyData.faces matches the number of PolyData.n_faces_strict.
Here are the codes for face numbers:
import numpy as np
import pyvista as pv
import alphashape
# Number of points in the point cloud
num_points = 100
np.random.seed(0)
point_cloud = np.random.rand(num_points, 3)
### alphashape ###
alpha_shape_1 = alphashape.alphashape(point_cloud,1)
print(f"""
Alphashape from alphashape package
number of faces:{len(alpha_shape_1.faces)}
""")
### pyvista ###
pts = pv.PolyData(point_cloud)
alpha_shape = pts.delaunay_3d(alpha= 1)
mesh_alpha = alpha_shape.extract_geometry()
faces_list = [mesh_alpha.faces[i+1:i + 4] for i in range(0, len(mesh_alpha.faces), 4)]
print(f"""
Alphashape from pyvista package
n_faces: {mesh_alpha.n_faces}
Number of strict faces: {mesh_alpha.n_faces_strict}
Number of normals:{len(mesh_alpha.face_normals)}
Number of mesh_alpha.faces: {len(faces_list)}
""")
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Summary:
(1) Differences for alpha shape from
pyvista
andalphashape
. And (2) questions aboutPolyData
faces.I tried to use
PolyData.delaunay_3d(alpha= <alpha value>)
to generate alphashapes. And have two main questions.1. The alpha shape from
pyvista
is different from the alpha shape fromalphashape
package. From the test I did,pyvista
one always has more faces thanalphashape
one. From the visualisation, it looks likepyvista
one seems to have some "interior faces".My questions are: (1) Why the face numbers are different and (2) If there are interior faces, any way to find them?
2. While I was trying to look at the normals, I found out that in some cases, the
PolyData.face_normals
,mesh_alpha.n_faces}
andmesh_alpha.n_faces_strict
are different, and the number ofPolyData.faces
matches the number ofPolyData.n_faces_strict
.Here are the codes for face numbers:
Beta Was this translation helpful? Give feedback.
All reactions