Commit Graph

312 Commits

Author SHA1 Message Date
jean-pierre charras 43c7cfec3a Revert "Record hole knockouts in zone filler earlier"
This reverts commit 3030c80de7.
The commit #3030c80d was a workaround related to a Clipper2 issue.
Updating Clipper2 is a better fix
2023-08-22 18:18:55 +02:00
Jon Evans a77e630901 ADDED: Connectivity for graphic shapes on copper layers
Graphic shapes (excluding text) can now have nets when on
copper layers. Shapes behave like tracks in that they will
pick up nets from connected pads, and follow track opacity
settings.
2023-08-10 21:47:43 -04:00
Jeff Young f43b90b15f Lazy context handling for SVG plotting.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15325
2023-08-07 14:01:58 +01:00
Seth Hillbrand 96a34e5b57 Consolidate Maximum clearance calculation
We were calculating the same thing in three locations and we missed
adding the clearance from the footprints in, resulting in bad fills and
missed drc errors (see QA addition)
2023-07-26 12:55:48 -07:00
Seth Hillbrand 3030c80de7 Record hole knockouts in zone filler earlier
Spokes are placed across an entire pad when filling, so the hole
knockouts need to knocked out prior to deflating

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15160
2023-07-12 11:17:57 -07:00
Jeff Young 8f754c7c3e A more performant and slighty more aggressive blob trimmer.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14462

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14107
2023-07-12 17:30:42 +01:00
Mike Williams 37837dc392 PCB: introduce PCB_FIELD_T 2023-06-20 18:34:52 +00:00
Jon Evans 3783fc8f5a Remove unused line 2023-05-30 20:06:18 -04:00
Jeff Young f5791f5dc6 Left some fixes out of previous commit. 2023-05-29 16:22:24 +01:00
Jeff Young 65e53b8ecd Move SHAPE_POLY_SET::Inflate's error spec from a seg-count to a max-deviation.
1) Also reorders parameters to make sure the compiler helps out.

2) This also makes it harder to mess up the discrepency between
   BOX2I/wxRECT/etc::Inflate() and SHAPE_POLY_SET::Inflate.

3) Also fixes a couple of bugs where the corner strategy was passed
   in as a segCount.

4) Also fixes a couple of bugs where the error wasn't forced to the
   outside to match the ERROR_LOCATION.

5) Also fixes a couple of bugs where the seg count was specified
   without regard to an already passed-in max deviation
2023-05-29 15:29:03 +01:00
Jeff Young c71cf21e2f Use rendered text to generate bounding box for knockout text.
Don't open-code knockout text shape generation in several different
places.

Make sure triangulated knockout text gets clearance added when
specified.

Collapse duplicated footprint text item plot routine (they're no
longer any different from plotting pcb text items).
2023-05-28 17:20:11 +01:00
Jeff Young 768fbf5af2 Give up on trying to calculate text bounding boxes.
It results in too many hacks strewn through the code.  Just draw the
text and measure it.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14803
2023-05-26 18:44:33 +01:00
Jeff Young 6807ca6f9f Allow text input to Convert to Polygon/Zone/Keepout.
Also fixes non-copper zone filler to honor fill keepouts.

Fixes https://gitlab.com/kicad/code/kicad/issues/14566
2023-04-28 17:43:08 +01:00
Seth Hillbrand f7f52d77e4 Rework Copper Sliver check
Adds QA checks to copper sliver tests.  Adds the following checks:
- Dot product between two arms (quickly avoids checks for >90°)
- Checks the sliver is convex (area test)
- Eliminates minor slivers with angles that are approximately 0 and ones
  with the opposite side width beneath a configurable level
- Updates Clipper2 to fix a couple of jagged edges on inflate
- Adds simplify during zone fill inflation to limit jaggies

Fixes https://gitlab.com/kicad/code/kicad/issues/14549
2023-04-25 10:32:46 -07:00
Jeff Young bbd6c80507 Collapse FP_* down into their PCB_* equivalents. 2023-03-31 22:57:46 +01:00
Jeff Young d6dd58fff9 Keep track of single-pad-islands so we can discount spokes to them. 2023-03-25 10:44:46 +00:00
Seth Hillbrand 2e2da951a5 Don't double-expand NPTH checks
When filling the zone for the NPTH, the hole should not be considered as
a copper element in terms of clearance.  This prevents close but
different knockout elements from being formed
2023-03-22 15:07:58 -07:00
Jon Evans b176881d49 Allow shorting copper zones through negative clearance
This brings the zone filler in line with other places where
we use negative clearance rules to disable constraints.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14069
2023-02-24 20:36:39 -05:00
Seth Hillbrand af10878954 Use Chamfer lines when deflating
Rounded line ends when deflating leads to microscopic jags in the
outline that are not visible but add substantial computation time and
minor error when computing polygon offsets.

Instead, the chamfer deflate method prevents these jagged lines by
clipping angles < 90° by the error level.  This does not impact deflate
calls where we explicitly require the angles to be maintained
2023-02-22 16:24:26 -08:00
jean-pierre charras 2032b8af59 Pcbnew: fix incorrect rotation of thermal spoke for rotated footprints.
If the footprint rotation is not a multiple of 90°, the thermal spokes
were not correctly rotated.
Fixes #13919
https://gitlab.com/kicad/code/kicad/issues/13919
2023-02-15 18:19:34 +01:00
Seth Hillbrand f4825cdd8f Allow same-net, same-priority zone filling
When two zones with the same net and same priority overlap, they should
both be filled, matching the behavior of v6.  If you would like an
explicit override of one or the other, you need to set the zone priority
higher.  Relying on the UUID as a tie breaker is good for zones with
different nets but creates unexpected changes from v6 when applying it
to zones of the same net
2023-02-10 11:07:08 -08:00
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