Fixed name for drc rules, force and torque.

This commit is contained in:
Daniel Treffenstädt 2025-06-15 15:03:56 +02:00
parent dab925a778
commit 42eb1dbff1
No known key found for this signature in database
GPG Key ID: 3D92CAF477537F3E
21 changed files with 69 additions and 72 deletions

View File

@ -57,8 +57,8 @@ track
track_angle
pad_fanout_ratio
pad_fanout_via_distance
footprint_fanout_force
footprint_fanout_torque
footprint_fanout_mirror_symmetry
footprint_fanout_point_symmetry
track_width
track_segment_length
version

View File

@ -274,8 +274,8 @@ void PANEL_SETUP_RULES::onScintillaCharAdded( wxStyledTextEvent &aEvent )
|| token == wxT( "track_segment_length" )
|| token == wxT( "pad_fanout_ratio" )
|| token == wxT( "pad_fanout_via_distance" )
|| token == wxT( "footprint_fanout_force" )
|| token == wxT( "footprint_fanout_torque" )
|| token == wxT( "footprint_fanout_mirror_symmetry" )
|| token == wxT( "footprint_fanout_point_symmetry" )
|| token == wxT( "via_count" )
|| token == wxT( "via_diameter" )
|| token == wxT( "zone_connection" );
@ -500,8 +500,8 @@ void PANEL_SETUP_RULES::onScintillaCharAdded( wxStyledTextEvent &aEvent )
"track_segment_length|"
"pad_fanout_ratio|"
"pad_fanout_via_distance|"
"footprint_fanout_force|"
"footprint_fanout_torque|"
"footprint_fanout_mirror_symmetry|"
"footprint_fanout_point_symmetry|"
"via_count|"
"via_diameter|"
"zone_connection" );

View File

@ -29,8 +29,8 @@
| `track_segment_length` | min/max | Checks the length of track and arc segments. An error will be generated for each segment that has a length below the `min` value (if specified) or above the `max` value (if specified).<br> |
| `pad_fanout_ratio` | max | Checks the width of the fanout for a pad stated as a percentage of the pad minor axis length. An error will be generated for each connected track with a width above the `max` value (if specified).<br> |
| `pad_fanout_via_distance`| min | Checks the distance from a pad to the next via. Creates an error if the distance is below the min value. <br> |
| `footprint_fanout_force` | max | Checks whether the fanout from a footprint is linearly symmetric in each quadrant. Each connection to the pad creates a force equal to its width along its axis. The sum of all forces on the footprint is checked here. Creates an error if the maximum force is exceeded. Units of mm. <br> |
| `footprint_fanout_torque` | max | Checks whether the fanout from a footprint is rotationally symmetric in each quadrant. Each connection to the pad creates a torque equal to its width along its axis with a lever from the footprint center. The sum of all moments on the footprint is checked here. Creates an error if the maximum moment is exceeded. Units of mm. <br> |
| `footprint_fanout_mirror_symmetry` | max | Checks the mirror symmetry of the tracks and thermal spokes connected to the pads of a footprint. A maximum value can be used to fine-tune the allowed deviation from perfect symmetry. An error will be generated for the footprint if the deviation is above the `max` value (if specified). <br> |\n
| `footprint_fanout_point_symmetry` | max | Checks the point symmetry of the tracks and thermal spokes connected to the pads of a footprint. A maximum value can be used to fine-tune the allowed deviation from perfect symmetry. An error will be generated for the footprint if the deviation is above the `max` value (if specified). <br> |\n
| `via_count` | max | Counts the number of vias on every net matched by the rule condition. If that number exceeds the constraint `max` value on any matched net, an error will be generated for that net.<br> |
| `via_dangling` | | Checks for vias that are unconnected or connected on only one layer. This constraint does not take a min/opt/max value. In combination with a severity clause, this constraint can be used to allow or disallow dangling vias in various conditions.<br> |
| `zone_connection` | `solid`<br>`thermal_reliefs`<br>`none` | Specifies the connection to be made between a zone and a pad.<br> |

View File

@ -137,13 +137,13 @@ DRC_ITEM DRC_ITEM::padFanoutViaDistance( DRCE_PAD_FANOUT_VIA_DISTANCE,
_( "Pad fanout via distance" ),
wxT( "pad_fanout_via_distance" ) );
DRC_ITEM DRC_ITEM::footprintFanoutForce( DRCE_FOOTPRINT_FANOUT_FORCE,
_( "Footprint fanout force" ),
wxT( "footprint_fanout_force" ) );
DRC_ITEM DRC_ITEM::footprintFanoutMirrorSymmetry( DRCE_FOOTPRINT_FANOUT_MIRROR_SYMMETRY,
_( "Footprint fanout mirror symmetry" ),
wxT( "footprint_fanout_mirror_symmetry" ) );
DRC_ITEM DRC_ITEM::footprintFanoutTorque( DRCE_FOOTPRINT_FANOUT_TORQUE,
_( "Footprint fanout torque" ),
wxT( "footprint_fanout_torque" ) );
DRC_ITEM DRC_ITEM::footprintFanoutPointSymmetry( DRCE_FOOTPRINT_FANOUT_POINT_SYMMETRY,
_( "Footprint fanout point symmetry" ),
wxT( "footprint_fanout_point_symmetry" ) );
DRC_ITEM DRC_ITEM::annularWidth( DRCE_ANNULAR_WIDTH,
_HKI( "Annular width" ),
@ -335,8 +335,8 @@ std::vector<std::reference_wrapper<RC_ITEM>> DRC_ITEM::allItemTypes(
DRC_ITEM::trackSegmentLength,
DRC_ITEM::padFanoutRatio,
DRC_ITEM::padFanoutViaDistance,
DRC_ITEM::footprintFanoutForce,
DRC_ITEM::footprintFanoutTorque,
DRC_ITEM::footprintFanoutMirrorSymmetry,
DRC_ITEM::footprintFanoutPointSymmetry,
DRC_ITEM::annularWidth,
DRC_ITEM::drillTooSmall,
DRC_ITEM::microviaDrillTooSmall,
@ -425,8 +425,8 @@ std::shared_ptr<DRC_ITEM> DRC_ITEM::Create( int aErrorCode )
case DRCE_TRACK_SEGMENT_LENGTH: return std::make_shared<DRC_ITEM>( trackSegmentLength );
case DRCE_PAD_FANOUT_RATIO: return std::make_shared<DRC_ITEM>( padFanoutRatio );
case DRCE_PAD_FANOUT_VIA_DISTANCE: return std::make_shared<DRC_ITEM>( padFanoutViaDistance );
case DRCE_FOOTPRINT_FANOUT_FORCE: return std::make_shared<DRC_ITEM>( footprintFanoutForce );
case DRCE_FOOTPRINT_FANOUT_TORQUE: return std::make_shared<DRC_ITEM>( footprintFanoutTorque );
case DRCE_FOOTPRINT_FANOUT_MIRROR_SYMMETRY: return std::make_shared<DRC_ITEM>( footprintFanoutMirrorSymmetry );
case DRCE_FOOTPRINT_FANOUT_POINT_SYMMETRY: return std::make_shared<DRC_ITEM>( footprintFanoutPointSymmetry );
case DRCE_ANNULAR_WIDTH: return std::make_shared<DRC_ITEM>( annularWidth );
case DRCE_DRILL_OUT_OF_RANGE: return std::make_shared<DRC_ITEM>( drillTooSmall );
case DRCE_VIA_DIAMETER: return std::make_shared<DRC_ITEM>( viaDiameter );

View File

@ -59,8 +59,8 @@ enum PCB_DRC_CODE
DRCE_TRACK_SEGMENT_LENGTH, // Track segment is too short or too long
DRCE_PAD_FANOUT_RATIO, // The fanout width from a pad is too large as a percentage of pad width
DRCE_PAD_FANOUT_VIA_DISTANCE, // The distance from a pad to the nearest via connected by copper
DRCE_FOOTPRINT_FANOUT_FORCE, // The fanout from a footprint should by symmetric.
DRCE_FOOTPRINT_FANOUT_TORQUE, // The fanout from a footprint should by symmetric.
DRCE_FOOTPRINT_FANOUT_MIRROR_SYMMETRY, // The fanout from a footprint should by symmetric.
DRCE_FOOTPRINT_FANOUT_POINT_SYMMETRY, // The fanout from a footprint should by symmetric.
DRCE_ANNULAR_WIDTH, // Via size and drill leave annular ring too small
DRCE_CONNECTION_WIDTH, // Net connection too small
DRCE_DRILL_OUT_OF_RANGE, // Too small via or pad drill
@ -209,8 +209,8 @@ private:
static DRC_ITEM trackSegmentLength;
static DRC_ITEM padFanoutRatio;
static DRC_ITEM padFanoutViaDistance;
static DRC_ITEM footprintFanoutForce;
static DRC_ITEM footprintFanoutTorque;
static DRC_ITEM footprintFanoutMirrorSymmetry;
static DRC_ITEM footprintFanoutPointSymmetry;
static DRC_ITEM annularWidth;
static DRC_ITEM drillTooSmall;
static DRC_ITEM viaDiameter;

View File

@ -82,8 +82,8 @@ enum DRC_CONSTRAINT_T
VIA_DANGLING_CONSTRAINT,
PAD_FANOUT_RATIO_CONSTRAINT,
PAD_FANOUT_VIA_DISTANCE_CONSTRAINT,
FOOTPRINT_FANOUT_FORCE_CONSTRAINT,
FOOTPRINT_FANOUT_TORQUE_CONSTRAINT
FOOTPRINT_FANOUT_MIRROR_SYMMETRY_CONSTRAINT,
FOOTPRINT_FANOUT_POINT_SYMMETRY_CONSTRAINT,
};

View File

@ -521,8 +521,8 @@ void DRC_RULES_PARSER::parseConstraint( DRC_RULE* aRule )
case T_track_segment_length: c.m_Type = TRACK_SEGMENT_LENGTH_CONSTRAINT; break;
case T_pad_fanout_ratio: c.m_Type = PAD_FANOUT_RATIO_CONSTRAINT; break;
case T_pad_fanout_via_distance: c.m_Type = PAD_FANOUT_VIA_DISTANCE_CONSTRAINT; break;
case T_footprint_fanout_force: c.m_Type = FOOTPRINT_FANOUT_FORCE_CONSTRAINT; break;
case T_footprint_fanout_torque: c.m_Type = FOOTPRINT_FANOUT_TORQUE_CONSTRAINT; break;
case T_footprint_fanout_mirror_symmetry: c.m_Type = FOOTPRINT_FANOUT_MIRROR_SYMMETRY_CONSTRAINT; break;
case T_footprint_fanout_point_symmetry: c.m_Type = FOOTPRINT_FANOUT_POINT_SYMMETRY_CONSTRAINT; break;
case T_connection_width: c.m_Type = CONNECTION_WIDTH_CONSTRAINT; break;
case T_annular_width: c.m_Type = ANNULAR_WIDTH_CONSTRAINT; break;
case T_via_diameter: c.m_Type = VIA_DIAMETER_CONSTRAINT; break;

View File

@ -46,8 +46,8 @@
Errors generated:
- DRCE_PAD_FANOUT_RATIO
- DRCE_PAD_FANOUT_VIA_DISTANCE
- DRCE_FOOTPRINT_FANOUT_FORCE
- DRCE_FOOTPRINT_FANOUT_TORQUE
- DRCE_FOOTPRINT_FANOUT_MIRROR_SYMMETRY
- DRCE_FOOTPRINT_FANOUT_POINT_SYMMETRY
*/
class DRC_TEST_PROVIDER_FANOUT_CHECKS : public DRC_TEST_PROVIDER
@ -71,8 +71,8 @@ public:
bool DRC_TEST_PROVIDER_FANOUT_CHECKS::Run()
{
if( !m_drcEngine->HasRulesForConstraintType( PAD_FANOUT_RATIO_CONSTRAINT )
&& !m_drcEngine->HasRulesForConstraintType( FOOTPRINT_FANOUT_FORCE_CONSTRAINT )
&& !m_drcEngine->HasRulesForConstraintType( FOOTPRINT_FANOUT_TORQUE_CONSTRAINT )
&& !m_drcEngine->HasRulesForConstraintType( FOOTPRINT_FANOUT_MIRROR_SYMMETRY_CONSTRAINT )
&& !m_drcEngine->HasRulesForConstraintType( FOOTPRINT_FANOUT_POINT_SYMMETRY_CONSTRAINT )
&& !m_drcEngine->HasRulesForConstraintType( PAD_FANOUT_VIA_DISTANCE_CONSTRAINT ) )
{
reportAux( wxT( "No fanout constraints found. Tests not run." ) );
@ -392,8 +392,8 @@ bool DRC_TEST_PROVIDER_FANOUT_CHECKS::Run()
auto checkFootprintSymmetry = [&]( const FOOTPRINT* footprint ) -> bool
{
if( m_drcEngine->IsErrorLimitExceeded( DRCE_FOOTPRINT_FANOUT_FORCE )
&& m_drcEngine->IsErrorLimitExceeded( DRCE_FOOTPRINT_FANOUT_TORQUE ) )
if( m_drcEngine->IsErrorLimitExceeded( DRCE_FOOTPRINT_FANOUT_MIRROR_SYMMETRY )
&& m_drcEngine->IsErrorLimitExceeded( DRCE_FOOTPRINT_FANOUT_POINT_SYMMETRY ) )
{
return false;
}
@ -521,19 +521,18 @@ bool DRC_TEST_PROVIDER_FANOUT_CHECKS::Run()
int actual_torque = pcbIUScale.mmToIU( std::sqrt( std::abs( torque ) ) );
int actual_force = pcbIUScale.mmToIU( force.EuclideanNorm() );
auto force_constraint = m_drcEngine->EvalRules( FOOTPRINT_FANOUT_FORCE_CONSTRAINT,
footprint, nullptr, footprint->GetLayer() );
auto force_constraint = m_drcEngine->EvalRules( FOOTPRINT_FANOUT_MIRROR_SYMMETRY_CONSTRAINT, footprint, nullptr,
footprint->GetLayer() );
auto torque_constraint = m_drcEngine->EvalRules(
FOOTPRINT_FANOUT_TORQUE_CONSTRAINT, footprint, nullptr, footprint->GetLayer() );
auto torque_constraint = m_drcEngine->EvalRules( FOOTPRINT_FANOUT_POINT_SYMMETRY_CONSTRAINT, footprint, nullptr,
footprint->GetLayer() );
if( force_constraint.m_Value.HasMax()
&& force_constraint.GetSeverity() != RPT_SEVERITY_IGNORE
&& !m_drcEngine->IsErrorLimitExceeded( DRCE_FOOTPRINT_FANOUT_FORCE ) )
if( force_constraint.m_Value.HasMax() && force_constraint.GetSeverity() != RPT_SEVERITY_IGNORE
&& !m_drcEngine->IsErrorLimitExceeded( DRCE_FOOTPRINT_FANOUT_MIRROR_SYMMETRY ) )
{
if( actual_force > force_constraint.m_Value.Max() )
{
std::shared_ptr<DRC_ITEM> drcItem = DRC_ITEM::Create( DRCE_FOOTPRINT_FANOUT_FORCE );
std::shared_ptr<DRC_ITEM> drcItem = DRC_ITEM::Create( DRCE_FOOTPRINT_FANOUT_MIRROR_SYMMETRY );
wxString msg;
msg = formatMsg( _( "(%s fanout force exceeded. %s; actual %s)" ),
@ -547,14 +546,12 @@ bool DRC_TEST_PROVIDER_FANOUT_CHECKS::Run()
reportViolation( drcItem, footprint->GetPosition(), footprint->GetLayer() );
}
}
if( torque_constraint.m_Value.HasMax()
&& torque_constraint.GetSeverity() != RPT_SEVERITY_IGNORE
&& !m_drcEngine->IsErrorLimitExceeded( DRCE_FOOTPRINT_FANOUT_TORQUE ) )
if( torque_constraint.m_Value.HasMax() && torque_constraint.GetSeverity() != RPT_SEVERITY_IGNORE
&& !m_drcEngine->IsErrorLimitExceeded( DRCE_FOOTPRINT_FANOUT_POINT_SYMMETRY ) )
{
if( actual_torque > torque_constraint.m_Value.Max() )
{
std::shared_ptr<DRC_ITEM> drcItem =
DRC_ITEM::Create( DRCE_FOOTPRINT_FANOUT_TORQUE );
std::shared_ptr<DRC_ITEM> drcItem = DRC_ITEM::Create( DRCE_FOOTPRINT_FANOUT_POINT_SYMMETRY );
wxString msg;
msg = formatMsg( _( "(%s fanout torque exceeded. %s; actual %s)" ),

View File

@ -1,9 +1,9 @@
(version 1)
(rule "test footprint fanout torque"
(constraint footprint_fanout_torque (max 0.1mm))
(rule "test footprint fanout point symmetry"
(constraint footprint_fanout_point_symmetry (max 0.1mm))
)
(rule "test footprint fanout force"
(constraint footprint_fanout_force (max 0.1mm))
(rule "test footprint fanout mirror symmetry"
(constraint footprint_fanout_mirror_symmetry (max 0.1mm))
)

View File

@ -70,8 +70,8 @@
"duplicate_footprints": "ignore",
"extra_footprint": "ignore",
"footprint": "ignore",
"footprint_fanout_force": "error",
"footprint_fanout_torque": "error",
"footprint_fanout_mirror_symmetry": "error",
"footprint_fanout_point_symmetry": "error",
"footprint_filters_mismatch": "ignore",
"footprint_symbol_mismatch": "ignore",
"footprint_type_mismatch": "ignore",

View File

@ -1,5 +0,0 @@
(version 1)
(rule "test footprint fanout force"
(constraint footprint_fanout_force (max 0.1mm))
)

View File

@ -0,0 +1,5 @@
(version 1)
(rule "test footprint fanout mirror symmetry"
(constraint footprint_fanout_mirror_symmetry (max 0.1mm))
)

View File

@ -70,7 +70,7 @@
"duplicate_footprints": "ignore",
"extra_footprint": "ignore",
"footprint": "ignore",
"footprint_fanout_force": "error",
"footprint_fanout_mirror_symmetry": "error",
"footprint_fanout_torque": "ignore",
"footprint_filters_mismatch": "ignore",
"footprint_symbol_mismatch": "ignore",
@ -234,7 +234,7 @@
"pinned_symbol_libs": []
},
"meta": {
"filename": "footprint_fanout_force.kicad_pro",
"filename": "footprint_fanout_mirror_symmetry.kicad_pro",
"version": 3
},
"net_settings": {

View File

@ -0,0 +1,5 @@
(version 1)
(rule "test footprint fanout point symmetry"
(constraint footprint_fanout_point_symmetry (max 0.1mm))
)

View File

@ -70,8 +70,8 @@
"duplicate_footprints": "ignore",
"extra_footprint": "ignore",
"footprint": "ignore",
"footprint_fanout_force": "ignore",
"footprint_fanout_torque": "error",
"footprint_fanout_mirror_symmetry": "ignore",
"footprint_fanout_point_symmetry": "error",
"footprint_filters_mismatch": "ignore",
"footprint_symbol_mismatch": "ignore",
"footprint_type_mismatch": "ignore",
@ -234,7 +234,7 @@
"pinned_symbol_libs": []
},
"meta": {
"filename": "footprint_fanout_torque.kicad_pro",
"filename": "footprint_fanout_point_symmetry.kicad_pro",
"version": 3
},
"net_settings": {

View File

@ -1,5 +0,0 @@
(version 1)
(rule "test footprint fanout torque"
(constraint footprint_fanout_torque (max 0.1mm))
)

View File

@ -76,8 +76,8 @@
"duplicate_footprints": "ignore",
"extra_footprint": "ignore",
"footprint": "ignore",
"footprint_fanout_force": "ignore",
"footprint_fanout_torque": "ignore",
"footprint_fanout_mirror_symmetry": "ignore",
"footprint_fanout_point_symmetry": "ignore",
"footprint_filters_mismatch": "ignore",
"footprint_symbol_mismatch": "ignore",
"footprint_type_mismatch": "ignore",

View File

@ -70,8 +70,8 @@
"duplicate_footprints": "ignore",
"extra_footprint": "ignore",
"footprint": "ignore",
"footprint_fanout_force": "ignore",
"footprint_fanout_torque": "ignore",
"footprint_fanout_mirror_symmetry": "ignore",
"footprint_fanout_point_symmetry": "ignore",
"footprint_filters_mismatch": "ignore",
"footprint_symbol_mismatch": "ignore",
"footprint_type_mismatch": "ignore",

View File

@ -55,8 +55,8 @@ BOOST_FIXTURE_TEST_CASE( DRCFanoutChecks, DRC_REGRESSION_TEST_FIXTURE )
{
{ "fanout_checks/pad_fanout_ratio", 4 },
{ "fanout_checks/footprint_fanout_combined", 8 },
{ "fanout_checks/footprint_fanout_torque", 4 },
{ "fanout_checks/footprint_fanout_force", 4 },
{ "fanout_checks/footprint_fanout_point_symmetry", 4 },
{ "fanout_checks/footprint_fanout_mirror_symmetry", 4 },
{ "fanout_checks/pad_fanout_via_distance", 2 },
};
// clang-format on