dimanche 21 décembre 2014

Algorithm for sweeping a 2d shape along a curve?


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:



  1. Simplify the shape to a polygon

  2. Sample the shape at various times t along the curve

  3. For each t, connect each point of the polygon at t the corresponding point of the polygon at t-1

  4. Calculate the convex hull of the joined shapes

  5. Move to t+1


Do I have it right? Is this the best way to approach this problem?





Aucun commentaire:

Enregistrer un commentaire