Commit Graph

1041 Commits

Author SHA1 Message Date
Marek Roszko 4df3cb912d Remove another leaky wx/log.h header 2021-06-03 08:11:15 -04:00
Marek Roszko cf2bb5692a Remove the wxLog calls from math/util.h for now
This was leaking windows headers and partial wx headers to 1084 compilation units......
This also means math/util.h is leaking to 1084 compilation units which seems a bit high too.
2021-06-01 18:44:22 -04:00
Jon Evans 247da631f9 Revert "Fix typo and clean up leftover tracks"
This reverts commit ed66c0f14d.

Revert "Clean up co-linear tracks after finishing routing"

This reverts commit 1a102f03c0.

More complex solution needed

Fixes https://gitlab.com/kicad/code/kicad/-/issues/8526
2021-06-01 11:18:00 -04:00
Jon Evans 1a102f03c0 Clean up co-linear tracks after finishing routing
This involved adding some extra infrastructure to be able
to handle the case where a track that is sitting in the
router's commit waiting to be added to the board actually
needs to be deleted instead.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/8419
2021-05-31 17:36:38 -04:00
Marek Roszko 382dca4e6f Fix uninitialized member warnings
Based on PVS Studio report
2021-05-30 20:01:01 -04:00
Tomasz Wlostowski 67f0bbc6d7 router: fixed crash in HullIntersection() when the path has 0 or 1 points.
fixes: 8515
2021-05-31 00:20:32 +02:00
Tomasz Wlostowski 614787caae router: clear head line geometry if current head routing failed + small improvement to follow-mouse optimization.
Also added a lot of verbosity for the pns-log-viewer tool.

Fixes: 8511
2021-05-31 00:18:42 +02:00
Tomasz Wlostowski dfd80e077c router: fix another corner case in LINE::Walkaround() (duplicated vertex triggered by feeding a closed loop as the input path)
fixes: 1775
2021-05-31 00:17:12 +02:00
Jon Evans 0da85ded2f PNS: Fix diff pair handling of microvias as start items
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8514
2021-05-30 15:51:28 -04:00
Tomasz Wlostowski fcb89b99a3 router: walkaround algo should not copy the previous via position when the current iteration via placement fails.
fixes: 7827
2021-05-30 00:35:58 +02:00
Tomasz Wlostowski af2e163890 router: annotate source locations of WALKAROUND debug items 2021-05-30 00:35:54 +02:00
Jon Evans 3eb5a484e1 PNS: Don't clip tuning paths to pads on other layers
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8504
2021-05-29 15:52:44 -04:00
Jon Evans 28f17c3ae6 PNS: Prevent wrong clearance being cached for new diff pairs
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8377
2021-05-29 13:31:17 -04:00
Jon Evans 85ca85652d Do not add debug items to view if debug flag isn't enabled
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8510
2021-05-29 12:40:24 -04:00
Jon Evans bd59da3642 PNS: Local min distance has a minimum points requirement
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8510
2021-05-29 12:40:24 -04:00
Tomasz Wlostowski ebd957b08e router: rework router's debugging infrastructure to be more compatibile with the 'qa/pns/pns-log-viewer' tool.
The log viewer tool lets you inspect all the intermediate stages of the routing algorithms. This patch:
- Adds source location tracking of the debug calls (need to use the PNS_DBG macro, sorry)
- Moves some wxLogTrace calls to DEBUG_DECORATOR::Message() so that messages can be displayed alongside the corresponding geometric shapes
2021-05-29 00:13:24 +02:00
Tomasz Wlostowski 132eb53a40 router: clean some debug clutter 2021-05-29 00:13:24 +02:00
Tomasz Wlostowski b3caa3c4d4 router: fix ordering of colliding hulls in NODE::NearestObstacle()
Replaced the generic SHAPE_LINE_CHAIN::Intersect() with PNS::HullIntersection() which correctly rejects
'non-penetrating' intersections.
2021-05-29 00:13:24 +02:00
Tomasz Wlostowski e66bbfd1ec router: improve the feel of the walkaround algorithm
Makes walkaround more 'huggy' - the trace being routed sticks to obstacles
instead of jumping around in uncontrollable way.
2021-05-29 00:13:24 +02:00
Tomasz Wlostowski 8148b5d81f router: improvements in LINE::Walkaround()
- Fix walk failure if the input path starts on the hull boundary
  (happens very often during tight walkaround)
- Input line can have a loop at the end now. Such condition happens when the routing
  destination point lies inside the hull of a colliding primitive.
2021-05-29 00:13:24 +02:00
Tomasz Wlostowski d2ec3fc4ed router: P&S-specific hull/line interection function that correctly rejects segments/vertices that only touch the hull polygons without penetrating them 2021-05-29 00:13:24 +02:00
Tomasz Wlostowski 8c4361bbc6 router: adapt to new SHAPE_LINE_CHAIN::INTERSECTIONS structure 2021-05-29 00:13:24 +02:00
Jeff Young 5c9a73aa5e Correct position for grid even when we're not snapping to a point.
Fixes https://gitlab.com/kicad/code/kicad/issues/8125
2021-05-25 21:57:19 +01:00
Jeff Young 4c69a74505 Force layers visible when routing on them.
Fixes https://gitlab.com/kicad/code/kicad/issues/8432
2021-05-16 11:18:31 +01:00
david-beinder 75f49ba1b6 Add length tuner settings to toolbar context menu 2021-05-12 02:34:52 +00:00
Jon Evans bc6b9b527a Allow stackup height to be excluded from length calculations
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8384
2021-05-10 22:11:58 -04:00
Jeff Young 7356f9568d Move grid disable modifier from ALT to CTRL.
Also had to move the H/V/45 disable modifier from CTRL to SHIFT.

Fixes https://gitlab.com/kicad/code/kicad/issues/8124
2021-05-09 20:17:40 +01:00
Jon Evans 1a45d9474b Don't show commands that cancel routing when routing is in progress
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8363
2021-05-08 14:55:02 -04:00
Marek Roszko 03cf2b517f Enum class PAD_ATTR_T
Renamed such that python stays the same
2021-05-01 10:51:54 -04:00
Marek Roszko e20562b09b Some cleanup 2021-05-01 10:37:20 -04:00
Marek Roszko 21fde9b629 enum class PCB_SHAPE_TYPE_T 2021-04-30 22:36:12 -04:00
Tomasz Wlostowski a433451bd8 router: 'root line' tracking in the SHOVE algorithm. See comments for detailed explanation. 2021-04-27 14:13:16 +02:00
Tomasz Wlostowski 3a8744d054 router: introduce concept of a root lines in the OPTIMIZER.
By 'root lines' we mean the oldest traceable ancestor of each track moved by the router
(i.e. after shoving for a while, the root of each shoved line is it's latest non-shoved version).

With this we can teach the OPTIMIZER more tricks, such as the LIMIT_CORNER_COUNT constraint. It ensures
the results of the optimization will not be less cornery than the original line, reducing the feeling
of the optimizer being too intrusive.
2021-04-27 14:13:16 +02:00
Tomasz Wlostowski 76f8861e6e router: revert Seth's arc adjustment in StartDragging().
Fixes picking the last segment instead of the last vertex to drag (when one is requested).
I didn't notice any behaviour change of the dragger wrs to arcs.
2021-04-27 14:13:16 +02:00
jean-pierre charras e27733587d Fix 2 minor Coverity warnings. 2021-04-23 19:57:36 +02:00
Jonathan Haas 075bd788eb Remove unused OBSTACLE_VISITOR::m_extraClearance 2021-04-23 01:53:09 +00:00
Ian McInerney ecd9bf696e Be consistent about using nullptr instead of 0
0 can be too easily overloaded into an int, so ensure we use nullptr
when we mean pointers.
2021-04-22 22:20:34 +01:00
Jon Evans cf47d665ea PNS: Dragged line needs to retain width
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8246
2021-04-22 09:04:41 -04:00
Jon Evans 9b1890606d PNS: Do not allow resolved optimal values to go below board minimums 2021-04-21 22:43:26 -04:00
Jon Evans cbd7d698a9 Fix diff pair error message suffix suggestions
We accept diff pairs that end in N/P, no underscore required
2021-04-20 21:08:34 -04:00
Jon Evans 2535daf661 PNS: Account for via stack height in diff pair length tuner
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8256
2021-04-20 19:31:10 -04:00
Jon Evans dd828bd964 PNS: Bring back original Highlight Collisions behavior
From discussion with Tom, Jeff, and Wayne, it appears as though
we all agreed that Highlight Collisions should behave like it
did in 5.1, which is to say, always just highlight collisions,
never prevent them.  The Allow DRC Violations checkbox just
controls whether or not you can fix/commit the head line if it
has violations; you are not prevented from moving the head
line to violating positions in any case.

Right now, there does not seem to be much demand for a separate
"Stop at First Obstacle" mode since Walkaround basically does that
but better, but we agreed that if there is demand for it in the
future, it should be implemented as a new router mode rather than
a behavior of Highlight Collisions mode controlled by the Allow
DRC Violations checkbox.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/7828
2021-04-18 21:01:07 -04:00
Tomasz Wlostowski 4538d78828 router: fix via shoving regression. 2021-04-19 00:43:30 +02:00
Tomasz Wlostowski 57de83897a router: VIA SetDrill() and SetPosition() must update the hole shape too. 2021-04-19 00:43:15 +02:00
Jon Evans ec6995697d PNS: even more free performance
If this doesn't work, we have bigger problems
2021-04-18 09:50:06 -04:00
Jon Evans 6425ad4118 PNS: Fix propagateDpHeadForces obstacle calculation
Using a synthetic via here doesn't quite let us use VIA::PushoutForce
because it will use the wrong clearance, and also doesn't quite have
the logic we want.  I am not familiar enough with PushoutForce to know
if its logic is a bug in other cases, so instead I just brought in the
parts of its algorithm that are needed here.

Additionally, we prevent pushing more than once from a given obstacle,
which causes walkaround to be more successful when routing diff pairs
against a large collider such as a keepout area.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/8232
2021-04-17 22:37:30 -04:00
Jon Evans 5974446523 PNS: Let's make the r-tree work for us
I'm not sure where the magic number of "4x worst" came from, but it's
been around forever.  This is extremely inefficient as it negates much
of the power of r-tree filtering in dense designs.  If we really trusted
it, we could set this just to worstClearance.  Keeping it above the worst
clearance by a little bit seems to provide enough of a speed improvement
to resolve the test cases I have, so I'll go with that for now.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/7777
2021-04-17 21:37:11 -04:00
Jon Evans 1d7e5a0443 Fix merge error that prevented a previous change from working 2021-04-14 23:30:16 -04:00
Jon Evans 268d570941 PNS: keep last valid diff pair trace as current state
This allows fixing/committing what is on screen even if the current
cursor position doesn't have a valid solution (the old behavior
would result in the current trace disappearing)
2021-04-14 23:21:10 -04:00
Jon Evans c829dba88e PNS: Reduce minimum distance to start turn in diff pair placer
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8193
2021-04-14 23:21:10 -04:00