melsman / futhark-bezier

Flattened Data-Parallel Generation of Cubic Bezier Curves in Futhark

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Flattened Data-Parallel Generation of Cubic Bezier Curves

By Martin Elsman, DIKU

This application demonstrates the use of the flattening by expansion technique [1] for drawing cubic bezier curves. The application is written in Futhark and builds on the Futhark Lys Library.

The implementation also supports antialiased drawing of linear bezier curves (i.e., lines) with partly support for antialiased drawing of cubic bezier curves; we still need to perform some calculations on the derivative, which should be easy to do; see the screen capture below, which demonstrates how antialiasing improves the visual appearance.

Running it

To build and run the application, do as follows:

$ cd src
$ futhark pkg sync
$ make
$ ./bezier -i

Copyright and License

Copyright (c) Martin Elsman, DIKU

MIT License

Future Work

By splitting the curves appropriately, we may be able to predict better the exact number of pixels required to draw a continuous cubic bezier curve. It would also be great to understand how we should blend two crossing antialised lines.

References

[1] Martin Elsman, Troels Henriksen, and Niels G. W. Serup. Data-Parallel Flattening by Expansion. In Proceedings of the 6th ACM SIGPLAN International Workshop on Libraries, Languages and Compilers for Array Programming (ARRAY ‘19). Phoenix, AZ, USA. June, 2019. PDF

About

Flattened Data-Parallel Generation of Cubic Bezier Curves in Futhark

License:MIT License


Languages

Language:Futhark 99.8%Language:Makefile 0.2%