Marlin cubic bezier accuracy !

Laurent Bourgès bourges.laurent at gmail.com
Thu Oct 24 05:52:55 UTC 2024


Hi phil & graphics fans,

I was looking at william kahan papers on floating-point accuracy... but
most links were editor's paywall (only abstracts): disappointing.

But I finally found his public professor page at berkeley univ:
https://www2.eecs.berkeley.edu/Faculty/Homepages/kahan.html

Then google gave me his personal page with all his articles & lecture
materials freely available as pdf:
http://people.eecs.berkeley.edu/~wkahan/index.htm

All Files (so cool):
http://people.eecs.berkeley.edu/~wkahan/

To fix marlin's bezier quad or cubic issues, I found how to solve as
accurately as possible (1 ulp?):
- quadratics: http://people.eecs.berkeley.edu/~wkahan/Qdrtcs.pdf
- cubics: http://people.eecs.berkeley.edu/~wkahan/Math128/Cubic.pdf

So happy to read all this previous material on maths course:
See
!http://people.eecs.berkeley.edu/~wkahan/Math128/

Enjoy & share this open data,
Laurent


Le lun. 21 oct. 2024, 10:48, Laurent Bourgès <bourges.laurent at gmail.com> a
écrit :

> Hi alexey,
>
> Thanks, I will look at your code to check its accuracy on few hard cases,
> but marlin uses its own (fast) variant (higher error)...
>
> Anyway it will help me as I can ask you questions!
>
> See
>
> https://github.com/bourgesl/marlin-renderer/blob/75f91452efaf3c607b0df6b7aa0f6f458cda67a8/src/main/java/org/marlin/pisces/DHelpers.java#L252
>
> Cheers,
> Laurent
>
> Le lun. 21 oct. 2024, 10:26, <alexey.ushakov at jetbrains.com> a écrit :
>
>> Hi Laurent,
>>
>> Actually part of the work (separating curves into monotonic ones) I've
>> implemented in Java years ago, see ProcessQuad/ProcessCubic
>>
>> https://github.com/openjdk/jdk/blob/master/src/java.desktop/share/classes/sun/java2d/loops/ProcessPath.java
>>
>> I suppose applying some kind of Newton algorithm to the monotonic parts
>> should be no-brainer.
>>
>> Best Regards,
>> Alexey
>>
>> On Thu, 2024-10-17 at 11:33 -0700, Philip Race wrote:
>> > Hi Laurent,
>> >
>> > I think there'd be problems with any of these.
>> > I can't see the JDK depending on Rust, and some optionally available
>> > functionality would
>> > be very unusual.  And it'll be some time before we work out how the
>> > JDK
>> > itself will use
>> > jextract etc for FFM access to non-JDK libraries. There's 3rd party
>> > legal issues and build issues.
>> >
>> > -phil.
>> >
>> > On 10/12/24 2:27 AM, Laurent Bourgès wrote:
>> > > Hi,
>> > >
>> > > I wonder if I could use good math native library like gsl if
>> > > present
>> > > to use FFM in order to have high accuracy on polynom eval, solver
>> > > for
>> > > quadratic & cubic polynoms.
>> > >
>> > > I need an high accuracy (double double) solver for cubics & quads
>> > > to
>> > > compute intersection line & cubic bezier.
>> > > See http://www.cemyuksel.com/research/polynomials/
>> > >
>> > > Alternatively I could write a julia or rust code to implement my
>> > > needs
>> > > and link it with openjdk.
>> > >
>> > > See my paper work,
>> > > Good week-end,
>> > > Laurent
>> >
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/client-libs-dev/attachments/20241024/66690c46/attachment.htm>


More information about the client-libs-dev mailing list