From f69eccd32af8d81ca39d241e45c0ea7b63a56a3c Mon Sep 17 00:00:00 2001 From: SoftFever Date: Wed, 7 Oct 2026 01:23:21 +0800 Subject: [PATCH] Open the Design tab on a front-right isometric view --- docs/HLSD/design-tab.md | 3 ++- src/slic3r/GUI/CAD/DesignCanvas.cpp | 19 +++++++++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/docs/HLSD/design-tab.md b/docs/HLSD/design-tab.md index 6476be10fb..9b8010ce2c 100644 --- a/docs/HLSD/design-tab.md +++ b/docs/HLSD/design-tab.md @@ -303,7 +303,8 @@ The tab is a page of Orca's main window and answers to the same settings as Prep not need it either, since the committed object is placed on an empty spot of the current plate. What the canvas does read from the plate is moved onto its bed: the exclude areas, the plate box the camera orbits about when nothing is picked (`GLCanvas3D::_current_plate_box`), - and the first view, which starts as a copy of Prepare's camera. + and the first view, which starts from Prepare's camera turned to the tab's iso view: the CAD + isometric from the front-right corner that Home returns to, not Prepare's front-left one. - **Viewport text.** The status line and the active tool's values are drawn by the canvas in its ImGui pass, so they go with the canvas: a top-level window over GL does not follow its frame and was left floating over other applications. diff --git a/src/slic3r/GUI/CAD/DesignCanvas.cpp b/src/slic3r/GUI/CAD/DesignCanvas.cpp index 819e0be85d..0489df35c1 100644 --- a/src/slic3r/GUI/CAD/DesignCanvas.cpp +++ b/src/slic3r/GUI/CAD/DesignCanvas.cpp @@ -59,6 +59,16 @@ extern wxPopupWindow* wxCurrentPopupWindow; namespace Slic3r { namespace GUI { +// The Design tab's iso view is the CAD one: a true isometric from the front-right corner, which +// shows the navigator's Front, Right and Top faces. Camera's own "iso" looks from the front-left +// at 45 degrees and stays Prepare's and the thumbnails'. +static void select_iso_view(Camera& camera) +{ + const Vec3d target = camera.get_target(); + camera.look_at(target + camera.get_distance() * Vec3d(1., -1., 1.).normalized(), target, Vec3d::UnitZ()); + camera.auto_type(Camera::EType::Perspective); +} + DesignCanvas::DesignCanvas(wxWindow* parent) : wxPanel() { @@ -192,10 +202,12 @@ DesignCanvas::DesignCanvas(wxWindow* parent) // The view this canvas opens on. Built lazily, on the way into the Design tab, so this // is the view the user is looking at right now — moved off the current plate onto the - // Design bed, which stays at the printer bed's home whichever plate is current. + // Design bed, which stays at the printer bed's home whichever plate is current — turned to + // the iso view Home returns to, keeping its target and zoom. m_parked_camera = wxGetApp().plater()->get_camera(); if (PartPlate* plate = wxGetApp().plater()->get_partplate_list().get_curr_plate()) m_parked_camera.translate_world(-plate->get_origin()); + select_iso_view(m_parked_camera); // Before any of this class's own Binds below: wx calls dynamically bound handlers in // reverse order of binding, and GLCanvas3D swallows several events without skipping them — @@ -470,7 +482,10 @@ bool DesignCanvas::zoom_to_box(BoundingBoxf3 box) void DesignCanvas::set_view(const std::string& view_name) { if (m_canvas) { - m_canvas->select_view(view_name); + if (view_name == "iso") + select_iso_view(wxGetApp().plater()->get_camera()); // the Design camera while the tab is shown + else + m_canvas->select_view(view_name); m_canvas->zoom_to_volumes(); m_canvas->set_as_dirty(); if (m_canvas_widget)