Altium PCB import: remove more invalid polygons.

(cherry picked from commit eb6cd4cc5d)
This commit is contained in:
Alex Shvartzkop 2023-07-21 08:00:24 +05:00
parent deb035c7fe
commit 5b73af668f
1 changed files with 10 additions and 5 deletions

View File

@ -1731,11 +1731,12 @@ void ALTIUM_PCB::ParsePolygons6Data( const ALTIUM_COMPOUND_FILE& aAltiumPcbF
SHAPE_LINE_CHAIN linechain;
HelperShapeLineChainFromAltiumVertices( linechain, elem.vertices );
if( linechain.PointCount() < 2 )
if( linechain.PointCount() < 3 )
{
// We have found multiple Altium files with polygon records containing nothing but two
// coincident vertices. These polygons do not appear when opening the file in Altium.
// https://gitlab.com/kicad/code/kicad/-/issues/8183
// Also, polygons with less than 3 points are not supported in KiCad.
//
// wxLogError( _( "Polygon has only %d point extracted from %ld vertices. At least 2 "
// "points are required." ),
@ -1931,11 +1932,12 @@ void ALTIUM_PCB::ConvertShapeBasedRegions6ToBoardItem( const AREGION6& aElem )
SHAPE_LINE_CHAIN linechain;
HelperShapeLineChainFromAltiumVertices( linechain, aElem.outline );
if( linechain.PointCount() < 2 )
if( linechain.PointCount() < 3 )
{
// We have found multiple Altium files with polygon records containing nothing but
// two coincident vertices. These polygons do not appear when opening the file in
// Altium. https://gitlab.com/kicad/code/kicad/-/issues/8183
// Also, polygons with less than 3 points are not supported in KiCad.
return;
}
@ -1979,11 +1981,12 @@ void ALTIUM_PCB::ConvertShapeBasedRegions6ToFootprintItem( FOOTPRINT* aFoot
SHAPE_LINE_CHAIN linechain;
HelperShapeLineChainFromAltiumVertices( linechain, aElem.outline );
if( linechain.PointCount() < 2 )
if( linechain.PointCount() < 3 )
{
// We have found multiple Altium files with polygon records containing nothing but
// two coincident vertices. These polygons do not appear when opening the file in
// Altium. https://gitlab.com/kicad/code/kicad/-/issues/8183
// Also, polygons with less than 3 points are not supported in KiCad.
return;
}
@ -2023,11 +2026,12 @@ void ALTIUM_PCB::ConvertShapeBasedRegions6ToBoardItemOnLayer( const AREGION6& aE
SHAPE_LINE_CHAIN linechain;
HelperShapeLineChainFromAltiumVertices( linechain, aElem.outline );
if( linechain.PointCount() < 2 )
if( linechain.PointCount() < 3 )
{
// We have found multiple Altium files with polygon records containing nothing
// but two coincident vertices. These polygons do not appear when opening the
// file in Altium. https://gitlab.com/kicad/code/kicad/-/issues/8183
// Also, polygons with less than 3 points are not supported in KiCad.
return;
}
@ -2049,11 +2053,12 @@ void ALTIUM_PCB::ConvertShapeBasedRegions6ToFootprintItemOnLayer( FOOTPRINT*
SHAPE_LINE_CHAIN linechain;
HelperShapeLineChainFromAltiumVertices( linechain, aElem.outline );
if( linechain.PointCount() < 2 )
if( linechain.PointCount() < 3 )
{
// We have found multiple Altium files with polygon records containing nothing
// but two coincident vertices. These polygons do not appear when opening the
// file in Altium. https://gitlab.com/kicad/code/kicad/-/issues/8183
// Also, polygons with less than 3 points are not supported in KiCad.
return;
}