Pcbnew: Partial revert of commit 0bceb69fe9

In DRAWSEGMENT polygonal shape: the commit tried to use triangulation (CacheTriangulation) to draw the shape (similar to zones).
It was much faster than using GLU tesselator (one order of magnitude).
Unfortunately, CacheTriangulation() works only with simple polygons, not with any polygon.
And simplifying a polygon with a lot of vertexes is very time consuming.
So using CacheTriangulation() is now removed and GLU tesselator is used as previously.

Fixes: lp:1806411
https://bugs.launchpad.net/kicad/+bug/1806411
This commit is contained in:
jean-pierre charras 2018-12-03 20:07:39 +01:00
parent 2cb4187f52
commit af65c48979
1 changed files with 10 additions and 1 deletions

View File

@ -973,11 +973,20 @@ void PCB_PAINTER::draw( const DRAWSEGMENT* aSegment, int aLayer )
if( shape.OutlineCount() == 0 )
break;
#if 0
// On Opengl, a not convex filled polygon is usually drawn by using triangles as primitives.
// Although using CacheTriangulation() to create basic triangle primitives
// to draw the polygon solid shape on Opengl, it is not used because CacheTriangulation()
// does not work fine with any polygon.
// It must be a simple polygon.
// And unfortunately, calling shape.Simplify( PM_FAST) is very slow.
// So we just use GLU tesselation (much slower, but works with any polygon)
// This section is left until a better way is found
if( !shape.IsTriangulationUpToDate() )
{
shape.CacheTriangulation();
}
#endif
m_gal->Save();
if( MODULE* module = aSegment->GetParentModule() )