Code covered by the BSD License  

Highlights from
distributePointsOnPolygon

Be the first to rate this file! 4 Downloads (last 30 days) File Size: 5.21 KB File ID: #41743
image thumbnail

distributePointsOnPolygon

by

 

14 May 2013 (Updated )

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   Please login to tag files.
Please login to add a comment or rating.
Updates
04 Jun 2013

Now connects first and last vertex (if it was not connected already).

Contact us