Make VRML use board edge bounding box for parity with step

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15472
This commit is contained in:
Marek Roszko 2023-08-24 20:42:58 -04:00
parent 4497aaa3fa
commit a17cd9d054
2 changed files with 5 additions and 7 deletions

View File

@ -195,9 +195,8 @@ void PCB_EDIT_FRAME::OnExportIDF3( wxCommandEvent& event )
if( dlg.GetAutoAdjustOffset() ) if( dlg.GetAutoAdjustOffset() )
{ {
BOX2I bbox = GetBoard()->GetBoardEdgesBoundingBox(); BOX2I bbox = GetBoard()->GetBoardEdgesBoundingBox();
aXRef = pcbIUScale.IUTomm( bbox.GetCenter().x );
aXRef = bbox.Centre().x * pcbIUScale.MM_PER_IU; aYRef = pcbIUScale.IUTomm( bbox.GetCenter().y );
aYRef = bbox.Centre().y * pcbIUScale.MM_PER_IU;
} }
else else
{ {

View File

@ -230,10 +230,9 @@ void PCB_EDIT_FRAME::OnExportVRML( wxCommandEvent& event )
if( dlg.GetOriginChoice() == 1 ) if( dlg.GetOriginChoice() == 1 )
{ {
// Origin = board center: // Origin = board center:
BOARD* pcb = GetBoard(); BOX2I bbox = GetBoard()->GetBoardEdgesBoundingBox();
VECTOR2I center = pcb->GetBoundingBox().GetCenter(); aXRef = pcbIUScale.IUTomm( bbox.GetCenter().x );
aXRef = pcbIUScale.IUTomm( center.x ); aYRef = pcbIUScale.IUTomm( bbox.GetCenter().y );
aYRef = pcbIUScale.IUTomm( center.y );
} }
double scale = scaleList[dlg.GetUnits()]; // final scale export double scale = scaleList[dlg.GetUnits()]; // final scale export