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.
This commit is contained in:
vocx-fc
2020-06-20 11:53:52 -05:00
committed by Yorik van Havre
parent 38ada85382
commit 9e871cf27b

View File

@@ -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