Commit Graph

131 Commits

Author SHA1 Message Date
Jeff Young e782794f96 Flesh out object properties and DRC Rule syntax help. 2020-09-05 17:44:59 +01:00
Jeff Young d1006138fd ADDED holeWallPlatingThickness to AdvancedCfg.
Used for zone filling and DRC hole collision testing.  Allows us to
calculate the actual hole size from the finish hole size.

Fixes https://gitlab.com/kicad/code/kicad/issues/5468
2020-09-03 16:00:07 +01:00
Jeff Young 8609180406 Add all non-shape properties to dummy hole pad.
This is required in case there are DRC Rules that are matching against
the properties.  It also allows any local clearance overrides to take
effect.

Fixes https://gitlab.com/kicad/code/kicad/issues/5468
2020-09-03 15:03:09 +01:00
Jeff Young 996ea4d5f9 Performance improvements for zone filling.
Remove extraneous simplify calls.

Fixes https://gitlab.com/kicad/code/kicad/issues/3812
2020-08-25 20:10:14 +01:00
Jeff Young 6d12859c14 Give up on trying to get Clipper's miter strategies to work.
Instead, make sure we remove the clearance holes and outline at
the end so that copper isn't allowed to "spill" into areas it
shouldn't be in.

Also fixes a bug where the Advance Cfg defaults weren't getting
loaded when the file didn't exist.

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

Fixes https://gitlab.com/kicad/code/kicad/issues/5306
2020-08-25 19:07:37 +01:00
Jeff Young a407befa4c Fix breakage from layer change.
We have to be careful about processing edges on the Edge_Cuts even
when we're talking about a zone on some other layer.
2020-08-13 00:18:09 +01: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 463100d67f Remove a long-standing hack to keep divots out of adjacent zones.
The new algorithm unions any adjacent zones before doing the
chamfer/fillet and then subtracts the other zones back out afterwards.

Fixes https://gitlab.com/kicad/code/kicad/issues/3812
2020-08-12 22:20:08 +01:00
Jeff Young a6d44676b3 Move commit handling outside of ZoneFiller.
This allows us to rever the commit on a cancel.

Fixes https://gitlab.com/kicad/code/kicad/issues/5107
2020-08-12 22:20:07 +01:00
Seth Hillbrand 5fc6b74c89 ADDED: Remove unused pads
This option removes copper layers from pads and vias where they are not
connected to other board elements.  This allows the inner layers to be
more closely routed if the via landing pad is not needed.

Fixes https://gitlab.com/kicad/code/kicad/issues/1835
2020-08-10 03:27:26 +00:00
Jeff Young e5b50d90a7 Update DRC rules to new layer and disallow grammars.
Also adds support for hooking rules up to named zones.

Fixes https://gitlab.com/kicad/code/kicad/issues/2041
2020-08-07 21:49:36 +01:00
Jeff Young e14bbc7d83 Fix auto-added include. 2020-08-07 17:10:12 +01:00
Jeff Young 00e77d1ba4 Implement pad & via aprons for hatched zones.
Fixes https://gitlab.com/kicad/code/kicad/issues/2519
2020-08-07 15:15:43 +01:00
Jeff Young c30739dff3 Implement a more aggressive zone-fill-cancel.
We now unfill all zones so that the user can clearly see that
things are not in a "finished" state.

Fixes https://gitlab.com/kicad/code/kicad/issues/5035
2020-08-05 16:51:58 +01:00
Jeff Young 3cf5db3ce5 Allow cancelling of zone fills.
Fixes https://gitlab.com/kicad/code/kicad/issues/5035
2020-08-04 19:53:35 +01:00
Seth Hillbrand 6900f04ee0 Change Zone extra clearance magic number to AC
Rather than keeping a magic number in the code, we set the default in
the advanced config setting and allow users/developers to modify it.
2020-07-26 07:20:24 -07:00
Jon Evans f8bfb2bc16 Fix several issues with multilayer zones
- Properly refill if layer set is modified
- Fix some threading issues with island removal
- Fix copy constructor

Fixes https://gitlab.com/kicad/code/kicad/-/issues/4765
2020-07-01 20:51:44 -04:00
jean-pierre charras 8d18f289c7 remove a message printed only for debug/test. 2020-07-01 18:52:42 +02:00
Jon Evans 44f3cdb31e Fix a few issues with zone islands 2020-06-29 12:16:37 -04:00
Seth Hillbrand 224b41e8b1 Fix a threading segfault when filling zones
The shape cache gets reset by the zone fill algorithm.  This needs to be
cleaned before multiple threads are created and cannot be modified when
threading.

Fixes https://gitlab.com/kicad/code/kicad/issues/4723
2020-06-28 11:12:31 -07:00
Jon Evans 1d5e4f86af ADDED: Copper zone island removal is now configurable
ADDED: Zones and keepouts can now be named (for DRC)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/4392
2020-06-28 09:09:38 -04:00
Jon Evans 0d4ee39f75 CHANGED: Copper zones can be on more than one layer
Fixes https://gitlab.com/kicad/code/kicad/-/issues/1963
2020-06-28 08:52:37 -04:00
Jeff Young d01b29ab37 Cleanup pad geometry handling.
There were a lot of plotters, exporters, etc. that were rolling their
own implementations.

This also introduces a lazily-built set of SHAPE objects for doing
collision detection and some forms of rendering (and later DRC).
2020-06-22 22:28:37 +01:00
Jeff Young 39ec63c4e9 Fix some inconsistencies in clearance priorities.
Fixes https://gitlab.com/kicad/code/kicad/issues/4555
2020-05-29 13:41:45 +01:00
Jeff Young cec857c0f4 Complete hookup of zone filler to new clearance engine. 2020-05-18 19:20:46 +01:00
Jeff Young d3f017d825 DRC rules parser and engine.
Fixes https://gitlab.com/kicad/code/kicad/issues/2182

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

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

Fixes https://gitlab.com/kicad/code/kicad/issues/1965
2020-05-16 15:53:05 +01: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
jean-pierre charras 39c2c4e13b Zone filler: pads non connected in zone option: use same algo as the 5.1 branch
to calculate thermal clearance (antipad size) for pads having the same netcode
as the zone, the net clearance has no meaning
(net clearance between object of the same net is 0)
and the zone_clearance can be set to 0 (i.e. use the netclass clearance).
Therefore use the antipad clearance (thermal clearance) or the zone_clearance if bigger.
2020-02-17 18:21:49 +01:00
Ian McInerney 6b8d81e95d Add zone area to message panel
ADDED: Area of zone fill is displayed in the message panel

Fixes https://gitlab.com/kicad/code/kicad/issues/2412
2020-02-05 09:44:53 +00:00
jean-pierre charras 48ae188b15 Zone filler: fix a few issues, in Smoothed Polygons mode.
- Fix non optimal shape of solid polygons after inflate transform.
- Add a small extra clearance ((2 microns) when creating clearance areas
(especially, convert arc to polygons create small differences)
- Add a small threshold (1 micron) in drc test distances to avoid false positives
- fix a minor issue in TransformOvalToPolygon that created sometimes a not perfect shape

Fixes #3812
https://gitlab.com/kicad/code/kicad/issues/3812
2020-01-26 18:19:24 +01:00
Jeff Young d24bd5c832 Fix a couple of Coverity issues. 2020-01-12 21:07:41 +00:00
Ian McInerney 13b6028e1b Refactor all math into a new kimath library
* Split up the thirdparty code into the thirdparty folder (#3637)
* Create a new kimath static library containing all the math functions

This is part of cleaning the build system for #1906.
2020-01-07 17:12:59 +00:00
Mark Roszko 19ceb11ae7 Change more enums over to scoped enums 2019-12-28 00:55:11 +00:00
Mark Roszko 11ff16be4e Switch to scoped enums 2019-12-20 14:11:39 +00:00
jean-pierre charras 02977aacfc Pcbnew: fix incorrect rotation angle unit when building thermal spokes
The new Rotate function uses radians, not deci-degrees.

Fixes #3668 | https://gitlab.com/kicad/code/kicad/issues/3668
2019-12-13 17:41:20 +01:00
Seth Hillbrand c4d853c1e8 SHAPE_LINE_CHAIN: Remove element access
This is the first step to allowing non-segments in the line chain.
External routines cannot be allowed to change the line chain without
going through the internal routines.  To accomplish this, we remove the
Vertex() and Point() access routines and only leave the const versions.
Transformations are given for both points as well as the chain itself.
2019-12-12 13:54:48 +00:00
jean-pierre charras 4a75cc586c Zone filler: do not create stubs in thermal reliefs when not possible.
pad size is sometimes smaller than the zone minimal width.
So, to avoid strange and incorrect results, do not create the stubs in
thermal relief when the pad size is smaller than the zone minimal width.
2019-12-04 13:23:09 +01:00
Ross Schlaikjer 64a42ffa35 Add keepout in footprints: Starting point. 2019-10-29 11:24:30 +01:00
jean-pierre charras a18d3cca6e Pcbnew, zone filler: Ensure hatch pattern thickness bigger than zone minimal width (one micron bigger).
This margin is mandatory to avoid incorrect polygons in Gerber files:
due to the fact Gerber units can be 10 nm (and Gerbview internal unit is also 10nm), valid polygons
can be converted to non valid (self intersecting for instance) by coordinates truncation.
This is a known problem in Gerber files (not specific to Gerber format)

Fixes: lp:1847737
https://bugs.launchpad.net/kicad/+bug/1847737
2019-10-12 11:12:27 +02:00
jean-pierre charras bd34348068 Pcbnew: allows using filled polygons in zones with no outline thickness.
This option was only available if advanced config "ForceThickZones" was set.
2019-09-06 16:13:41 +02:00
Jeff Young a25368cc6b Improve spelling.
The groundwork here is thanks to kunda1.

Fixes: lp:1831510
* https://bugs.launchpad.net/kicad/+bug/1831510
2019-08-20 19:14:05 +01:00
jean-pierre charras d208447cba Zone filler: clamp thermal stub width to the pad minimal size.
Setting stub width to a ridiculous large value (for instance 100 times the pad size) creates strange and broken shapes,
and obviously stubs cannot be built.
Ensure also the thermal shape is inside the zone boundary (because the algo adds areas this was previously possible)

Fixes: lp:1837559
https://bugs.launchpad.net/kicad/+bug/1837559
2019-07-23 20:32:38 +02:00
jean-pierre charras 164d40f235 Zone filled, non copper zones: fix missing inflate for non stroked solid areas. 2019-07-17 13:24:21 +02:00
Jeff Young 2c5876ee8c Add more control over how corners are handled when inflating polygons. 2019-07-16 16:41:21 +01:00
Jeff Young 6da11de5e0 Be more careful about thermal reliefs for pads on different layers.
Fixes: lp:1605049
* https://bugs.launchpad.net/kicad/+bug/1605049
2019-07-14 23:15:39 +01:00
Jeff Young fe188489c7 A better hack for the post-ProgressReporter-loss-of-focus issue. 2019-07-14 18:18:48 +01:00
Jeff Young 928d6c5dff Implement preserved-corners to prevent divots when filling adjacent zones.
Fixes: lp:1460787
* https://bugs.launchpad.net/kicad/+bug/1460787
2019-07-14 18:18:48 +01:00
Jeff Young 1a7cef2950 Improve performance, commenting and API of some polygon classes. 2019-07-14 10:39:38 +01:00
Jeff Young a3855cb4f2 Allow thermal spokes to be same width as minimum width.
Also some changes for readability and clarity, both in the code
and in the Feature Constraints panel.

Fixes: lp:1835674
* https://bugs.launchpad.net/kicad/+bug/1835674
2019-07-14 10:36:48 +01:00
Jeff Young 2d17d2b91f Cleanup and commenting. 2019-07-14 10:36:48 +01:00