Re: [Boost-bugs] [Boost C++ Libraries] #6063: resize does not offset rectangles (etc.) correctly when using corner_fill_arc

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #6063: resize does not offset rectangles (etc.) correctly when using corner_fill_arc
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-02-07 19:45:52


#6063: resize does not offset rectangles (etc.) correctly when using
corner_fill_arc
--------------------------------+-------------------------------------------
  Reporter: dbfaken@… | Owner: ljsimons
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: polygon
   Version: Boost 1.47.0 | Severity: Problem
Resolution: | Keywords:
--------------------------------+-------------------------------------------

Comment (by dbfaken@…):

 Another wrinkle:
 Corner-rounding-offset is being done via a minkowski sum of the given
 shape with a polygonalized "circle", but the vertices are being snapped to
 integral values (e.g. int) via round_down().
 This causes the 'circle' to be skewed toward the lower-left-hand quadrant,
 instead of being symmetric about its center-point.

 This in turn can cause improper offsetting of a simple square with the
 given code, since even with the 'arcRadScaling' and 'elbowDist'
 compensation in polygon_set_data<T>::resize(), a circle passed through
 round_down() may not reach the appropriate corners when
 minUnroundedAngleDegrees=90.

 The solution is to use a circle where the points are symmetrically rounded
 'away' from the center of the circle.

 The next patch fixes this by adding a required parameter
 'round_away_from_center' to make_arc. It is set to true when called from
 polygon_set_data<T>::resize(). I have left it as false (so that
 round_down<T>() is still used - same behaviour as in 1.47) when called
 from make_resizing_vertex_list() for now, though this case should
 presumably also be fixed.
 There is also a small tweak to avoid dividing by zero, and a tweak to
 make_arc so it doesn't include the center in the polygon when generating a
 full circle.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/6063#comment:3>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:08 UTC