Finding the connection lines between layers of a trimesh

47 Views Asked by At

I'm attempting to find the Explicit Corridor Map (ECM) of a Multi Layered Environment represented as a Triangle mesh following this paper. I'm focused on one small part of it right now. In section 5.2 of the paper it discusses "Connections". To find the ECM you first need to split the MLE into layers (which should be sets of triangles which are roughly coplanar and connected) and identify the connections between each layer as lines. This image does a good job of describing this visually.

For my implementation, I'm using Python and this Trimesh library. I can layer a given mesh, though it still needs refinement. The layers are split into separate "submeshes" to be independently manipulated, which is necessary for finding each layer's medial axis. What I'm struggling with is identifying connections.

My immediate thought is duplicate edges indicate a connection. But this comes with a few caveats. The submeshes don't retain the vertex indexing of the parent mesh, unfortunately, so making a list of duplicate edges would have to happen before the submeshing, making it seemingly expensive to identify which layers each duplicate edge belongs to. Also, I'm not confident that duplicate edges may not even capture every connection. A connection may consist of more than a single edge meaning you have to find some way to group them, and multiple connections may be close to each other making it harder to do that grouping.

I don't know if I wrote that very well, but I hope what comes across is that I'm confused, because the paper glosses over this point, making me think that there should be some relatively simple way to do this that I'm missing / Don't know the right words to find it online. (The same is true for finding the Neighbor set, by the way, referenced in 5.3.2.)

I can identify some brute force and/or inelegant approaches that would work, but I am concerned with performance, and the brute force implementation would almost certainly be too expensive.

I've provided a toy problem obj file to toy around with if that is of interest (.obj and .mtl), and I can provide more of the code I've written so far if anyone would find that helpful, but I'm more interested in finding resources for this, if they exist. Some of the difficulty definitely arises from how the library represents the mesh internally, but not the bulk of it.

Stack overflow wants me to include code to post a pastebin link, so here you go :). 
0

There are 0 best solutions below