Divide polygon into smaller

Hi,

Is there a function to split a polygon into several polygons with a given number of vertices? My problem is that I have to spend a Complex over 101 simple polygonal vertices less than 101 vertices.

I'm programming in VBA

Regards

Parents
  • Good illustration!

    Unknown said:
    Is there a function to split a polygon into several polygons with a given number of vertices?

    There is no function that does exactly what you want.  There are algorithms that will triangulate a polygon, but that isn't what you want either.

    You must write your own algorithm:

    1. Extract a list of vertices from your polygon (complex shape element)
    2. Iterate the vertex list  in chunks, 100 vertices at a time
      1. Close the chunk (insert new last.point = first.point)
      2. Construct a new shape element from each chunk of vertices
      3. Add the shape to your DGN model
    3. Delete the original complex shape

     
    Regards, Jon Summers
    LA Solutions

  • Hi Jon,

    Thanks for your reply. The theory is easy but there is a problem. Your solution is good for regular polygon. But if the polygon is irregular the areas are incorrect. You can see in the picture.

    Is there some algorithm or function that triangulates the polygon? I need it is divided into smaller areas and the sum of these is the total area.

    Best Regards

Reply Children