try finding the most "lonely" vertex (one furthest from the average
position), then use that as a start point.
from the start point, assume an initial direction vector of any
non-picked point, then pick points adn compare to see if any of them
point "futher out" (have a larger value when dot with outward
direction vector (which is just the normalised position of the initial
vertex))
once you have the lowest curvature, then continue to the next point,
chosing a next vertex that is in the same direction and also low
curvature (high dot in forwards (forwards = this point pos - last
point pos) with high dot in out (again, just the normalised position
of the vertex)
once you have done this until the best next point is the initial
position, you will have a convex shape that you can start adding the
other vertices to.
ad vertices one at a time, choose the unpicked vertex that is closest
to a line, then add it as a split on that line.
repeat until all unpicked vertices are gone.
2009/6/24 Jose Marin <jos...@ya...>:
>
> Hi.
>
> Do you know some algorithm to create a polygon from a 2D point cloud?
>
> Another task would be create a polygon from a bunch of triangles (not related to the above task).
>
> The resulting polygon may be non-convex.
>
> I have searched, but didn't find any good solution...
>
> Thanks.
>
> Jose
>
>
>
> Veja quais são os assuntos do momento no Yahoo! +Buscados
> http://br.maisbuscados.yahoo.com
>
> ------------------------------------------------------------------------------
> _______________________________________________
> GDAlgorithms-list mailing list
> GDA...@li...
> https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list
> Archives:
> http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list
>
--
fabs();
Just because the world is full of people that think just like you,
doesn't mean the other ones can't be right.
|