51 Commits

Author SHA1 Message Date
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
Jon Evans
cd36edd152 PNS: Fix following of locked segments
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19186
2024-12-02 13:45:47 -05:00
Tomasz Wlostowski
0583b55ba0 router: reimplement JOINT::NextSegment() to correctly handle multilayer joints
Note: as JOINTs are indexed by position and net, we can have a joint with four track segments belonging to two LINEs linked (two on layer A, two on layer B, e.g. two corners of two separate lines going through). The previous version
of the function would stop at such a joint (thinking it's a corner joint). As such situation is pretty common while shoving/moving vias, the algorithm was easily confused.

Private note: just fixed another 11-year-old bug...
2024-11-02 19:59:08 +01:00
Tomasz Wlostowski
663afac3df router: make sure empty (unlinked) JOINTs have also empty layer range
Due to the architecture of the NODE storage (overrides), JOINTs that don't have any items attached are still kept in the child nodes, but with empty link list. So has to be the layer range, otherwise adding new items to a child node might result with JOINTs having mismatched layers vs items.
2024-11-02 19:59:08 +01:00
Tomasz Wlostowski
56c57ba310 router: added IsTrivialEndpoint() in JOINT 2024-11-02 19:59:08 +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
b8819b4636 Another reduction in asserts. 2024-07-19 22:11:56 +01:00
Jeff Young
24846d3f44 Repair earlier fix for VVIAs. 2023-12-19 16:48:01 +00:00
Jeff Young
de070a1d62 Watch out for VVIAs.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16339
2023-12-12 15:45:13 +00:00
Alex Shvartzkop
7eb98a9863 Fixes for tuning patterns and router.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16160
2023-11-28 20:55:39 +03:00
Jeff Young
5da35d7750 Don't modify dp-tuning when doing skew tuning.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15901
2023-10-22 20:35:14 +01:00
Wayne Stambaugh
b5eee9dd7e Coverity warning fixes. 2023-10-16 17:04:14 -04:00
Jeff Young
be532e96d6 Fix errors in calculating tuning length.
Fix mismatched parameter passing in TOPOLOGY::followTrivialPath()
and TOPOLOGY::AssembleTrivialPath().
Fix logic error in PNS::JOINT::IsLineCorner().
Handle VVIAs in PNS::JOINT::IsNonFanoutVia().

Fixes https://gitlab.com/kicad/code/kicad/-/issues/10614
2023-09-25 15:50:44 +00:00
Jeff Young
76cd637895 Make the net identifier opaque to PNS router.
This also improves performance as we don't have to look up the
netcodes in a map.
2023-08-22 15:17:02 +00:00
jean-pierre charras
b9ed84b7db Fix minor compil warnings 2023-04-25 12:43:15 +02:00
Tomasz Wlostowski
1283c4713f router: rework ITEM ownership model.
- prerequisite for holes as first class objects code
- introduced the OWNABLE_ITEM interface that defines the owning container (NODE/other ITEM/ITEM_SET)
- simplified the ITEM_SET interface
- constified a lot of APIs (ownership/JOINT management) as a side effect

Rebased and cleaned up by Jeff Young <jeff@rokeby.ie> 5 April 2023
- some STL cover types removed
2023-04-05 11:21:31 +01:00
Jon Evans
664bf1382d PNS: Fix IsLineCorner logic
Handle segment width test in the case of locked segs
Fix logic failure where vias on path cause crash

Fixes https://gitlab.com/kicad/code/kicad/-/issues/11990


(cherry picked from commit 25123759887fb6a94c5eaebfbf2e7c065ef4d1e7)
2022-07-12 02:49:24 +00:00
Jon Evans
9a2950cca1 PNS: Use exact hulls for walkaround path generation
When we generate hulls, by default we subtract the clearance epsilon
to prevent false collisions in the router that wouldn't be flagged
by DRC.  However, we need to use the actual hull with no epsilon
when generating hulls for pathfinding in the walkaround system.

Without this change, it is possible for the walkaround to generate
a valid-seeming path that results in a DRC violation, for example
when dragging a drag against a board edge.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/10536
Fixes https://gitlab.com/kicad/code/kicad/-/issues/11365
Fixes https://gitlab.com/kicad/code/kicad/-/issues/10710

(cherry picked from commit 2a91ba35c1a1e443714c4a33334236be1f60413e)
2022-06-04 00:04:03 -04:00
Jon Evans
6fd14ac945 [PNS] Fix invalid assumption in IsLineCorner
(cherry picked from commit a4aa447b95a4a21567ba3ef5200e33c4c2dd3186)
2022-05-31 20:24:54 -04:00
Jon Evans
7de9e48b57 PNS: Fix tuning calculations through locked segments
Fixes https://gitlab.com/kicad/code/kicad/-/issues/9727
2021-12-05 13:35:28 -05:00
Wayne Stambaugh
cf00319c85 More NULL expunging. 2021-07-20 07:27:18 -04:00
Marek Roszko
382dca4e6f Fix uninitialized member warnings
Based on PVS Studio report
2021-05-30 20:01:01 -04:00
Wayne Stambaugh
6a39b81647 Fix the last of broken Doxygen comment specifiers. 2021-01-27 17:39:44 -05:00
Seth Hillbrand
8c19b4b6ae pcbnew: Adding arcs to PNS
This is allows ARCs in tracks to be synchronized with
the PNS router.  Note this does not yet include the UI components
to route curved traces
2020-02-21 16:11:41 -08:00
Seth Hillbrand
7c28c3838a Comment-only changes
Makes class comments conform to coding standards
2020-01-10 16:43:01 -08:00
Jeff Young
aa4d7682ca Don't shove stitching vias.
Whether or not it's a good idea, the current algorithm doesn't support
it and leaves them on top of each other.

Fixes: lp:1833214
* https://bugs.launchpad.net/kicad/+bug/1833214
2019-07-21 16:38:06 -06:00
Seth Hillbrand
13997f0050 Revert "pcbnew: Adding copy constructors to PNS items"
This reverts commit 41e4bc4d9fe52c81986ad1522dc3f8965a4ef6bf.

This commit requires additional testing before recommitting as it causes
issues with FindJoint().
2018-10-09 14:50:20 -07:00
Seth Hillbrand
41e4bc4d9f pcbnew: Adding copy constructors to PNS items
Adding safe copy constructors to PNS items including assignment check
and copy operations
2018-10-09 05:37:48 -07:00
Tomasz Włostowski
9932ff32ae refactoring: wrapped boost::optional in OPT<> class for the purpose of easier transition to C++17 in the future 2017-11-03 23:59:02 +01:00
Simon Richter
ad088db6d2 Add more "override" markers. 2016-09-25 13:59:41 -04:00
decimad
6c749e0ba8 Remove PNS_ prefix from most types inside namespace PNS 2016-09-06 16:06:06 +02:00
decimad
4cf44d9725 Rename pns item kind constants in preparation for renaming pns classes 2016-09-06 16:06:06 +02:00
decimad
de6281e977 Move PNS router code into namespace PNS
update copyright messages
2016-09-06 16:06:06 +02:00
Simon Richter
1b2fd6a382 Replace BOOST_FOREACH with C++11 range based for. 2016-06-29 16:07:55 -04:00
Tomasz Wlostowski
08178104bb router: take track width changes into account when calculating trace length for tuning 2015-11-05 19:20:08 +10:00
Tomasz Wlostowski
3596ef2d4c router: fixed loop removal regression in shove mode 2015-10-09 14:31:06 +02:00
Tomasz Wlostowski
5bbf980ec7 router: fixes for disappearing segments after shoving & assertion in PNS_NODE destructor 2015-09-14 18:40:29 +02:00
Tomasz Wlostowski
95c59c8060 router: multiple fixes:
- PNS_ITEMSET now keeps ownership info (does not rely on PNS_ITEM::Owner(), avoiding the risk of dangling pointers)
- fixed vias losing connected traces when dragging in mark obstacles mode
- fixed rare segfault when board item returned null netclass
2015-08-19 17:27:23 +02:00
Tomasz Wlostowski
e342744a32 router: Do not use reference to a temporary object. Prevent double freeing (m_joints). Draw tuned track always on top. 2015-08-12 21:12:13 +02:00
Maciej Suminski
0fbf31ef38 P&S: memory mgr & disappearing trace fixes. Still a bit buggy, though... 2015-08-03 21:11:51 +02:00
Maciej Suminski
4fb9bce354 Code formatting. 2015-02-18 17:53:46 +01:00
Tomasz Włostowski
112adccbcb router: differential pairs & length tuning support 2015-02-18 01:29:54 +01:00
Maciej Suminski
9245b90392 Code formatting. 2014-11-14 20:19:00 +01:00
Tomasz Wlostowski
80adf9d85b router: multiple changes
- re-worked PNS_LINE_PLACER and PNS_ROUTER classes a bit, removing duplicate class members
- cleaned up Andrew's blind/buried via fixes
- fixed 'custom via width' dialog bug updating the width even when closed/cancelled
- fixed incorrect radius of drawn microvias
2014-11-14 19:15:58 +01:00
Kirill Mavreshko
b4e0a5cbbf Fixes bug #1332438: PNS router crashes when you another track while routing in "shove" mode 2014-06-23 08:50:53 +02:00
Maciej Suminski
ad1b138f28 Reformatted PNS code to conform the coding policy. 2014-05-16 13:37:31 +02:00
Tomasz Włostowski
061660e9e4 Long-awaited new version of the P&S router 2014-05-14 15:53:54 +02:00
Maciej Suminski
0ac3e1fbf2 Namespace KiGfx->KIGFX.
template<> -> template <>
Some more reformatting according to uncrustify results.
2013-10-14 16:13:35 +02:00
Maciej Suminski
22045b61ea Converted tabs to spaces. Removed trailing whitespaces. 2013-10-14 13:43:57 +02:00
Maciej Sumiński
5598acb617 Uncrustifying push&shove router 2013-09-26 23:53:54 +02:00