Skip to content

Commit 91c584b

Browse files
Merge pull request #261 from normanrichardson/shapely_fix
Update STRtree api to shapely 2.0
2 parents 6e00eae + bb58e4b commit 91c584b

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

sectionproperties/analysis/section.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,6 @@ def __init__(
193193
Polygon(self.geometry.mesh["vertices"][tri][0:3])
194194
for tri in self.geometry.mesh["triangles"]
195195
]
196-
self.poly_mesh_idx = dict((id(poly), i) for i, poly in enumerate(p_mesh))
197196
self.mesh_search_tree = STRtree(p_mesh)
198197

199198
# initialise class storing section properties
@@ -2259,11 +2258,7 @@ def get_stress_at_points(
22592258

22602259
for pt in pts:
22612260
query_geom = Point(pt)
2262-
tri_ids = [
2263-
self.poly_mesh_idx[id(poly)]
2264-
for poly in self.mesh_search_tree.query(query_geom) # TODO
2265-
if poly.intersects(query_geom)
2266-
]
2261+
tri_ids = self.mesh_search_tree.query(query_geom, predicate="intersects")
22672262
if len(tri_ids) == 0:
22682263
sig = None
22692264
elif len(tri_ids) == 1:

0 commit comments

Comments
 (0)