Commit Graph

83 Commits

Author SHA1 Message Date
Ian McInerney 87a8235831 Remove group from dummy track before deletion
The dummy track in the merge colinear segments is used to overwrite the
original segment with the changes at the end, so the group must be
removed before leaving the function, and can't be removed at creation.

Fixes KICAD-74M
2024-04-01 21:59:55 +01:00
Alex Shvartzkop 2121227194 Fix nullptr group assert in tracks cleaner. 2024-02-10 00:44:05 +03:00
jean-pierre charras 07d7ccf46f Fix 2 minor compil warnings. 2024-01-10 09:16:14 +01:00
Seth Hillbrand d3e1e54b24 Avoid removing segments that do not maintain conns
If the two segments being merged have connection points originally, then
the merged segment must have the same connection points.  We had been
moving the merged segment to match the original connections but this is
not as robust as just not merging these lines (and therefore leaving the
original)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15495
2024-01-05 11:40:30 -08:00
Jeff Young 62d959ed0e Don't assume an error location for PAD::GetEffectivePolygon().
While ERROR_INSIDE was good for plotting, 3D generation, etc., it's
not good for generating router hulls.

Also reverts part of the change to always use polygons for PNS::SOLIDs.  A single shape in a SHAPE_COMPOUND will be faster (and
more accurate).

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14898
2023-10-13 13:59:26 +01:00
Jeff Young fb40c202a1 Refine track dangling test.
Turns out Clean Up Tracks and Vias wants a different answer from DRC.
2023-06-17 22:56:57 +01:00
Seth Hillbrand 19d0aceda3 Remove superfluous m_status variable
This used to be used to store information for the item similar to
m_state but it has been deprecated and no uses remained
2023-03-24 09:38:39 -07:00
Marek Roszko aacc9746e3 Yeet the last of wxSize/wxPoint to stop leaking gdicmn everywhere 2023-02-18 22:57:18 -05:00
Seth Hillbrand e713a3eac2 Handle cleanup safely
Make sure that the connectivity has successfully completed before
attempting to merge segments.  Also avoids reaching into the shared_ptr
if we don't need to

Fixes https://gitlab.com/kicad/code/kicad/issues/13639
2023-01-23 15:56:46 -08:00
Jeff Young 8d4694a83e Iterator safety.
Move mergeSegments to a lambda so we can more easily break out of the
nested for-loops when we find a merge.  We really need to start over
again at that point as we may have invalidated our connectivity items
iterator.

This also means we don't have to queue up all the track pointers, which
should get us a _little_ bit of the performance back.

Fixes https://gitlab.com/kicad/code/kicad/issues/13287
2022-12-27 20:14:13 +00:00
Jeff Young d16b23d16e Name shortening and line-break reduction. 2022-10-21 18:41:39 +01:00
Seth Hillbrand 35ac39844f Clean up some auto usage
Don't make new copies of shared_ptr if we can use references.  Keep auto
usage down to hard-to-type-out sequences
2022-08-15 11:29:45 -07:00
Jeff Young 96f01d33c8 Performance improvements.
1) Move a bunch of std::map's to std::unordered_map to get constant-time
look-ups
2) Lengthen progress-reporting intervals to spend more time doing work
and less time talking about it
3) Reverse order of SHAPE_LINE_CHAINs in thermal intersection checks to
make (much) better use of bbox caches
4) Don't re-generate bboxes we already have
5) Fix some autos that weren't by reference (and were therefore copying
large datasets)
6) Rename delta progressDelta so it's easier to search for in future
7) Get rid of a few more autos (because I don't like them)
8) Pass large items to lambdas by reference

Fixes https://gitlab.com/kicad/code/kicad/issues/12130
2022-08-03 11:59:42 +01:00
luz paz af6ba1a16e Fix typos in pcbnew sub-directory
Found via `codespell -q 3 -S *.po,./thirdparty,./Documentation/changelogs -L aactual,acount,aline,alocation,alog,anormal,anumber,aother,apoints,aparent,aray,ba,busses,dout,einstance,leaded,modul,ontext,ot,overide,serie,te,,tesselate,tesselator,tht`
2022-06-30 09:39:45 -04:00
Jeff Young dd561f1e4d Improve Cleanup Tracks and Vias messages. 2022-04-23 21:04:43 +01:00
Jeff Young c4c8848fa3 Performance enhancements for Cleanup Tracks & Vias.Performance enhancements for Cleanup Tracks & Vias.Performance enhancements for Cleanup Tracks & Vias.Performance enhancements for Cleanup Tracks & Vias.Performance enhancements for Cleanup Tracks & Vias.Performance enhancements for Cleanup Tracks & Vias.Performance enhancements for Cleanup Tracks & Vias.Performance enhancements for Cleanup Tracks & Vias.Performance enhancements for Cleanup Tracks & Vias.
Fixes https://gitlab.com/kicad/code/kicad/issues/11119
2022-03-18 11:04:53 +00:00
jean-pierre charras c34dc13a8e Rework on DIALOG_CLEANUP_TRACKS_AND_VIAS: do not immediately run the cleanup engine.
The cleanup engine is now run on request, before options are selected.
Needed for large boards because the calculation time can be significant.
2022-03-14 18:12:44 +01:00
Seth Hillbrand b5c2f0d39a Remove the open array in favor of std containers
The containers allow iteration, size knowledge and lower bug surface
2022-03-03 16:03:26 -08:00
Seth Hillbrand 9d927f3135 Check for additional connections between tracks
Prevents removal when a track is connected not just to other tracks but
also other connected items

Fixes https://gitlab.com/kicad/code/kicad/issues/10916
2022-03-03 12:07:20 -08:00
Seth Hillbrand 3a29d94c0a Prevent merging tracks across pads
When merging co-linear tracks, we should maintain the existing break if
it exists on pads, vias and other connection points
2022-02-17 19:43:04 -08:00
Seth Hillbrand cf88b9aaec Maintain connectivity while cleaning tracks/vias
When merging segments that loop back on each other, we need to merge
them in such a way to to keep the resulting endpoints connected to the
original adjoining endpoints

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

(cherry picked from commit 8e9d44942f)
2022-02-17 15:24:54 -08:00
Seth Hillbrand 16e802aff4 Don't count zero-length as duplicate
We were checking for duplicate tracks by looking to see if the two
tracks had two shared points.  A null track always matched this case,
which removed the valid track.  We solve this by avoiding null tracks in
the duplicate checker.  They are removed separately in the null track
stage.

This also fixes a GTK-specific tree issue where we require the
BeforeReset()/AfterReset() calls instead of Cleared() to prevent GTK
from dereferencing a parent after freeing

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

(cherry picked from commit 8753051db6)
2022-01-28 16:34:34 -08:00
Marek Roszko ea613cf448 Another batch of point changes 2022-01-01 13:17:12 -05:00
Jeff Young d5a5928e5a Improve clean up tracks & vias algorithm for neck-downs.
Fixes https://gitlab.com/kicad/code/kicad/issues/10098
2021-12-23 16:54:03 +00:00
Jeff Young 0d539a84a2 Fix bugs in Tracks Cleaner.
1) Implement more robust connection checking so we don't decide very
short segments with both endpoints within a single track are connected
at both ends.

2) Make use of the IS_DELETED flag to perform iteration during dryRun
so that all deletions to be made are flagged.

Fixes https://gitlab.com/kicad/code/kicad/issues/8883
2021-08-01 15:50:01 +01:00
Jeff Young 096e342386 Prefix TRACK, ARC and VIA. 2021-06-11 22:07:02 +01:00
Seth Hillbrand d8b1e827c7 Check all previous merge events
Typo only continued merge loop when last element was successfully
merged, leaving tracks where multiple segments were colinear

Fixes https://gitlab.com/kicad/code/kicad/issues/5020
2021-06-10 16:59:35 -07:00
luz paz f968fc8719 Fix source comment / documentation typos 2021-06-09 19:32:58 +00:00
Jeff Young 00ed75b891 Fix DRC performance with multi-layer keepout zones.
The main issue was a parameter mismatch which caused On^2 behaviour
for zone layers.

But there are several other performance optimizations here, along
with status bar updating for zones while running the dissallow test.

Fixes https://gitlab.com/kicad/code/kicad/issues/8521
2021-06-02 14:11:43 +01: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 ed66c0f14d Fix typo and clean up leftover tracks 2021-05-31 22:42:56 -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
Seth Hillbrand fb5cd22cd0 Honor locking in cleanup ops
Assume that the user has locked tracks/vias for a reason and would very
much like them to remain in place, regardless of the operation

Fixes https://gitlab.com/kicad/code/kicad/issues/7562
2021-02-16 10:20:45 -08:00
Seth Hillbrand 1e96374715 Consider tracks and vias together
Dangling tracks and vias affect each other and need to be considered at
the same time in order to fully remove the dangling segments
2021-01-08 09:35:58 -08:00
Jeff Young f5443de7f9 D_PAD -> PAD. 2020-11-13 15:16:24 +00:00
Jeff Young ae9afdd169 SNR. (Mostly for progammers, but a little for user messages.) 2020-11-02 16:20:00 +00:00
Jeff Young c351b3c31f Naming conventions. 2020-11-01 14:12:35 +00:00
Jeff Young 1a1aef756e Reporting "actual" incompatible with exiting after first hit.
But we're currently using this only as a rough collision check
anyway as it doesn't know the specific item-to-item clearance.
2020-10-31 15:45:41 +00:00
Jeff Young c44855a647 More performance enhancements for Cleanup Tracks and Vias. 2020-10-27 22:46:19 +00:00
Ian McInerney 31e626f279 Cleanup creation of all our smart pointers 2020-10-26 23:52:44 +00:00
Jeff Young 2e94be0855 Move geometric parts of Cleanup Tracks and Vias to RTree.
Removes two separate O(n^2) traverses over the tracks.

Fixes https://gitlab.com/kicad/code/kicad/issues/6077
2020-10-26 18:37:59 +00:00
Jeff Young ce5fbb0c58 Small performance boost and fix a bug between tracks and arcs. 2020-10-26 15:36:07 +00:00
Jeff Young 1703729269 Require explicit decl of maxError and errorLocations.
This should reduce both performance issues and clearance issues.
2020-10-13 13:49:07 +01:00
Seth Hillbrand 8fcb6c6f05 Exit fix loop in cleanup tracks
Fixes https://gitlab.com/kicad/code/kicad/issues/5968
2020-10-11 08:00:51 -07:00
jean-pierre charras 8285110c2a more cleanup about removing useless include 2020-10-02 08:58:19 +02:00
Jeff Young 01bf395cc2 Make via cleaning options clearer.
Fixes https://gitlab.com/kicad/code/kicad/issues/5253
2020-08-19 11:56:28 +01:00
Tomasz Wlostowski ae5eab1d85 TRACKS_CLEANER: post-rebase fixes 2020-08-13 14:50:59 +02:00
Tomasz Wlostowski d937fadd6f Migrate RC_ITEM to use shared_ptr 2020-08-13 14:50:59 +02:00
Jeff Young 393bb0fd83 Fix assert where geometry routine wasn't ready to handle layers.
This introduces layer handling to a lot of the geometry routines.
Many of them don't do much with it now, but it does help multi-layer
zones and will help when padstacks are implemented.
2020-08-12 22:20:08 +01:00
Jeff Young ea1be41ff0 Only clean up tracks completely inside pads.
Fixes https://gitlab.com/kicad/code/kicad/issues/5093
2020-08-06 21:53:28 +01:00