Commit Graph

291 Commits

Author SHA1 Message Date
Jeff Young f2f54fe926 Improve zone-layer-connections terminology and comments.
This makes it clearer that the overrides are not inverses of each
other -- one overrides the flashing state and the other overrides
the connection state (to other zones, not to everything).

Also fixes a bug where we were failing to check the force-no-connect
for pads.
2023-02-05 17:39:42 +00:00
Alex c122fd0e36 Remove unused cache_optionally_flashed_connections. 2023-02-05 17:39:42 +00:00
Alex f6fd85af85 CHANGED: Try to determine via/pad flashing state before filling zones.
If removing unused via annular ring option is enabled on a layer, then the via will have the ring if both:
- Via center is not inside a rule area with "Keep out copper fill" flag set
- Highest-priority zone the via hole intersects with has the same net

Pads will be flashed if:
- Pad center is not inside a rule area with "Keep out copper fill" flag set
- Highest-priority zone at the pad center has the same net

Fixes https://gitlab.com/kicad/code/kicad/issues/12964
2023-02-05 17:39:42 +00:00
Seth Hillbrand b427ad80f6 Don't make unneeded copies of std::pairs 2023-02-03 15:28:53 +01:00
Seth Hillbrand e60152e351 Fix island removal when copper->edge clearance is 0
Just testing a single point to find copper that is outside the board works
until the arc->segment conversion moves the board outline just enough to
have the filled copper slightly (few IU) outside of the converted outline.

Instead, we do an expensive check of comparing the size of the
intersection between the island and the island's intersection with the
board.  If the intersection is at least half as large as the original
island, we can say with certainty that the island is inside.  The margin
could be much smaller than half but this preserves the intent without
picking an arbitrary number that might be violated

Fixes https://gitlab.com/kicad/code/kicad/issues/13717
2023-02-02 19:19:26 +00:00
Seth Hillbrand f34aa947d3 Allow on-outline zones to be considered inside
Also ensure that calculated areas for island removal are absolute.

The on-outline zone can happen when the clearance to the edge is
particularly small.

Fixes https://gitlab.com/kicad/code/kicad/issues/13717
2023-01-31 12:32:23 -08:00
Jon Evans 675b6b5d5c Fix logic error in ec4d377d
Also fixup goldens for importers for new default island mode
2023-01-27 10:16:56 -05:00
Jon Evans ec4d377d15 Stop removing islands for fully-isolated zones
It is hard for a user to tell what is going on when their zone
just doesn't fill at all.  We catch isolated areas in the DRC so
we can just leave them alone here until the zone has at least one
non-isolated filled area.

Also change default back to always remove islands to reduce confusion

Fixes https://gitlab.com/kicad/code/kicad/-/issues/13271
2023-01-27 08:57:18 -05:00
Jeff Young bf4b9ef6e2 Remove sorting by priority before filling.
We can't fill lower-priority zones until the higher-priority ones
have been tesselated, and as the tesselation step always gets pushed
to the back of the queue after the fill finishes having them sorted
by priority accomplishes little.  (We're also going to push all other
layers of the high-priority zone to the back as the first layer will
have the lock, further degrading the usefulness of sorting.)
2023-01-15 15:52:24 +00:00
Jeff Young 0c8f95aa02 Make sure tesselate_lambda has lock before modifying zone.
Also implements locking for upating pad & tracks' zoneConnectionCaches.

Fixes https://gitlab.com/kicad/code/kicad/issues/13531
2023-01-15 15:52:24 +00:00
Jeff Young 45a71a205c Don't wait for degenerate zones. 2023-01-15 15:52:24 +00:00
Jeff Young e509fa0fc9 Don't depend on a pad being connected to a non-zone when filling zones.
If the pad hasn't already been owned by another zone, and the zone we're
currently filling can connect to it, then we want to try to flash it even
if it's not connected to anything else.

Fixes https://gitlab.com/kicad/code/kicad/issues/13415
2023-01-07 19:34:32 +00:00
Jeff Young f4bce6079c Prevent round-off errors from drawing one spoke and not the other.
Fixes https://gitlab.com/kicad/code/kicad/issues/13316
2023-01-02 19:23:52 +00:00
Seth Hillbrand d8f94962ff Prevent halting the main GUI thread 2022-12-05 11:10:57 -08:00
Alex 0089df8ca4 Update comment in zone filler. 2022-12-05 21:48:12 +03:00
Alex c4aed1d941 Make sure that threads are not running after zone filling. 2022-12-05 21:36:59 +03:00
Jeff Young 19eab62516 More safety around ratsnest state.
Fixes https://gitlab.com/kicad/code/kicad/issues/13011
2022-11-30 13:00:21 +00:00
Jeff Young b42d5da07d Check keepTopBottom when determining whether or not to flash a pad/via.
Fixes https://gitlab.com/kicad/code/kicad/issues/12961
2022-11-22 18:18:43 +00:00
Seth Hillbrand aca3329469 Remove superfluous Simplify call 2022-10-28 17:01:36 -07:00
Seth Hillbrand 7a874255c5 Be smarter about canceling fills
Handles cancellation in main fill loop.  Allows loops to finish without
restarting new ones.  Further enhancement might allow breaking threads
cleanly but this gets 90% of the cases

Fixes https://gitlab.com/kicad/code/kicad/issues/12693
2022-10-28 10:17:58 -07:00
Jeff Young d16b23d16e Name shortening and line-break reduction. 2022-10-21 18:41:39 +01:00
Jeff Young 323c04af2c Fix order-of-ops issue with calling collide before tesselating. 2022-10-20 18:37:48 +01:00
Jeff Young 1f0fa3ef63 Fix bug in new optionally-flashed via/pad zone fill logic. 2022-10-18 14:02:47 +01:00
Jeff Young 437d2c4589 Overhaul of remove-unconnected's zone filling and drawing strategies.
1) The highest priority zone that a via/pad collides with "owns" its
connectivity state.  Once set, lower priority zones cannot change it --
and in fact, if they would have connected to it are forced not to.

2) The connectivity state goes with the zone fill state, and therefore
must be saved in the file.

3) Display of remove-unconnected's pads is no longer done in GetViewLOD()
(which isn't called for selected items), and is instead done in PCB_PAINTER.
This allows us to draw the full pad in outline mode when a via/pad is
selected which would otherwise only show the hole.

4) Note that in some cases this will still generate DRC errors -- in
particular when a via nearly collides with a higher priority zone it
won't get "owned" by that zone and may therefore have insufficient
clearance if said zone concludes it's unconnected and a subsequent
(lower priority) zone connects to it (causing it to now become flashed).

Fixes https://gitlab.com/kicad/code/kicad/issues/11299
2022-10-18 13:05:42 +01:00
Seth Hillbrand b4f3390626 Drill size is absolute
Use hole plating size for visibility only, not zone filling, routing or
DRC
2022-10-04 09:52:40 -07:00
Jeff Young e49de68a59 Implement a more durable zone bounding box caching strategy.
Fixes https://gitlab.com/kicad/code/kicad/issues/10821
2022-10-01 22:10:43 +01:00
Jeff Young d776e908d0 Fix an edge-case in the spoke genration logic for non-cardinal spokes.
Fixes https://gitlab.com/kicad/code/kicad/issues/12549
2022-10-01 19:31:47 +01:00
Jeff Young d67437a2aa Move ratsnest exclusion processing to a post-pass.
Also fixes a few cases where we were unnecessarily rebuilding
connectivity more than once for an operation.
2022-09-29 17:08:49 +01:00
Jeff Young 503385f52e Don't use FindNamedPad for net-tie logic. It only reutrns the *first*
pad of a given number.

Also improves other DRC logic to tighten up the net-tie rules now that
we know which pads are allowed to short with which other pads.

Also removes the "Overlapping pads" DRC violation now that we know
whether or not overlapping pads in a net-tie footprint constitute a
short.

Fixes https://gitlab.com/kicad/code/kicad/issues/12506
2022-09-25 17:38:31 +01:00
Seth Hillbrand 9b4eb91f12 Zone Fill performance enhancement
Don't wait until all zones are filled before tesselating fills.
Tesselation happens on a layer-by-layer basis, so once the zones' layers
are filled, we can tesselate them in parallel with the remaining fill
work
2022-09-19 11:53:50 -07:00
Seth Hillbrand 0295090135 Zone Fill performance for overlapping zones
When multiple zones overlap each other, we need to synchronize the
filling.  This should not wait for all zones to try to fill before
restarting.  Instead, zones that cannot be filled because the depend on
another zone finishing are immediately re-inserted into the fill queue.
2022-09-19 10:11:06 -07:00
Marek Roszko 3d5913c825 Remove convert_to_biu.h, merge contents to base_units.h 2022-09-16 21:09:28 -04:00
Marek Roszko 66e8931405 Remove IU_PER_MM thats standalone 2022-09-16 21:09:27 -04:00
Marek Roszko a8613ee80f Combine Iu2Millimeter & remove PcbMm2iu 2022-09-16 21:09:26 -04:00
Seth Hillbrand 8e361e8a15 Be more diligent about checking for zone file deps
The outline collision is relatively cheap (especially after filtering
bbox collisions) so check if a zone REALLY depends on another zone
before making it wait.  Waiting for zones can really increase the total
fill time
2022-09-16 17:23:06 -07:00
Jeff Young 19d8dcad8b Don't hang when filling degenerate zones. 2022-09-15 23:16:08 +01:00
Seth Hillbrand 26a1114e3c Avoid Yields when the results are ready
We always need to check for calculation results before yielding the
system otherwise we will delay outcomes

Fixes https://gitlab.com/kicad/code/kicad/issues/12228
2022-09-14 13:30:04 -07:00
Jeff Young b4492e0bd2 More EDA_RECE yeetage. 2022-08-31 17:19:50 +01:00
jean-pierre charras 5616ef2e7c ZONE_FILLER::buildThermalSpokes() fix incorrect spoke shape for pad shapes with offset.
Fixes #12201
https://gitlab.com/kicad/code/kicad/issues/12201
2022-08-10 15:27:28 +02: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
Jeff Young 43df863df2 Fix issue with caches not being initialized when printing msg bar. 2022-08-01 13:09:51 +01:00
Seth Hillbrand 03c279ffd4 ADDED: Threadpool
Thread pools are long-lasting executors that have close to zero overhead
when launching new jobs.  This is advantageous over creating new threads
as we can use this for threading smalling jobs and smaller quanta.  It
also avoids the heuristics needed to determine the optimal number of
threads to spawn
2022-06-24 22:59:24 +00:00
Jeff Young f2c26ae528 Formatting. 2022-06-08 23:53:18 +01:00
Jeff Young fa11e1c097 Take text height into account as well as thickness for knockout margin.
Also centralizes calculation so all clients will get the same answer.

Fixes https://gitlab.com/kicad/code/kicad/issues/11636
2022-05-20 12:29:01 +01:00
Jeff Young cc86d3da2a Give up trying to find a one-size-fits-all boudningBox for text.
Fixes https://gitlab.com/kicad/code/kicad/issues/11636
2022-05-18 17:14:57 +01:00
Jeff Young 30ecca464d Rename mechanical_clearance -> physical_clearance.
Fixes https://gitlab.com/kicad/code/kicad/issues/11554
2022-05-06 15:54:46 +01:00
Jeff Young 371091a09b Make zone filler respect mechanical clearances. 2022-05-06 00:06:00 +01:00
Jeff Young 5d0d2201f3 Improve clearance report messages.
Removes some duplicated terms; puts in some more headers to make
visual parsing easier, and makes non-connected-pads report the correct
data.

Also fixes a bug where zone-connection overrides of none weren't getting
handled correctly.

Fixes https://gitlab.com/kicad/code/kicad/issues/11544
2022-05-03 16:30:04 +01:00
Jeff Young 604a148f40 Don't apply electrical clearance to shapes on Edge.Cuts.
Also don't apply them to NPTH holes.
2022-04-13 23:38:45 +01:00
Jeff Young 1dae5eb7c4 A better blob vs web detector.
Since we're in a deflated state, a long web *could* still have a very
small area.  So check max extents instead.
2022-04-10 19:48:45 +01:00