Skip to content

Commit d9e94e3

Browse files
committed
Removed import error handling for alphashape
1 parent 9300c59 commit d9e94e3

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

qcore/srf.py

+3-10
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,7 @@
1515

1616
import numpy as np
1717

18-
try:
19-
import alphashape
20-
from alphashape import optimizealpha
21-
import shapely
22-
except ImportError:
23-
# only used for get_perimeter function
24-
pass
25-
18+
from alphashape import alphashape, optimizealpha
2619

2720
from qcore.binary_version import get_unversioned_bin
2821

@@ -837,9 +830,9 @@ def get_perimeter(srf_file, depth=True, plot=False):
837830
# The following will try to optimize alpha with 10 iterations (default is 1000), and if no success, alpha=0 (convex hull)
838831

839832
alpha = optimizealpha(points, max_iterations=10)
840-
ashape = alphashape.alphashape(points, alpha)
841-
833+
ashape = alphashape(points, alpha)
842834
perimeters.append(np.dstack(ashape.exterior.coords.xy)[0])
835+
843836
if plot:
844837
fig, ax = plt.subplots()
845838
ax.scatter(*zip(*points))

0 commit comments

Comments
 (0)