Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Is it possible to split non-convex polygons into convex plygons with Mathematica 9?

For example:

pts={{-5, 29.6537}, {-4, 16.3031}, {-3, 13.8614}, {-2, 9.22332}, {-1, 
  6.89646}, {0, 6.76047}, {1, 9.20436}, {2, 6.65919}, {3, 
  18.2084}, {4, 18.9102}, {5, 31.6521}}

enter image description here

share|improve this question
2  
You may Triangulate it! –  PlatoManiac May 28 '13 at 10:59
    
This is not unique. Have you tried dividng it into triangles? –  Ali May 28 '13 at 11:00
    
As noted, even the triangulation isn't unique... ;) –  Guess who it is. May 28 '13 at 11:01
4  
See my answer to the MO question, "Partitioning a polygon into convex parts." There is a relatively easy algorithm (Hertel-Mehlhorn) superior to triangulation for most shapes. –  Joseph O'Rourke May 28 '13 at 12:23
1  
dma.fi.upm.es/docencia/trabajosfindecarrera/programas/… is a very nice exposition of both a triangulation algorithm and the Hertel-Mehlhorn algorithm. –  David Speyer Jun 4 '13 at 15:07

1 Answer 1

up vote 5 down vote accepted

In V9, hidden in Graphics`Mesh` is the PolygonTriangulate function...

pts = {{-5, 29.6537}, {-4, 16.3031}, {-3, 13.8614}, {-2, 9.22332}, {-1, 6.89646},
 {0, 6.76047}, {1, 9.20436}, {2, 6.65919}, {3, 18.2084}, {4, 18.9102}, {5, 31.6521}};

Graphics[
 GraphicsComplex[
  pts,
  {EdgeForm[{Thick, Gray}],
   LightRed,
   Polygon@Graphics`Mesh`PolygonTriangulate[pts]}
  ], Axes -> True, AspectRatio -> 1/GoldenRatio]

enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.