I am trying to create a graphics application where the user can use an arbitrary shape as a “brush”, which will be swept along the drawing path. The shape may be transformed along the path (rotated, resized, etc).
I read this paper, and it seemed promising:
Approximate General Sweep Boundary of a 2D Curved Object
My understanding of the method is this:
- Simplify the shape to a polygon
- Sample the shape at various times t along the curve
- For each t, connect each point of the polygon at t the corresponding point of the polygon at t-1
- Calculate the convex hull of the joined shapes
- Move to t+1
Do I have it right? Is this the best way to approach this problem?
To clarify what I mean by a “Sweep Boundary”: Examples would include a pen writing a line, Zorro marking the wall with his sword, a magic marker on a mirror. In each of these cases, there is a path that defines the movement (the “Heartline”) and a shape that defines the width and angle of the writing instrument (the “Counterpoint”). The counterpoint is independent of the heartline and can change at any point t along the path.
The path would be “convex” only in the sense that an envelope is formed by the counterpoint as it “travels” along the heartline.
5