79199633

Date: 2024-11-18 10:56:33
Score: 2.5
Natty:
Report link

correct() can't "fix" the polygon in all cases. Consider this polygon:

{ 0.0, 0.0 }, { 1.0, 1.0 }, { 0.0, 1.0 }, { 1.0, 0.0 }

It is self-intersecting and runs neither clockwise nor counter-clockwise. How is correct() supposed to fix it? In fact bg::is_valid(poly) returns false before and after bg::correct(poly). However, I used it with Boost 1.82 and got correct results in all cases I tried. Anyway, I would suggest to use multi_point instead of polygon in the case of the OP. I think this would also reduce overhead. I really wonder why Boost chose polygon as geometry type in their sample code for convex_hull().

Reasons:
  • RegEx Blacklisted phrase (1.5): fix it?
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Starts with a question (0.5): can't
  • Low reputation (1):
Posted by: Thomas