From 77f2f4d4adebaf405e644464e33cd3629e71dd03 Mon Sep 17 00:00:00 2001 From: Tommaso Bianchi Date: Sun, 26 Jul 2026 06:20:32 +0200 Subject: [PATCH] Design tab: datum and curve tools were rejected by the solid-preview check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit refresh_preview() exempted only Sketch and Plane from the ghost-preview path. Axis, CoordSys, Helix and Project produce no solid either, so they fell through to it, found nothing, and reported "invalid: preview produced no geometry" — which also DISABLED Confirm, so all four tools were unusable rather than merely noisy. Guaranteed on an empty document; with a body present the ghost path finds something and masks it, which is why it survived until the tools were tried on a fresh project. All six non-solid tools are now exempt, each with its own ready message. The list is not a guess: recompute() skips Sketch, Helix, Plane, Axis and CoordSys outright and routes Project through apply_project(), which emits sketch entities and no solid — so the panel and the kernel now agree on exactly what is not a solid. Mate already had its own branch, since it needs Confirm gated on having two distinct CoordSys features. Introduced when Axis/CoordSys (batch 1) and Helix/Project (batch 3) were wired without extending this exemption. Confirmed fixed on hardware: Axis -> Plane Intersection with XY and XZ now resolves on an empty document, which also exercises 60b04feea1. Compiles clean; kernel untouched, suite unaffected at 143 cases / 1980 assertions. Co-Authored-By: Claude Opus 5 (1M context) --- src/slic3r/GUI/DesignPanel.cpp | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/slic3r/GUI/DesignPanel.cpp b/src/slic3r/GUI/DesignPanel.cpp index 9ce5f7b2ee..19e2030db9 100644 --- a/src/slic3r/GUI/DesignPanel.cpp +++ b/src/slic3r/GUI/DesignPanel.cpp @@ -8087,12 +8087,25 @@ void DesignPanel::refresh_preview() { if (m_active == Tool::None) { m_viewport->clear_preview(); return; } - if (m_active == Tool::Sketch || m_active == Tool::Plane) { - // A sketch / datum plane carries no 3D solid; there is no ghost to show. Always - // valid, so just enable Confirm and clear any stale ghost. + // Features that produce NO solid: a sketch, the three datums, a helix curve, and Project + // (which emits sketch entities). They have no ghost to build, so they must not go through + // the solid-preview path below — it finds nothing and reports "invalid: preview produced + // no geometry", which is what Axis / CoordSys / Helix / Project did on an empty document. + // route_feature() skips these for the same reason, so the two agree on what is not a solid. + if (m_active == Tool::Sketch || m_active == Tool::Plane || m_active == Tool::Axis || + m_active == Tool::CoordSys || m_active == Tool::Helix || m_active == Tool::Project) { m_viewport->clear_preview(); m_status->SetForegroundColour(wxColour(120, 210, 120)); - m_status->SetLabel(m_active == Tool::Plane ? _L("Plane ready") : _L("Sketch ready")); + wxString ready; + switch (m_active) { + case Tool::Plane: ready = _L("Plane ready"); break; + case Tool::Axis: ready = _L("Axis ready"); break; + case Tool::CoordSys: ready = _L("Coord Sys ready"); break; + case Tool::Helix: ready = _L("Helix ready"); break; + case Tool::Project: ready = _L("Project ready"); break; + default: ready = _L("Sketch ready"); break; + } + m_status->SetLabel(ready); for (wxButton* b : m_confirm_btns) if (b) b->Enable(true); m_status->Refresh(); update_datum_gizmo(); // Plane card: show/refresh the in-canvas resize handles