1

I am really new to this so any help is appreciated so basically I am trying to use PyTorch geometric to identify topological features within 3D CAD models (i.e. slots, pockets, holes, etc) but in order to do that I need to represent the cad model into a graph in PyTorch geometric. For the input data, I am thinking of using adjacency of the faces to identify the features within the model.

Below is an example that is what I want to achieve out of a 3D model. The relationships between each face are represented in a graph format.

enter image description here

So after getting the above graph I want to feed that to the algorithm for the graph classification. The issue that I am facing is how can I extract that adjacency information out of the CAD model (i.e. Let's say face 1 is connected to face 3 so I take the 2 faces as two nodes in the graph and connect the two-node with an edge as both faces are touching each other) makes a graph out of it as shown in the above image.

I did come across one tool called pythonOCC not sure I can use that to extract the adjacency information out of it, if possible please suggest what I can do using that tool.

Sparky05
  • 4,692
  • 1
  • 10
  • 27
  • out of curiosity: you seem to count the inner lining of a circular hole as one surface - how is the convex/concave realtionship handled if, for instance two circular holes meet inside a body at an angle? that would create a convex and a concave edge. – bukwyrm Aug 13 '21 at 10:14
  • yeah that will be the case I think but first, I want to try it for simple geometry just to get some idea about it like how good the model is performing for simple geometry classification – Shubham Verma Aug 13 '21 at 10:47
  • Have you been able to solve this? – Thiago Petrone Jan 09 '22 at 13:49
  • I am not sure whether there is any direct way to extract adjacency information but I did use the angle between two faces to create features out of it and for that angle value extraction I took help from my colleague. And it was not completed but I was able to classify simple cad models like bolts, screws, and nuts into their respective classes. – Shubham Verma Jan 09 '22 at 15:47
  • @ShubhamVerma Did you solved this issue? I am also facing same issue and I am trying to solve this using trimesh to convert the mesh data to NetworkX graph and then to Deep Library Graph. Though I am able to convert the mesh to graph, I want to convert BREP CAD data to DLG not mesh to DLG as some faces with NURBS gets removed when converting to mesh data. – sk3145 Jun 01 '22 at 05:08

0 Answers0