Concave polygon, issue with solid representation and vtkDelaunay2D

Dear developers,

I was trying to test some functionality with a simple concave polygon but hit the following issue - after I draw the desired shape, only the wireframe is correct, but solid representation does not show the original shape. The vtkDelaunay2D also does not preserve the concave shape. This is the outcome I get:


when running this Python code:
python_minEx_drawPolygon.py (2.7 KB)

Am I doing something wrong or perhaps this is a bug? I found some similar issues reported here and here, but no apparent solution seemed to emerge.

Best wishes,
Ugis

  1. Rendering engines (e.g., OpenGL) typically do not tessellate concave polygons correctly (they typically use some sort of greedy fan triangulation). This is why your “solid” polygon is rendered incorrectly. Try vtkTriangleFilter.

  2. vtkDelaunay produces convex triangulations of the input points. You’ll have to specify constraint edges/loops to produce convex tessellations.

1 Like

Hi Will,

Thanks a lot for the quick answer and explanation. Indeed, vtkTriangleFilter and specifying constraint solved both issues (when having the correct rotational order of the constraint loop). Problem solved!

If anyone else have the issue, this is the fixed Python code:
python_minEx_drawPolygon.py (2.9 KB)