Open M-Pixel opened 4 years ago
The message could maybe mention that the failure is in the check_integrity_and_topological_planarity
function. But this exception appears to be triggered only by the following minimal geometry:
That is to say, there is a vertex (where the triangles meet) that has more than two border edges emanating from it, so it's not a valid facet fan.
Is "sface" short for "surface", or something else?
no sface is short for sphere face: https://doc.cgal.org/latest/Nef_3/index.html#Nef_3Definition
This error appears to be extremely common, having to do with vertices merging due to floating point inaccuracy. There are dozens of forum posts and GH issues about this error, by OpenSCAD users. Often, in these threads, an OpenSCAD developer is able to identify the area of concern. In my case, I've run into this error by unioning or differencing just about anything with a particular organic mesh, so it's very unlike the more basic situations where a glance at the input instructions by an expert could possibly yield a solution.
If the condition were to output a message indicating the 3D position of the area of concern, in addition to whatever other contextual values contribute to the value of
e->incident_sface()
, it would make diagnosis easier, let alone possible in particularly complex compositions or meshes. The goal of any error message on data derived from user input should be to give the user an understanding of the "where" and the "why" in their input, so that they can fix it.Additionally, the basic message could be far more informative: In which context is the function being called? What is "e" meant to represent? Why should it not be equal to the default value? Why should I need to be proficient in C++ to understand that the error is comparing some value to a default value? Is "sface" short for "surface", or something else?
While my anecdote is about one particular assertion, I am posting the issue with a more general title, suspecting that there are likely many other assertions that should also be supplemented with contextual information and user-oriented messages.