Commit Graph

661 Commits

Author SHA1 Message Date
Jeff Young 1a672aba56 Fix a couple of DRC bugs where the bbox wasn't inflated for largestClearance.
Also removes a case of double-testing a pad with a non-plated hole.
2022-08-26 13:22:57 +01:00
Jeff Young 909358e643 Make sure pair caches are layer-specific where they need to be. 2022-08-26 13:22:57 +01:00
Jeff Young 86944c4f9f Marginal performance improvements. 2022-08-26 13:22:57 +01:00
Seth Hillbrand f1261e71d4 Replace boost::optional with std::optional 2022-08-25 15:50:47 -07:00
Jeff Young 792d7babe3 Performance (std::map -> std::unordered_map) and commenting. 2022-08-22 12:43:57 +01:00
Jeff Young 46df421064 ADDED defined pad groups for net-tie footprints
Each pad group is allowed to short nets with other pads in its group.

Legacy footprints with the "net tie" keyword hack will get a single
group auto-created with all the footprint's pads in it.

DRC and the router now allow a track to collide with copper graphic items
while entering a net-tie pad as long as the closest point in the collision
is within the pad.

DRC (and the footprint checker) now check for copper items in the
footprint shorting pads which are not in the same pad group.

Fixes https://gitlab.com/kicad/code/kicad/issues/2265
2022-08-19 18:54:20 +01:00
Marek Roszko 3a718385cf Just match the type to the comparison type on second thought 2022-08-18 22:22:04 -04:00
Marek Roszko 675938375b Use a larger data type for min_dist
Squared norms are massive and can logically exceed 32-bit ints
2022-08-18 22:19:36 -04:00
Seth Hillbrand b9461f2ba7 Re-enable tests for zones
Avoid invalid substantial checks triggered by signed floating point
zeros.  Adds a QA check to ensure zone-self checks are maintained
2022-08-18 17:06:29 -07:00
Seth Hillbrand 35ac39844f Clean up some auto usage
Don't make new copies of shared_ptr if we can use references.  Keep auto
usage down to hard-to-type-out sequences
2022-08-15 11:29:45 -07:00
Jeff Young 1f347582f8 Introduce new marker type so we can track DRC errors on the drawing sheet.
Fixes https://gitlab.com/kicad/code/kicad/issues/12221
2022-08-15 18:03:03 +01:00
Jeff Young 86938aa425 Read, write and process the board-wide Allow soldermask bridges in FPs. 2022-08-14 22:56:29 +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 a11f48ef10 Markers provider is no longer responsible for all markers.
Unconnected items and schematic partity violations are also now
represented by markers, so the ERC/DRC window itself needs to do
the deep-delete.

Fixes https://gitlab.com/kicad/code/kicad/issues/12182
2022-08-08 22:02:20 +01:00
Jeff Young 015bde8cb0 Test pad:hole violations in footprints as long as not same pad number.
Fixes https://gitlab.com/kicad/code/kicad/issues/12124
2022-08-07 19:49:39 +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 9a4136de00 Implement annular ring checking for pads.
Fixes https://gitlab.com/kicad/code/kicad/issues/12109
2022-08-01 17:45:34 +01:00
Jeff Young f3936f24ae Go back to single-threaded sliver checker.
Something was unhappy with the multi-threaded version.
(Note that we still multi-thread the polygon-building, which is the
most expensive part.)
2022-08-01 17:45:34 +01:00
Jeff Young 7556d7152f Fix errant return and improve progress reporting. 2022-08-01 13:09:51 +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 0304ad4494 Move connection width testing to rule system.
Also copies connection width progress reporting architecture over to
the sliver checker.
2022-08-01 13:09:51 +01:00
Jeff Young f2f04b1d20 Better progress reporting for thermal connections. 2022-08-01 13:09:51 +01:00
Jeff Young b0a9cea6f6 Better progress reporting, and don't report necks that don't have items.
Since we aren't searching zones (they aren't in the m_CopperItemRTreeCache)
this will drop all errors that are zone-only (which are better handled by
zone-min-width).
2022-08-01 13:09:51 +01:00
Jeff Young 54213bb7f1 Cleanup and move to DRC_ENGINE's status reporter.
1) brace formatting
2) get rid of some autos
3) get rid of a dyn_cast that CLion claims is bad
4) use DRC_ENGINE's status reporter
2022-08-01 13:09:51 +01:00
Jeff Young bf5e649e44 Fix log errors in new solder masking checking code. 2022-07-23 09:26:04 +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 a2c002e1da Improve solder mask aperture testing.
1) For solder mask apertures report both the aperture and both
exposed items.

2) Don't process solder mask apertures in footprints with the
"bridging allowed" flag set.

Fixes https://gitlab.com/kicad/code/kicad/issues/12064
2022-07-22 23:06:07 +01:00
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