Expand Fill: what a beast!

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:

  • perpendicular and parallel lines
  • performance
  • line to line intersections
  • curve to line and curve to curve intersection
  • performance
  • capping off intersections with a miter limit or adding a curve
  • performance

Continue reading