diff options
| author | Kaalleen <36401965+kaalleen@users.noreply.github.com> | 2023-10-15 07:08:36 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-10-15 07:08:36 +0200 |
| commit | 2f966ce4de8185121126bff945737629b42d1329 (patch) | |
| tree | 4c0a58838f55d7cd8198419f9886305c5fe73032 /lib/stitches/auto_fill.py | |
| parent | bbd7391b181673eb86e9f3dd88066b9da34ba7ba (diff) | |
Update shapely (#2471)
* update shapely
* pin pyinstaller to 5.13.2 (issues with macOS) (rejbasket)
* macOS: do not install shapely from binary, but remove .dylibs folder (breaks notarizazion) (rejbasket)
Diffstat (limited to 'lib/stitches/auto_fill.py')
| -rw-r--r-- | lib/stitches/auto_fill.py | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/stitches/auto_fill.py b/lib/stitches/auto_fill.py index 50eea18e..b4d63224 100644 --- a/lib/stitches/auto_fill.py +++ b/lib/stitches/auto_fill.py @@ -380,14 +380,11 @@ def process_travel_edges(graph, fill_stitch_graph, shape, travel_edges): edge = (p1.as_tuple(), p2.as_tuple(), 'travel') - for segment in strtree.query(ls): - # It seems like the STRTree only gives an approximate answer of - # segments that _might_ intersect ls. Refining the result is - # necessary but the STRTree still saves us a ton of time. - if segment.crosses(ls): - start = segment.coords[0] - end = segment.coords[-1] - fill_stitch_graph[start][end]['segment']['underpath_edges'].append(edge) + for segment in strtree.query(ls, predicate='crosses'): + segment_geom = strtree.geometries.take(segment) + start = segment_geom.coords[0] + end = segment_geom.coords[-1] + fill_stitch_graph[start][end]['segment']['underpath_edges'].append(edge) # The weight of a travel edge is the length of the line segment. weight = p1.distance(p2) |
