56 Commits

Author SHA1 Message Date
Jon Evans ac8f0096ce Lazy-allocate a few pad and padstack things 2026-03-19 21:32:07 -04:00
Seth Hillbrand f6e62961a4 pcbnew: fix crash when setting Custom padstack mode on flipped footprint pad
PADSTACK::CopperLayer() (const overload) used m_copperProps.at(ALL_LAYERS)
as a final fallback.  For CUSTOM padstacks, ALL_LAYERS == F_Cu is the only
key present after a freshly-created CUSTOM padstack (converted from NORMAL).

When a pad belonging to a flipped footprint was edited in the Pad Properties
dialog, TransferDataFromWindow would call m_currentPad->Flip() after copying
the padstack from the (front-side) preview pad.  PAD::Flip() calls
PADSTACK::FlipLayers() which, in CUSTOM mode, renames every copper-layer key
in m_copperProps via BOARD::FlipLayer(), so F_Cu became B_Cu.  After the
flip, ALL_LAYERS (= F_Cu) was no longer in m_copperProps.

Any subsequent const call to CopperLayer(F_Cu) -- e.g. from
PAD::GetMsgPanelInfo() which uses PADSTACK::ALL_LAYERS as a hardcoded
layer -- then fell through to m_copperProps.at(ALL_LAYERS) and threw
std::out_of_range, surfacing as an "Unhandled exception" error.

Fix: in const PADSTACK::CopperLayer() for CUSTOM mode, if the requested
layer is not explicitly in the map and ALL_LAYERS is also absent, return
the first available entry instead of throwing.  Apply the same defensive
logic to PADSTACK::EffectiveLayerFor().

Adds a regression test (Issue23234_CustomPadstackFlip) in qa_pcbnew.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/23234
2026-02-26 09:25:59 -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
Jeff Young 62f7dd8551 Be careful of proxy layers when flipping PADSTACK layers. 2026-02-01 18:08:22 +00:00
Jeff Young a5f84fe067 Don't crash fetching a non-existent layer. 2026-01-31 22:00:20 +00:00
Jeff Young dd29ada5d0 Build out PADSTACK::Similarity() and PADSTACK::FlipLayers(). 2026-01-31 22:00:20 +00:00
Jeff Young 0959b553d1 Build out PADSTACK::Compare().
Also add angle to PCB_BARCODE::Compare().
2026-01-31 15:13:29 +00:00
Jeff Young 30d77f11de Formatting and code de-obfuscation. 2026-01-31 15:13:29 +00:00
Jeff Young 7da3f06ca6 Clean up TODO.
While it might be tempting to put these in the individual property
setters, there's no well-defined order in which they're called,
and many of the consistency checks are between multiple properties.
2026-01-31 15:13:29 +00:00
Seth Hillbrand 239882d938 Show list of deleted items in reduce layer action
Also include specifically defined padstack items.  So if a padstack
includes a unique shape on a layer, include it in the list.

We may want to reduce the sensitivity of the check in the future

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21363
2025-12-27 16:27:15 -08: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 0ee57301a9 RounRect pads: fix issue about round_rect_corner_radius and round_rect_radius_ratio
These parameters store a similar info for round rect corner, but only one should
be used to avoid missing init of one value (or mismatch) in code.
round_rect_radius_ratio is now only kept.
2025-12-01 08:09:53 +01: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 736d3c2d26 Don't require callers to jump through hoops.
Fixes KICAD-Y6J.
Fixes KICAD-Y6H.
Fixes KICAD-Y6G.
2025-07-31 15:58:49 +01:00
Jeff Young 5d8def9055 Don't assert inner layer in Footprint Editor (KICAD-STX). 2025-07-07 18:48:30 +01:00
Jeff Young 693ea44990 Debugging.
(Separate wxCHECKs so Sentry can tell us which
one fired.)
2025-07-06 21:42:13 +01:00
Jeff Young 9e07f1e68b Include LAYER_LOCKED_ITEM_SHADOW in PADSTACK::EffectiveLayerFor() (KICAD-V2W) 2025-07-06 21:26:13 +01:00
Jeff Young 7d18c237b3 Pads can be on Dwgs & Eco layers. (KICAD-RQE) 2025-07-04 16:12:41 -06:00
Jeff Young 2a2a73a1e9 Don't allow auto-conversion from double to EDA_ANGLE.
We have no idea if the double is in radians or
degrees.
2025-04-14 11:52:04 +01:00
Alex Shvartzkop 5d70b07c99 Altium PCB: fix padstack shapes import on F.Cu.
(cherry picked from commit 2c74d46d79)
2025-04-07 23:24:09 +03: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
Sean Mollet 185491f2b8 GENCAD Export only produces a single pad - Fix 2025-04-03 11:30:03 -04: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
Jon Evans 0ba869465c API: switch to Distance type for thermal settings 2025-01-09 21:25:15 -05:00
Jon Evans 4dfcbc6d2a API: make thermal spoke settings optional 2025-01-09 20:55:50 -05:00
Jeff Young dd7c076bc9 Use std::optional for pad connection overrides.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19555
2025-01-09 17:32:05 +00: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
John Beard f7aded00c7 Pcbnew: draw clearance lines on their own GAL layers
This tidies up quite a performance hit on layer change
caused by repainting vias, pads and tracks for their
clearances.

Instead, on a layer change, just disable any old clearance
layer and enable the new one (if any).

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/19404
2024-12-31 00:53:10 +08:00
John Beard 5520b524f6 Pcbnew: handle new layers in PADSTACK::EffectiveLayerFor 2024-12-31 00:53:10 +08:00
Jon Evans 07f0b096ba API: Move graphic shapes to common 2024-11-26 18:55:20 -05:00
Jon Evans eaa4367694 Make sure custom shape primitives get parents updated 2024-11-19 19:57:05 -05:00
Jon Evans b44015e204 Add padstack copper offset to API 2024-11-17 23:56:11 -05:00
Jon Evans cb06d750de Add trapezoid delta to the padstack API definition 2024-11-17 22:32:35 -05:00
Jon Evans bc45f1b352 REMOVED: separate color for via net names
Vias can now use track net name color
2024-11-16 11:27:20 -05:00
Jon Evans 71a0a638a0 Remove unused pad layers and simplify pad colors 2024-11-16 11:27:20 -05:00
Jon Evans 9b8f8e929a Fix crash in pad properties dialog when saving custom padstack 2024-11-09 15:01:48 -05:00
Jon Evans a170e86fbd Support padstacks in annular width and edge clearance DRC 2024-11-09 10:33:23 -05:00
Jon Evans 26247b0d27 Support custom padstacks in footprint checker 2024-11-09 08:47:10 -05:00
Jon Evans 91db6e8aab Align API for padstacks with the actual implementation 2024-11-06 23:42:02 -05:00
Jon Evans d0b2334ceb PNS: Support via stacks 2024-11-04 21:30:38 -05:00
jean-pierre charras 0443bd44d4 Pcbnew, PADSTACK::operator=() fix missing copy of m_parent member 2024-11-04 17:16:43 +01:00
Jon Evans 59f7615fbd Expose padstack settings in via properties dialog
Behind a flag because this feature may not
stabilize before V9
2024-11-02 10:02:29 -04:00
Jon Evans 42b5b604e2 Implement Flip action for PADSTACK
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19002
2024-10-27 11:27:31 -04:00
jean-pierre charras 21a2243f40 PADSTACK::operator=(): custom pad shape: add missing copy of primitives
The primitives were not duplicated in the new pad, so creating bugs especially
when trying to edit a flipped custom shaped pad or its footprint parent
(just opening/closing the dialog break the pad).
2024-10-27 09:04:18 +01:00
Jon Evans df0de2b059 Expose padstack editing in Pad Properties dialog 2024-10-05 23:23:44 -04:00
Jon Evans ed0a265aa6 Prevent setting negative pad sizes 2024-10-02 21:18:10 -04:00
Jon Evans 56e0811516 Phase 2 of padstack support
CHANGED: PCB file format now supports saving/loading complex padstacks

CHANGED: PTH pads are now rendered per copper layer in the copper color;
         the PTH pad color is no longer used.

ADDED: support for importing complex pad stacks from Altium PCBs

Enforce padstack-aware access to pad properties across KiCad

Fixes https://gitlab.com/kicad/code/kicad/-/issues/8182
2024-10-01 19:55:03 -04:00
Jon Evans 284a760af7 Move more properties into PADSTACK 2024-07-20 17:48:20 -04:00
Jon Evans 1a1083def6 Revert "Tented usually means that there is no soldermask"
This reverts commit 021f251efd.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18230
2024-06-18 17:52:42 -04:00