Opened 12 years ago

Closed 12 years ago

#5358 closed Bugs (invalid)

polygon resize() generates bad/broken vertices

Reported by: Andy Ross <andy@…> Owned by: Lucanus Simonson
Milestone: To Be Determined Component: polygon
Version: Boost Development Trunk Severity: Showstopper
Keywords: Cc:

Description

boost::polygon::resize() (and its variants: shrink()/bloat()/operator+(), etc...) routinely produces "bad" vertices in the output stream. Most of the shrunken polygon is correct, but a handful of vertices seem to be replaced with visually random locations.

The attached code (which has non-trivial input data, but not so complicated that it can't be inspected by hand) shows the problem pretty clearly. The "before" polygon (image attached) looks good, the "after" shrunken version is mostly correct with some oddball excursions.

Setting corner_fill_arc to true suppresses this behavior, and the output polygon looks more correct (though obviously the output is different). That, however, has some severe performance problems (to be detailed in a separate bug) and isn't an acceptable substitute.

This is a showstopper for me right now. Test vs. svn as of submission date.

Attachments (3)

shrinkbug.cpp (5.5 KB ) - added by Andy Ross <andy@…> 12 years ago.
Code to exercise bug (and also generate attached images)
before.png (13.7 KB ) - added by Andy Ross <andy@…> 12 years ago.
pre-shrink polygon
after.png (16.8 KB ) - added by Andy Ross <andy@…> 12 years ago.
post-shrink polygon, with bad vertices

Download all attachments as: .zip

Change History (4)

by Andy Ross <andy@…>, 12 years ago

Attachment: shrinkbug.cpp added

Code to exercise bug (and also generate attached images)

by Andy Ross <andy@…>, 12 years ago

Attachment: before.png added

pre-shrink polygon

by Andy Ross <andy@…>, 12 years ago

Attachment: after.png added

post-shrink polygon, with bad vertices

comment:1 by Lucanus Simonson, 12 years ago

Resolution: invalid
Status: newclosed

Very small features before shrinking can become very large after if the angle is accute. That is what happened in this case.

Note: See TracTickets for help on using tickets.