1851 Commits

Author SHA1 Message Date
Tomasz Wlostowski
fd502efffb router: ensure rebuildJoint() does not leave dangling root node (with incorrect links) joint in case the (overridden) joint has same hash value but different linked items. Probably the oldest bug in P&S, I can't stop wondering how it had worked reasonably well for so many years :D 2024-11-02 19:59:08 +01:00
Tomasz Wlostowski
b1c515b98a router: replace the restricted set in COLLISION_SEARCH_OPTION for a generic filter lambda 2024-11-02 19:59:08 +01:00
Tomasz Wlostowski
08324556ff router: LOGGER now supports multiple start/end items 2024-11-02 19:59:08 +01:00
Tomasz Wlostowski
ceeceb2266 router: add preferred dragging direction to dragCorner() + FindSegment() method in LINE 2024-11-02 19:59:08 +01:00
Tomasz Wlostowski
56c57ba310 router: added IsTrivialEndpoint() in JOINT 2024-11-02 19:59:08 +01:00
Tomasz Wlostowski
b5ec91d1d3 router: added FindVertex() method in ITEMSET 2024-11-02 19:59:08 +01:00
Tomasz Wlostowski
fa48a42b8c router: add GetLastCommittedLeaderSegments() API method 2024-11-02 19:59:08 +01:00
Tomasz Wlostowski
b7c47e53ed router: allow negative indices to pick (N-index) items in LINK_HOLDER 2024-11-02 19:59:08 +01:00
JamesJCode
37a3e55bd3 Allow pcb rule areas to handle keepout and placement concurrently
- Implements component classes for placement rule areas and multichannel tool
- Implements property inspector properties for rule areas
- Fixes some zone member default initialisation issues
- Gates all multichannel-related imlpementation with existing adv config flag
- Removes rule area type enum, replaces with inference from keepout and
  placement settings
2024-10-10 23:29:02 +01:00
Jon Evans
2a605e4a4e Infrastructure and file format for via stacks 2024-10-06 18:45:25 -04:00
Seth Hillbrand
934453a340 Fix view checking in PNS
Layers in m_view are board layers and need to be translated when going
through the interface

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18831
2024-10-04 15:51:15 -07:00
jean-pierre charras
6c26497213 PNS router: fix a crash when switching to next/previous copper layer.
When (key + and - ) switching to next/previous layer before any usage of
the PNS router, Pcbnew crashed, likely due to incorrect value (perhaps
missing init) of the PNS_KICAD_IFACE (m_iface) m_board member.
So ensure this member is up to date before using it in ROUTER TOOL events.
2024-10-04 10:12:10 +02:00
jean-pierre charras
dba16fc168 PNS router: switch to next or previous copper layer: fix order.
the layer id order is not the UI order. So ensure UI order is used when
switching (keys + and -) to next and previous copper layer.
2024-10-04 09:54:06 +02: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
jean-pierre charras
6cfff7156a PNS router: rename IsCopperLayer( int aLayer ) to avoid a collision.
IsCopperLayer( int aLayer ) can be ::IsCopperLayer( int aLayer ) or
PNS_KICAD_IFACE_BASE::IsCopperLayer( int aLayer ) in pns_kicad_iface.cpp
This is error prone.
So, to avoid mistakes,  PNS_KICAD_IFACE_BASE uses now 2 functions:
- IsPNSCopperLayer( int aPNSLayer )
- IsKicadCopperLayer( PCB_LAYER_ID aPcbnewLayer )

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18800
2024-09-29 09:35:02 +02:00
John Beard
7ba772bc4c Pad.h doesn't need geometry_utils.h
Saves 200+ files from a rebuild if you touch it.
2024-09-28 13:24:26 +01:00
Seth Hillbrand
a8dc101010 Fix layer translation in setting start item
Need to be very careful when translating between PNS layers and board
layers.  PNS layers are linear while board layers are not, so reaching
into the view will return a board layer (maybe we should proxy this
through the iface?)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18708
2024-09-27 11:08:19 -07:00
Seth Hillbrand
1a6b309ad6 Some extra cleanup for layer interface
PNS<->Board layer interface needs clear boundaries about where we are
using board layers (with the alternating numbers) and PNS layers which
are sequential and all copper
2024-09-13 15:50:12 -07:00
Seth Hillbrand
caa63b11da Fix missing conversion from board layer to PNS layer 2024-09-12 09:13:16 -07:00
Mike Williams
04ff715945 pcb: fix crash on routing many traces
Further improvements could be made to the behavior of the autoroute
functionality in this case, but not crashing is a good start.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/18328
2024-09-12 10:20:48 -04:00
John Beard
a3a3f7648e Break ERROR_LOC out to its own header
Having this in geometry_utils.h means that touching
that header affects nearly every file, as this type is used
in EDA_SHAPE, BOARD_ITEM and SHAPE.
2024-09-11 22:08:36 +01:00
Seth Hillbrand
5e0abadb23 Reorganize layer numbering
F_Cu = 0
B_Cu = 2
Remaining internal copper layers are even and incrementing

Non-copper layers are odd and incrementing.

This means that we can no longer do things like:
for( PCB_LAYER_ID layer = F_Cu; layer <= B_Cu; ++layer)
Instead, we have the class LAYER_RANGE:
for( PCB_LAYER_ID layer : LAYER_RANGE( F_Cu, B_Cu) )

Similarly, gt/lt tests should not refer to the integer value of the
layer.  We have functions such as IsCopperLayer to test whether a layer
is copper or not.

When using the connectivity RTree, the third dimension is layer, so we
provide B_Cu with the special INT_MAX value, ensuring that elements
between F_Cu and B_Cu will be identified.  There is a new, special
function GetBoardLayer() for interfacing with CN_ITEMS

Similarly, PNS layers remain unchanged and sequential.  A set of
interface functions is provided to map PNS layers to Board layers and
back.  This allows the PNS_LAYER_RANGE to function as expected
2024-09-06 23:07:58 +00:00
Jeff Young
94f995c49e Reduce dependency on dynamic_cast.
(Especially where it is no-worky on MacOS.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17245
2024-09-04 17:24:49 +01:00
Jeff Young
53a713a525 Fix typo in boolean logic.
(And we might as well make the intent clearer while we're here.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18574
2024-08-23 20:51:31 -06:00
Jeff Young
cbfd6ec9ea CHANGED: remove single layer restriction for uvias.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18501
2024-08-15 16:42:57 -06:00
JamesJCode
3f2b6f7ae0 PNS: Update track widths during routing
This allows routing through, for example, neck downs defined
based on courtyard DRC rules
2024-08-15 21:59:22 +01:00
JamesJCode
c39551b032 PNS: Check for nearest segment anchor for initial track constraints 2024-08-15 21:45:34 +01:00
JamesJCode
364f6d4213 PNS: Use correct diff pair width / gap settings when starting route 2024-08-15 19:50:48 +01:00
JamesJCode
67b9170146 PNS: Include net when querying DRC for initial track width 2024-08-15 09:07:56 +01:00
JamesJCode
013fa4824b Report track clearance constraint from DRC rule if >= board minimum 2024-08-14 22:10:39 +01:00
JamesJCode
a6a62b1be5 Use correct track width constraint when starting PNS from footprint 2024-08-14 22:04:26 +01:00
JamesJCode
72a0c41e3d Correctly handle track clearance constraints in router 2024-08-14 21:21:19 +01:00
JamesJCode
41ff744f1e Update message panel when placing a via with interactive router 2024-08-14 17:37:11 +01:00
Tomasz Wlostowski
9963b9dd9f TOOL_INTERACTIVE: only create the context menu when we are running in GUI mode
TOOL_MENU::m_menu was unconditionally created by the TOOL_INTERACTIVE constructor, resulting in crashes if
we wanted to run the TOOLs in headless  mode, e.g. in unit tests. This commits makes
the creation of the menu object dependent on Pgm::IsGui().
2024-08-13 22:50:26 +02:00
Tomasz Wlostowski
4347ae1270 router: ignore the newly introduced placement rule areas, just focus on keepouts for the moment. 2024-08-13 22:50:26 +02:00
JamesJCode
03e388be80 Hold weak reference to NET_SETTINGS in CONNECTIVITY_DATA 2024-08-04 09:03:03 +01:00
Jeff Young
937854c577 Make target length sticky within a session.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18109
2024-08-01 14:34:59 +01:00
James J
7ce00e511b Multi-netclass support 2024-07-26 20:49:29 +00:00
Jeff Young
fcb104694b Avoid cover types. 2024-07-22 13:21:29 +01:00
Jeff Young
b8819b4636 Another reduction in asserts. 2024-07-19 22:11:56 +01:00
Seth Hillbrand
c0bf866c58 Speed up shutdown
When shutting down, we shouldn't need to do a lot of things like
resyncing the PNS world multiple times that can really slow down the
process
2024-07-05 11:16:20 -07:00
Jeff Young
16340e6cf4 Support both short and long item descriptions. 2024-06-28 22:10:22 +01:00
Jeff Young
c549a214c9 Performance: don't alloc std::vector in critical areas.
For some history, see also aa2ad3b44c3e533cf00a5077db17fb0ee7e302eb
2024-06-21 19:07:46 +01:00
Jeff Young
bc14a841cb Check for drilled hole errors in Footprint Checker.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18093
2024-05-27 13:51:21 +01:00
Jeff Young
98496dfa60 Formatting. 2024-05-23 16:31:53 +01:00
Jeff Young
d5c3a4036c Process clearance rules for plated holes in router.
Also makes sure the clearance is shown for a collision,
even if the preference for showing clearances is off.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18078
2024-05-23 16:26:43 +01:00
Seth Hillbrand
e097f88d56 Avoid snapping to edge cuts when routing
Snapping happens to elements on copper layers but edge cuts is only
_virtually_ on copper layers.  We need to set its routable flag off to
ensure we don't force-snap to the snap points

(cherry picked from commit c248993a843da28d4bfe367f8e74eb40637297c2)
2024-05-21 09:34:45 -07:00
Seth Hillbrand
64e3e17143 Reserve shift for grid modification
(cherry picked from commit f75e6dae8484c041f6a3b37a19a95bcb7cf26929)
2024-05-21 09:34:45 -07:00
Seth Hillbrand
be0e058807 Optimize ARC hulls in PNS
If we can't route through the arc opening, then it is effectively a
circle and we can treat it as such.
2024-05-21 09:34:45 -07:00
Seth Hillbrand
83ad0d5fad Honor Ctrl+Shift combo when starting routing
We want to be able to start routing at an arbitrary point if we
explicitly disable the snapping and grid together
2024-05-21 09:34:45 -07:00