"Sam Van der Jeught" <sam_vanderjeught@hotmail.com> wrote in message <ifur3e$oda$1@fred.mathworks.com>...
> Hi all,
>
> I have some scattered data points and I've delaunay traingulated them. I plot them and get a nice image of all the points being connected in triangles in the typical delaunay way.
>
> The next thing I want to do, is to impose a cartesian grid onto this map of triangles and find out, for each pixel, which are the triangles that have some part in that pixel. For example, let's say we have the case where there is one original data point completely in the pixel, then we can have up to 6 neighbouring triangles that are all for some certain percentage in this pixel. I want to know what that percentage is, and what the vertices of those triangles are.
>
> I'm kind of stuck on this, so if any of you has a brilliant idea, please let me know,
>
It will take some work. Doable. But not trivial, since
its a big search problem, and then on top of that you
need to test to see if there is any intersection of a pair
of polygonal domains.
At first thought, I'd do something like compute the set
of circumcircles for each triangle. This will tell you if a
triangle has any possible intersection with a given pixel.
Once you can narrow down the set of triangles which
MAY intersect a pixel, then you apply a more accurate
test.
The above scheme will work. Probably faster is to build
a quadtree form the triangulation. Use that to potentially
more efficiently find a list of triangles that may intersect
a given pixel. Then do the same operations I described
above. Again, it becomes a test for the intersection of
two polygonal domains. In the end it must come down
to that.
Nothing will avoid doing some work here. There is no
magic.
John
