Commit Graph

1211 Commits

Author SHA1 Message Date
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
Tomasz Wlostowski 2ae3a83b54 router: fix use-after-free crash in single trace shove routing when m_endItem's owning NODE is erased by the springback algorithm.
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/9994
2021-12-15 01:33:05 +01:00
Jon Evans b291d6c810 Fix success conditions in DP placer
The placer can sometimes generate segments that are not quite parallel.
Use a different tolerance for ApproxParallel to account for this.

Also set a minimum score for placement judging so that any placement
that doesn't violate DRC can be placed.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/9948
2021-12-12 13:05:38 -05:00
jean-pierre charras 6d0d4e0db9 Pcbnew, router tool: ensure switching layer by + or - works when starting routing.
Fixes #9936
https://gitlab.com/kicad/code/kicad/issues/9936
2021-12-11 09:54:03 +01:00
Seth Hillbrand 77fbb495f2 Highlight net during inline drag
Keep consistent UX between inline drag and drag started in the router
tool itself by highlighting the net being dragged

Fixes https://gitlab.com/kicad/code/kicad/issues/9919
2021-12-09 09:28:43 -08:00
Jeff Young 95087c6de5 Fix clearance outlines for router head.
Fixes https://gitlab.com/kicad/code/kicad/issues/9885
2021-12-06 15:51:53 +00:00
Jon Evans 5ba215c8ea Use actual width when previewing PNS lines 2021-12-05 13:41:39 -05: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
Jeff Young 5cb2641142 Fix nullptr dereference in router.
Fixes https://gitlab.com/kicad/code/kicad/issues/9844
2021-12-02 13:20:44 +00:00
Jeff Young a596a1f2e2 ROUTER_TOOL needs to handle pads not handled by router itself.
Fixes https://gitlab.com/kicad/code/kicad/issues/9839
2021-12-01 22:25:02 +00:00
Jeff Young 3c0b10b022 Don't use approximated shapes for router hulls.
We only do 45-degree routing anyway so we might as well build an
octagonal-based hull from the get-go.

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

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

Fixes https://gitlab.com/kicad/code/kicad/issues/9833
2021-12-01 19:44:30 +00:00
Jeff Young 09ed60feb3 Don't make inferences about object type based on shape. 2021-12-01 19:44:30 +00:00
Ian McInerney 63560ecd7b Remove RM_Smart state from router tool
It was never fully implemented and there was no way to switch into this
route mode.
2021-12-01 09:52:37 +00:00
Jon Evans a746d31038 PNS: Fix loop removal outside shove mode
Fixes https://gitlab.com/kicad/code/kicad/-/issues/9680
2021-11-27 15:21:47 -05:00
Jon Evans 8a0f8c329f PNS: Fix DP gateway generation when pad distance < gap
Fixes https://gitlab.com/kicad/code/kicad/-/issues/9306
2021-11-27 14:03:19 -05:00
Seth Hillbrand 4b226b8172 Unify our breakTracks routines
Fixes https://gitlab.com/kicad/code/kicad/issues/9793
2021-11-27 06:34:47 -08:00
Jeff Young 6652e5acf4 Draw pad holes when dragging.
Most of the time they're under the pad, but the provide needed
info when the hole is larger than the pad.

Fixes https://gitlab.com/kicad/code/kicad/issues/9786
2021-11-27 00:55:09 +00:00
Jeff Young 9547c72e73 Teach router about different keepout rules.
Fixes https://gitlab.com/kicad/code/kicad/issues/9786
2021-11-27 00:55:04 +00:00
Jeff Young 99ec2b1801 Don't hide original object when highlight is only part of it.
Fixes https://gitlab.com/kicad/code/kicad/issues/9772
2021-11-25 23:42:13 +00:00
Jon Evans da458535c4 PNS: Avoid flickering clearances on new items
Fixes https://gitlab.com/kicad/code/kicad/-/issues/9773
2021-11-25 15:38:04 -05:00
Jon Evans 63718323bc PNS: Holes need to be moved with solids
Fixes https://gitlab.com/kicad/code/kicad/-/issues/9773
2021-11-25 15:31:18 -05:00
Jon Evans b4342d813b Fix SHAPE_LINE_CHAIN::Slice when end is an arc followed by a point
Fixes https://gitlab.com/kicad/code/kicad/-/issues/9770
2021-11-25 10:05:33 -05:00
Jeff Young ade8fe4333 When dragging footprints pads with holes also need to be taken along.
Otherwise (aside from not colliding with their dragged location) we
won't update their locations and then if they happen to be the first
pad in the footprint we'll try to update the footprint's location post-
drag with the pad offset (which will be {0,0}.

This is easily reproducible with the test document in the bug in the
"fixes" statement.

Fixes https://gitlab.com/kicad/code/kicad/issues/9391
2021-11-25 14:54:12 +00:00