RFR: 8176501: Method Shape.getBounds2D() incorrectly includes Bezier control points in bounding box [v2]
Laurent Bourgès
lbourges at openjdk.java.net
Mon Nov 15 06:56:40 UTC 2021
On Fri, 12 Nov 2021 19:09:18 GMT, Laurent Bourgès <lbourges at openjdk.org> wrote:
>> I just pushed a commit ( 40bda06 ) that addresses the machine error problem to my satisfaction. It includes a unit test that failed before that commit and now passes.
>>
>> At your convenience let me know your thoughts. (That commit continues to focus on very small doubles; it may (?) need help to address very large double errors.)
>
> That looks interesting as the new margin looks like ulp(x - bbox), however it may be not enough as the position error depends on curve polynom coefficients (magnitude).
>
> I derived your (yesterday) test to play with the margin and try small to huge curves.
> I found the condition number ~ sum (abs(coeffs)) so margin = math.ulp(cond). But sometimes the quad solver is giving t with few ulps error that cause high position shifts.
>
> I will go on testing your last approach and share my experiments
As this accuracy problem is a more general issue on quad / cubic curves, I created the Marlin-Math project to ascertain the math function accuracy.
See https://github.com/bourgesl/marlin-math/blob/main/src/main/java/test/FindExtremaAccuracyTest.java
I will propose a new upper margin value that quarantees the edge condition.
-------------
PR: https://git.openjdk.java.net/jdk/pull/6227
More information about the client-libs-dev
mailing list