Skip to content

Commit 88fc9c9

Browse files
baehrjogonzalocasas
authored andcommitted
bug fix on is_polygon_in_polygon_xy
1 parent e4bbf7c commit 88fc9c9

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2121
* Fixed `AttributeError` in Plotter's `PolylineArtist` and `SegementArtist`.
2222
* Fixed wrong key type when de-serializing `Graph` with integer keys leading to node not found.
2323
* Fixed bug in `VolMeshArtist.draw_cells` for Rhino, Blender and Grasshopper.
24+
* Fixed bug in the `is_polygon_in_polygon_xy` that was not correctly generating all the edges of the second polygon before checking for intersections.
2425

2526
### Removed
2627

src/compas/geometry/predicates/predicates_2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ def is_polygon_in_polygon_xy(polygon1, polygon2):
383383
for i in range(len(polygon1)):
384384
line = [polygon1[-i], polygon1[-i - 1]]
385385
for j in range(len(polygon2)):
386-
line_ = [polygon2[-j], polygon2[j - 1]]
386+
line_ = [polygon2[-j], polygon2[-j - 1]]
387387
if is_intersection_segment_segment_xy(line, line_):
388388
return False
389389
for pt in polygon2:

0 commit comments

Comments
 (0)