From 998a6e397f7346a013d45599ab8ae1e16eae9a05 Mon Sep 17 00:00:00 2001 From: Mario Voigt Date: Mon, 14 Sep 2020 00:04:58 +0200 Subject: [PATCH] added some dev comments for paperfold --- extensions/fablabchemnitz/paperfold.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/extensions/fablabchemnitz/paperfold.py b/extensions/fablabchemnitz/paperfold.py index 90298c4e..600dd8ce 100644 --- a/extensions/fablabchemnitz/paperfold.py +++ b/extensions/fablabchemnitz/paperfold.py @@ -37,6 +37,14 @@ possible import file types -> https://www.graphics.rwth-aachen.de/media/openmesh ToDos: - Add glue tabs - Fix bug with canvas resizing. bounding box of paperfoldMainGroup returns undexplainable wrong results. Why the fuck? How to update the view to get correct values here? +- Print statistics about + - groups + - triagle count + - edge count per type (valley cut, mountain cut, valley fold, mountain fold) + - remove unrequired extra folding edges on plane surfaces (compare the output from osresearch/papercraft and paperfoldmodels) which should be removed before printing/cutting. + For example take a pentagon - it's face gets divided into three triangles if we put it into a mesh triangulation tool. Means we receive two fold edges which we don't need. + This would create more convenient output like osresearch/papercraft and dxf2papercraft do. + See https://github.com/osresearch/papercraft/blob/master/unfold.c > coplanar_check() method """ @@ -294,8 +302,7 @@ def unfold(mesh): # Calculate the minimum spanning tree spanningTree = nx.minimum_spanning_tree(dualGraph) - #Unfold the tree - + # Unfold the tree fullUnfolding = unfoldSpanningTree(mesh, spanningTree) [unfoldedMesh, isFoldingEdge, connections, glueNumber, foldingDirection] = fullUnfolding @@ -317,7 +324,6 @@ def unfold(mesh): if triangleIntersection(triangle1, triangle2, epsilon): faceIntersections.append([connections[face1.idx()], connections[face2.idx()]]) - # Find the paths # We find the minimum number of cuts to resolve any self-intersection