From 99a816699f22f3dad42ccbc096c3e88a047e2289 Mon Sep 17 00:00:00 2001 From: furti Date: Tue, 18 Jun 2019 19:41:53 +0200 Subject: [PATCH] Fix possible colorization problem When we set "UseOriginalColors" to true, it is possible that we cant calculate the exact number of diffuse colors, because the "applyShape" method optimized the shape somewhat. That operations could remove faces. To fix this for now, we simply set the shape without further optimizations. --- src/Mod/Arch/ArchFence.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Mod/Arch/ArchFence.py b/src/Mod/Arch/ArchFence.py index 94d70cb96e77..edc59fd7978a 100644 --- a/src/Mod/Arch/ArchFence.py +++ b/src/Mod/Arch/ArchFence.py @@ -117,8 +117,7 @@ def execute(self, obj): self.sectionFaceNumbers = sectionFaceNumbers - self.applyShape(obj, compound, obj.Placement, - allowinvalid=True, allownosolid=True) + obj.Shape = compound def calculateNumberOfSections(self, pathLength, sectionLength, postLength): withoutLastPost = pathLength - postLength @@ -325,7 +324,7 @@ def normalizeColors(self, obj, numberOfFaces): # 2. "Set colors" was called on the tip and the individual faces where colorized. # We use the diffuseColors of the tip in that case tipColors = obj.Tip.ViewObject.DiffuseColor - + if len(tipColors) > 1: colors = tipColors @@ -470,3 +469,5 @@ def colorizeFaces(o, color=(0.6, 0.0, 0.0, 0.0), faceIndizes=[2]): colorizeFaces(post) print(makeFence(section, post, path)) + + # _CommandFence().Activated()