kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #38658
PCBNew: Segments/polygons not rendered correctly (from Bug 1806411])
Hi Seth,
Sorry for the delay.
Attached 2 examples (a small polygon and a large polygon inside a
footprint) of incorrect rendering when using our triangulation on Opengl
(from the sample board of bug 1806411).
To see that:
set the line 976 in pcb_painter.cpp
#if 0
to
#if 1
to use our triangulation in Opengl.
Note the incorrect rendering happens only when footprints are flipped.
I am not familiar with the PolygonTriangulation:: code
and, of course, I can be wrong,
but I am worried by this code in
PolygonTriangulation::TesselatePolygon( const SHAPE_LINE_CHAIN& aPoly )
if the first attempt to tesselate aPoly does not work, a second attempt
is made on a "simplified" polygon, using this code:
ClipperLib::Paths simplified;
ClipperLib::SimplifyPolygon( aPoly.convertToClipper( true ), simplified );
If aPoly is self intersecting it can work, but our polygons are usually
not intersecting, but are polygons with holes linked by overlapping
segments.
So I am guessing "simplified" is a list of paths (polygons) the first is
the outline, and others are holes.
So in this case the tesselation cannot work.
(This is easy to see if the second attempt is forced instead of using
the first attempt.
--
Jean-Pierre CHARRAS
Attachment:
polygon_rendering_test.zip
Description: Zip compressed data
Follow ups