Commit Graph

140 Commits

Author SHA1 Message Date
Jeff Young cb53a18ee3 Bug fixes for handling boolean flags in DRC rules. 2023-05-26 18:44:33 +01:00
Jeff Young af7753c7cd Record parent rule for DRC assertions.
(Particularly important if the rule specified a severity.)

Also fixes a bug looking up LSET layer names in the
GetStandardLayerNames array (which aren't the same).

https://forum.kicad.info/t/a-few-questions-about-custom-rules-syntax/40068/7
2023-04-30 13:01:09 +01:00
Jeff Young 8260f0ee13 Add support for unitless values to PCB_EXPR_EVALUATOR.
Fixes https://gitlab.com/kicad/code/kicad/issues/13016
2022-11-29 14:24:20 +00:00
Jeff Young d16b23d16e Name shortening and line-break reduction. 2022-10-21 18:41:39 +01:00
Jeff Young 51c20da93e Areas might have layers defined in area as well as rule.
Fixes https://gitlab.com/kicad/code/kicad/issues/12584
2022-10-07 23:52:47 +01:00
Jeff Young e49de68a59 Implement a more durable zone bounding box caching strategy.
Fixes https://gitlab.com/kicad/code/kicad/issues/10821
2022-10-01 22:10:43 +01:00
Jeff Young b6efb88ee9 Fix logic error when filling zones.
Fixes https://gitlab.com/kicad/code/kicad/issues/12542
2022-09-29 17:46:24 +01:00
Jeff Young cf1565a16a Bug fixes for layer expression processing.
1) Push a VAR onto the stack, not a resolved value
2) Don't collapse a PCB_LAYER_VALUE to a VALUE during processing
3) Make sure we run overloaded operators from the correct side

Fixes https://gitlab.com/kicad/code/kicad/issues/12437
2022-09-16 14:14:43 +01:00
Mark Roszko b00178adb3 Nuke base_units from orbit 2022-09-16 04:38:10 +00:00
Jeff Young b4492e0bd2 More EDA_RECE yeetage. 2022-08-31 17:19:50 +01:00
Jeff Young 2dc6300501 Move EDA_ITEM bounding boxes to BOX2I. 2022-08-31 10:16:55 +01:00
Jeff Young 77c79b6f6a Apply searchArea architecture to courtyard functions. 2022-08-28 21:20:03 +01:00
Jeff Young 667a54ad86 Retire insideArea in favour of intersectsArea and enclosedByArea. 2022-08-28 18:02:41 +01:00
Jeff Young f99761e5bd entirelyInsideArea() prototype. 2022-08-26 13:22:57 +01:00
Jeff Young a9536b5de9 CHANGED netclass assignments now done via canvas or via patterns. 2022-08-14 22:56:29 +01:00
Jeff Young 96f01d33c8 Performance improvements.
1) Move a bunch of std::map's to std::unordered_map to get constant-time
look-ups
2) Lengthen progress-reporting intervals to spend more time doing work
and less time talking about it
3) Reverse order of SHAPE_LINE_CHAINs in thermal intersection checks to
make (much) better use of bbox caches
4) Don't re-generate bboxes we already have
5) Fix some autos that weren't by reference (and were therefore copying
large datasets)
6) Rename delta progressDelta so it's easier to search for in future
7) Get rid of a few more autos (because I don't like them)
8) Pass large items to lambdas by reference

Fixes https://gitlab.com/kicad/code/kicad/issues/12130
2022-08-03 11:59:42 +01:00
Jeff Young 43df863df2 Fix issue with caches not being initialized when printing msg bar. 2022-08-01 13:09:51 +01:00
Jeff Young f41af10007 Clean up hole shapes for safety (smart pointer) and consistency. 2022-07-22 23:06:07 +01:00
Jeff Young 97b0005780 More caching for DRC.
Also fixes a bug where some physical clearance tests would be run even
if the clearance was 0 (or if the rule was set to IGNORE).
2022-06-17 23:58:31 +01:00
Jeff Young 5e80e2a421 58f553a9ca requires that cache be layer-sensitive.
Fixes https://gitlab.com/kicad/code/kicad/issues/11814
2022-06-15 00:30:11 +01:00
Jeff Young 4b668269b7 Don't try and use zone fill before it's been calculated. 2022-05-16 15:20:01 +01:00
Jeff Young f7cdc7af75 Apply a more sophisticated test for ignoring isInCoupledDiffPair.
The basic problem is that the DRC engine does length testing and skew
testing by collecting all the diff pair constituent parts and pairing them
itself.  Since each part is collected on its own, we need to ignore the
'B' unit when evaluating any conditional expressions.  However, doing this
in general means that when evaluating "OwnClearance()" we also ignore the
'B' unit and return the diff pair CLEARANCE_CONSTRAINT when we shouldn't.

This implements a more discerning test which know what the current requested
constraint is when evaluating expressions.

See also https://forum.kicad.info/t/solved-custom-differencing-rule-not-working-drc/34034/6

Fixes https://gitlab.com/kicad/code/kicad/issues/11314
2022-04-02 15:12:42 +01:00
Jeff Young 65185f53a1 Rotate fp zones before comparing with library versions.
Also includes some performance fixes to not copy around triangulation
data when it's not needed.

Fixes https://gitlab.com/kicad/code/kicad/issues/10143
2022-03-14 15:53:24 +00:00
Jeff Young ae307e1b34 Parallelize DRC triangulation, keepout processing, and sliver checking.
Also fixes issue with adding fractured polygons in sliver checking which
slowed the board from hell down to less than a crawl.
2022-03-11 20:52:11 +00:00
Jeff Young 392a3ec131 Fix typo which leads to catastrophic performance on boards with tons of zones. 2022-03-08 20:16:37 +00:00
Seth Hillbrand c18d9b9baf Normalize `IsInsideCourtyard` 2022-03-04 15:49:02 -08:00
Jeff Young 8f670552a6 Allow Rule Areas on all physical layers.
Required to do things like modify silk_clearance rules.
2022-02-17 23:59:09 +00:00
jean-pierre charras 876061369b Fix some Pcbnew crashes due to null pointers 2022-02-14 13:46:05 +01:00
Jeff Young fe7e72538e Don't force user to be overly pedantic when writing diffpair rules. 2022-02-13 18:16:13 +00:00
Jeff Young 8dcc933fc3 Don't use bounding box cache during insideArea.
For starters we can't rely on it having been updated, but we also
cache the entire result so there's no huge cost-savings anyway.

Fixes https://gitlab.com/kicad/code/kicad/issues/10821
2022-02-12 18:38:11 +00:00
Jeff Young 7ccac79192 More wxString wide literals. 2022-02-05 21:29:34 +00:00
Jeff Young 6cec58cf75 Add field access to custom DRC rules.
ADDED getField() method to custom DRC rules.
2021-12-24 18:13:00 +00:00
Seth Hillbrand b88473e41f Respect context layer in eval
When testing for a specific layer context, we should only return true if
the item either exists on that layer or if the context layer is
UNDEFINED_LAYER, meaning the layer value is not material to the test

Relates to https://gitlab.com/kicad/code/kicad/-/issues/9366
2021-10-15 10:35:29 -07:00
Seth Hillbrand 58f553a9ca Check for layer when DRC on vias and non-zone items
We were already checking for zone-zone overlap but missing checks when
running against (possibly) buried vias as well as the general check

Fixes https://gitlab.com/kicad/code/kicad/issues/9366
2021-10-11 10:33:50 -07:00
Jeff Young b9ffe2aca8 Don't capture stack-defined lambdas by reference. 2021-08-21 22:49:57 +01:00
Seth Hillbrand 3b3cb88ad9 Remove shadowed variable in lambda 2021-08-21 14:01:20 -07:00
Jeff Young eb85af3366 Don't capture references to local stack variables. 2021-08-21 21:40:17 +01:00
Jeff Young 048e13f423 Defer DRC rule function eval to make use of short-circuit bools.
The lemon parser doesn't lend itself to short-circuiting booleans,
but if we defer processing until we fetch the second value when
processing the TR_OP_BOOLEAN opcode then we get to piggy-back on
C++'s boolean short-circuiting.
2021-08-21 16:43:11 +01:00
Jeff Young 1a252b4f96 Add a compile error for ill-defined rules, and more performance.
Also adds const-safety to GetBoard().
2021-08-16 12:14:17 +01:00
Jeff Young f34e280c81 Garden-variety 100X performance improvement.
Adds a compile mode for layer strings.
2021-08-15 22:24:51 +01:00
Jeff Young 1ec70d30af Cherry-pick some 7.0 Clearance Resolution improvements.
6.0 will be in the field for a long time, and the better the debugging
tools we have available the less costly it will be to maintain.

Fixes https://gitlab.com/kicad/code/kicad/issues/8961
2021-08-15 19:03:58 +01:00
luz paz 0446d35f0d Fix source comment/doc typos (follow-up)
Found via `codespell -q 3 -S *.po,./thirdparty -L aactual,acount,aline,alocation,alog,anormal,anumber,aother,apoints,aparent,aray,dout,einstance,modul,ot,overide,serie,te,,tesselate,tesselator,tht`
2021-07-13 10:48:17 +00:00
Jeff Young a89f6404b4 Fix logic bug found by Coverity. 2021-06-24 12:18:22 +01:00
Jeff Young 096e342386 Prefix TRACK, ARC and VIA. 2021-06-11 22:07:02 +01:00
Marek Roszko 10e60acf34 Clean up including of board_design_settings.h 2021-06-06 15:03:42 -04:00
Ian McInerney 4f05262705 Cleanup includes in board.h and footprint.h 2021-06-03 20:19:52 +01:00
Ian McInerney 23f8851409 Remove pcb_group include from board header 2021-06-03 20:03:31 +01:00
Jeff Young 00ed75b891 Fix DRC performance with multi-layer keepout zones.
The main issue was a parameter mismatch which caused On^2 behaviour
for zone layers.

But there are several other performance optimizations here, along
with status bar updating for zones while running the dissallow test.

Fixes https://gitlab.com/kicad/code/kicad/issues/8521
2021-06-02 14:11:43 +01:00
Marek Roszko cf2bb5692a Remove the wxLog calls from math/util.h for now
This was leaking windows headers and partial wx headers to 1084 compilation units......
This also means math/util.h is leaking to 1084 compilation units which seems a bit high too.
2021-06-01 18:44:22 -04:00
Jeff Young d12e5d824e Renaming for clarity and a performance improvement in corner rounding. 2021-06-01 23:11:54 +01:00