kallaballa / libnfporb

Implementation of a robust no-fit polygon generation in a C++ library using an orbiting approach
GNU General Public License v3.0
106 stars 31 forks source link

removeCoLinear makes polygon invalid #9

Closed martinhansdk closed 3 years ago

martinhansdk commented 6 years ago

Attached is colinear.zip which causes the error

terminate called after throwing an instance of 'std::runtime_error'
  what():  Polygon A is invalid: Geometry is defined as closed but is open

As far as I can tell it is because removeCoLinear removes some of the segments so the first and last point of the polygon end up to be different. Calling bg::correct() on the resulting polygon seems to fix it.

kallaballa commented 3 years ago

Sorry for the long wait :). I incorporated your test case and your solution. c04e0cf2d6c63b89a28fcff18a9ba911cf51bc7b

Thank you!