distributePointsOnPolygon
by Wouter
14 May 2013
(Updated 04 Jun 2013)
This function distributes polygon points evenly across the polygon.
|
Watch this File
|
| File Information |
| Description |
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.
Notes:
- 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
Usage:
[ 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
Demo:
distributePointsOnPolygon() |
| Required Products |
MATLAB
|
| MATLAB release |
MATLAB 8.1 (R2013a)
|
| Other requirements |
Image processing toolbox is probably needed for the example code. |
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Updates |
| 04 Jun 2013 |
Now connects first and last vertex (if it was not connected already). |
|
Contact us