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: 2011-10-27 20:00:55
#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@â¦):
Attaching another version of the patch (this time in 'unified diff' patch
format) which adds an optional parameter ''double
minUnroundedAngleDegrees''.
This fixes another problem in the corner-rounding - that all corners get
rounded, even though '''the docs say''' that rounding is only applied to
"acute corners".
The new parameter allows the caller to control which corners get rounded.
For example, setting it to 90.0 will only allow acute-angled corners (<90)
to get rounded. This is typically desired in, e.g. VLSI layout - you
don't want your purely-90-degree corners to get rounded!
Setting it to 45.0 will likewise preserve Polygon_45-type objects as
containing only 45-degree angles.
I have set the default to 180.0 to preserve the original behaviour, but as
mentioned above I would suggest making it 90.0 to match the docs.
Note this patch includes/supercedes the previous .diff file I attached.
For simplicity in the patch I have only added this parameter to the
boost::polygon::polygon_set_data<T>::resize() function, not to the generic
boost::polygon::resize() operator.
If this extra parameter is found pleasing, the parameter should be
propagated through to the other versions, with the default value. (if you
want me to post a patch for this just say so in a comment)
----
Quick description of the fix (see also the comments in the code):
This builds upon the previous fix.
I simply set the radius of the convolved circle to the distance of the
'elbow' generated by a corner of angle ''minUnroundedAngleDegrees''. The
extra area generated by the larger circle still gets trimmed off by the
intersection with the 'unrounded offset', as before.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/6063#comment:2> 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:07 UTC