delete unrequired groups

This commit is contained in:
leyghisbb 2021-05-09 22:36:59 +02:00
parent 4ecb9b2df9
commit 3afb58f15d

View File

@ -609,6 +609,12 @@ def writeSVG(self, unfolding, size, randomColorSet):
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:")
inkex.utils.debug(" * Number of mountain cuts: " + str(mountainCuts))
@ -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()):