Zone fill can create DRC errors

Bug #1818752 reported by Seth Hillbrand on 2019-03-05
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Critical
jean-pierre charras

Bug Description

When filling with certain combinations of thermal clearance and thermal spoke width, pcbnew can generate zone fills that violate DRC.

The attached board shows a minimal example. In this board, there is a small track below pad 16 that causes two zone areas to appear on both sides. The zone areas overlap tracks and cause DRC errors.

Removing the track stub and/or modifying the zone parameters sufficiently will cause the bad fill to correct itself.

Application: pcbnew
Version: (5.1.0-rc2-38-g4612175da2), release build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.64.0 OpenSSL/1.1.1a zlib/1.2.11 libidn2/2.0.5 libpsl/0.20.2 (+libidn2/2.0.5) libssh2/1.8.0 nghttp2/1.36.0 librtmp/2.3
Platform: Linux 4.19.0-2-amd64 x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.24
    Boost: 1.67.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.64.0
    Compiler: Clang 7.0.1 with C++ ABI 1002

Build settings:
    USE_WX_GRAPHICS_CONTEXT=OFF
    USE_WX_OVERLAY=ON
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_PYTHON3=ON
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_WXPYTHON_PHOENIX=ON
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON

Seth Hillbrand (sethh) wrote :
Seth Hillbrand (sethh) wrote :

Also, thanks to Frank for finding the initial error and supplying an example board on which to test it.

It looks to me the thermal shapes for rect pads are broken because they create self intersecting polygons.

Changed in kicad:
importance: Medium → Critical
milestone: 5.1.1 → 5.1.0
Frank Severinsen (shack) wrote :

Works fine with 5.0.2
The GND pads are also connecting fine.

It seems like the problem is when the zone Thermal spoke width is bigger than the pad size (it connect if the Y size is bigger than spoke width), it has troubles connecting (which would make sense).
But the small circles on the side is quite weird.

Frank Severinsen (shack) wrote :

Works fine with 5.0.2
The GND pads are also connecting fine.

It seems like the problem is when the zone Thermal spoke width is bigger than the pad size (it connect if the Y size is bigger than spoke width), it has troubles connecting (which would make sense).
But the small circles on the side is quite weird.

Frank Severinsen (shack) wrote :

It appears to me like V5.0.2 constrains the Thermal spoke width to Pad size (x or y depending on angle) together with something else. Where as 5.1 is simply refusing to put the spoke, if there is not room for it

Wayne Stambaugh (stambaughw) wrote :

What do we need to do to get this fixed? Obviously something has changed since the 5.0 branch.

Seth Hillbrand (sethh) wrote :

I didn't think to check 5.0.2 for comparison. That makes it a bit easier to find.

Changed in kicad:
assignee: nobody → Seth Hillbrand (sethh)
status: Triaged → In Progress

I can confirm the root issue is due to incorrect calculation of thermal shapes for rect pads.
They can generate self intersecting polygons, and these self intersecting polygons generate broken filled areas.

I have a fix for that.

Wayne Stambaugh (stambaughw) wrote :

@JP, I see Seth has assign himself to the bug report so he may already have a solution as well. @Seth, it sounds like JP has a fix for this so please feel free to collaborate with him as you see fit.

Seth Hillbrand (sethh) wrote :

No worries. Jp, all yours!

Changed in kicad:
assignee: Seth Hillbrand (sethh) → jean-pierre charras (jp-charras)
Wayne Stambaugh (stambaughw) wrote :

@JP, when are going push your fix? It would be nice to get a few days of testing on the fix before the 5.1 release.

@Wayne,
I'll commit my fix soon (tomorrow for me).

The new thermal shape calculation just need refinements to generate a good shape.

Wayne Stambaugh (stambaughw) wrote :

Thanks JP! I appreciate your help.

KiCad Janitor (kicad-janitor) wrote :

Fixed in revision 200ff1cda602da123514920ce96f0a0f50f1fc26
https://git.launchpad.net/kicad/patch/?id=200ff1cda602da123514920ce96f0a0f50f1fc26

Changed in kicad:
status: In Progress → Fix Committed
Frank Severinsen (shack) wrote :

Ill be testing in a minute

Seth Hillbrand (sethh) wrote :

Works great for me. Thanks JP!

Frank Severinsen (shack) wrote :

Works great here as well.
Thanks JP

Wayne Stambaugh (stambaughw) wrote :

There is definitely a difference between 5.0.2 and JP's fix in the zone filling. I've attached the gerberss of the zone refills for both versions and it looks like the 5.0.2 fill was using the wrong spoke width. Actually, JP's fix still appears to use an incorrect spoke width. The spoke width setting for the zone is 20 mils but according to gerbview, the spoke width is 30 mils. Unless I'm not understanding something or gerbview is rendering in correctly, this still doesn't seem right.

Wayne Stambaugh (stambaughw) wrote :
Wayne Stambaugh (stambaughw) wrote :

Scratch that. Cockpit error on my part. None the less, there is a difference between the fills. JP's fixes seem to be correct and there was (is) a bug in the 5.0.2 thermal relief zone filling.

Yes, thermal spoke widths are clamped to the pad x size and pad y size.
It was already the case in 5.0.2, but unfortunately the clamping values in 5.0.2 are incorrect (too large).
I fixed it in 5.1.0.

Changed in kicad:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers