I finally have a buggy, working version of my AS3 expand fill (or stroke along a path, or line offset … take your pick). An ActionScript-based (dynamic) equivalent to Flash CS tool’s expand fill feature, also the same as a graphic stroke. Because I need this thing to be as high performing as possible (I’ll be using it at runtime all over the UI), and because this type of solution is a big pile of mathematics, it’s been a very interesting journey. Among the challenges I’ve had to deal with:
Once finished the solution should be available open source, although I can’t really say for which project. If anyone knows of similar solutions that are already in the opensource domain I’d love to know about them (whatever language). The only experimentation I ran across was Grant Skinner’s Drawing Curved Lines article, which is interesting but not very helpful. I’m also looking for information on combining two shapes in various ways (subtraction, addition, multiplication).
Here are a couple examples demonstrating straight lines and curves at varying insets. I’m not even subdividing the curves yet so it will continue to look better as I clean up the final solution (steep curves need to be subdivided in order to reach around the original curve).


Great study. I’d love to play around with this if you ever release it.
great! Yeah I plan on releasing it as part of a larger open source project.
someday…