From 315a35e2eaa098fe983cbcb2ddebaa0fe8426110 Mon Sep 17 00:00:00 2001 From: Tommaso Bianchi Date: Fri, 14 Aug 2026 23:16:14 +0200 Subject: [PATCH] CAD: Sweep path and Loft profiles fill from a viewport sketch pick (snaporca-ysm2, e1p item 6) Ported from snaporca 314d30c660. See that commit for the measurements. Co-Authored-By: Claude Opus 5 (1M context) --- src/slic3r/GUI/DesignPanel.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/slic3r/GUI/DesignPanel.cpp b/src/slic3r/GUI/DesignPanel.cpp index 6cb20a2a8c..22e9846354 100644 --- a/src/slic3r/GUI/DesignPanel.cpp +++ b/src/slic3r/GUI/DesignPanel.cpp @@ -3366,6 +3366,32 @@ DesignPanel::DesignPanel(wxWindow* parent) // any stale solid face/edge pick so Extrude treats this loop as the profile. m_sel_solid_face = m_sel_solid_edge = -1; m_pick_face = m_pick_face_body = -1; + // Sweep card open: the sketch you point at becomes the PATH. The profile is already + // settled selection-first — you pick a sketch and then invoke Sweep, which is the design + // law's own canonical example — so the path is the input that was still trapped in a + // combo. The picker excludes the profile, so pointing at the profile correctly does + // nothing. e1p item 6; same shape as the Boolean and Mirror fixes. + if (m_active == Tool::Sweep && m_sweep_path != nullptr) { + for (unsigned i = 0; i < m_sweep_path->GetCount(); ++i) { + if (int(reinterpret_cast(m_sweep_path->GetClientData(i))) != feat) continue; + m_sweep_path->SetSelection(i); + m_sweep_path_ref = feat; + refresh_preview(); + break; + } + } + // Loft card open: pointing at a sketch TOGGLES its membership, so a loft is built by + // clicking the profiles in the viewport instead of hunting rows in a check-list. The + // list stays visible as the typed half and still shows the order, which matters here — + // loft order is not commutative. + if (m_active == Tool::Loft && m_loft_list != nullptr) { + for (size_t i = 0; i < m_loft_sketch_idx.size() && i < m_loft_list->GetCount(); ++i) { + if (m_loft_sketch_idx[i] != feat) continue; + m_loft_list->Check(unsigned(i), !m_loft_list->IsChecked(unsigned(i))); + refresh_preview(); + break; + } + } set_tree_selection(feat); m_status->SetForegroundColour(wxNullColour); set_status(region >= 0