Altium PCB import: import holes in non-Cu polygons.
This commit is contained in:
parent
eb6cd4cc5d
commit
ef66fe88ac
|
@ -1059,6 +1059,9 @@ AREGION6::AREGION6( ALTIUM_PARSER& aReader, bool aExtendedVertices )
|
|||
|
||||
uint32_t num_outline_vertices = aReader.Read<uint32_t>();
|
||||
|
||||
if( aExtendedVertices )
|
||||
num_outline_vertices++; // Has a closing vertex
|
||||
|
||||
for( uint32_t i = 0; i < num_outline_vertices; i++ )
|
||||
{
|
||||
if( aExtendedVertices )
|
||||
|
@ -1080,9 +1083,6 @@ AREGION6::AREGION6( ALTIUM_PARSER& aReader, bool aExtendedVertices )
|
|||
}
|
||||
}
|
||||
|
||||
// TODO: for now we only support holes in regions where there are stored as double
|
||||
if( !aExtendedVertices )
|
||||
{
|
||||
holes.resize( holecount );
|
||||
for( uint16_t k = 0; k < holecount; k++ )
|
||||
{
|
||||
|
@ -1096,7 +1096,6 @@ AREGION6::AREGION6( ALTIUM_PARSER& aReader, bool aExtendedVertices )
|
|||
holes.at( k ).emplace_back( VECTOR2I( x, y ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
aReader.SkipSubrecord();
|
||||
|
||||
|
|
|
@ -1993,9 +1993,23 @@ void ALTIUM_PCB::ConvertShapeBasedRegions6ToBoardItemOnLayer( const AREGION6& aE
|
|||
return;
|
||||
}
|
||||
|
||||
SHAPE_POLY_SET polySet;
|
||||
polySet.AddOutline( linechain );
|
||||
|
||||
for( const std::vector<ALTIUM_VERTICE>& hole : aElem.holes )
|
||||
{
|
||||
SHAPE_LINE_CHAIN hole_linechain;
|
||||
HelperShapeLineChainFromAltiumVertices( hole_linechain, hole );
|
||||
|
||||
if( hole_linechain.PointCount() < 3 )
|
||||
continue;
|
||||
|
||||
polySet.AddHole( hole_linechain );
|
||||
}
|
||||
|
||||
PCB_SHAPE* shape = new PCB_SHAPE( m_board, SHAPE_T::POLY );
|
||||
|
||||
shape->SetPolyShape( linechain );
|
||||
shape->SetPolyShape( polySet );
|
||||
shape->SetFilled( true );
|
||||
shape->SetLayer( aLayer );
|
||||
shape->SetStroke( STROKE_PARAMS( 0 ) );
|
||||
|
|
Loading…
Reference in New Issue