altium: support keepout restrictions in Arcs, Fills and Regions
This commit is contained in:
parent
dd1dbb81f6
commit
79aafd1bd3
|
@ -60,10 +60,13 @@ types:
|
||||||
- id: sub1_len
|
- id: sub1_len
|
||||||
type: u4
|
type: u4
|
||||||
- id: data
|
- id: data
|
||||||
type: arc_sub1
|
type: arc_sub1(sub1_len)
|
||||||
size: sub1_len
|
size: sub1_len
|
||||||
|
|
||||||
arc_sub1:
|
arc_sub1:
|
||||||
|
params:
|
||||||
|
- id: sub1_len
|
||||||
|
type: u4
|
||||||
seq:
|
seq:
|
||||||
- id: layer
|
- id: layer
|
||||||
type: u1
|
type: u1
|
||||||
|
@ -102,6 +105,10 @@ types:
|
||||||
type: f8
|
type: f8
|
||||||
- id: width
|
- id: width
|
||||||
type: u4
|
type: u4
|
||||||
|
- size: 11
|
||||||
|
- id: keepout_restrictions
|
||||||
|
type: keepout_restrictions
|
||||||
|
if: sub1_len >= 57
|
||||||
|
|
||||||
pad:
|
pad:
|
||||||
seq:
|
seq:
|
||||||
|
@ -366,10 +373,13 @@ types:
|
||||||
- id: sub1_len
|
- id: sub1_len
|
||||||
type: u4
|
type: u4
|
||||||
- id: data
|
- id: data
|
||||||
type: track_sub1
|
type: track_sub1(sub1_len)
|
||||||
size: sub1_len
|
size: sub1_len
|
||||||
|
|
||||||
track_sub1:
|
track_sub1:
|
||||||
|
params:
|
||||||
|
- id: sub1_len
|
||||||
|
type: u4
|
||||||
seq:
|
seq:
|
||||||
- id: layer
|
- id: layer
|
||||||
type: u1
|
type: u1
|
||||||
|
@ -405,6 +415,10 @@ types:
|
||||||
type: xy
|
type: xy
|
||||||
- id: width # 29
|
- id: width # 29
|
||||||
type: s4
|
type: s4
|
||||||
|
- size: 12
|
||||||
|
- id: keepout_restrictions
|
||||||
|
type: keepout_restrictions
|
||||||
|
if: sub1_len >= 46
|
||||||
|
|
||||||
text:
|
text:
|
||||||
seq:
|
seq:
|
||||||
|
@ -527,10 +541,13 @@ types:
|
||||||
- id: sub1_len
|
- id: sub1_len
|
||||||
type: u4
|
type: u4
|
||||||
- id: data
|
- id: data
|
||||||
type: fill_sub1
|
type: fill_sub1(sub1_len)
|
||||||
size: sub1_len
|
size: sub1_len
|
||||||
|
|
||||||
fill_sub1:
|
fill_sub1:
|
||||||
|
params:
|
||||||
|
- id: sub1_len
|
||||||
|
type: u4
|
||||||
seq:
|
seq:
|
||||||
- id: layer
|
- id: layer
|
||||||
type: u1
|
type: u1
|
||||||
|
@ -564,6 +581,10 @@ types:
|
||||||
type: xy
|
type: xy
|
||||||
- id: rotation
|
- id: rotation
|
||||||
type: f8
|
type: f8
|
||||||
|
- size: 9
|
||||||
|
- id: keepout_restrictions
|
||||||
|
type: keepout_restrictions
|
||||||
|
if: sub1_len >= 47
|
||||||
|
|
||||||
region:
|
region:
|
||||||
seq:
|
seq:
|
||||||
|
@ -654,6 +675,21 @@ types:
|
||||||
size: propterties_len
|
size: propterties_len
|
||||||
type: str
|
type: str
|
||||||
|
|
||||||
|
keepout_restrictions:
|
||||||
|
seq:
|
||||||
|
- id: keepout_restriction_unknown # not used
|
||||||
|
type: b3
|
||||||
|
- id: keepout_restriction_pth
|
||||||
|
type: b1
|
||||||
|
- id: keepout_restriction_smd
|
||||||
|
type: b1
|
||||||
|
- id: keepout_restriction_copper
|
||||||
|
type: b1
|
||||||
|
- id: keepout_restriction_track
|
||||||
|
type: b1
|
||||||
|
- id: keepout_restriction_via
|
||||||
|
type: b1
|
||||||
|
|
||||||
xy:
|
xy:
|
||||||
seq:
|
seq:
|
||||||
- id: x
|
- id: x
|
||||||
|
|
|
@ -592,6 +592,16 @@ AARC6::AARC6( ALTIUM_PARSER& aReader )
|
||||||
endangle = aReader.Read<double>();
|
endangle = aReader.Read<double>();
|
||||||
width = aReader.ReadKicadUnit();
|
width = aReader.ReadKicadUnit();
|
||||||
|
|
||||||
|
if( aReader.GetRemainingSubrecordBytes() >= 12 )
|
||||||
|
{
|
||||||
|
aReader.Skip( 11 );
|
||||||
|
keepoutrestrictions = aReader.Read<uint8_t>();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
keepoutrestrictions = is_keepout ? 0x1F : 0;
|
||||||
|
}
|
||||||
|
|
||||||
aReader.SkipSubrecord();
|
aReader.SkipSubrecord();
|
||||||
|
|
||||||
if( aReader.HasParsingError() )
|
if( aReader.HasParsingError() )
|
||||||
|
@ -957,6 +967,16 @@ AFILL6::AFILL6( ALTIUM_PARSER& aReader )
|
||||||
pos2 = aReader.ReadVector2I();
|
pos2 = aReader.ReadVector2I();
|
||||||
rotation = aReader.Read<double>();
|
rotation = aReader.Read<double>();
|
||||||
|
|
||||||
|
if( aReader.GetRemainingSubrecordBytes() >= 10 )
|
||||||
|
{
|
||||||
|
aReader.Skip( 9 );
|
||||||
|
keepoutrestrictions = aReader.Read<uint8_t>();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
keepoutrestrictions = is_keepout ? 0x1F : 0;
|
||||||
|
}
|
||||||
|
|
||||||
aReader.SkipSubrecord();
|
aReader.SkipSubrecord();
|
||||||
|
|
||||||
if( aReader.HasParsingError() )
|
if( aReader.HasParsingError() )
|
||||||
|
@ -997,6 +1017,8 @@ AREGION6::AREGION6( ALTIUM_PARSER& aReader, bool aExtendedVertices )
|
||||||
bool is_cutout = ALTIUM_PARSER::ReadBool( properties, wxT( "ISBOARDCUTOUT" ), false );
|
bool is_cutout = ALTIUM_PARSER::ReadBool( properties, wxT( "ISBOARDCUTOUT" ), false );
|
||||||
|
|
||||||
is_shapebased = ALTIUM_PARSER::ReadBool( properties, wxT( "ISSHAPEBASED" ), false );
|
is_shapebased = ALTIUM_PARSER::ReadBool( properties, wxT( "ISSHAPEBASED" ), false );
|
||||||
|
keepoutrestrictions = static_cast<uint8_t>(
|
||||||
|
ALTIUM_PARSER::ReadInt( properties, wxT( "KEEPOUTRESTRIC" ), 0x1F ) );
|
||||||
|
|
||||||
// TODO: this can differ from the other subpolyindex?!
|
// TODO: this can differ from the other subpolyindex?!
|
||||||
//subpolyindex = static_cast<uint16_t>(
|
//subpolyindex = static_cast<uint16_t>(
|
||||||
|
|
|
@ -524,6 +524,7 @@ struct AREGION6
|
||||||
uint16_t net;
|
uint16_t net;
|
||||||
uint16_t component;
|
uint16_t component;
|
||||||
uint16_t subpolyindex;
|
uint16_t subpolyindex;
|
||||||
|
uint8_t keepoutrestrictions;
|
||||||
uint16_t holecount;
|
uint16_t holecount;
|
||||||
|
|
||||||
ALTIUM_REGION_KIND kind; // I assume this means if normal or keepout?
|
ALTIUM_REGION_KIND kind; // I assume this means if normal or keepout?
|
||||||
|
@ -544,6 +545,7 @@ struct AARC6
|
||||||
uint16_t net;
|
uint16_t net;
|
||||||
uint16_t component;
|
uint16_t component;
|
||||||
uint16_t subpolyindex;
|
uint16_t subpolyindex;
|
||||||
|
uint8_t keepoutrestrictions;
|
||||||
|
|
||||||
VECTOR2I center;
|
VECTOR2I center;
|
||||||
uint32_t radius;
|
uint32_t radius;
|
||||||
|
@ -699,6 +701,7 @@ struct AFILL6
|
||||||
ALTIUM_LAYER layer;
|
ALTIUM_LAYER layer;
|
||||||
uint16_t component;
|
uint16_t component;
|
||||||
uint16_t net;
|
uint16_t net;
|
||||||
|
uint8_t keepoutrestrictions;
|
||||||
|
|
||||||
VECTOR2I pos1;
|
VECTOR2I pos1;
|
||||||
VECTOR2I pos2;
|
VECTOR2I pos2;
|
||||||
|
|
|
@ -1931,11 +1931,8 @@ void ALTIUM_PCB::ConvertShapeBasedRegions6ToBoardItem( const AREGION6& aElem )
|
||||||
m_board->Add( zone, ADD_MODE::APPEND );
|
m_board->Add( zone, ADD_MODE::APPEND );
|
||||||
|
|
||||||
zone->SetIsRuleArea( true );
|
zone->SetIsRuleArea( true );
|
||||||
zone->SetDoNotAllowTracks( false );
|
|
||||||
zone->SetDoNotAllowVias( false );
|
HelperSetZoneKeepoutRestrictions( zone, aElem.keepoutrestrictions );
|
||||||
zone->SetDoNotAllowPads( false );
|
|
||||||
zone->SetDoNotAllowFootprints( false );
|
|
||||||
zone->SetDoNotAllowCopperPour( true );
|
|
||||||
|
|
||||||
zone->SetPosition( aElem.outline.at( 0 ).position );
|
zone->SetPosition( aElem.outline.at( 0 ).position );
|
||||||
zone->Outline()->AddOutline( linechain );
|
zone->Outline()->AddOutline( linechain );
|
||||||
|
@ -1982,11 +1979,8 @@ void ALTIUM_PCB::ConvertShapeBasedRegions6ToFootprintItem( FOOTPRINT* aFoot
|
||||||
aFootprint->Add( zone, ADD_MODE::APPEND );
|
aFootprint->Add( zone, ADD_MODE::APPEND );
|
||||||
|
|
||||||
zone->SetIsRuleArea( true );
|
zone->SetIsRuleArea( true );
|
||||||
zone->SetDoNotAllowTracks( false );
|
|
||||||
zone->SetDoNotAllowVias( false );
|
HelperSetZoneKeepoutRestrictions( zone, aElem.keepoutrestrictions );
|
||||||
zone->SetDoNotAllowPads( false );
|
|
||||||
zone->SetDoNotAllowFootprints( false );
|
|
||||||
zone->SetDoNotAllowCopperPour( true );
|
|
||||||
|
|
||||||
zone->SetPosition( aElem.outline.at( 0 ).position );
|
zone->SetPosition( aElem.outline.at( 0 ).position );
|
||||||
zone->Outline()->AddOutline( linechain );
|
zone->Outline()->AddOutline( linechain );
|
||||||
|
@ -2218,7 +2212,7 @@ void ALTIUM_PCB::ConvertArcs6ToBoardItem( const AARC6& aElem, const int aPrimiti
|
||||||
ConvertArcs6ToPcbShape( aElem, &shape );
|
ConvertArcs6ToPcbShape( aElem, &shape );
|
||||||
shape.SetStroke( STROKE_PARAMS( aElem.width, PLOT_DASH_TYPE::SOLID ) );
|
shape.SetStroke( STROKE_PARAMS( aElem.width, PLOT_DASH_TYPE::SOLID ) );
|
||||||
|
|
||||||
HelperPcpShapeAsBoardKeepoutRegion( shape, aElem.layer );
|
HelperPcpShapeAsBoardKeepoutRegion( shape, aElem.layer, aElem.keepoutrestrictions );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -2260,7 +2254,8 @@ void ALTIUM_PCB::ConvertArcs6ToFootprintItem( FOOTPRINT* aFootprint, const AARC6
|
||||||
ConvertArcs6ToPcbShape( aElem, &shape );
|
ConvertArcs6ToPcbShape( aElem, &shape );
|
||||||
shape.SetStroke( STROKE_PARAMS( aElem.width, PLOT_DASH_TYPE::SOLID ) );
|
shape.SetStroke( STROKE_PARAMS( aElem.width, PLOT_DASH_TYPE::SOLID ) );
|
||||||
|
|
||||||
HelperPcpShapeAsFootprintKeepoutRegion( aFootprint, shape, aElem.layer );
|
HelperPcpShapeAsFootprintKeepoutRegion( aFootprint, shape, aElem.layer,
|
||||||
|
aElem.keepoutrestrictions );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -3315,7 +3310,8 @@ void ALTIUM_PCB::ConvertFills6ToFootprintItem( FOOTPRINT* aFootprint, const AFIL
|
||||||
shape.Rotate( center, EDA_ANGLE( aElem.rotation, DEGREES_T ) );
|
shape.Rotate( center, EDA_ANGLE( aElem.rotation, DEGREES_T ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
HelperPcpShapeAsFootprintKeepoutRegion( aFootprint, shape, aElem.layer );
|
HelperPcpShapeAsFootprintKeepoutRegion( aFootprint, shape, aElem.layer,
|
||||||
|
aElem.keepoutrestrictions );
|
||||||
}
|
}
|
||||||
else if( aIsBoardImport && IsAltiumLayerCopper( aElem.layer )
|
else if( aIsBoardImport && IsAltiumLayerCopper( aElem.layer )
|
||||||
&& aElem.net != ALTIUM_NET_UNCONNECTED )
|
&& aElem.net != ALTIUM_NET_UNCONNECTED )
|
||||||
|
@ -3365,11 +3361,8 @@ void ALTIUM_PCB::ConvertFills6ToBoardItemWithNet( const AFILL6& aElem )
|
||||||
if( aElem.is_keepout )
|
if( aElem.is_keepout )
|
||||||
{
|
{
|
||||||
zone->SetIsRuleArea( true );
|
zone->SetIsRuleArea( true );
|
||||||
zone->SetDoNotAllowTracks( false );
|
|
||||||
zone->SetDoNotAllowVias( false );
|
HelperSetZoneKeepoutRestrictions( zone, aElem.keepoutrestrictions );
|
||||||
zone->SetDoNotAllowPads( false );
|
|
||||||
zone->SetDoNotAllowFootprints( false );
|
|
||||||
zone->SetDoNotAllowCopperPour( true );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if( aElem.rotation != 0. )
|
if( aElem.rotation != 0. )
|
||||||
|
|
|
@ -223,10 +223,10 @@ private:
|
||||||
void HelperSetZoneKeepoutRestrictions( ZONE* aZone, const uint8_t aKeepoutRestrictions );
|
void HelperSetZoneKeepoutRestrictions( ZONE* aZone, const uint8_t aKeepoutRestrictions );
|
||||||
void HelperPcpShapeAsBoardKeepoutRegion( const PCB_SHAPE& aShape,
|
void HelperPcpShapeAsBoardKeepoutRegion( const PCB_SHAPE& aShape,
|
||||||
const ALTIUM_LAYER aAltiumLayer,
|
const ALTIUM_LAYER aAltiumLayer,
|
||||||
const uint8_t aKeepoutRestrictions = 0x1F );
|
const uint8_t aKeepoutRestrictions );
|
||||||
void HelperPcpShapeAsFootprintKeepoutRegion( FOOTPRINT* aFootprint, const PCB_SHAPE& aShape,
|
void HelperPcpShapeAsFootprintKeepoutRegion( FOOTPRINT* aFootprint, const PCB_SHAPE& aShape,
|
||||||
const ALTIUM_LAYER aAltiumLayer,
|
const ALTIUM_LAYER aAltiumLayer,
|
||||||
const uint8_t aKeepoutRestrictions = 0x1F );
|
const uint8_t aKeepoutRestrictions );
|
||||||
|
|
||||||
std::vector<std::pair<PCB_LAYER_ID, int>>
|
std::vector<std::pair<PCB_LAYER_ID, int>>
|
||||||
HelperGetSolderAndPasteMaskExpansions( const ALTIUM_RECORD aType, const int aPrimitiveIndex,
|
HelperGetSolderAndPasteMaskExpansions( const ALTIUM_RECORD aType, const int aPrimitiveIndex,
|
||||||
|
|
Loading…
Reference in New Issue