Commit Graph

15 Commits

Author SHA1 Message Date
Oleg Endo 3de5b98316 improve performance of CONNECTIVITY_DATA::GetNetItems
- CN_CONNECTIVITY_ALGO::ForEachItem
move implementation to header, so that a lambda can be inlined by the
compiler.  improves iteration performance x2

- CN_ITEM::Net
move implementation to header, so that it can be inlined by the
compiler.

- CONNECTIVITY_DATA::GetNetItems
don't use std::set to filter out duplicates.  use std::unique on sorted
vector.  use a bitset to perform type check.
2020-04-21 13:23:56 +00:00
Seth Hillbrand 8c19b4b6ae pcbnew: Adding arcs to PNS
This is allows ARCs in tracks to be synchronized with
the PNS router.  Note this does not yet include the UI components
to route curved traces
2020-02-21 16:11:41 -08:00
Jeff Young c29a0b1966 Fix geometry error in connectivity algorithm.
For custom pad shapes were were calculating cardinal points off
of the bounding box.  However, the bounding box must be rotated
around the pad's position, rather than its shapePos -- which is
an issue since any thermal spokes will be rotated around the
shapePos.

Of course we don't really need to sort that out because we're
doing an intersection of the pad's boundary polygon with a vector
from the shapePos out to the cardianl point -- so we really just
need the cardinal point to be "out there".  So I've changed it
to use use INT_MAX / 2.

Fixes: lp:1851703
* https://bugs.launchpad.net/kicad/+bug/1851703
2019-11-10 14:52:01 +00:00
Jeff Young a6a4973324 Handle rotation for N/S/E/W pad cardinal points.
Fixes: lp:1844727
* https://bugs.launchpad.net/kicad/+bug/1844727
2019-11-05 17:22:51 +00:00
Jeff Young 429c7055e9 Some performance enhancements contributed by Oleg Endo.
Fixes: lp:1846438
* https://bugs.launchpad.net/kicad/+bug/1846438
2019-10-04 19:41:40 +01:00
Seth Hillbrand 4d8949371f conn: Connect pads to anchor points not geo center
Pads may include offsets that allow the user to shift the connection
point of the pad.  This is captured by the pad m_Pos but not by
ShapePos().  When testing connectivity, we need to get the offset
position.
2019-09-19 13:49:12 -07:00
Seth Hillbrand 18b6bdf5dd Use cached bbox for connectivity
On large boards, connectivity checks are hotspots.  We use the cached
bbox to avoid re-computing polygons for pads.
2019-08-23 10:45:41 -07:00
Jeff Young 809a4e3c0e Improve connectivity tests for pads.
We now test N, S, E and W as well as center.

Fixes: lp:1840721
* https://bugs.launchpad.net/kicad/+bug/1840721
2019-08-23 17:44:10 +01:00
jean-pierre charras dd702cd53d Remove pads not on copper layers (just on tech layers) from connectivity calculation.
Pads not on copper layers now do not have a netname, and are no longer taken in account in connectivity.
Especially it avoid creating useless rats-nests for these pads.
2019-07-25 13:08:41 +02:00
jean-pierre charras c9ccd8a642 Fix broken TRACKS_CLEANER algo to merge collinear track segments. 2019-06-28 20:23:09 +02:00
jean-pierre charras 71aafb6eb3 Pcbnew, connectivity: fix incorrect detection of dangling track ends when a end is inside a zone.
This end was not detected as connected by the IsDangling method.
Fix incorrect cleaning of dangling tracks in track cleaner.
Remove also a dead code.
The merge co-linear track segments is still full bugged in track cleaner.
2019-06-28 15:25:50 +02:00
Seth Hillbrand 6f7475dcd3 pcbnew: Prevent no-connects from driving clusters
The no-connect net (0) should never drive the net of a cluster.
Otherwise, tracks connecting between unconnected pads and connected pads
can acquire net 0 incorrectly.
2019-05-21 19:29:29 -07:00
Seth Hillbrand 7b2f245283 pcbnew: Tracks cleanup use connectivity database
Rather than duplicating the connectivity calculations in determining
whether a track is dangling, we utilize the current database to find the
number of connected items for an anchor item when feasible.

Multiple anchors such as tracks still need additional logic.

Fixes: lp:1805479
* https://bugs.launchpad.net/kicad/+bug/1805479
2018-11-27 11:17:59 -08:00
Seth Hillbrand 59adb109a6 Organizing connectivity
Moved large routines out of headers in into cpp.  Moved trivial routines
into headers.
2018-10-12 16:31:09 -07:00
Seth Hillbrand cfaf7c1f23 pcbnew: re-organizing connectivity
The connectivity files were unwieldy.  This separates them logically
into data, algo and items where the items classes are those that hold,
surprise, surprise, the items, lists and clusters.
2018-10-12 16:31:09 -07:00