As I said here, I'm asking for help with some parts of the unfolding algorithm.
What I'm going to ask is not exactly related to FreeCAD, is more a python programming question.
Suppose I have a list containing 17 face objects (listA), and then I have another list like this one (listB):
Code: Select all
[[4, 2], [5, 3], [0, 6], [1, 7], [0, 8], [1, 9], [10, 2], [11, 3], [4], [5], [6, 12], [7, 13], [14, 10], [15, 11], [12, 16], [13, 17], [14], [15]]
My question is how can I obtain a new list containing something like (if it start to unfold from face 4):
[ 4, A, B, C, D ], which is the route from the selected face up to a face without new branches.
Some combination of faces will never link with face 4 (this algorithm has also filtering purposes), this faces should be discarded.
I think it involves recursive programming and my brain just shuts itself down before getting damaged.
Solving this could be a major step forward, because once the route is created, it could be interpreted like: unfold D over C, all over B, all over A, all over 4. Clean and extrude solution.
I've tried to explain it as simple as possible, if it is not clear enough I will try to draw something, give another example or whatever is needed.
Javier