65 Commits

Author SHA1 Message Date
Jeff Young
96fa79cef2 Minor performance optimizations. 2025-06-03 11:41:27 +01:00
Seth Hillbrand
fd3620296b Remove errant printf 2025-05-08 15:55:30 -07:00
Seth Hillbrand
97296a3b08 Properly handle arc coupled items
When arcs do not share a center, the circle formed by the arc will be
closer on one side than the other.  When this happens, the NearestPoints
calculation was accidentally taking the distance from the wrong side of
the circle.

Note that this was likely due to the conventions for Rotate (positive =
reduce angle) being mixed up with angular addition

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20636
2025-05-07 13:12:05 -07:00
Jeff Young
e64c7a4aba Don't apply coupling rules to tuning patterns. 2025-05-06 17:54:25 +01:00
Jeff Young
6307058ac8 Formatting and reduced reliance on dyn_cast. 2025-05-06 12:03:09 +01:00
jean-pierre charras
66a7abca09 DRCE_DIFF_PAIR_GAP_OUT_OF_RANGE: use a better position for the marker.
It was put at arc center. Now put on arc middle.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20636
2025-04-13 18:01:44 +02:00
jean-pierre charras
8528151a2b Fix incorrect format for a message 2025-01-17 11:54:14 +01:00
Jeff Young
21fb208d52 Fix a bad format stmt argument type. 2025-01-14 17:38:24 +00:00
Seth Hillbrand
3e8791b88d Fixup multiple issues with DP checks
Handle arcs properly even when not exactly concentric.  Properly check
for interfering elements that would prevent coupling.  Avoiding those
that are directly connected

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17967
2025-01-13 16:11:16 -08:00
Seth Hillbrand
0b2d4d4879 Revise Copyright statement to align with TLF
Recommendation is to avoid using the year nomenclature as this
information is already encoded in the git repo.  Avoids needing to
repeatly update.

Also updates AUTHORS.txt from current repo with contributor names
2025-01-01 14:12:04 -08:00
Seth Hillbrand
6be6680d8c Fix DRC error with arcs
When two arcs only barely overlapped, we cannot predict the actual point
ends as they exist in the error margins.  Since arc tracks have
different radii by definition, rounding errors in calculating the
overlap angle led to some mistaken identification of parallel segments.

This adds an advanced config flag to set the preferred cutoff point
(currently 0.001°) for whether two arcs actually overlap in shared angle
space
2024-10-21 13:37:28 -07:00
Seth Hillbrand
015b93b474 Fixup arc check in dp coupled
Handle arcs starting at candidate end point.
Fix total arc size

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17967
2024-05-30 22:45:33 -07:00
Seth Hillbrand
75ab3d9e8b Handle arcs dp coupling
Calculate coupled arcs and spacing

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17967
2024-05-30 16:11:12 -07:00
Jeff Young
652c1d4006 Formatting. 2024-05-30 13:12:53 +01:00
Jeff Young
d51e058e24 Move diff-pair netname resolution to BOARD.
Also adds reporting of dp gap constaints and max uncoupled to track
selections, and max uncoupled during routing.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/13748
2023-10-15 22:46:23 +01:00
Wayne Stambaugh
a1fb8e1b1d Coverity fixes and code cleaning. 2023-03-06 07:12:18 -05:00
Wayne Stambaugh
789bf6455a Coverity fixes and code cleaning. 2023-03-02 09:04:47 -05:00
Jon Evans
26b9d2f5ac DRC: Allow disabling DP constraints in specific areas
Fixes https://gitlab.com/kicad/code/kicad/-/issues/13743
2023-02-01 23:11:39 -05:00
Jon Evans
12b0a12d74 Handle DP checks for board minimum rules
Fixes https://gitlab.com/kicad/code/kicad/-/issues/13640
2023-01-23 17:45:16 -05: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
9119b5072a Respect DRCEpsilon in diff-pair coupling test.
Fixes https://gitlab.com/kicad/code/kicad/issues/12587
2022-10-06 22:18:53 +01:00
Jeff Young
d6c7f46842 Formatting. 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
Jeff Young
854acd4c77 Null-ptr safety for diff-pair-coupling test.
Fixes https://gitlab.com/kicad/code/kicad/issues/12329
2022-09-02 00:49:33 +01:00
Seth Hillbrand
f1261e71d4 Replace boost::optional with std::optional 2022-08-25 15:50:47 -07: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
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
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 d0796399a248f3ca3154c6ec250cc7ecf3f8143e)
2022-04-11 16:58:10 -07: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
6f555b6258 wxT() and some cleanup in DRC. 2022-03-11 23:19:16 +00:00
Jeff Young
663edcf665 Better progress indication for board from hell. 2022-03-09 14:30:21 +00:00
Jeff Young
ab583a32f9 Better layer handling for DRC markers.
Fixes https://gitlab.com/kicad/code/kicad/issues/10126
2021-12-26 15:06:12 +00:00
Jeff Young
5f37c2b247 Custom rule severities.
ADDED severity token to custom rule syntax.  Each rule can now define
its own severity.

Fixes https://gitlab.com/kicad/code/kicad/issues/6148
2021-12-24 15:42:22 +00:00
Jeff Young
0a609dd48d Add footprint library checking to DRC.
Fixes https://gitlab.com/kicad/code/kicad/issues/6821
2021-12-23 19:18:45 +00:00
Jeff Young
096e342386 Prefix TRACK, ARC and VIA. 2021-06-11 22:07:02 +01:00
luz paz
f968fc8719 Fix source comment / documentation typos 2021-06-09 19:32:58 +00:00
Ian McInerney
4f05262705 Cleanup includes in board.h and footprint.h 2021-06-03 20:19:52 +01:00
Seth Hillbrand
f40f696c37 Don't extract dp segment info from minimal-length
segments with 1IU of length are approximately parallel to everything and
the distance projections break down into rounding errors

Fixes https://gitlab.com/kicad/code/kicad/issues/8541
2021-06-03 08:44:17 -07: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
Jon Evans
6381ffd10a Fix diff pair coupling test when gap constraint is in a different rule
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8519
2021-05-31 10:13:05 -04:00
Jeff Young
6272b48481 Make sure layer gets passed in to rules evaluation. 2021-02-08 14:53:49 +00:00
Jeff Young
018c17399d SNR. 2021-01-01 23:17:49 +00:00
Jon Evans
bc712a7383 Remove some stray printfs 2020-12-29 14:58:45 -05:00
Wayne Stambaugh
dd4298bb94 Coverity fixes: 280374, 313611, 313648, 313649, and 314720. 2020-12-11 13:29:52 -05:00
Ian McInerney
be4b6ec06a Cleanup compiler warnings 2020-12-09 23:13:33 +00:00
Jeff Young
b1f0bf7334 More consistent naming. 2020-12-08 13:05:39 +00:00
Jeff Young
9c7c05c161 Mostly formatting cleanup but a few type-casting cleanups too. 2020-11-24 22:16:41 +00:00
Jeff Young
84dd5108ba Remove some "class_" prefixes from files. 2020-11-13 15:16:23 +00:00
Jeff Young
f7333ad64a Update some classnames including archaic zone names. 2020-11-12 10:31:25 +00:00