4

I need algorithm for rasterize a curve in to pixels

example http://i54.tinypic.com/ffc0n9.png

I tried apply DDA line algorithm for control points, but I didn't give good result. Also I try enlarge curve (for example in 3 times), and then approximate it by 3x3 rectangles, but still result not so good.

Bergi
  • 630,263
  • 148
  • 957
  • 1,375
studyman
  • 41
  • 4
  • Have you tried Bresenham's approach? – Rafe Aug 20 '13 at 23:37
  • what kind of curve? aprox, interpolation, polynomial,bezier,spline??? Bresenham is good for basic axis aligned cirle/eliptic curves only. For more complex shapes (or more dimensions) i use parametric polynomials (x[t]=Px(t),y[t]=Py(t),z[t]=Pz(t),...) with the same parameter, and rasterise it as joined lines. The length of lines depends on the rasterized scale (have declared min detail in pixels so lines canot be bigger than this detail). This is good loking in any zoom/scale but with higher zooms is more CPU/GPU eating. also the detail step can be dependet on derivation (curvature radius) – Spektre Sep 04 '13 at 09:40
  • Also for best quality/performance you can combine previous apprach with bresenham eliptic curves (rasterize your curve as eliptic arcs not lines, but it takes a little bit more computation ...) – Spektre Sep 04 '13 at 09:42

0 Answers0