KiKit icon indicating copy to clipboard operation
KiKit copied to clipboard

DRU processing: hasNetclass(): netclass name not prefixed (Board_N-...)

Open markh-de opened this issue 8 months ago • 0 comments

Prerequisites

  • [x] I have read FAQ
  • [x] I have searched existing issues (including closed ones)
  • [x] I use KiKit at least version 1.7.2 (older version are not supported)

KiKit version

1.7.2

KiCAD version (only KiCAD 8 and 9 are supported)

9.0.1

Operating system

Ubuntu Linux 24.04.2 LTS

Description

I think the feature of having multiple netclasses is relatively new in KiCad (release 9?), and probably so is the DRU condition hasNetclass().

When processing the DRU file, KiKit does not prepend the board name to the netclass name (hasNetclass() argument) when copying the DRU rule.

The source rule:

(rule "[Project] Keep outer Cu pours away from 100R DP traces"
    (constraint clearance (min 1.000mm))
    (condition "A.Type == 'Zone' && A.Name == 'OUTER_POUR' && B.hasNetclass('DP_100R')")
)

... should result in the following for the panel:

(rule "Board_0-[Project] Keep outer Cu pours away from 100R DP traces"
    (constraint clearance (min 1.000mm))
    (condition "A.Type == 'Zone' && A.Name == 'OUTER_POUR' && B.hasNetclass('Board_0-DP_100R')")
)

because the netclass DP_100R was copied to Board_0-DP_100R.

However, we get a copy of that rule for Board_0-, but without the prefix in the argument of the hasNetclass() condition:

(rule "Board_0-[Project] Keep outer Cu pours away from 100R DP traces"
    (constraint clearance (min 1.000mm))
    (condition "A.Type == 'Zone' && A.Name == 'OUTER_POUR' && B.hasNetclass('DP_100R')")
)

This needs to be supported, as otherwise rules are not properly applied and designs may be exported incorrectly (wrong clearances etc.).

Thank you for KiKit!

Steps to Reproduce

  • Have custom DRC rules (DRU file) using the hasNetclass() condition
  • Create a panel of that design
  • Miss the prefixed netclass names in the Board_N- copies of the custom rules

markh-de avatar Apr 30 '25 07:04 markh-de