You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I use a negative offset of say 2 meter in a polygon square that is 2m2 (a small square), an "IndexError: list index out of range" error comes up. Ofcourse I would expect an error message in this situation. However, this invalid input offset is not properly handled.
The code that I use:
import pyclipper
negative_offset = -2
coordinates = # Small polygon of around 2m2
clipper_offset = pyclipper.PyclipperOffset()
coordinates_scaled = pyclipper.scale_to_clipper(coordinates)
clipper_offset.AddPath(coordinates_scaled, pyclipper.JT_ROUND, pyclipper.ET_CLOSEDPOLYGON)
new_coordinates = clipper_offset.Execute(pyclipper.scale_to_clipper(negative_offset))
new_coordinates_scaled = pyclipper.scale_from_clipper(new_coordinates)
The text was updated successfully, but these errors were encountered:
When I use a negative offset of say 2 meter in a polygon square that is 2m2 (a small square), an "IndexError: list index out of range" error comes up. Ofcourse I would expect an error message in this situation. However, this invalid input offset is not properly handled.
The code that I use:
The text was updated successfully, but these errors were encountered: