Commit Graph

11 Commits

Author SHA1 Message Date
vocx-fc
8b8210f290 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.
2020-06-22 11:59:58 +02:00
vocx-fc
aef11c1f8c Arch: division including a float to obtain correct result 2019-12-26 13:22:35 -03:00
Bernd Hahnebach
36d418349e Arch: make new property to use shape color instead of material color working for all Arch objs 2019-08-14 21:41:47 +02:00
furti
f58c20afec Fix some problems with ArchFence
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.
2019-06-27 11:48:50 -03:00
furti
99a816699f 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.
2019-06-27 11:48:50 -03:00
furti
88d16c1495 Add support for PartDesign:Body colors
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.
2019-06-15 18:00:12 -03:00
furti
34292991de Add option to colorize ArchFence
When "UseOriginalColors" is set to true, the fence will copy the diffuse
colors of the original post and section to colorize itself.
2019-06-15 18:00:12 -03:00
furti
b82eef770f Optimize buildFence method
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.
2019-05-15 17:40:58 -03:00
furti
84169efee9 Add missing "Part" import to Arch Fence 2019-05-15 17:40:58 -03:00
furti
750d808918 Clip sections when too long
When the path wraps around a corner the section might be too long to fit
between the fence posts. So we clip it to the length so that it fits.
2019-05-07 21:31:12 -03:00
furti
41a4ef6674 Add Arch Fence builder
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.
2019-05-07 21:31:12 -03:00