a tad simpler:
note: ideally, the angle of each fold should be included in an "assembly instructions" file, while the output file only contains the cuts.
output outline must be a single continuous path.
Code:
faceX_clicked() // event-based I suppose?
is it connected to two or more faces present in the tree?
{
// connect where?
request from user: FACE = select_face()
if FACE not in unfold_tree: try again (or make new group)
} else is it connected to another face present in unfold_tree? {
FACE = that face (in the tree) it is connected to
} else {
make new group (set label and color, else random)
return
}
what edge connects the two faces? add this edge and its position to fold_list, mark it as a fold in the output.
add faceX to unfold_tree and compute its position ; output can be generated on-the-fly for all edges of faceX that are not part of fold_list
update face color and edge colors in the 3D model view ; color faces by first-level branch (group) and edges by unset/cut/fold
note: ideally, the angle of each fold should be included in an "assembly instructions" file, while the output file only contains the cuts.
output outline must be a single continuous path.