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.
The commit that introduces the colorization option added some problems.
First the "sectionFaceNumbers" property is only set when an execute is
performed. When this does not happen, an exception is thrown when the
document is saved that contains a fence created with an older version
of FreeCAD.
Also the new Props on the ViewProvider where not set because the
"onDocumentRestored" is not reckognized for ViewProviders.
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.
When the tip of a PartDesign:Body is colorized, the colors are stored
on tip level. But when the shape of the whole body is changed the information
is stored on body level. To account for this we check if the tip has more
than one DiffuseColor set. When not, we use the shape color of the body.
The method is renamed to "makeFence" to better fit to the overall Arch
naming style. Additionally it returns the generated object now so one
can use it directly from python.
This tool can build a Fence by giving it a single Section, a single Post
and a Path.
It will calculate the number of posts and sections needed and repeat them
along the path so that a full fence is build.