Commit Graph

1233 Commits

Author SHA1 Message Date
Alex 6de30b19a0 Don't sync the world twice in inline router tools.
Activate() already clears and syncs the world via PNS::TOOL_BASE::Reset,
so there's no need to sync in InlineDrag and InlineBreakTrack.

(cherry picked from commit cc4e34ef49)
2022-10-21 17:21:24 +03:00
Jeff Young da520f83ee Use comma to separate diff pair nets/netclassse rather than /.
("/" is problematic because it's more likely to appear in netnames.)

Fixes https://gitlab.com/kicad/code/kicad/issues/12592

(cherry picked from commit 6fd195c389)
2022-10-21 11:11:02 +01:00
Jeff Young 47547713de Broaden reset-sizes-after-layer-switch algorithm.
Fixes https://gitlab.com/kicad/code/kicad/issues/12576

(cherry picked from commit 40ad5b6de3)
2022-10-21 11:09:47 +01:00
Jeff Young bf95906f90 Re-entrancy guard for router tool.
Fixes https://gitlab.com/kicad/code/kicad/issues/12604

(cherry picked from commit 413fd82813)
2022-10-19 18:24:33 +01:00
Jeff Young 5bcd0a5828 Update router sizes when switching layers.
We may have layer-specific rules involved.  Note that at some point
we also need to do something similar on every "fix route" step to
handle area-specific rules.

Fixes https://gitlab.com/kicad/code/kicad/issues/12576

(cherry picked from commit d8a3ba7917)
2022-10-19 14:47:08 +01:00
Jeff Young 74d8040e8c Force flashing when generating SOLIDs.
We only have a single SOLID per pad, so the solid's shape must always
be the flashed shape and then we can do layer-specific flashing tests
internally.

Fixes https://gitlab.com/kicad/code/kicad/issues/12458

(cherry picked from commit 08260661b8)
2022-10-19 14:43:13 +01:00
Jeff Young 6390633a7b Use GetCurrentNets(), not m_startItem for message panel updates.
Fixes https://gitlab.com/kicad/code/kicad/issues/12592

(cherry picked from commit cbb997a3b5)
2022-10-19 14:28:06 +01:00
Jeff Young f1029b7280 We don't always have a line when dragging.
Fixes https://gitlab.com/kicad/code/kicad/issues/12612

(cherry picked from commit b2f05c758b)
2022-10-13 09:15:24 -07:00
Seth Hillbrand e834374ad2 Drill size is absolute
Use hole plating size for visibility only, not zone filling, routing or
DRC

(cherry picked from commit b4f3390626)
2022-10-04 10:00:36 -07:00
Jeff Young 6d25e57cd7 Allow free pad usage in router.
Fixes https://gitlab.com/kicad/code/kicad/issues/11730

(cherry picked from commit 7c83c78afe)
2022-09-28 14:49:44 +01:00
Tomasz Wlostowski e593e0b014 router: somewhat improved stop-if-walk-path-is-too-long heuristic in the walkaround algorithm 2022-09-06 11:06:38 -07:00
Tomasz Wlostowski 42dae1504a router: fix negative chamfer value for hulls generated for 0-length segments 2022-09-06 11:06:31 -07:00
Seth Hillbrand 440d324c9e Don't prevent immediate actions while router active
Immediate actions that can take place are useful.  We should only be
preventing immediate actions while actively routing or dragging

Fixes https://gitlab.com/kicad/code/kicad/issues/12311

(cherry picked from commit 91fbb5c957)
2022-09-06 11:04:33 -07:00
Jeff Young 0acea2e386 Make sure via-gap-same-as-trace-gap gets turned off for board settings.
Fixes https://gitlab.com/kicad/code/kicad/issues/12236

(cherry picked from commit 7baa56528a)
2022-09-02 00:55:53 +01:00
Roberto Fernandez Bautista 83305dd407 Re-route m_last_head after routing fails
This should ensure the shove state gets reverted

Fixes https://gitlab.com/kicad/code/kicad/-/issues/9023
2022-09-01 22:06:06 +00:00
Seth Hillbrand 1d5db513a1 Ensure arcs are handled in topology
Use the connection-independent `Anchor()` function to get connection
points for either arcs or segments in topology.  This allows the
ratsnest to be correctly drawn between nets with arcs

Fixes https://gitlab.com/kicad/code/kicad/issues/12205
2022-09-01 22:06:06 +00:00
Seth Hillbrand a12ae5050a Cleanup unused code
(cherry picked from commit 76b9e25143)
2022-08-02 08:51:04 -07:00
Seth Hillbrand 82e8e38054 PNS: Handle via-in-pad distances when tuning
Tuning with a via in pad, the via isn't a part of the full line.  But we
still need to account for the line length distance of the
starting/ending vias.  To do this, we simply measure the height from
the ending track to the ending pad and starting track to starting pad
2022-08-01 20:23:07 -07:00
Seth Hillbrand 6c617d84ca Prevent drag index from exceeding full line count
Simplification removes segments, so we might lose our valid index.
Ideally, we would simplify during the assembly or pass the input index
to the simplify routine to maintain the proper value.

Fixes https://gitlab.com/kicad/code/kicad/issues/12137
2022-08-01 08:57:45 -07:00
Jeff Young 06baaa33fa Rely on DRC rules when items might overlap.
Fixes https://gitlab.com/kicad/code/kicad/issues/1790

(cherry picked from commit f48ed79039)
2022-07-25 19:31:05 +01:00
Jeff Young cd5b4ec8f2 Add edge-exclusions to router (for castellated pads).
Fixes https://gitlab.com/kicad/code/kicad/issues/1790

(cherry picked from commit 833dc70bff)
2022-07-25 19:30:49 +01:00
Jon Evans 2512375988 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
2022-07-11 22:47:28 -04:00
Tomasz Wlostowski b59c334edb router: another attempt at improving 'kink' robustness of the hull generator
(cherry picked from commit f5fe1d5462)
2022-06-10 09:17:07 -04:00
Tomasz Wlostowski 4d5b5d3791 router: fix SegmentHull() corner case when it 'chamfers' more than the clearance permits (corner case for 0-length segments, which we use
for representing holes)


(cherry picked from commit 56df462474)
2022-06-08 22:39:22 +00:00
Tomasz Wlostowski 4694a2622e router: use either copper or hole clearance, whichever is larger, when checking track -> hole collisions
(cherry picked from commit 990281a897)
2022-06-08 22:39:08 +00:00
Tomasz Wlostowski 92ba60628e router: improvements in robustness of SegmentHull()
- ensure the 'chamfer' radius and clearance is rounded before computing the actual hull vertices
- for small, non-45 degree line segments (present in many boards), generate a slightly larger but still axis-aligned 45 degree hull instead of following exactly the segment direction


(cherry picked from commit bcfe12ce47)
2022-06-08 16:14:03 +00:00
Jon Evans 895314b639 PNS: Fixup hole clearance to use exact hulls for walkaround
(partially cherry picked from commit 30fb298ed3)
2022-06-07 22:34:16 -04:00
Jon Evans 6253b878a0 PNS: Implement HoleHull for VIA
(cherry picked from commit 23596812b6)
2022-06-08 02:05:25 +00:00
Jon Evans 5d4e2aa595 PNS: Remove offsets from hull generation
This is likely an old workaround to numerical precision issues
in the DRC system that no longer exist.  Removing this is necessary
for "exact" hull generation to produce walkaround results that
look nice (paths falling exactly on the grid lines)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/10710
2022-06-03 17:39:22 -04:00
Jon Evans 2a91ba35c1 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
2022-06-03 17:39:22 -04:00
Jon Evans 8d8f96b094 PNS: Fix off-by-one in dragCornerInternal
Fixes https://gitlab.com/kicad/code/kicad/-/issues/10919
2022-06-01 17:11:03 -04:00
Jon Evans a4aa447b95 [PNS] Fix invalid assumption in IsLineCorner 2022-05-31 20:19:20 -04:00
Jon Evans 53dbd3bb02 PNS: Fix skew calculation with pad-to-die specified
Fixes https://gitlab.com/kicad/code/kicad/-/issues/11710
2022-05-31 20:19:19 -04:00
Jeff Young e21f0ec9fb Honour prime-event-location when starting router.
Fixes https://gitlab.com/kicad/code/kicad/issues/11239

(cherry picked from commit a54bbfe12b)
2022-04-03 18:21:00 +01:00
Seth Hillbrand 901c330478 Update end item before moving on track/via change
The move even dereferences m_enditem for logging and perhaps other
actions.  We need to ensure that the end item has not been invalidated
before taking this action

Fixes https://gitlab.com/kicad/code/kicad/issues/10732
2022-03-02 09:21:52 -08:00
Jeff Young 246b6fcdd6 Use router to update message panel when routing.
Fixes https://gitlab.com/kicad/code/kicad/issues/10068
2022-02-20 13:54:01 +00:00
Tomasz Wlostowski 4eb9440a42 router: include arc approximation tollerance in arc hull clearance calculation
fixes: https://gitlab.com/kicad/code/kicad/-/issues/10470
(cherry picked from commit ce28525172)
2022-02-17 09:22:19 -08:00
Jeff Young 7cba8e847d Don't use bounding box cache during insideArea.
For starters we can't rely on it having been updated, but we also
cache the entire result so there's no huge cost-savings anyway.

Fixes https://gitlab.com/kicad/code/kicad/issues/10821

(cherry picked from commit 8dcc933fc3)
2022-02-13 18:20:31 +00:00
Jeff Young 9e5e46514d More wide-string declarations. 2022-02-05 13:29:00 +00:00
Seth Hillbrand 901685f01b Don't convert KIID on the fly
Converting to string on save prevent unneeded ops
2022-02-03 10:34:14 -08:00
Seth Hillbrand 833ce19221 Be more diligent in preventing drag line errors
They can happen even when there are no collisions, so we need to reset
the 'ok' flag before using the line again.

Fixes https://gitlab.com/kicad/code/kicad/issues/9555
2022-01-31 16:09:14 -08:00
Seth Hillbrand 38a4894d92 Prevent multiple single-point line solutions
Suggested by @rivimey, we test the case where both lines return singular
point lines and prevent them leaking into our drag solution

Fixes https://gitlab.com/kicad/code/kicad/issues/9555
2022-01-29 07:07:03 -08:00
Seth Hillbrand 8ae304dcca Don't allow degenerate lines in dragger
If walkaround returns an invalid line, don't consider it for a track

Fixes https://gitlab.com/kicad/code/kicad/issues/9555
2022-01-28 15:18:42 -08:00
Jon Evans 20bbf9b179 PNS: Do not clear layer pairs when importing new sizes
Fixes https://gitlab.com/kicad/code/kicad/-/issues/10225
2022-01-13 20:37:37 -05:00
Jon Evans cf4d46b24d PNS: Do not allow smart pads when in 90-degree mode
Fixes https://gitlab.com/kicad/code/kicad/-/issues/10386
2022-01-13 20:21:19 -05:00
Jon Evans 45182febaf Exit router and invoke edit tool when attempting to drag an arc track
Fixes https://gitlab.com/kicad/code/kicad/-/issues/10208
2022-01-02 16:10:26 -05:00
Tomasz Wlostowski 57af990066 router: fix layer switch issue when starting a track on via without fixed segments
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/9915
2021-12-16 00:55:17 +01:00
Mike Williams 956ac871c3 PCB Editor: changes to track width overrides starting track width
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/8797
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/8797
2021-12-15 23:32:48 +00:00
Tomasz Wlostowski 97c2627de6 router: added missing case items (fixes regression in component dragging)
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/10010
2021-12-15 23:18:55 +01:00
Tomasz Wlostowski 965ab42938 router: when dragging segments, don't snap to other segments on the same layer. Fixes drag flickering for short segments.
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/9720
2021-12-15 01:48:04 +01:00