Commit Graph

309 Commits

Author SHA1 Message Date
Jon Evans 18e17abd6a Rename "Keepout" to "Rule Area"
These objects can now be used in advanced DRC rules and
not just for keeping things out.  Also remove the restriction
that at least one of the "basic" keepout rules must be set,
so that these areas can be used for more advanced rules.
2020-09-21 23:55:02 -04:00
jean-pierre charras 456735f803 VIEW::ViewGetLOD() returns double now instead of int.
ViewGetLOD() returns the minimal value of a zoom to show an item.
However a zoom is a double, and using int as minimal value does not
allows setting a correct value in some cases.
2020-09-21 17:55:24 +02:00
Jeff Young f340636f70 When knocking out higher-priority zone use fill, not outline.
Also fixes a bunch of naming issues, primarily with lowercase for
protected variables, but also some for consistency with other parts
of the code.

Also changes the zone fill radio buttons in Board Setup to be more
generic referring to legacy vs. current, and to have tooltips.

Fixes https://gitlab.com/kicad/code/kicad/issues/5583
2020-09-18 16:45:41 +01:00
Jeff Young e2e229da96 Finish exorcising the old DRC system.
This moves the various BOARD_ITEM calls to the new system, and make
the DRC_ENGINE long-lived so that it can field those queries.
2020-09-15 20:15:46 +01:00
Jeff Young 514da2f886 Move DRC dialog to new DRC engine. 2020-09-14 22:39:36 +01:00
Jeff Young cc86630f11 Start pulling new DRC engine into Kicad. 2020-09-11 16:04:11 +01:00
Jeff Young e2bc7557cc Clean up arc/circle polygonization.
1) For a while now we've been using a calculated seg count from a given
maxError, and a correction factor to push the radius out so that all
the error is outside the arc/circle.  However, the second calculation
(which pre-dates the first) is pretty much just the inverse of the first
(and yields nothing more than maxError back). This is particularly
sub-optimal given the cost of trig functions.

2) There are a lot of old optimizations to reduce segcounts in certain
situations, someting that our error-based calculation compensates for
 anyway.  (Smaller radii need fewer segments to meet the maxError
condition.) But perhaps more importantly we now surface maxError in the
UI and we don't really want to call it "Max deviation except when it's
not".

3) We were also clamping the segCount twice: once in the calculation
routine and once in most of it's callers.  Furthermore, the caller
clamping was inconsistent (both in being done and in the clamping
value). We now clamp only in the calculation routine.

4) There's no reason to use the correction factors in the 3Dviewer;
it's just a visualization and whether the polygonization error is
inside or outside the shape isn't really material.

5) The arc-correction-disabling stuff (used for solder mask layer) was
somewhat fragile in that it depended on the caller to turn it back on
afterwards.  It's now only exposed as a RAII object which  automatically
cleans up when it goes out of scope.

6) There were also bugs in a couple of the polygonization routines where
we'd accumulate round-off error in adding up the segments and end up with
an overly long last segment (which of course would voilate the error
max). This was the cause of the linked bug and also some issues with vias
that we had fudged in the past with extra clearance.

Fixes https://gitlab.com/kicad/code/kicad/issues/5567
2020-09-11 11:23:49 +01:00
Jeff Young e31705d4b3 More source reporting for clearance rules. 2020-09-10 20:58:38 +01:00
Tomasz Wlostowski 2c1bd645b2 pcbnew: initial support for GetEffectiveShape() for zones and modules 2020-09-08 01:31:42 +02:00
Seth Hillbrand 8648a074da Ensure ZONEs use copy CTOR for super-class
If we don't uniformly use the copy CTOR, we miss the additional
properties held by the superclass.

This also adds additional crash protection in GetMsgPanelInfo for zones
although it should never be triggered

Fixes https://gitlab.com/kicad/code/kicad/issues/5530
2020-09-06 08:34:39 -07:00
Jeff Young e782794f96 Flesh out object properties and DRC Rule syntax help. 2020-09-05 17:44:59 +01:00
Jeff Young 305abb210f Add a mode to allow zone smoothing to produce external fillets.
Fixes https://gitlab.com/kicad/code/kicad/issues/5306
2020-08-30 15:20:59 +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 1cce03acb1 Commenting and formatting. 2020-08-18 19:05:30 +01:00
Jon Evans bd14f8a82a ADDED: New appearance control widget for PcbNew
Featuring:
- Layer view presets
- Per-type opacity for tracks, vias, pads, zones
- Net and netclass color and visibility controls

CHANGED: Simplified object visibilty controls

Fixes https://gitlab.com/kicad/code/kicad/-/issues/1951
Fixes https://gitlab.com/kicad/code/kicad/-/issues/1981
Fixes https://gitlab.com/kicad/code/kicad/-/issues/2003
Fixes https://gitlab.com/kicad/code/kicad/-/issues/2173
Fixes https://gitlab.com/kicad/code/kicad/-/issues/2254
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4325
2020-08-15 15:24:28 -04: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 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 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
Seth Hillbrand 8a0be64ad4 Ensure dangling test takes track width into account
When running a hit test to check if the anchors are connected, we should
loosen the check for tracks to account for the width.  Otherwise
connected anchors can be connected in the system but test positive for
IsDangling()

Fixes https://gitlab.com/kicad/code/kicad/issues/5027
2020-08-05 13:17:29 -07:00
Jeff Young be957e0105 Convert parent-less module items to board items on paste.
Fixes https://gitlab.com/kicad/code/kicad/issues/4938
2020-07-27 19:53:42 +01:00
Ian McInerney 20c1492b6a Initialize pointers to nullptr in copy constructor
Fixes https://gitlab.com/kicad/code/kicad/issues/4940
2020-07-20 11:31:34 +01:00
Ian McInerney 2542d41481 Fix copy constructors for BOARD_DESIGN_SETTINGS and ZONE_CONTAINER 2020-07-18 23:55:06 +01:00
Maciej Suminski a289056a9e Properties meta-data for pcbnew classes 2020-07-05 22:44:38 +02:00
Maciej Suminski 89698a727b Removed const modifier for returned non-reference types 2020-07-05 22:44:38 +02: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
Jon Evans 32b7b0c617 Fix filled zone rotation and move operations 2020-06-30 22:26:30 -04:00
Jon Evans 49c7ba6724 Make it easier to select keepouts 2020-06-29 20:37:57 -04: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
Jon Evans 0b34cea3d5 Add an optional name property to zones 2020-06-28 08:51:57 -04:00
Jeff Young 6acd35c981 Cleanup. 2020-06-27 20:07:26 +01: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
Seth Hillbrand 08c61e6788 Ensure triangulation follows moving zone
Dragging filled zones in OpenGL was extremely slow due to the
invalidated triangulation cache.  Moving the zone should also move the
triangles and keep the cache valid.
2020-06-17 19:43:11 -07:00
jean-pierre charras 8bd9b26717 ZONE_CONTAINER, display info: fix incorrect layer of zones on user layers.
Add also display on hatch count and filled polygons corner count, previously removed,
but useful for large and complex zones (that can take a lot of computation time
for DRC and display).
2020-06-10 21:01:44 +02: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 1db799d841 Implement "disallow" rules and integrate with keepout settings. 2020-05-25 22:51:47 +01:00
Jeff Young 416d82727f Redo DRC rules to get ready for new system. 2020-05-25 22:51:47 +01:00
Jeff Young 69f121d907 Another attempt to get DRC and status bar to share message content. 2020-05-22 14:12:56 +01:00
Jeff Young a5b53a623d Update status bar with clearance & rule sources. 2020-05-21 21:26:30 +01:00
Jeff Young cec857c0f4 Complete hookup of zone filler to new clearance engine. 2020-05-18 19:20:46 +01:00
Jeff Young 05855a5a1c Performance enhancements for DRC. 2020-05-18 13:38:17 +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
jean-pierre charras bc24d8e957 Fix typo and I18N string 2020-05-10 16:55:15 +02:00
Jeff Young 0f8c7ffd11 Add pad keepout and footprint keepout areas.
Fixes https://gitlab.com/kicad/code/kicad/issues/2365
2020-05-07 17:51:27 +01:00
Jeff Young f7e518dbc6 Add clearance sources to some DRC violation reports. 2020-05-01 18:49:42 +01:00
Jeff Young 1535c83b88 Lay some groundwork for adding distances to DRC errors.
modified:   eeschema/lib_rectangle.cpp
2020-04-24 14:46:22 +01:00
Michael Kavanagh e4cbeeab4c Remove dead code in pcbnew
* Remove dead zone printer
* Remove old canvas in pad properties window
2020-04-22 21:50:15 +00:00
Jeff Young 7f1b409305 Remove dead legacy print code. 2020-04-20 17:03:38 +01:00
Tomasz Wlostowski c121f8f52c pcbnew: speed up ZONE_CONTAINER bounding box calculation 2020-04-15 13:00:48 +02:00
Ian McInerney 45dabde68e Small cleanup in zone class 2020-04-14 18:00:09 +01:00