Commit Graph

26 Commits

Author SHA1 Message Date
Seth Hillbrand f74d1060d4 Ensure that the copper conn check re-adds epsilon
When checking if the particular rule is what is being checked, we rely
on the value of the minimum width.  Since we modified that to allow
width checking, this re-adds it for the comparison
2024-05-22 16:30:09 -07:00
Seth Hillbrand bce560d05f Include DRC Epsilon in connection width checker
Avoids rounding errors flagging connections too small by nanometers
2024-05-22 16:15:51 -07:00
Seth Hillbrand c841d0df6d Handle small holes in DRC Connection width test
If there is a small hole (smaller than the conn width), we can loop
around in a circle checking all points and not move past the mimimum
distance.

To avoid this, if we detect a loop, we exit the substantial checker.
This should return with true because a large hole will return true and
we are only checking to see if there is a minimum amount of copper
between two open areas
2024-03-30 07:58:34 -07:00
Jeff Young aa4107ce2d Code cleanup (and Coverity quieting). 2024-01-04 14:35:08 +00:00
Marek Roszko 4d77fd48ef Shove thread_pool to core 2023-09-06 17:50:12 -04:00
jean-pierre charras 21f2f98270 drc_test_provider_connection_width: fix crash due to a null pointer.
Fix a crash (tested on W10 - MSYS2) when running DRC on the board
attached to issue #15005
Fixes #15005
https://gitlab.com/kicad/code/kicad/-/issues/15005
2023-06-20 16:32:07 +02:00
qu1ck 0c049eccc7 Fix a bunch of compiler warnings 2023-04-11 17:01:30 +00:00
Seth Hillbrand 914b5a4d21 Simplify test for substantial nubs
Substantial elements following a divot should be at least as far in each
cardinal direction from the origin point in order to be considered
substantial.  This catches cases where the "substantial" element is
actually a straight segment away from the divot

Fixes https://gitlab.com/kicad/code/kicad/issues/14130
2023-03-22 13:01:50 -07:00
Seth Hillbrand 7653a2bf99 Smarten connection width checker looking for splits
Fractured polygons are always fractured along the x-axis, so when
checking to see if a segment is a fracture point, we check if the y
coordinate is equal.  This avoids situations where there are multiple
fracture points between two inflection points

Additionally, we add a second check to ensure we don't hit spurious
blobs (all kinks should be symmetric and therefore be substantial in
each direction)

Fixes https://gitlab.com/kicad/code/kicad/issues/14130
2023-03-06 16:14:34 -08:00
Seth Hillbrand a0f99ea8ba Allow for rounding error in connection width checker
We perform checks using squared distance but this loses the integer
rounding in the standard norm.  To correct for this, we allow a single
IU in the restriction, allowing fractionally smaller connection widths
before calculating the squared limit

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

Fixes https://gitlab.com/kicad/code/kicad/issues/14131
2023-02-28 15:26:16 -08:00
Seth Hillbrand e7fe69b97f Better handling of vertex sorting
Nominally, the zcode of a vertex is unique.  This is not 100% true,
however, as we must interlace two 32-bit numbers into a single 32-bit
number.  Sorting needs to account for the possibility that the zcode
will be the same while other elements of the vertex are different.  This
commit fixes the broken boolean logic to more clearly handle these cases

Fixes https://gitlab.com/kicad/code/kicad/issues/13867
2023-02-13 11:21:04 -08:00
Seth Hillbrand b5bd633625 Strict-order points in connection_width
The connection width checker uses morton codes to order elements.  The
sort should be primarily morton-based but needs to be stable in order to
ensure that nextZ/prevZ elements are properly placed as the actual
next/prev elements in the list.  Otherwise, hitting a fracture point
might make us skip in the wrong direction

Fixes https://gitlab.com/kicad/code/kicad/issues/12831
2022-12-03 16:03:43 -08:00
Jeff Young d16b23d16e Name shortening and line-break reduction. 2022-10-21 18:41:39 +01:00
Jeff Young 098e96f1c7 Use more precise formatting in DRC messages when less precise values are identical.
Fixes https://gitlab.com/kicad/code/kicad/issues/12587
2022-10-06 22:18:53 +01:00
Jeff Young 64a6fc0fd4 Push UNITS_PROVIDER down into a low-level mixin.
This allows us to also construct cheap UNIT_PROVIDERs for specific
tasks when necessary.
2022-09-19 17:10:59 +01:00
Mark Roszko b00178adb3 Nuke base_units from orbit 2022-09-16 04:38:10 +00:00
Seth Hillbrand 26a1114e3c Avoid Yields when the results are ready
We always need to check for calculation results before yielding the
system otherwise we will delay outcomes

Fixes https://gitlab.com/kicad/code/kicad/issues/12228
2022-09-14 13:30:04 -07:00
Jeff Young 792d7babe3 Performance (std::map -> std::unordered_map) and commenting. 2022-08-22 12:43:57 +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
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 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 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
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