pcbnew: Add edge polygons to pns keepout

Fixes: lp:1806846
* https://bugs.launchpad.net/kicad/+bug/1806846
This commit is contained in:
Seth Hillbrand 2018-12-05 04:56:34 -07:00
parent 02039be2d9
commit 0614f59973
1 changed files with 29 additions and 12 deletions

View File

@ -941,20 +941,37 @@ bool PNS_KICAD_IFACE::syncGraphicalItem( PNS::NODE* aWorld, DRAWSEGMENT* aItem )
} }
case S_CURVE: case S_CURVE:
{ {
aItem->RebuildBezierToSegmentsPointsList( aItem->GetWidth() ); aItem->RebuildBezierToSegmentsPointsList( aItem->GetWidth() );
wxPoint start_pt = aItem->GetBezierPoints()[0]; wxPoint start_pt = aItem->GetBezierPoints()[0];
for( unsigned int jj = 1; jj < aItem->GetBezierPoints().size(); jj++ ) for( unsigned int jj = 1; jj < aItem->GetBezierPoints().size(); jj++ )
{ {
wxPoint end_pt = aItem->GetBezierPoints()[jj]; wxPoint end_pt = aItem->GetBezierPoints()[jj];
SHAPE_SEGMENT *seg = new SHAPE_SEGMENT( SHAPE_SEGMENT *seg = new SHAPE_SEGMENT(
VECTOR2I( start_pt ), VECTOR2I( end_pt ), aItem->GetWidth() ); VECTOR2I( start_pt ), VECTOR2I( end_pt ), aItem->GetWidth() );
segs.push_back( seg ); segs.push_back( seg );
start_pt = end_pt; start_pt = end_pt;
}
} }
break; }
break;
case S_POLYGON:
{
if( !aItem->IsPolygonFilled() )
{
auto poly = aItem->BuildPolyPointsList();
for( size_t ii = 1; ii < poly.size(); ii++ )
{
segs.push_back( new SHAPE_SEGMENT(
VECTOR2I( poly[ii-1] ), VECTOR2I( poly[ii] ), aItem->GetWidth() ) );
}
segs.push_back( new SHAPE_SEGMENT(
VECTOR2I( poly.back() ), VECTOR2I( poly.front() ), aItem->GetWidth() ) );
}
}
break;
default: default:
break; break;