List of Parts and Connections


RE: List of Parts and Connections
#2
I have developed something similar recently. The code has three main parts:
1. Parsing the LDCad snap metas and converting them to a slightly different structure. This isn't difficult, it just took some time to fully understand the snap meta format.
2. Finding out which parts can interact (Broadphase collision). Each part has a bounding box. An AABB tree is built to efficiently find all the pairs where the bounding boxes intersect.
3. For each pair that intersects: Iterate through all combinations of connectors of both parts to determine which connectors are connected. This sounds computationally expensive, but most combinations can be ruled out pretty fast (cylindrical connectors must be colinear for example).

This method is pretty fast. I can compute a full connection graph for datsville in a few seconds on my i7-6700k. But the graph is too large to visualize with GraphViz.

Here's a visualization of a submodel of the Porsche 911 OMR model:
   
Reply
« Next Oldest | Next Newest »



Messages In This Thread
List of Parts and Connections - by Cole - 2024-01-22, 15:53
RE: List of Parts and Connections - by Basil Bader - 2024-01-23, 6:59
RE: List of Parts and Connections - by Cole - 2024-02-26, 7:06

Forum Jump:


Users browsing this thread: 1 Guest(s)