Skip to content

Commit

Permalink
Fix possible colorization problem
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
furti authored and yorikvanhavre committed Jun 27, 2019
1 parent 41d54eb commit 99a8166
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Mod/Arch/ArchFence.py
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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()

0 comments on commit 99a8166

Please sign in to comment.