-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Manifold metadata #425
Comments
You can attach properties to vertices, which will be preserved after operations. Alternatively, there is also a originalID, exposed in runOriginalID, that can be made unique for every single manifold by calling AsOriginal. |
Ah sweet. Thanks @pca006132. |
I've had a quick play and it looks like originalId and a separate dictionary should work. 🙇♂️ |
After boolean operations, we will try to simplify the mesh by removing some vertices, which can make later operations more efficient. However, if the vertices have different original IDs, we cannot remove them, so the mesh will be more complicated. But normally we don't expect too much of a performance problem even if you use AsOriginal everywhere. |
Right, got it. Unfortunately after a bit more testing I don't think either approach will work after all. In my initial testing I used lists of manifolds and that worked fine. However, after trying it with an actual assembly the manifolds that go in to the Being able to survive a compose/decompose would be ideal as then I can just work with the final assembly. I've also tried using the vert properties which feels a bit sketchy (I think it locked up the tab at one point) but also I couldn't make work. I can assign a new value in the vert property array but it doesn't stick. I tried mutating existing entries as well as creating a new expanded Float32Array and assigning it back. The values were not present after retrieving them with I will take a different approach for now and console.log or concat part / cut lists as the assemblies are made rather than involving the manifolds but it's a much less desirable solution for my use case. |
Here is a simple repro example for both cases in case I'm doing something silly: vertProperties:
OriginalID
|
Interesting, will have a look at it later this week. |
I see that after your |
Good to know I'm not doing something dumb 😅. I did try union but it seemed it was a one way operation. Since my main focus is a cut / part list it's pretty important to be able to work back to the constituent parts from the final assembly. I had compose / decompose down as a kind of grouping mechanism which seems perfect for this use case. Thanks for your time on this 🙇 |
Compose can only be used for parts that are non-intersecting, it is just some low level optimization exposed to the users. If you want to preserve the different parts, the way I would do it is to translate them to the correct location and apply all other operations to each of them, without doing union. And then you can export each component individually. |
Yes, I agree with @pca006132, though I'm still a bit confused about the use case. Can you describe a simple end-to-end example of what you're trying to accomplish? Parts and cuts are pretty different concepts, so it would be helpful to understand your workflow. |
Umm, maybe it's best explained with what I'm playing with atm. Here is what it currently looks like:
This produces:
The intention is to be able to pack cut lists on to boards and produce a shopping list for hardware. To be honest I think this approach will work well enough for now but metadata on the manifolds was the first place my head went for this. Interestingly, if you change the final |
Since the current approach is working well enough please feel free to close this. That said if originalID is supposed to survive a compose/decompose then that may be a bug and I'm fairly sure the |
Yes, those are both valid issues - let's keep this open to track. And thanks for the detail! That's a very interesting use case that I'll have to think over a bit. |
In playing with your example, I think your current approach is the right one. In fact I would avoid any If you made this into a tool outside of manifoldCAD.org, you might also consider simply putting each cut and part into its own glTF node, so you can name them and keep them separate more easily downstream. Manifold is meant for mesh modification - tracking assemblies is probably easier done at a higher level. You might look at my new |
I've also been thinking it would be cool to support OpenSCAD-style animations in ManifoldCAD.org, which would also require a concept of assemblies. I'm trying to figure out the right level of API to expose for this - I'll keep your example in mind. |
Sounds awesome 😁. I'll take a look at your model-viewer example and be sure to let you know if I come up with anything fun. For now I'll be focusing on building the workbench and working with ManifoldCAD ... otherwise I'll never get it built 🙊 . The simplicity in ManifoldCAD is nice for that to be honest; no crazy distractions or mad complex interfaces to learn. Just a small API. I might see about implementing a grid or an axis indicator or maybe even just shortcut keys for front / side / top / perspective elevations (a little like blender keypad shortcuts). It can be quite confusing to determine camera orientation after you've been working a while. 🤔 Anyway, thanks again for your time and consideration 🙇 |
Yes, some help with UI would be excellent! Glad you like it. |
Regarding the bugs: I realized the As for the OOM, I have a minimal repro:
It seems we have some problem when two |
I can have a look but I don't have a lot of time recently, so I will probably be a bit slow on this. |
* fix compose index error #425 (comment) * simplify test case
* fix compose index error elalish#425 (comment) * simplify test case
Would there be a possibility of being able to attach metadata to Manifolds?
I'm trying to use ManifoldCAD to create designs for a woodworking project but ideally I'd be able to attach labels, material, fastener sizes etc to manifolds.
I'm hoping that I will then be able to generate cut and part lists from decomposed manifolds that make up the finished design.
It may also allow me to isolate specific manifolds by name in code.
An alternative (though slightly more cumbersome method) would be if a unique id can be exposed for every manifold. This way I could maintain an independent dictionary of metadata keyed by id... though I would definitely prefer being able to attach metadata directly.
Wouldn't need to be much more than a dictionary of strings; more complex types can be serialized in and out of this if needs be.
Finally, thank you for such a great project 🙇
The text was updated successfully, but these errors were encountered: