fix: a failing fillet/chamfer and a failing ql exactly() attach their evidence picture again
2.2.6 drew one picture for each (the failing edge as an orange line; the matched faces orange and the near misses purple). The native port attached none, and the old test file that asserts them was one of those the port deleted. - BlendDiagnosis carries the edges and the caption of the six probes (the old ones); raise_blend_failure asks for the picture through DiagnosticImage (new field highlight_edges), the provider call gets the edges. - evidence.py draws it, and the ql picture through the existing ql evidence hook, on a clone of the scope: the user's shape is not tagged. - test_error_diagnostics_blend_ql.py is restored (13 tests). 12 pass; test_ql_evidence_highlight_is_visible is listed as open: the picture is right but the soft renderer's shading leaves 302 sampled orange pixels where the test asks for more than 400. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -460,15 +460,17 @@ void bind_sdk_compat(py::module_& m) {
|
||||
const auto callable = std::make_shared<KeptCallable>(provider);
|
||||
set_diagnostic_image_provider([callable](const DiagnosticImage& request) -> std::optional<ErrorEvidence> {
|
||||
const py::gil_scoped_acquire gil; // the operation that failed may be running without the GIL
|
||||
py::list shapes;
|
||||
py::list shapes, highlight_edges;
|
||||
for (const Shape& shape : request.shapes) shapes.append(scad::pybind::reactive::shape_to_python(shape));
|
||||
for (const Shape& edge : request.highlight_edges) highlight_edges.append(scad::pybind::reactive::shape_to_python(edge));
|
||||
const py::object picture = callable->get()(request.kind, request.operation, request.view, request.caption,
|
||||
request.dedup_key, shapes, scad::pybind::value_to_python(request.payload));
|
||||
request.dedup_key, shapes, scad::pybind::value_to_python(request.payload),
|
||||
highlight_edges);
|
||||
if (picture.is_none()) return std::nullopt;
|
||||
return evidence_of(picture);
|
||||
});
|
||||
}, py::arg("provider"),
|
||||
"Install provider(kind, operation, view, caption, dedup_key, shapes, payload) -> evidence dict or None: it "
|
||||
"Install provider(kind, operation, view, caption, dedup_key, shapes, payload, highlight_edges) -> evidence dict or None: it "
|
||||
"draws the pictures a failing operation asks for. None removes it.");
|
||||
m.def("_sample_edge_points", [](const Shape& edge, int samples) {
|
||||
if (edge.kind() != Kind::Edge) throw TypeError("_sample_edge_points needs an Edge");
|
||||
|
||||
Reference in New Issue
Block a user