polyline snapping to grid
  Home FAQ Contact Sign in
comp.graphics.algorithms only
 
Advanced search
POPULAR GROUPS

more...

comp.graphics.algorithms Profile…
 Up
polyline snapping to grid         


Author: Anja
Date: Feb 20, 2007 20:19

Hello all,

I have a polyline that is has the points with floating point
precision. What I want to do is have the polyline include the complete
pixel that has been touched. Here is a diagram that might help to
visualize what I am trying to do:

http://bp1.blogger.com/_9lf9wnKFBNM/RdvHFfcfRpI/AAAAAAAAAAk/RXysuIGXSzk/s1600-h/curve...

Say we consider two points that have been marked with the red dots. As
you can see, they pass through the middle of a pixel. What I want to
do is transform the points so that the points get shifted to include
the complete pixel that it has touched. This is indicated by the blue
dots as the new values for the given points.

Is there some algorithm that will let me achieve this transformation.
Ultimately, it is just a floor or ceiling operation on the points but
determining which operation to apply on which point seems to be the
trick.

Thanks,

Anja
2 Comments
Re: polyline snapping to grid         


Author: Anja
Date: Feb 21, 2007 07:23

On Feb 21, 4:33 pm, "[Jongware]" wrote:
> gmail.com> wrote in message
>
> news:1172054027.272975.103990@l53g2000cwa.googlegroups.com...
>
>
>
>> On Feb 21, 2:32 pm, "[Jongware]" wrote:
>>> "Anja" googlemail.com> wrote in message
>
>>>news:1172031595.342975.200740@j27g2000cwj.googlegroups.com...
>
>>>> Hello all,
>
>>>> I have a polyline that is has the points with floating point
>>>> precision. What I want to do is have the polyline include the complete
>>>> pixel that has been touched. Here is a diagram that might help to
>>>> visualize what I am trying to do:
>
Show full article (2.91Kb)
no comments
Re: polyline snapping to grid         


Author: Hans-Bernhard Bröker
Date: Feb 21, 2007 12:49

Anja wrote:
> Hello all,
>
> I have a polyline that is has the points with floating point
> precision. What I want to do is have the polyline include the complete
> pixel that has been touched.

Touched -- by what?
> Say we consider two points that have been marked with the red dots. As
> you can see, they pass through the middle of a pixel.

Huh? Since when can points "pass through the middle" of anything?
> What I want to do is transform the points so that the points get
> shifted to include the complete pixel that it has touched.

What is this "it"?
no comments