[vtkusers] Curve growing
Anja Ende
anja.ende at googlemail.com
Thu Feb 1 17:54:56 EST 2007
Hi everyone,
This is not a VTK question per se, but I am hoping some algorithm experts
can help me here.
I am a curve defined by a set of floating point numbers. So each x, y pair
descrives a curve and the curve is created by simple joining these point
pairs.
Now, my probem is that the curve should snap to each pixel that it touches.
So, if we consider the x part of the coordinates... then the points lying on
the "left side" of the curve should round off to the lower value...
So, if you have x value like 63.5 on the lft side, it should becomne 63.0.
and if you have points on the "right side" of the curve, it should round off
to the upper value...
So, if you have value like 130.5 on the right side, it should become 131.0
Similar logic should follow for the y values.
My initial idea was to increment/decrement the values by 1.0 and see if that
pixel lies in my region. If the pixel to the right lies in thr region, then
I take the floow of the value, else I take the ceiling.
This worked for most of ther curves but every now and then I come across
curves that act not int he way I want.
I was wondering if there is an algorithm for growing a curve so that it
snaps to the touched pixel...
Thanks for any help you might give me here. I would really appreciate it.
Cheers,
Anja
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070201/9336be7c/attachment.htm>
More information about the vtkusers
mailing list