improve/fix stair obstacle cutting (again)
This commit is contained in:
parent
0ce53c0af5
commit
11017f0329
1 changed files with 6 additions and 1 deletions
|
@ -463,7 +463,12 @@ class AltitudeArea(LevelGeometryMixin, models.Model):
|
||||||
line = space_geom.intersection(LineString([coord1, coord2]))
|
line = space_geom.intersection(LineString([coord1, coord2]))
|
||||||
if line.is_empty:
|
if line.is_empty:
|
||||||
continue
|
continue
|
||||||
cuts.append(scale(line, xfact=1.02, yfact=1.02))
|
factor = (line.length + 2) / line.length
|
||||||
|
line = scale(line, xfact=factor, yfact=factor)
|
||||||
|
centroid = line.centroid
|
||||||
|
line = min(assert_multilinestring(space_geom.intersection(line)),
|
||||||
|
key=lambda l: l.centroid.distance(centroid), default=None)
|
||||||
|
cuts.append(scale(line, xfact=1.01, yfact=1.01))
|
||||||
|
|
||||||
remaining_space = tuple(
|
remaining_space = tuple(
|
||||||
orient(polygon) for polygon in remaining_space
|
orient(polygon) for polygon in remaining_space
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue