202 Commits

Author SHA1 Message Date
Jeff Young c9e4d8b5c0 Separate post-machining into its own property manager category. 2026-02-25 13:53:47 +00:00
Seth Hillbrand 5d2ee4db9d Skip EvalRules when no custom rules exist
GetSolderMaskExpansion() on PAD, PCB_TRACK, and PCB_SHAPE called
EvalRules(SOLDER_MASK_EXPANSION_CONSTRAINT) unconditionally during
DRC, even when no custom rules existed for that constraint type.

Now check HasRulesForConstraintType() first and fall back to the
direct property lookup chain when no custom rules exist.

Also fix a bug where PCB_TRACK and PCB_SHAPE returned 0 instead of
the board default mask expansion when no local override was set.

Apply the same optimization to solder paste margin lookups. Add
per-provider DRC timing via the existing KICAD_DRC_PROFILE trace mask.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/23213
2026-02-23 11:59:51 -08:00
Seth Hillbrand 80bfe4472c Fix routing perf regression from clearance cache
The clearance cache added in b0d0dd57ef invalidates on every
SetLayer() and SetNetCode() call. The router's rule resolver
calls SetLayer() on dummy board items for every clearance
evaluation during routing. Each call acquires an exclusive
lock and linearly scans the entire cache, but dummy items
never exist in the cache, so this is pure waste.

Skip cache invalidation for items flagged ROUTER_TRANSIENT.
The flag is already set on all dummy items in the rule
resolver.

Also replace the O(n) linear scan in InvalidateClearanceCache
with targeted O(1) hash erasure per copper layer.
2026-02-20 15:05:37 -08:00
Seth Hillbrand 6c9c75eb07 Remove property.h and property_mgr.h from inspectable.h
This breaks the view_item.h -> inspectable.h -> property.h chain that
pulled wx/propgrid/property.h into 150-200 TUs. The lean inspectable.h
now includes only wx/any.h, wx/string.h, wx/variant.h.

Headers using DECLARE_ENUM_TO_WXANY (board_item.h, sch_item.h) retain
their property.h include since the macro requires it.
2026-02-13 19:54:46 -08:00
Seth Hillbrand b0d0dd57ef Add clearance cache to improve clearance outline rendering performance
When displaying pad and track clearance outlines, GetOwnClearance()
was called repeatedly during rendering, re-evaluating DRC rules on
every paint refresh. With complex DRC rules, this caused significant
slowdown.

Add a lazy-evaluated cache in DRC_ENGINE keyed by (UUID, layer) that
stores clearance values. The cache is invalidated when DRC rules
change (in InitEngine) or properties change that could affect clearance
(net, layer, pad type)
2026-01-07 16:59:47 -08:00
Jeff Young d7cd6a6af7 Reconcile old VIATYPE vs. new layer checking.
The GUI nor file tokens can differentiate blind vs buried,
but they do differentiate micro.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/22607
2025-12-31 17:05:11 +00:00
Jeff Young c4b72c386a Formatting. 2025-12-15 16:38:43 +00:00
Jeff Young 7e0f11ff0a Improve code SNR. 2025-12-10 16:34:03 +00:00
jean-pierre charras d494440fbe PCB_ARC: Display angle in Info panel. Fix code used only in debug, usually disabled. 2025-12-04 11:24:33 +01:00
Seth Hillbrand 4f1c0b4a16 Clean up some via validation
Missing a couple of optional parameters when moving panels

Fixes https://gitlab.com/kicad/code/kicad/-/issues/22441
2025-12-02 12:41:31 -08:00
Wayne Stambaugh 83d3f65458 Use correct signature of VIA::Width() to prevent crash.
- Update VIA::GetWidth() to raise an assertion and always return a valid albeit
  most likely incorrect width.

- Fix interactive via placement tool to call the correct VIA::GetWidth() which
  prevents the crash/assertion.  This uses the layer of the shape where the via
  is being placed.

Fixes KICAD-ZY6

(cherry picked from commit 0be18638f8)
2025-12-01 16:17:13 -05:00
Seth Hillbrand 4775140bf1 Fix wxformbuilder version
Unify backdrill nomenclature to "XX Backdrill Must-Cut" specifying the
layer through which the backdrill must pass.
2025-12-01 10:27:03 -08:00
Seth Hillbrand 899d4888aa ADDED: Backdrill support
- Allow setting backdrill (from B.Cu up) and tertiary drill (from F.Cu
  down) width and target layer (backdrill is inclusive)
- Allow setting post machining options (counterbore, countersink)
- Update properties for vias and THT pads
- Add output for Excellon and Gerber drill files as separated files for
  different drill depths
- Add drill map output calling out post-machined holes
- Add STEP export support
- Add 3d-viewer support
- Add 2581 support using backdrill property.  Post machining called out
  in comments
- Add ODB++ support using separate drill file for each depth
- Add DRC check for tracks connected to pad layers that are backdrilled
  or post-machined

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18836
2025-11-29 17:59:31 -08:00
Jeff Young 5644110666 Update location of board-wide tenting settings. 2025-11-25 17:56:28 +00:00
Wayne Stambaugh 6ba805173e Fix false positive warning message when updating board from schematic.
The board connectivity algorithm creates pseudo net names for footprints
that have multiple pads with the same number using a "_N" suffix.  At
some point a change was made to the zone net properties dialog that
allowed choosing a pseudo net name as the net name assigned to the zone.
This caused the netlist updater to trigger a false "zone has no pads
connected" warning because the pseudo net name is not in the schematic
net list.

The warning message was not very helpful. Added the correct zone layers
and the net name assigned to the zone to the message for improved
clarity.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/22133
2025-10-28 11:00:26 -04:00
Seth Hillbrand e28d899d1d Move via validation to VIA class
Adds validation to the default sizes panel and properties panel in
additon to the via dialog

Fixes https://gitlab.com/kicad/code/kicad/issues/19043
2025-10-04 04:36:31 -07:00
Seth Hillbrand 592e8542a3 Fix botched merge
These were in place previously but one of my rebases broke it.  This
should get us back to compiling
2025-09-26 16:15:37 -07:00
Seth Hillbrand 43e327b688 Resolve discrepancy between constraint and disallow
Vias are referred to by their type without combining (e.g. blind/buried)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/13783
2025-09-26 11:41:17 -07:00
Jeff Young 80ca30ac37 Repair missing handling of solder mask expansion on copper shapes. 2025-09-15 11:07:33 +01:00
Jeff Young 8a60893249 Regularize content of item descriptions.
1) Use sentence capitalisation
2) Show text of text items

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21582
2025-08-29 12:03:55 +01:00
Seth Hillbrand 1a4eba56a7 ADDED: Skip Via support
Skip vias are vias that are flashed on their start and end layers but
have no annular rings on the interior layers and do not connect to zones
in those layers

You can now select Annular ring type "Start and end layers only".  This
will prevent annular ring flashing on intermediate layers and zones
fills will provide clearance.  You can still connect tracks to
intermediate layers but preventing that will fall to the designer

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21433
2025-08-07 15:48:10 -07:00
Andrzej Wolski c73d555fe2 ADDED: Lasso selection in pcbnew
Adds a lasso or freeform selection tool to KiCad in addition to standard
rectangular selection.  Adds supporting HitTest routines

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/1977
2025-08-06 16:06:40 -07:00
Jeff Young c758a2fbaf Don't sequence layers when order doesn't matter. 2025-07-14 19:12:44 +01:00
Jeff Young d2a623719b Be consistent about getting board copper layers. 2025-07-09 13:05:22 +01:00
Mark Roszko 907c424f5f Set VIATYPE setting via property type as well 2025-07-06 11:17:41 -04:00
Mark Roszko 30242cca77 Don't allow the property editor to set bad layer pairs for vias 2025-07-06 11:10:39 -04:00
Jeff Young fde693ebe1 Don't overflow trying to draw ticks on ruler (KICAD-9HV). 2025-07-03 16:34:21 -06:00
Jeff Young 5ab735eb93 Ensure algorithmic safety (KICAD-ARX). 2025-07-01 21:42:11 -06:00
Jeff Young b35150abf7 Remove overzealous assert (KICAD-MF5).
(It is still called when using global Edit Tracks & Vias
to set vias to netclass defaults.)
2025-06-30 11:59:08 -06:00
Jeff Young 07b8291173 Remove overzealous assert (KICAD-MH0).
(It is still called with no layer from SWIG.)
2025-06-27 22:59:12 -06:00
Jeff Young 2ce1107e62 Overflow protection (KICAD-ARX). 2025-06-27 22:59:11 -06:00
Mark Roszko 1922cab5f4 Kill the near-global spread of length_delay_calculation.h 2025-06-14 13:32:18 -04:00
Jeff Young ff0f6c448b Performance. 2025-06-08 16:33:05 +01:00
Jeff Young c994b96509 ADDED: custom rules for solder mask & paste margins.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15622
2025-06-03 11:41:27 +01:00
Jon Evans 7e24210b1e API: Use net names, not codes, and allow creating new nets
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21027


(cherry picked from commit 0ff77bd332)

Co-authored-by: Jon Evans <jon@craftyjon.com>
2025-05-30 22:13:44 -04:00
Jeff Young d384790d47 Don't use line styles for solder masks on shapes in 3D viewer.
Also convert hatched fills to solid for solder masks.

Also give track solder masks their specified
expansion when exporting to STEP.

Also implement solder masks for shapes when
exporting to STEP.
2025-04-28 21:46:10 +01:00
Jeff Young c2be7fa3e6 Account for aperture & track masks in plated copper calculations. 2025-04-25 12:23:23 +01:00
Alex Shvartzkop 7d0a001831 Optimize via LOD calculations. 2025-04-25 03:23:45 +03:00
JamesJCode eb17ebee4e Implement time-domain length tuning
- Adds time and delay units
- Adds time domain tuning parameters entry and storage
- Adds pad-to-die delay property
- Adds time domain parameter interface for length / delay calculations
- Adds unit tracking for numerical constants through LIBEVAL
   - Will need future work to truly propagate through binary expressions
- Adds time domain tuning to meander placers
- Adds time delay display to net inspector panel
- Modifies DRC to handle time domain constraints
2025-04-17 21:46:56 +01:00
Jeff Young 8b33b25e83 Use thermal reliefs to guarantee connection to hatched zones.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20447
2025-04-04 22:45:52 +01:00
Alex Shvartzkop 7a04389ac2 Improve pan performance when showing a large amount of TH pads.
See https://gitlab.com/kicad/code/kicad/-/issues/20506

(cherry picked from commit a1a710dfed)
2025-04-04 22:49:05 +03:00
jean-pierre charras 91dda80530 Pcbnew, printing vias: always print the via hole, even for small holes.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20546
2025-04-04 16:40:53 +02:00
Jon Evans dc9fa2e2ac More functional fix for IPC API item modifications
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20206
2025-03-28 20:27:45 -04:00
Jeff Young 07eda5d57e ADDED: report copper area for current selection.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20439
2025-03-27 10:14:30 +00:00
Jeff Young 0a4533703c Performance. 2025-03-24 10:28:41 +00:00
Jeff Young b11b1a6f72 Ease in a bit more fmt::format(). 2025-03-11 10:08:04 +00:00
Jeff Young 727fc9bd06 Fix merge mess-up. 2025-03-07 13:23:57 +00:00
Jeff Young 877c6bce89 Printing is not zoom-specific.
(Some of these items don't currently get printed, but
there's no sense in leaving a latent bug around in case
we ever change our minds.)
2025-03-07 13:01:00 +00:00
Seth Hillbrand 7558b49afd Ensure all via layers are printed 2025-03-06 17:57:34 -08:00
Daniel Treffenstädt 3768221d9c ADDED: Support for IPC-4761 Via protection features
Fixes https://gitlab.com/kicad/code/kicad/-/work_items/18837
2025-03-01 18:02:54 +00:00