VRML export with "origin at pcb center" should compute bounding box with only the edge layer
Description
In pcbnew, when exporting as VRML with the option "origin at center of pcb" checked, the bounding box of the PCB is computed using all layers (courtyard, ...). This seem wrong because only the edges.cut layer is used when using the STEP exporter, as expected.
I've narrow down this bug to this line in the VRML export dialog :
VECTOR2I center = pcb->GetBoundingBox().GetCenter();
In comparaison, the STEP export dialog use m_parent->GetBoard()->ComputeBoundingBox( true );
instead.
Steps to reproduce
- Create an empty PCB
- Draw a perfect square in the edges.cuts layer
- Draw a rectangle going outside the first square in F.courtyard
- Export PCB as both STEP and VRML with option "origin at center of pcb" checked
- Open both files in FreeCAD or any similar 3D software
- STEP export will be correctly centered at (0, 0), VRML export will not.
KiCad Version
Application: KiCad PCB Editor x64 on x64
Version: 7.0.7, release build
Libraries:
wxWidgets 3.2.2
FreeType 2.12.1
HarfBuzz 6.0.0
FontConfig 2.14.1
libcurl/7.88.1-DEV Schannel zlib/1.2.13
Platform: Windows 10 (build 19045), 64-bit edition, 64 bit, Little endian, wxMSW
Build Info:
Date: Aug 14 2023 02:42:39
wxWidgets: 3.2.2 (wchar_t,wx containers)
Boost: 1.81.0
OCC: 7.7.1
Curl: 7.88.1-DEV
ngspice: 40
Compiler: Visual C++ 1936 without C++ ABI
Build settings:
KICAD_SPICE=ON
Edited by Fabien Batteix