From 3afb58f15dd7b8961cf0bc2b60eac38e2c054291 Mon Sep 17 00:00:00 2001 From: leyghisbb Date: Sun, 9 May 2021 22:36:59 +0200 Subject: [PATCH] delete unrequired groups --- extensions/fablabchemnitz/paperfold.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/extensions/fablabchemnitz/paperfold.py b/extensions/fablabchemnitz/paperfold.py index 90ac7ce0..b319a4f5 100644 --- a/extensions/fablabchemnitz/paperfold.py +++ b/extensions/fablabchemnitz/paperfold.py @@ -608,6 +608,12 @@ def writeSVG(self, unfolding, size, randomColorSet): if (self.options.printGluePairNumbers is False and self.options.printAngles is False and self.options.printLengths is False) or self.options.importCoplanarEdges is False and dihedralAngle == 0: text.delete() tspan.delete() + + #delete unrequired groups if no text labels + if (self.options.printGluePairNumbers is False and self.options.printAngles is False and self.options.printLengths is False) or self.options.importCoplanarEdges is False and dihedralAngle == 0: + textGroup.delete() + textFacesGroup.delete() + textEdgesGroup.delete() if self.options.printStats is True: inkex.utils.debug("Folding edges stats:") @@ -670,7 +676,7 @@ class Unfold(inkex.EffectExtension): if boxSize > maxSize: maxSize = boxSize - #generate random colors for glue pairs + #generate random colors; used to identify glue tab pairs randomColorSet = [] if self.options.separateGluePairsByColor: while len(randomColorSet) < len(mesh.edges()):