RFR: 8176501: Method Shape.getBounds2D() incorrectly includes Bezier control points in bounding box [v2]

Jeremy duke at openjdk.java.net
Thu Nov 11 09:44:17 UTC 2021


On Wed, 10 Nov 2021 10:25:55 GMT, Laurent Bourgès <lbourges at openjdk.org> wrote:

>> @prrace @mrserb what do you think on this bug in terms of precision requirements?
>> - should bbox always include control points ?
>> - should ideal shape always fit in bbox ? So I propose to add a margin > numerical inaccuracies.
>> 
>> I can develop a numerical approach based on fuzzy testing:
>> - generate random curves (high magnitude changes on control points)
>> - use both this algorithm (double) and implement the same with BigDecimal
>> - estimate the extrema error = max distance(pts big decimal, pts double)
>
> Ideally jdk could provide new math methods:
> - evalPoly(eqn[])
> - find roots...
> Based on compensated horner scheme and Math.fma() ~ 0.5 ulp

I attempted to explore a numerical approach to pad the bounding box here 4b9d87d6d03e923bb2663fc8f4f77b7549df6e70 ... but I don't like the results so far. Any suggestions? (Or if you have a better approach in mind we can discard that entire class...)

-------------

PR: https://git.openjdk.java.net/jdk/pull/6227



More information about the client-libs-dev mailing list