Commit Graph

81 Commits

Author SHA1 Message Date
Jeff Young 7ee6afeace Performance improvement for zone filling. 2019-07-06 00:04:54 +01:00
Jeff Young a2fe319b92 Fix bug introduced when edge-thickness adjustments were moved.
Fixes: lp:1835132
* https://bugs.launchpad.net/kicad/+bug/1835132
2019-07-03 12:12:00 +01:00
Seth Hillbrand 743c650129 Move zone refill to action
This unifies the zone refill across architecture into the tool-based
architecture.  Also provides ZONE_FILLER-based progress managment for
tools.

(cherry picked from commit be9cd98cb1)
2019-07-01 09:27:04 -07:00
Jeff Young 00cf8ba976 Fix rotated & offset pad thermal spoke geometry. 2019-06-26 00:04:35 +01:00
Jeff Young 107d206dba Back to the drawing board for zone filling.
This one doesn't cut any corners so should be "correct".  And it
turns out to be pretty fast.
2019-06-25 21:10:21 +01:00
Jeff Young d4054029cd Shrink/expand zone by minimum width only after doing all knockouts.
It's too complicated trying to keep everything smaller or larger by
half the pen width, and some things like spoke-end-detection need the
actual outline anyway.
2019-06-25 11:34:28 +01:00
Jeff Young 3784950603 Added more sophisticated checking for thermal spoke connections.
And, again, some more performance optimizations to make up for it.
2019-06-25 11:34:28 +01:00
Jeff Young 0ed26e4e33 Fix some geometry error in thermal spoke calculations.
Also introduces some performance enhancements to make up for the
extra time spent in the calculations.
2019-06-25 11:34:28 +01:00
Jeff Young e5cb8a0310 Bug fixes for rotated pad thermal spokes. 2019-06-25 11:34:28 +01:00
Jeff Young 70e6d95c7f More zone fill performance enhancements.
Knocking out unconnected spokes turns out to be very expensive, so
keep them in a list and only apply them if they're connected.
2019-06-25 11:34:28 +01:00
Jeff Young 14986d1e0e Zone fill performance enhancements.
Batch up fast operations to reduce the number of slow operations
required.
2019-06-25 11:34:28 +01:00
Jeff Young 79cd457ba7 Implement thermal spokes for custom pad shapes.
The thermal spokes are anchored at the pad anchor.  They may or may
not make sense, depending on the pad shape.  It's up to the author
to move the anchor around as necessary or to not use thermals.
2019-06-25 11:34:28 +01:00
Jeff Young 5c89e4490e Change zone fill algorithm to better handle thermal reliefs.
Thermal reliefs must not knock-out spokes of other pads, while
clearances must knock-out spokes of all pads.  Therefore we now
do all thermal reliefs, then all spokes, then all clearances.

Fixes: lp:602176
* https://bugs.launchpad.net/kicad/+bug/602176

Fixes: lp:1782957
* https://bugs.launchpad.net/kicad/+bug/1782957
2019-06-25 11:34:27 +01:00
Seth Hillbrand 251e0ca19c Minor bug fix to zones
On linux, m_brdOutlinesValid initialized to "true" which prevented
non-copper zones from filling correctly
2019-06-22 10:56:37 -07:00
jean-pierre charras c8c318510e Pcbnew, zones filler: fix a bug I introduced in my commit b1803bc. 2019-06-22 16:41:20 +02:00
jean-pierre charras b1803bcf02 Pcbnew, zones filled: fix incorrect clipping of filled areas outside the board outlines.
fix also an other minor issue: these filled areas were slightly too large.
2019-06-22 09:55:57 +02:00
jean-pierre charras e75be4074e Pcbnew: finalize the new zone filling algo (filled polygons with no thickness). 2019-06-05 18:36:20 +02:00
Seth Hillbrand 9163ac543a pcbnew: Move pads to std::deque 2019-06-01 16:23:54 -07:00
Seth Hillbrand d1877d7c1b Moving modules from DLIST to std::deque 2019-06-01 09:53:23 -07:00
Seth Hillbrand 6bcf1839b7 pcbnew: Add arc approximation setting to board
This places the arc approximation setting in the kicad_pcb file and uses
it for all parts of the board rendering where arcs are converted to
segments.  This allows the user to customize their speed vs. accuracy
tradeoff.  The default setting of maximum error of 0.005mm is acceptable
for small boards on moderate systems.
2019-05-24 21:21:06 -07:00
jean-pierre charras ce93934f08 Pcbnew, ZONE_FILLER: fix incorrect test to remove filled areas outside the board edge cuts.
This incorrect test was only for zones with no net.
2019-05-23 20:22:03 +02:00
Seth Hillbrand ddc6079ceb Move remaining hard-coded segment counts
This removes the remaining hard-coded segments counts and replaces them
with the relative error calculation where the segments per arc is
determined by the maximum error we allow (smaller arcs = fewer segments)
2019-05-16 08:49:55 -07:00
jean-pierre charras 4e5a94efb7 Pcbnew, non copper zones: fix 2 issues.
1 - For debug purposes, the code to fill non copper zones was disabled and the copper zone code was uses instead.
It creates issues with pad clearance areas, because a non copper zone has no clearance areas.
2 - The non copper zone dialog had no option to set the outline smoothing option.
Unfortunately, this parameter was inherited from the last edited copper zone.
And therefore the non copper zone can have a non wanted outline smoothing option.
This option is now added to the dialog.

Fixes: lp:1826952
https://bugs.launchpad.net/kicad/+bug/1826952
2019-04-30 13:16:29 +02:00
Jeff Young dae41b7460 Remove legacy segment-based zones.
Give the user the option of cancelling a file open if there are
segment zones; otherwise they're converted to polygon fills.

Fixes: lp:1823087
* https://bugs.launchpad.net/kicad/+bug/1823087
2019-04-12 20:19:23 +01:00
jean-pierre charras aa53b5508e Zone filler: fix missing calculation of filled polygons when fill mode is ZFM::SEGMENTS 2019-04-10 17:49:40 +02:00
jean-pierre charras 37ae0bf809 Pcbnew: fix a serious issue in ZONE_FILLER. 2019-04-09 11:38:18 +02:00
Jeff Young 52e3a1d7c4 Trim zone fills to board outline.
Fixes: lp:1820306
* https://bugs.launchpad.net/kicad/+bug/1820306
2019-04-08 13:10:29 +01:00
Jeff Young 1ae47b6069 Implement a copper-to-edge-clearance setting.
For legacy boards, the setting is picked up from the board outline
thickness.  If the board outline has mixed thicknesses, then the
max is used and a warning is displayed.

Fixes: lp:1797787
* https://bugs.launchpad.net/kicad/+bug/1797787
2019-04-05 22:18:44 +01:00
jean-pierre charras 7170720f3c Allow hatch pattern in filled zones
the filled areas can use a hatch pattern (crossing lines) using square holes.
The zone filler removes too small holes (truncated holes) from hatch pattern.
It avoid to create small holes when a hole pattern is truncated by the filled area base shape.
2019-03-31 08:21:40 +02:00
jean-pierre charras fdfe5eabfb Fix incorrect detection of filled zones changes in DRC check.
Commit 6006703798 fixed a crash but broke the filled zones changes detection.
Filled zones were always seen as not up to date due to the fact the filled areas were cleared too early.

The up to date detection is also optimized: the old filled polygons are no longer stored.
Instead of, the MD5_HASH is calculated and stored before clearing the filled polygons.
2019-03-21 15:27:05 +01:00
jean-pierre charras 353d9d7c9e Pcbnew, Zone refill: avoid useless refilling, when zone parameters are not modified.
Previously, in many cases the selected zone was refilled on exit selection, even if the zone was not modified.
This is annoying, because the zone fill can be really time consuming, and cannot be called without a good reason.
Now the refilling is made only if a zone parameter is actually modified.
2019-03-14 17:33:25 +01:00
Seth Hillbrand 6006703798 pcbnew: Remove fills prior to updates
Removing existing fills will prevent re-drawing invalid polygons before
they are ready.  This seems to happen on Macs more easily due to redraw
timing.

Fixes: lp:1819553
* https://bugs.launchpad.net/kicad/+bug/1819553
2019-03-11 16:25:43 -07:00
jean-pierre charras b9944e2c06 Thermal reliefs: fix a corner case that wrongly removes a stub in a thermal shape.
This was due to the stub removal tests if a stub end is outside a solid area to remove it.
There is a corner case: is the stub end is exactly on a solid area outline extra segment
created by Fracture() used in calculations.

The stub removal tests are now made before fracturing.

Fixes: lp:1819317
https://bugs.launchpad.net/kicad/+bug/1819317
2019-03-10 19:14:53 +01:00
jean-pierre charras 2768b3ddbe Pcbnew: fix check zone fills before plotting doesn't test no net zones.
Fixes: lp:1817797
https://bugs.launchpad.net/kicad/+bug/1817797
2019-02-27 11:27:18 +01:00
jean-pierre charras 9cac0a38cc DIALOG_GRAPHIC_ITEM_PROPERTIES: better tooltip.
minor other code enhancement (does not create any actual change)
2019-01-19 12:35:35 +01:00
Seth Hillbrand 6b75f589e9 pcbnew: Do not remove islands from no-net zones
No net zones, by definition, do not connect to any other element.
Therefore, the entire net is an island and should not be removed by the
knockout section

Fixes: lp:1811239
* https://bugs.launchpad.net/kicad/+bug/1811239
2019-01-10 16:17:37 -08:00
Seth Hillbrand 12e0e72107 pcbnew: Don't knock out thermals for non-conn zone
Non-connected zones are, by definition, not connected, therefore, we
should not knock out thermal reliefs under any case

Fixes: lp:1810989
* https://bugs.launchpad.net/kicad/+bug/1810989
2019-01-08 14:24:28 -08:00
Seth Hillbrand 25f8b1ce72 pcbnew: Update multiple zone segments
Where we can get away with lower segment counts (localizing an anchor),
we keep the low-def 16 segment count.  Intermediate values and values
that are visible to the user are set to high definition.  Most are
simply hints to the inflation correction but where they show, the user
show see smooth lines.
2019-01-03 17:34:59 -08:00
Seth Hillbrand 847f6ab4b3 Spelling fix HIGHT->HIGH 2019-01-03 17:10:27 -08:00
Seth Hillbrand 064303e238 pcbnew: Move zone-knockout to default high def
Most rounding operations have been shifted to an absolute error
calculation and the ability to adjust zone segment counts has been
removed in 5.1.  The remaining elements that use fixed segment counts
are either 18 (DRC) or 32 (plotting).  This aligns the punchout segment
count with the higher (32) definition value
2019-01-03 17:09:56 -08:00
Seth Hillbrand 55f2a79957 pcbnew: locking connectivity using RAII
Rather than depend on proper unlocking for each exit, we move the
connectivity lock mutex into an RAII-type configuration that
automatically unlocks on exit.
2018-12-20 11:04:08 -08:00
Jeff Young f69ea8b4a2 Don't cut invisible module text out of zones.
Fixes: lp:1808651
* https://bugs.launchpad.net/kicad/+bug/1808651
2018-12-15 20:15:19 +00:00
Jeff Young dd9a001077 Turn off bugfix for lp:1797787 for 5.1.
This allows people to continue to use the edge-width as a proxy
for board edge clearance until we implement board edge clearance
as a real feature.

Fixes: lp:1797787
* https://bugs.launchpad.net/kicad/+bug/1797787
2018-12-08 17:09:41 +00:00
Jeff Young bcc8c64256 Consider edge cuts items to have zero width when filling zones.
Fixes: lp:1797787
* https://bugs.launchpad.net/kicad/+bug/1797787
2018-11-14 23:45:32 +00:00
Seth Hillbrand 1f25fcd3d6 pcbnew: Shift zone filler to std::async 2018-11-06 09:28:12 -08:00
Seth Hillbrand 4460313104 pcbnew: Separating connectivity to subdir 2018-10-12 16:31:09 -07:00
Seth Hillbrand 10d348999e pcbnew: Fix minor counting issue
The evaluation of count_if resulted in a 0 or 1, leading to segment zone
fills always running on single processor and the progress bar showing
incorrect status.  Likely infrequently hit as only affected segment
fills.
2018-10-09 05:37:48 -07:00
Seth Hillbrand 969e85daa3 pcbnew: Standardize zone fills threading
This is a boyscouting commit to standardize the threading of zone fills.
We do not need to join threads after their completion, instead we simply
allow them to clean up their memory without blocking the user.  This
also sets the maximum number of threads that may be created to the
number of zones being filled.  More than this will only leave un-used
threads being created and immediately killed.

We also include the connectivity search as a phase in the fill progress
reporter.  This was the case before but did not utilize the correct
maxsize, leading to stalled progress bar.
2018-09-21 12:44:20 -07:00
Seth Hillbrand 47fac8a259 Removing some unused code 2018-09-20 12:52:53 -07:00
Jeff Young c90a3efea2 Change KIDIALOG hashing algorithm to __FILE__ + __LINE__.
Using Title + Message wasn't working for all the dialogs which
did substitutions in the message (which was a lot of them).

Fixes: lp:1789348
* https://bugs.launchpad.net/kicad/+bug/1789348
2018-08-29 23:38:23 +01:00