Metadata #14
Replies: 4 comments 2 replies
-
Metadata was suggested by some of the Bevy devs. It's definitely one of the less mature parts of csgrs at the moment. I'd also like to be able to offer up polygons sorted by their metadata, but that requires Eq or similar on the Metadata type. Which I suppose isn't a big deal, but without a user championing that feature I've hesitated to make lasting API decisions. Want to keep this thread open to discuss ideas? |
Beta Was this translation helpful? Give feedback.
-
Yes keep it open. As a neophyte, I don't have a lot to offer in the way of solutions. But I do have questions, which do have value in their own way ;) |
Beta Was this translation helpful? Give feedback.
-
Questions and discussion and bug reports and patches all welcome. Thanks for your interest in this little library. You've already helped solve a pretty big bug! My first real uses for metadata are coming up in https://github.com/timschmidt/ironpath and https://github.com/timschmidt/partsrs, where I can use it for color / multi-material. I figure that will inform a lot of my choices going forward. So far I've just tried to keep it preserved and assigned appropriately through operations. Tests are an area that need a lot of work. Many have grown irrelevant as the library has developed. It would also be nice to have an example render or two for each function, demonstrating it's use, in the documentation. If you run into any documentation you'd like to correct, while using it, feel free to let me know and I'll get the change in. It's been developed fairly quickly, so there are still some rough edges. Your help in finding / fixing them is appreciated. Can I ask about your interest in csgrs? Is there something you're working on or would like to do with it? |
Beta Was this translation helpful? Give feedback.
-
Here are the prototype functions I have currently commented out in csg.rs. One requires PartialEq, one requires Eq + Hash across the metadata type:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I did a quick perusal of the code and don't see any actual use cases for metadata. The tests you have imply they shouldn't change, but it would seem to me that on an operations like union, intersection and union there might be specific semantics that the user of csgrs might want to have for their metadata.
For instance if you stored color and then used a union to combine them I'd guess the user would want to control what happens and that for some operations it might be desirable to have a trait MetaUnion that would be invoked if it existed.
Just thinking outloud, thougths?
Beta Was this translation helpful? Give feedback.
All reactions