14 May 2013
(Updated 04 Jun 2013)
This function distributes polygon points evenly across the polygon.
Watch this File
distributePointsOnPolygon this function uses faces and 2D/3D vertices as
input. The vertices are redistributed over the polygon to decrease the
variability in distance between the points.
This is done by shifting the points iteratively over the original contour
described by the polygon.
- the polygon should be connected; i.e. the first and last point must be
connected by faces.
- the vertices may not be connected > 2 times.
- the resulting polygon might be slightly smoohted, depending on the
number of original points and the distance between those points; you can
avoid this by using more input points or adding points at the longest faces
[ v ] = distributePointsOnPolygon ( v )
[ f, v ] = distributePointsOnPolygon ( f, v )
[ f, v ] = distributePointsOnPolygon ( f, v, debug )
use debug = 1 to see the progress.
tweak the PARAMETRS on line 70-76 to speed up the process/ improve accuracy
| Required Products
MATLAB 8.1 (R2013a)
||Image processing toolbox is probably needed for the example code.
|04 Jun 2013
Now connects first and last vertex (if it was not connected already).