Drawing Bézier Curves with Futhark's expand Operation
My futhark-bezier project draws cubic Bézier curves in Futhark.
It is a visual example of the expand operation defined in our paper
Data-Parallel Flattening by Expansion, with Troels Henriksen and Niels G. W. Serup.
Different curves can require different amounts of drawing work, making this an irregular parallel problem.
The expand operation turns those varying amounts of work into a flat array that can be processed in parallel.
The application builds on the Futhark Lys library and includes an interactive demo. It also supports antialiased line drawing, with partial support for antialiasing cubic curves. This makes it a concrete way to explore the connection between a reusable parallel operation and graphics. The repository includes the source code and instructions for building and running the application. Try it out to see flattening by expansion at work on something you can draw!