Design tab: datum and curve tools were rejected by the solid-preview check

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) <noreply@anthropic.com>
This commit is contained in:
Tommaso Bianchi
2026-07-26 06:20:40 +02:00
co-authored by Claude Opus 5
parent 4d331099de
commit 77f2f4d4ad
+17 -4
View File
@@ -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