Commit Graph

684 Commits

Author SHA1 Message Date
Seth Hillbrand 16e3d40552 ADDED: Display calculated clearance in status bar
In addition to showing resolved clearance, we also show the calculated
clearance in the same method as is used for DRC.  This will allow users
to better examine their system while working.

Fixes https://gitlab.com/kicad/code/kicad/issues/7934
2022-07-21 15:44:48 -07:00
Jeff Young 2de10080cd Add edge and margin clearances to message panel. 2022-07-15 16:14:32 +01:00
Seth Hillbrand a9a5136c1c Always allow blind/buried/micro vias
Removes a nanny setting that prevented the use of
blind/buried/micro-vias without a checkbox.  If the designer does not
want microvias in their board, they simply do not place microvias.
2022-07-12 19:47:31 -07:00
Seth Hillbrand 3081023b5e ADDED: Minimum copper connection width DRC check
Checks all copper connections in each net/layer for minimum width
setting.

Fixes https://gitlab.com/kicad/code/kicad/issues/9870
2022-07-11 19:26:56 +00:00
Jeff Young c7746fa000 Fix copy pasta error.
Fixes https://gitlab.com/kicad/code/kicad/issues/11986
2022-07-08 17:44:36 -06:00
Jeff Young 521b231873 Don't zero out width of shapes on Margin, only Edge_Cuts.
Fixes https://gitlab.com/kicad/code/kicad/issues/11967
2022-07-08 17:27:05 -06:00
Jeff Young 8a9bf02b7e Smarten up silk clearance & tented item handling.
The inspection tool will report whether or not the item is tented
(indicating in that case that any clearance will only be applied
to any hole).

The DRC test ignores tented items without a hole, and runs the
clearance test against the hole for items with a hole.

Fixes https://gitlab.com/kicad/code/kicad/issues/11954

Fixes https://gitlab.com/kicad/code/kicad/issues/11951
2022-07-08 17:27:05 -06:00
Jeff Young f611f9f5d3 Allow zone connection rules to target footprints.
If the pad is set to inherit and a rule targets its parent footprint,
then that rule should fire.
2022-07-08 17:27:05 -06:00
Jeff Young fa2e43f696 Reduce noise in board <-> library footprint tests. 2022-07-08 17:27:04 -06:00
Seth Hillbrand 7f9f37e507 Avoid double-caching FP zones
Leads to crashes/invalid data when multi-threading hits both at same
time
2022-07-05 20:07:18 -07:00
luz paz af6ba1a16e Fix typos in pcbnew sub-directory
Found via `codespell -q 3 -S *.po,./thirdparty,./Documentation/changelogs -L aactual,acount,aline,alocation,alog,anormal,anumber,aother,apoints,aparent,aray,ba,busses,dout,einstance,leaded,modul,ontext,ot,overide,serie,te,,tesselate,tesselator,tht`
2022-06-30 09:39:45 -04:00
Seth Hillbrand 03c279ffd4 ADDED: Threadpool
Thread pools are long-lasting executors that have close to zero overhead
when launching new jobs.  This is advantageous over creating new threads
as we can use this for threading smalling jobs and smaller quanta.  It
also avoids the heuristics needed to determine the optimal number of
threads to spawn
2022-06-24 22:59:24 +00:00
Seth Hillbrand a852286eb5 Cleanup compile warnings 2022-06-21 17:04:56 -07:00
Jeff Young 82ebc247b8 More performance enhancements for DRC. 2022-06-18 19:47:11 +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
Seth Hillbrand 4043dca613 Push wxString allocation to smaller context
Prevents creation of new wxString on stack for each clearance check
2022-06-16 08:26:28 -07:00
Seth Hillbrand 5327b10064 Remove shared wxString instance in DRC
Threaded DRC access will write to this string, re-allocating the memory
without any synchronization between threads using the string.  Comment
adding this listed performance as a reason for using shared strings.
Measured performance does not seem noticeably different in either case,
even with high-error count boards.  If there is a case where the
performance is limiting, we can replace these wxStrings with
std::wstring and utilize fmt

Fixes https://gitlab.com/kicad/code/kicad/issues/9888
2022-06-15 16:46:03 -07: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 d14fd5a9da Fix logic error with silk overlap test. 2022-06-04 19:34:24 +01:00
Jeff Young 8b75a32cfa We only want "actual" shapes, not anything derived from SHAPE.
Also fixes a bug where GetParentFootprint would get confused by
groups.

Fixes https://gitlab.com/kicad/code/kicad/issues/11741
2022-06-04 00:24:27 +01:00
Jeff Young d2a9cbe6e8 Use effective width for DRC.
Fixes https://gitlab.com/kicad/code/kicad/issues/11740
2022-06-03 23:27:10 +01:00
Jeff Young 37838dffb9 Make sure physical_clearance rules are run against courtyard layers. 2022-05-10 23:02:53 +01:00
Jeff Young ecf6773f74 Remove dead code. 2022-05-07 21:10:04 +01:00
Jeff Young 30ecca464d Rename mechanical_clearance -> physical_clearance.
Fixes https://gitlab.com/kicad/code/kicad/issues/11554
2022-05-06 15:54:46 +01:00
Jeff Young dfdedfa605 Fix some issue with NPTH pads with holes same size as pad. 2022-05-06 00:06:00 +01:00
Jeff Young f590dcf513 Fix a couple of typos. 2022-05-06 00:06:00 +01:00
Jeff Young 5d0d2201f3 Improve clearance report messages.
Removes some duplicated terms; puts in some more headers to make
visual parsing easier, and makes non-connected-pads report the correct
data.

Also fixes a bug where zone-connection overrides of none weren't getting
handled correctly.

Fixes https://gitlab.com/kicad/code/kicad/issues/11544
2022-05-03 16:30:04 +01:00
Jeff Young bf2566a44f Post-process board min clearance rather than building it in to netclasses.
The later makes the diagnostic messages harder to decipher.
2022-05-03 13:39:14 +01:00
Jeff Young d192d3c31d Better violation title for disabled layers check.
Fixes https://gitlab.com/kicad/code/kicad/issues/11451
2022-04-25 09:39:49 +01:00
Jeff Young f0dab2e07b Fix some layer handling issues. 2022-04-23 21:29:46 +01:00
Jeff Young e6684bf7c7 Add footprint checks to board-level DRC.
Fixes https://gitlab.com/kicad/code/kicad/issues/11437
2022-04-23 11:34:18 +01:00
Jeff Young 4525b1f085 More consistency in DRC error messages. 2022-04-23 09:39:34 +01:00
Jeff Young 9ff1ae5bdc Better inspection reporting for netclasses, custom rules and DRC. 2022-04-17 00:33:56 +01:00
Jeff Young 7f3a75bccd Add a bunch more inspections for rule resolution. 2022-04-15 22:10:13 +01:00
Seth Hillbrand 819276bd98 DP tolerance needs to be 1IU on each axis
ApproximatelyParallel will only check for parallel within 1 IU, so a 1x1
SEG will always be parallel and the projection is invalid

(cherry picked from commit d0796399a2)
2022-04-11 16:58:10 -07:00
Jeff Young 82820d4b1c Cleanup. 2022-04-09 20:39:35 +01:00
Jeff Young 722b2588f4 Better error reporting for DP uncoupled length.
Fixes https://gitlab.com/kicad/code/kicad/issues/10087
2022-04-08 11:40:53 +01:00
Jeff Young a118249093 NPTHs obey HOLE_CLEARANCE, not CLEARANCE.
Also, plating thickness appears on both walls, so diameter is drill
plus 2X plating thickness.
2022-04-04 20:43:08 +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
Wayne Stambaugh 150859c973 Try Coverity fixes that don't break unit tests. 2022-03-25 16:49:29 -04:00
Wayne Stambaugh 7da7864f5e Fix some Coverity issues. 2022-03-25 15:51:05 -04:00
Jeff Young b679a21651 Zero out parent rule when overridden by local property.
Fixes https://gitlab.com/kicad/code/kicad/issues/11197
2022-03-21 20:49:35 +00:00
Jeff Young cf611f1742 Better safety around layersets. 2022-03-21 18:19:00 +00:00
Jeff Young 5aa561abe1 Add overlapping pad test and share some tests between board & fp editor DRC.
Fixes https://gitlab.com/kicad/code/kicad/issues/10086
2022-03-18 19:58:42 +00:00
Jeff Young 0f359c8a3b Careful of calculated fields when comparing board FPs with library.
Fixes https://gitlab.com/kicad/code/kicad/issues/10143
2022-03-17 13:19:25 +00:00
Jeff Young 62f813fddc Better error reporting for PTH pads. 2022-03-16 14:56:32 +00:00
Jeff Young f596ae3487 Allow mechanical-clearance checks between edge_cuts and other layers. 2022-03-16 14:56:32 +00:00
Jeff Young 600dcd31ad Allow track board edge clearance violations inside the holes of castellated pads.
Fixes https://gitlab.com/kicad/code/kicad/issues/10970
2022-03-15 00:05:23 +00:00
Jeff Young 8d682002c3 Fix previous breakage from shared_ptr going out of scope.
Fixes https://gitlab.com/kicad/code/kicad/issues/10970
2022-03-14 23:57:50 +00:00
Jeff Young e7bf4ab8fa Separate board-edge silk clearance from mask-edge silk clearance.
Fixes https://gitlab.com/kicad/code/kicad/issues/10970
2022-03-14 20:19:09 +00:00
Jeff Young 2ec21c7720 Don't check for board edge collision on castellated pads.
Fixes https://gitlab.com/kicad/code/kicad/issues/10970
2022-03-14 20:19:09 +00: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 ced1e68ea1 A bit of wxT(). 2022-03-13 16:09:06 +00:00
Jeff Young db0b733be5 Clear DRC caches before running soldermask tests again.
Fixes https://gitlab.com/kicad/code/kicad/issues/10922
2022-03-12 19:44:34 +00:00
Jeff Young 89e61ff73b More performance enhancements for DRC. 2022-03-12 14:17:52 +00:00
Jeff Young 6f555b6258 wxT() and some cleanup in DRC. 2022-03-11 23:19:16 +00:00
Wayne Stambaugh eec528ae48 Fix GCC build error on Linux. 2022-03-11 17:03:01 -05: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 663edcf665 Better progress indication for board from hell. 2022-03-09 14:30:21 +00:00
Jeff Young e4b56ab7f1 Performance fixes for the board from hell.... 2022-03-08 23:54:34 +00:00
Jeff Young 1fc99dd2c0 Don't call GetLayer() on a multi-layer object. 2022-03-05 23:07:43 +00:00
Jeff Young 843a56c4e4 Implement two-staged zone priority: assigned priority followed by UUID. 2022-03-01 14:53:35 +00:00
Jeff Young 914e706023 Replace zone-with-no-pads test with isolated copper test.
The later is far more discriminating.

Fixes https://gitlab.com/kicad/code/kicad/issues/11009
2022-03-01 12:02:17 +00:00
Jeff Young 79c7859052 Apply a19d9105f0 to zone case as well.
Also improves on the previous comments.

Fixes https://gitlab.com/kicad/code/kicad/issues/10922
2022-02-21 13:48:34 +00:00
Jeff Young 86988225c3 Exclude some fab attrs from library parity check.
Also excludes zone outline hatching, which is just a visualization
property.

Fixes https://gitlab.com/kicad/code/kicad/issues/10903
2022-02-19 14:59:50 +00:00
Seth Hillbrand a19d9105f0 Fix SolderBridge check to only check across multiple
We should not generate an error when overlapping a single copper element
with a soldermask that is not associated with copper.

Fixes https://gitlab.com/kicad/code/kicad/issues/10906
2022-02-18 11:47:28 -08:00
Jeff Young 6f6cf995ba Don't ask for layer of multi-layer item. 2022-02-18 14:53:10 +00:00
Jeff Young 1ee3ce45e8 Don't ask for layer of multi-layer objects. 2022-02-18 14:19:13 +00:00
Jeff Young ce0233577b Don't try to fetch layer of multi-layer objects. 2022-02-18 13:20:36 +00:00
Jeff Young e09ecd8380 Don't ask for layer of multi-layer objects. 2022-02-18 13:20:36 +00:00
Jeff Young 2172810600 Performance: better sharing of zone fills. 2022-02-15 19:19:03 +00:00
Jeff Young 3deaf902bb Retire the V5 zone fill algorithm.
Fixes https://gitlab.com/kicad/code/kicad/issues/10578
2022-02-11 13:10:52 +00:00
Jeff Young 50a4d610a6 Be cognizant of flashed layers when generating pad shapes. 2022-02-11 13:10:52 +00:00
Jeff Young ca56de7816 Show DRC overflows in both tab titles and number badges.
Fixes https://gitlab.com/kicad/code/kicad/issues/10617
2022-02-09 17:04:32 +00:00
Wayne Stambaugh 06e00c7957 Fix shadow variable compile warning in text DRC provider. 2022-02-08 09:26:12 -05:00
Jeff Young 3b5474f190 Don't punt on TrueType char thickness; analyze it.
Fixes https://gitlab.com/kicad/code/kicad/issues/10740
2022-02-08 14:10:37 +00:00
Jeff Young 137edbe3f3 Add disclaimer for TrueType fonts to thickness test.
Fixes https://gitlab.com/kicad/code/kicad/issues/10740
2022-02-08 14:10:37 +00:00
Jeff Young 3c5ae6d317 Don't let zone cutout on different layer confuse us about intersections.
Fixes https://gitlab.com/kicad/code/kicad/issues/10583
2022-02-08 14:10:37 +00:00
Jeff Young 091055fa1d Don't count track as a pre-existing connection. 2022-02-08 14:10:37 +00:00
Jeff Young 5ce559176d Overhaul the font metrics calcs for overbar, italics and bboxes. 2022-02-07 17:36:40 +00:00
Jeff Young e59aaf05c6 Make sure that GetConnectedItems searches from the root item.
Fixes https://gitlab.com/kicad/code/kicad/issues/10583
2022-02-06 19:43:25 +00:00
Jeff Young b2e3f03222 More wide-string declarations. 2022-02-05 22:03:04 +00:00
Marek Roszko 193dee11e8 Add missing null check PVS V595 2022-02-05 11:25:09 -05:00
Jeff Young c8d14ade65 Only run starved-thermals checks when pad is actually connected to zone.
Fixes https://gitlab.com/kicad/code/kicad/issues/10583
2022-02-02 13:09:27 +00:00
Jeff Young 63a3b1e20a Estimate outline font thickness for DRC readability checks. 2022-02-01 12:01:04 +00:00
Jeff Young 1f8c29c395 Coverity fixup. 2022-02-01 12:01:04 +00:00
Jeff Young 5739505aa3 TextBoxes for PCBNew. 2022-01-31 20:00:47 +00:00
Seth Hillbrand c01e2dcfec Fix large memory leak in DRC
All elements get effective shapes, many of which get triangulated.  This
memory needs to be freed when destroying the tree

(cherry picked from commit c2707f3cc0)
2022-01-28 17:08:33 -08:00
Jeff Young 29841ba315 Bring ERC & DRC dialogs into parity.
Fixes https://gitlab.com/kicad/code/kicad/issues/9350
2022-01-22 22:27:41 +00:00
Jeff Young 14006495d5 Angle cleanup. 2022-01-20 22:35:41 +00:00
Jeff Young 038db715a3 Move zone hatch orientation to EDA_ANGLE. 2022-01-19 00:34:03 +00:00
Jeff Young f60c05fc67 Use epsilon compartor for doubles. 2022-01-18 18:40:55 +00:00
Jeff Young 8c246a761d Move EDA_ANGLE from int to double. 2022-01-17 20:57:54 +00:00
Jeff Young 0967cc82e2 Exclude rules which match no enabled layers.
Fixes https://gitlab.com/kicad/code/kicad/issues/10227
2022-01-15 01:30:03 +00:00
jean-pierre charras bc77a1e2dd drc_test_provider_library_parity: fix a crash due to a incorrect if()...else() logic.
The incorrect logic allowed execution of the else sequence when it should not be executed.
2022-01-14 18:17:27 +01:00
Jeff Young 07013d00e1 More EDA_ANGLE. 2022-01-14 16:08:19 +00:00
Jeff Young abd3f5bc2b Move footprints to EDA_ANGLE. 2022-01-14 16:08:18 +00:00
Jeff Young d485eb2514 Move pads to EDA_ANGLE. 2022-01-14 16:08:18 +00:00
jean-pierre charras cf11abda3d Fix test_drc_regressions.cpp: disable tests that need a footprint library
DRCE_LIB_FOOTPRINT_ISSUES and DRCE_LIB_FOOTPRINT_MISMATCH imply a library
but the test cases do not have a library.
2022-01-12 15:57:41 +01:00
jean-pierre charras ea3efac2b6 drc/drc_test_provider_library_parity.cpp: protect against null pointer use.
qa tests, test_solder_mask_bridging.cpp: filter not relevant DRC tests
2022-01-12 14:41:11 +01:00