Board statistics dialog: negative/wrong area calculation

Bug #1838325 reported by Diego Herranz
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
KiCad
Fix Committed
Low
Seth Hillbrand

Bug Description

Hi,

I've been testing this new board statistics dialog and I think it is a nice addition.

There seems to be something wrong with the area calculation, though. See results below:

Board
Width: 125.000 mm
Height: 125.000 mm
Area: -0.002 mm²

Simple kicad_pcb attached. It's a square, not even weird shapes nor cutouts.

Thanks!

Application: Pcbnew
Version: 6.0.0-unknown-7b5b807~100~ubuntu16.04.1, release build
Libraries:
    wxWidgets 3.0.2
    libcurl/7.47.0 OpenSSL/1.0.2g zlib/1.2.8 libidn/1.32 librtmp/2.3
Platform: Linux 4.4.0-157-generic x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.2 (wchar_t,wx containers,compatible with 2.8) GTK+ 2.24
    Boost: 1.58.0
    OpenCASCADE Community Edition: 6.8.0
    Curl: 7.47.0
    Compiler: GCC 5.4.0 with C++ ABI 1009

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

Revision history for this message
Diego Herranz (diegoherranz) wrote :
Revision history for this message
Michael Kavanagh (michaelkavanagh) wrote :

Can't reproduce on macOS.

Application: Pcbnew
Version: (5.1.0-1384-g7b5b807a8), debug build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.54.0 LibreSSL/2.6.5 zlib/1.2.11 nghttp2/1.24.1
Platform: Mac OS X (Darwin 18.6.0 x86_64), 64 bit, Little endian, wxMac
Build Info:
    wxWidgets: 3.0.4 (wchar_t,STL containers,compatible with 2.8)
    Boost: 1.70.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.54.0
    Compiler: Clang 10.0.1 with C++ ABI 1002

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

Changed in kicad:
milestone: none → 6.0.0-rc1
Revision history for this message
Michael Kavanagh (michaelkavanagh) wrote :

Note however the misalignment of the buttons in the dialog.

tags: added: pcbnew
Revision history for this message
Alexander Sh (jasuramme) wrote :

I can't reproduce that either.
I wonder if that's bug related to 6.0.0-rc1
will compile and look for that

Changed in kicad:
importance: Undecided → Low
Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :

Same here:
Width: 125,000 mm
Height: 125,000 mm
Area: -0,002 mm²

I though that it was a locale issue, due the "," of Latin languages. But appear to be a Ubuntu related issue.

Application: Pcbnew
Version: 6.0.0-unknown-22fdc7f~86~ubuntu16.04.1, release build
Libraries:
    wxWidgets 3.0.2
    libcurl/7.47.0 OpenSSL/1.0.2g zlib/1.2.8 libidn/1.32 librtmp/2.3
Platform: Linux 4.4.0-159-generic x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.2 (wchar_t,wx containers,compatible with 2.8) GTK+ 2.24
    Boost: 1.58.0
    OpenCASCADE Community Edition: 6.8.0
    Curl: 7.47.0
    Compiler: GCC 5.4.0 with C++ ABI 1009

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

Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

Should this be marked as invalid if the issue is with Ubuntu's handling of the ',' in Latin languages?

Revision history for this message
Nick Østergaard (nickoe) wrote :

To me it sounds more likely there is an issue with the inout values. Isn't the height width being generated internally? Why should the decimal seperatpr have any influence here.

Revision history for this message
Ian McInerney (imcinerney) wrote :

@Hildo, can you compile master from source and apply the attached patch? I would like to see if this fixes the for Ubuntu (I don't see the issue on my Fedora install).

Revision history for this message
Diego Herranz (diegoherranz) wrote :

@stambaughw, I think what @hildogjr was trying to say is that he thought it might be because of the ',' handling but it wasn't in the end.

In fact, my locale doesn't use the ',' but a '.' and it fails too.

Thanks.

Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

Fixed in revision 2518a2cc81921f139a9fa0e042fc1967ff02ac3a
https://git.launchpad.net/kicad/patch/?id=2518a2cc81921f139a9fa0e042fc1967ff02ac3a

Changed in kicad:
status: New → Fix Committed
assignee: nobody → Seth Hillbrand (sethh)
Revision history for this message
Diego Herranz (diegoherranz) wrote :

Still not fixed for me:

Width: 125.000 mm
Height: 125.000 mm
Area: -0.002 mm²

Application: Pcbnew
Version: 6.0.0-unknown-9f80da6~100~ubuntu16.04.1, release build
Libraries:
    wxWidgets 3.0.2
    libcurl/7.47.0 OpenSSL/1.0.2g zlib/1.2.8 libidn/1.32 librtmp/2.3
Platform: Linux 4.4.0-159-generic x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.2 (wchar_t,wx containers,compatible with 2.8) GTK+ 2.24
    Boost: 1.58.0
    OpenCASCADE Community Edition: 6.8.0
    Curl: 7.47.0
    Compiler: GCC 5.4.0 with C++ ABI 1009
Build settings:
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_PYTHON3=OFF
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON

Revision history for this message
Seth Hillbrand (sethh) wrote :

Huh. I pushed a couple more fixups here. I don't see this anymore, so I'm a bit puzzled. Which Ubuntu version are you using?

Revision history for this message
Diego Herranz (diegoherranz) wrote :

I'll try again your latest patch when there is a new nightly.

I'm using Ubuntu GNOME 16.04.6 LTS 64-bit.

Thanks!

Revision history for this message
Diego Herranz (diegoherranz) wrote :

I've tried again today with 6.0.0-unknown-b109aba~100~ubuntu16.04.1 and it works

Width: 125.000 mm
Height: 125.000 mm
Area: 15625.000 mm²

Thanks for the fix!

Revision history for this message
Seth Hillbrand (sethh) wrote :

Thanks for reporting back. Glad it is working for you!

Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :

Yes, also working here. Appear also fine, removing areas of non-square boards that I tested.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers