It should be possible to assign an optional label to objects #2125
Labels
topic: core
Issues relating to core geometry, operations, algorithms
type: feature
New features and improvements to existing features
The problem
Validation errors are a fact of life, when implementing new functionality. But understanding what's causing them can be very hard, as it's not easy to identify what an object in the error message actually is. The same is probably true when working on non-trivial models.
A solution: labels
I think there is a relatively simple thing that could be done to improve this: Making it possible to assign an optional label to objects, so you can clearly associate what you see in the output with what you defined in the code.
These labels can be created and perpetuated by operations. For examples, if you have a sketch with a half-edge labeled "abc", then sweeping that sketch can create a label for the respective side face, something like "side face swept from abc". But this can be done piecemeal, as required, and doesn't need to fall into the scope of this issue.
Implementation
It might make sense to implement these labels as a separate layer, as to not further complicate the object graph and core data structures. ("Layers" are a concept that doesn't yet exist in the code base, at the time of writing, but see #2116 and #2117 for some thoughts on them.)
One possible hurdle is, that if labels are not part of the core data structures themselves, we need some way to inject them into the code that formats objects for the validation error messages. This can probably be done by creating
Debug
/Display
implementations not forHandle
itself, but for another struct thatHandle
can provide. Something like this:handle.display_with_label(label)
.The text was updated successfully, but these errors were encountered: