Incremental improvements

This commit is contained in:
XANTRONIX 2025-03-24 14:16:32 -04:00
parent 9b9a95b71a
commit 3a45bd9826

View file

@ -119,7 +119,7 @@ class PolygonBuilder():
if direction is not PointDirection.LEFT:
return
for i in range(i1, i2+1):
for i in range(i1+1, i2):
yield from self.yield_point(self.bounds[i % count])
def each_point_within(self):
@ -184,6 +184,19 @@ class PolygonBuilder():
last = point
#
# If the first point is to the right of the last point, fill in the
# intermediates.
#
i1 = self.bounds.nearest_index(self.point_first)
i2 = self.bounds.nearest_index(self.point_last)
dist, direction = self.bounds.index_distance(i1, i2)
if direction is PointDirection.RIGHT:
yield from self.each_intermediate_point(self.point_last,
self.point_first)
def process(self) -> shapely.Polygon:
pass