From 810f3efcbb434980da6dd7f299512f1bbc702be1 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Thu, 20 Jul 2023 17:33:03 +0200 Subject: [PATCH] PANEL_PREVIEW_3D_MODEL: Always shows the footprint not flipped, and rot 0. Otherwise, setting the 3D shapes rotation/position is not so easy. From master branch --- 3d-viewer/dialogs/panel_preview_3d_model.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/3d-viewer/dialogs/panel_preview_3d_model.cpp b/3d-viewer/dialogs/panel_preview_3d_model.cpp index cc565202a7..babc1d556b 100644 --- a/3d-viewer/dialogs/panel_preview_3d_model.cpp +++ b/3d-viewer/dialogs/panel_preview_3d_model.cpp @@ -105,6 +105,15 @@ PANEL_PREVIEW_3D_MODEL::PANEL_PREVIEW_3D_MODEL( wxWindow* aParent, PCB_BASE_FRAM m_dummyFootprint = new FOOTPRINT( *aFootprint ); m_dummyFootprint->SetParentGroup( nullptr ); + + // Ensure the footprint is shown like in Fp editor: rot 0, not flipped + // to avoid mistakes when setting the3D shape position/rotation + if( m_dummyFootprint->IsFlipped() ) + m_dummyFootprint->Flip( m_dummyFootprint->GetPosition(), false ); + + m_dummyFootprint->SetOrientation( ANGLE_0 ); + + m_dummyBoard->Add( m_dummyFootprint ); // Create the 3D canvas