From 9e871cf27bc35b2db5db12cbf27086f9452f942c Mon Sep 17 00:00:00 2001 From: vocx-fc Date: Sat, 20 Jun 2020 11:53:52 -0500 Subject: [PATCH] Arch: fix calculation of fence objects In the past it used the `Draft.calculatePlacementsOnPath` function but this function was moved and modified when the `PathArray` was improved. The `calculatePlacementsOnPath` function was moved to `draftobjects.patharray` and renamed `placements_on_path`. This doesn't completely fix the Fence object because some other modifications need to be done in the calculation of the paths. --- src/Mod/Arch/ArchFence.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Mod/Arch/ArchFence.py b/src/Mod/Arch/ArchFence.py index ac03ccff14..f6ed5d2131 100644 --- a/src/Mod/Arch/ArchFence.py +++ b/src/Mod/Arch/ArchFence.py @@ -3,6 +3,7 @@ import math import FreeCAD import ArchComponent import Draft +import draftobjects.patharray as patharray if FreeCAD.GuiUp: import FreeCADGui @@ -134,8 +135,9 @@ class _Fence(ArchComponent.Component): # We want to center the posts on the path. So move them the half width in transformationVector = FreeCAD.Vector(0, - postWidth / 2, 0) - placements = Draft.calculatePlacementsOnPath( - rotation, pathwire, obj.NumberOfSections + 1, transformationVector, True) + placements = patharray.placements_on_path(rotation, pathwire, + obj.NumberOfSections + 1, + transformationVector, True) # The placement of the last object is always the second entry in the list. # So we move it to the end