python module.GetCenter() doesn't return the center of footprint
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
KiCad |
Fix Released
|
Unknown
|
Bug Description
Maybe this is intended, but if so, it is an unfortunate name. GetCenter() seems to return the coordinates of whatever is at 0,0 in the footprint editor. As far as I know that is what GetPosition() returns as well. I expected it to return the geometric center of the footprint, which can be had by module.
I think this is true of all versions, but for sure
Application: KiCad
Version: 5.1.3-ffb9f22~
Libraries:
wxWidgets 3.0.4
libcurl/7.58.0 OpenSSL/1.1.1 zlib/1.2.11 libidn2/2.0.4 libpsl/0.19.1 (+libidn2/2.0.4) nghttp2/1.30.0 librtmp/2.3
Platform: Linux 5.0.0-25-generic x86_64, 64 bit, Little endian, wxGTK
Build Info:
wxWidgets: 3.0.4 (wchar_t,wx containers,
Boost: 1.65.1
OpenCASCADE Community Edition: 6.9.1
Curl: 7.58.0
Compiler: GCC 7.4.0 with C++ ABI 1011
Build settings:
USE_
USE_
KICAD_
KICAD_
KICAD_
KICAD_
KICAD_
KICAD_
BUILD_
KICAD_
KICAD_
KICAD_SPICE=ON
tags: | added: pcbnew |
Changed in kicad: | |
importance: | Low → Unknown |
status: | Expired → Fix Released |
@Matt, unfortunately it returns the anchor position of the module. It looks like someone forgot to override this in the MODULE object to return the geometrical center of the footprint which is what MODULE. GetFootprintRec t().Centre( ) does. Technically you are correct but I'm reluctant to change this for fear of breaking something due to MODULE::GetCenter() being used incorrectly somewhere else withing KiCad.