-
Notifications
You must be signed in to change notification settings - Fork 15
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
Is there a way to copy/isolate part of a graph into a new graph? #33
Comments
There is no API for this at the moment, but it's something I've been thinking about. There are two mechanisms that I think may be useful:
Implementing the first mechanism shouldn't be too hard, but the "cursor" idea includes some tricky details and I'm not sure what the API would look like. Would these cover your use cases?
No problem! I don't consider it an abuse. I'm also happy to answer questions via e-mail and Gitter though, so feel free to reach out that way too. |
Here's a first stab at isolating disjoint subgraphs. It comes with basic vertex traversal features on the same branch. Splitting a |
What I had in mind was more like having some sort of user defined predicate that decides on what consists disjoint topology. (ie material_id in Geomertry.Face). The cursor type seems like a possible solution but it would just be hiding some sort of filter over the iteration. For my use case just having an operation that could split a Vertex/Edge for me to slice my geometry at the borders of subgraphs would suffice. This affects the topology and adds an actual boundary at the borders but it's also the only way to do it without copying large parts of the mesh. The simplest method if copying wasn't an issue would probably be to copy the whole graph and delete unneeded geometry. |
I've been thinking of another way to approach this that may be useful. The path would need to completely subdivide a manifold. This means the path:
If a path meets those requirements, then it will completely subdivide sub-graphs. Such a |
The API for this could look something like the following: let mut path = graph.arc_mut(key).unwrap().into_path();
path.push(ByIndex(1)).unwrap();
...
let (a, b) = MeshGraph::split_at_path(path).unwrap(); This example uses a
I've pushed a sketch of this to the |
I've also started experimenting with an MeshGraph::split_at_path(path).unwrap();
let graphs = graph.into_disjoint_subgraphs();
for graph in graphs {
// ...
} It's important to note that this would require copying and/or rekeying in the storage layer, so this could be a relatively expensive operation. However, it should still be significantly cheaper and much more ergonomic than copying a graph and removing unwanted topology from the copies. |
It would be useful to be able to create subgraphs that restrict all traversals and manipulations to only part of the mesh. Is there such a functionality currently (cannot seem to find something like this in the docs).
(PS I'm sorry for abusing the issues page to ask for help using plexus. If you prefer I can send emails.)
The text was updated successfully, but these errors were encountered: