Commit Graph

1045 Commits

Author SHA1 Message Date
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
Jon Evans cac4d70154 PNS: Respect fix-all in diff pair placer 2021-04-14 23:21:10 -04:00
Jon Evans 296a9df530 PNS: Pick up diff pair starting width from continuation track 2021-04-12 23:10:15 -04:00
Jon Evans 1d9ca181a2 PNS: Use existing seg direction if both DP segs are parallel 2021-04-12 22:34:13 -04:00
Jon Evans 311cde0984 Safety check suggested by Coverity 2021-04-12 20:42:50 -04:00
Jon Evans 2aa5e568e8 Refactoring 2021-04-12 20:40:05 -04:00
Jon Evans 73fb85a352 PNS: Calculate diff pair primitive orientation using anchors only
The previous method fails if the primitive is an expanding or
contracting pair (diagonals going inward or outward) resulting in
incorrect orientation, which then leads to incorrect candidate
gateways being generated and no solution found.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/8185
2021-04-12 20:34:44 -04:00
Jon Evans 715c61ac9f PNS: Fix yet more arc edge cases
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8150
2021-04-12 19:59:55 -04:00
Jon Evans 49a91414d7 PNS: Apply co-linear seg merging to drag operations 2021-04-11 22:32:11 -04:00
Jon Evans 1c431d9929 PNS: Fix some off-by-one errors with arc dragging 2021-04-11 22:12:53 -04:00
Jon Evans a26fc6d65d PNS: Fix several issues with arc dragging
Do not merge vertices that belong to different arcs
Fix start segment identification after arcs
Fix free-angle drag after arc

Fixes https://gitlab.com/kicad/code/kicad/-/issues/8173
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8150
2021-04-11 17:56:40 -04:00
Jon Evans 7ba110bd77 PNS: Fix dragging of segments with arcs in line 2021-04-11 10:18:57 -04:00
Thomas Pointhuber a30894e5a1 Allow SHAPE_LINE_CHAIN and SHAPE_ARC to be mirrored using a SEG 2021-04-11 13:27:25 +00:00
Thomas Pointhuber fe8fbf1d5d Use arcs instead of line approximation for Miter shape
TODO:

* The resulting line chain is broken with the arcs, and
this appears to be some subsequent issue I was not able to pin down.
* The requirement of a correction factor is not clear to me
2021-04-11 13:27:25 +00:00
Jon Evans 5c448057c8 PNS: Prevent state flicker when starting drag 2021-04-10 16:31:39 -04:00
Jon Evans 7784d7cb12 PNS: Fix visible area restriction
VIEW::GetBoundary() returns the entire view area, not the visible area.
Surprisingly, we had no API for this, so I added one.

Also, changed the dragger behavior to toggle between optimizing just the
modified area and optimizing the visible area, i.e. we will now never
optimize off-screen portions of the dragged track.
2021-04-10 16:13:08 -04:00
Jon Evans 94afdcb92a PNS: Allow control of area-restricted drag optimization
CHANGED: The interactive router settings now include a switch to
         enable or disable optimization of the entire dragged track,
         which is now disabled by default.  When enabled, the router
         will reroute the entire track (from the dragged segment to
         the closest pad/via in each direction) to be more optimal.
         When disabled, only the area around the dragged segment
         will be modified.

CHANGED: The "optimizer effort" slider is removed from the interactive
         router settings dialog, as this setting did not have any
         meaningful impact in most cases and was a source of confusion.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/5918
2021-04-10 15:17:39 -04:00
Jeff Young dc0cf3b802 Clean up a confusing API.
AllowDRCViolations is kept in any mode as a *setting*, but only
controls router behaviour when the mode is mark obstacles.

Fixes https://gitlab.com/kicad/code/kicad/issues/7795
2021-04-10 11:08:02 +01:00
Jon Evans d878cbddbc PNS: a few forgotten cleanup items 2021-04-07 23:34:45 -04:00
Jon Evans c9040a5c53 PNS: fix some weirdness identified by PVS 2021-04-07 23:16:56 -04:00
Jon Evans d4957b112e PNS: Keep last valid drag solution in the node
Fixes https://gitlab.com/kicad/code/kicad/-/issues/5450
2021-04-07 21:59:23 -04:00
Jon Evans 26835f582c Some situations require more than one dummy
Fixes https://gitlab.com/kicad/code/kicad/-/issues/7820
2021-04-07 21:30:18 -04:00
Jon Evans 9432484394 PNS: Find origin segment correctly when arcs are present
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8139
2021-04-07 20:28:30 -04:00
Jon Evans 9f957d3e08 Fix crash when attempting to tune discontinuous lines
Also correctly find the tuning path through arcs

https://gitlab.com/kicad/code/kicad/-/issues/8131
2021-04-06 09:07:11 -04:00
david-beinder b2f788adc1 PNS: Fix UseConnectedTrackWidth when starting from ARCs 2021-04-06 01:27:13 +00:00
Jon Evans e46c9d35ac Add undo/redo handling to length tuner event loop
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8129
2021-04-05 19:58:14 -04:00
Jon Evans 24cd174a23 Don't dereference a possibly-invalid optional 2021-04-05 19:34:57 -04:00
Jon Evans a6c3d74a73 Pass active layer to StartRouting in length tuner
Fixes https://gitlab.com/kicad/code/kicad/-/issues/7857
2021-04-04 21:51:54 -04:00
Jon Evans a24bc34b66 Better colors for length tuning popup in dark mode 2021-04-04 20:33:59 -04:00
Jon Evans c7ecb51f77 Update PNS length tuning algorithm to match the new BOARD algorithm
Now tracks inside pads are optimized to give a more accurate length.
Also, the start/end of the assembled line is used to identify the right
pad joints for pad-to-die length calculation.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/4204
Fixes https://gitlab.com/kicad/code/kicad/-/issues/1765
Fixes https://gitlab.com/kicad/code/kicad/-/issues/6877
2021-04-04 20:27:22 -04:00
Jon Evans cdfb014ab6 CHANGED: Account for via height in track length calculations 2021-04-04 13:59:18 -04:00
Jon Evans 6b24abac8f PNS: Don't snap to end items if snapping is disabled by modifier key
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8033
2021-04-04 10:22:23 -04:00
Jon Evans a8896ebd73 Don't show leading ratline for unconnected net
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8040
2021-04-02 20:29:25 -04:00
Jeff Young f88d39b4f0 Fix state issue in router's switch layer handling.
Fixes https://gitlab.com/kicad/code/kicad/issues/7590
2021-04-01 18:10:04 +01:00
Jeff Young 8cb6f15687 Warn when diff pair router can't start due to too-small-gap.
Fixes https://gitlab.com/kicad/code/kicad/issues/7795
2021-03-30 19:49:23 +01:00
Jon Evans 78a60e9dfb PNS: Put polygon error outside pad shapes
Fixes https://gitlab.com/kicad/code/kicad/-/issues/7672
2021-03-29 19:49:59 -04:00
Jon Evans 6cbc3fb97d Fix a minor inconsistency between router and DRC
Also make sure collision highlighting runs at the starting
location of a drag.

See: https://gitlab.com/kicad/code/kicad/-/issues/7672
2021-03-29 19:41:17 -04:00
Jon Evans 8be9832153 PNS: Don't highlight Net 0 (the unconnected net)
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8040
2021-03-29 17:45:07 -04:00
Jon Evans 132ec37b56 Handle arc in buildHullForPrimitiveShape
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8008
2021-03-25 21:25:30 -04:00
Jeff Young 8be213e36f Trim includes (and use consistent terminology in error messages). 2021-03-21 20:15:47 +00:00
Jon Evans 5e0b65c3a8 Change wording of corner rounding action
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4505
2021-03-21 15:55:56 -04:00
Jeff Young cad1cb0262 Improve naming. 2021-03-16 12:07:06 +00:00
Jon Evans 18037e2f65 Rework bitmap system to load from archived PNGs
Bitmaps are now identified by an enum class instead of by pointers.
Bitmap loading and caching is now handled by a class in common, and
we no longer compile most bitmaps into the binary, so there is no
longer a bitmaps static library.

Instead, bitmaps are archived to a .tar.gz file which is installed
in ${KICAD_DATA}/resources/images.tar.gz

The source PNGs are checked in to Git as the original CPP files were,
so that people can build without the required dependencies to convert
SVGs to PNGs.

Initial support is also added for dark theme icons, although this
is not yet exposed in the GUI.

Stubs are present for multi-resolution image resources, but this is
not fully-baked yet and could use some refinement.
2021-03-11 08:37:35 -05:00
Jon Evans 720147d272 Remove transitive inclusion of bitmaps.h 2021-03-07 16:08:57 -05:00
david-beinder df99ee39d9 PNS: new through vias should span all copper layers
Fixes https://gitlab.com/kicad/code/kicad/issues/7576
2021-03-07 17:58:43 +00:00
Wayne Stambaugh 79a9d69ff5 Coverity fixes for issues 314755, 316287, 324536, 324539, and 324539. 2021-03-02 08:10:37 -05:00
Jeff Young d06e8ef01c Honour pre-defined-size selections for diff pairs.
Fixes https://gitlab.com/kicad/code/kicad/issues/7759
2021-03-02 12:12:05 +00:00
Jon Evans d269778cd4 PNS: disable smart pads in walkaround if posture is forced
Fixes https://gitlab.com/kicad/code/kicad/-/issues/7710
2021-02-27 13:48:01 -05:00
Jeff Young b36e1c741d Fix insidious bug which resets layer of SOLID when marking collision.
It's supposed to be setting the layer of the collsion display object,
not the host object, but there's a typo.

Fixes https://gitlab.com/kicad/code/kicad/issues/7712
2021-02-25 23:39:48 +00:00
Jeff Young 75032f3acd Use the more-constrained layer when running rules.
Fixes https://gitlab.com/kicad/code/kicad/issues/7639
2021-02-25 22:58:07 +00:00
Tomasz Wlostowski 87ea540953 Fix whitespace errors 2021-02-25 17:18:23 +01:00
Tomasz Wlostowski c79610e132 router: post-rebase fixes 2021-02-25 17:18:23 +01:00
Marek Roszko 6948cdd8ef router: Fix return type within pointInside2 2021-02-25 17:18:23 +01:00
Tomasz Wlostowski 9bdfc13155 router: improve locality of post-shove optimization
Fixes: #4359
2021-02-25 17:18:23 +01:00
Tomasz Wlostowski e1d4bb777c router: use new LINE::Walkaround in the walkaround algo 2021-02-25 17:18:23 +01:00
Tomasz Wlostowski 045d02f818 router: add strict/loose area restriction constraint. WIP 2021-02-25 17:18:23 +01:00
Tomasz Wlostowski 24574aa2f5 router: first insert intersections, then build graph in Walkaround() 2021-02-25 17:18:23 +01:00
Tomasz Wlostowski 61e75a838b router: replace large stack variables with std::array 2021-02-25 17:18:23 +01:00
Tomasz Wlostowski 028f209126 router: more robust LINE::Walkaround() implementation 2021-02-25 17:18:23 +01:00
Tomasz Wlostowski e9c55cd0e3 router: if the drag anchor is not reachable by the mouse, use the closest point on dragged trace for optimizer restriction
Fixes: #4056
2021-02-25 17:18:23 +01:00
Tomasz Wlostowski a141ed3444 router: feed view size change events to the router engine 2021-02-25 17:18:23 +01:00
Tomasz Wlostowski 12dfb541fc router: expose current view area to the router algorithms so that the optimizer could know not to mess with traces/vias not currently visible to the user (wip) 2021-02-25 17:18:23 +01:00
Tomasz Wlostowski 2831c7d24c router: fix compile error in DRAGGER 2021-02-25 17:18:23 +01:00
Tomasz Wlostowski b67e5768a6 router: feature to save debug event log & board dump for easier recreation of router bugs and misbehaviours 2021-02-25 17:18:23 +01:00
Tomasz Wlostowski ebdc68ac1d router: correctly handle line width in PREVIEW_ITEMs 2021-02-25 17:18:23 +01:00
Tomasz Wlostowski 34c037684b router: partially migrate SHOVE algorithm to use new DEBUG_DECORATOR 2021-02-25 17:18:23 +01:00
Tomasz Wlostowski 0e6cf3f56e router: fix board edge clearance queries
Fixes: #7254
2021-02-25 17:18:23 +01:00
Tomasz Wlostowski 4574f52eac router: DRAGGER::CurrentNode() should always return non-null value 2021-02-25 17:18:23 +01:00
Tomasz Wlostowski e221b11e3b GRID_HELPER: fixed arithmetic issue in segment snap distance check disguised as 'excessive optimization' by the dragger in the router 2021-02-25 17:18:23 +01:00
Tomasz Wlostowski 325300bd76 router: don't use compound pad shapes if pad contains a single primitive shape 2021-02-25 17:18:23 +01:00
Tomasz Wlostowski a4bd2ad8c6 router: drag in walkaround mode now works 2021-02-25 17:18:23 +01:00
Tomasz Wlostowski f84836f51e router: factor out POSTURE_SOLVER to more generic MOUSE_TRAIL_TRACER class 2021-02-25 17:18:23 +01:00
Tomasz Wlostowski af95235f47 router: report debug log events from DRAGGER 2021-02-25 17:18:23 +01:00
Tomasz Wlostowski 0306d16748 router: make post-drag optimization less intrusive
Fixes: #5918
2021-02-25 17:18:23 +01:00
Tomasz Wlostowski 14ce7a0ad7 router: implement area constraint in optimizer 2021-02-25 17:18:23 +01:00
Tomasz Wlostowski 64cf593ee9 router: debug points now have variable size 2021-02-25 17:18:23 +01:00
Jeff Young caa18c8e16 Fix bugs in diffPair hole-to-hole logic and add rule resolution.
Fixes https://gitlab.com/kicad/code/kicad/issues/7697
2021-02-25 14:23:02 +00:00
Jeff Young fa89263c8f Push hole-to-hole min processing down a level.
Also removes adding the track width to the via gap, which was
never right.

Fixes https://gitlab.com/kicad/code/kicad/issues/7173
2021-02-24 21:42:00 +00:00
Jeff Young 7f892669cc Consistent punctuation. 2021-02-23 12:46:27 +00:00
Marek Roszko c12666ec43 Fix arg type of NODE::followLine 2021-02-20 11:58:55 -05:00
Marek Roszko 6fce39607e Fix return type within pointInside2 2021-02-20 11:58:55 -05:00
jean-pierre charras d0b91b1106 Router, place via: fix issue created by 45b2bc: cancelling via must be made
only when the select layer is called.
Fixes #7606
https://gitlab.com/kicad/code/kicad/issues/7606
2021-02-19 17:28:20 +01:00
Seth Hillbrand 54282dffe3 Move preview items using FP orientation
Fixes https://gitlab.com/kicad/code/kicad/issues/7600
2021-02-18 16:32:40 -08:00
Jeff Young 45b2bce698 Cancel placement of via if user cancels layer selection.
Fixes https://gitlab.com/kicad/code/kicad/issues/7578
2021-02-18 11:53:36 +00:00
jean-pierre charras 5d2dc0b50e Fix a few (minor) issues:
- Make DIALOG_SHIM::SetPosition working)
- rename PCB_BASE_FRAME::SelectLayer() to PCB_BASE_FRAME::SelectOneLayer()
- PCB_BASE_FRAME::SelectOneLayer(): make dismiss dialog by escape key working.
Fixes #7578
https://gitlab.com/kicad/code/kicad/issues/7578
2021-02-17 20:56:43 +01:00
Jon Evans 0198d5a3bd PNS: don't lose track of pad offset when dragging footprints
Fixes https://gitlab.com/kicad/code/kicad/-/issues/7500
2021-02-16 19:47:52 -05:00
Seth Hillbrand 9212197c26 Grammar 2021-02-15 15:18:13 -08:00
Jeff Young e2f8b1a4b1 Interpreting wxDialog::ShowModal()'s retval as bool is never what you want.
Fixes https://gitlab.com/kicad/code/kicad/issues/7454
2021-02-08 17:40:57 +00:00
Jeff Young 6272b48481 Make sure layer gets passed in to rules evaluation. 2021-02-08 14:53:49 +00:00
Jeff Young 7aa7e3fd43 Push undo/redo blocking down a level in LengthTuner tool.
This way it's active only while tuning a single line, rather than
while the tool is selected.

Fixes https://gitlab.com/kicad/code/kicad/issues/7462
2021-02-08 14:15:46 +00:00
Seth Hillbrand 792904557e Remember Parent data when routing
Keeps parent information such as UUID and pad removal options for
elements that are just updated in routing rather than created fresh or
fully destroyed.

Fixes https://gitlab.com/kicad/code/kicad/issues/7460
2021-02-07 17:08:43 -08:00
Jon Evans 721bf82603 Handle malformed lines in dragCornerInternal
Fixes https://gitlab.com/kicad/code/kicad/-/issues/7398
2021-02-03 20:55:22 -05:00
Jeff Young d7ddc62d7e Fix mouse warping and dialog placement for layer switcher.
Fixes https://gitlab.com/kicad/code/kicad/issues/2607
2021-02-02 17:20:01 +00:00
Marek Roszko dc4b73fcef Correct m_board check location in PNS_KICAD_IFACE_BASE::SyncWorld 2021-02-01 11:58:22 -05:00
Seth Hillbrand 73886aecb1 Ensure partially triangulated polys are not valid
Moves rule area triangulation outside of layer iterator and keeps the
triangulation_valid flag false until the triangulation has been
completed.

Fixes https://gitlab.com/kicad/code/kicad/issues/7032
2021-01-29 16:33:57 -08:00
Wayne Stambaugh 6a39b81647 Fix the last of broken Doxygen comment specifiers. 2021-01-27 17:39:44 -05:00
Mikołaj Wielgus 3e42ba18a9 Show dragging tools in context selection menu for components
Show the dragging tools in the context selection menu when a single
component is selected. Prevent the dragging tools from appearing when
more than one object is selected, as they will not activate anyway.

Fixes https://gitlab.com/kicad/code/kicad/issues/7258
2021-01-27 19:55:42 +00:00