buildgraph: fix filling graph in narrow areas
This commit is contained in:
parent
59143db553
commit
8c60045382
2 changed files with 5 additions and 2 deletions
|
@ -38,10 +38,11 @@ class GraphRoom():
|
|||
self._add_ring(interior, want_left=True)
|
||||
|
||||
# now fill in missing doorways or similar
|
||||
missing_geometry = self.clear_geometry.difference(geometry.buffer(0.61, join_style=JOIN_STYLE.mitre))
|
||||
accessible_clear_geometry = geometry.buffer(0.31, join_style=JOIN_STYLE.mitre)
|
||||
missing_geometry = self.clear_geometry.difference(accessible_clear_geometry)
|
||||
polygons = assert_multipolygon(missing_geometry)
|
||||
for polygon in polygons:
|
||||
overlaps = polygon.buffer(0.62).intersection(geometry)
|
||||
overlaps = polygon.buffer(0.02).intersection(accessible_clear_geometry)
|
||||
if overlaps.is_empty:
|
||||
continue
|
||||
|
||||
|
|
|
@ -33,6 +33,8 @@ def get_coords_angles(geom):
|
|||
:rtype: a list of ((x, y), is_left) tuples
|
||||
"""
|
||||
coords = list(cleanup_coords(geom.coords))
|
||||
if len(coords) < 3:
|
||||
return []
|
||||
last_coords = coords[-2:]
|
||||
last_angle = coord_angle(last_coords[-2], last_coords[-1])
|
||||
result = []
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue