Commit Graph

18 Commits

Author SHA1 Message Date
wmayer
378f720291 Arch: fix regressions with material handling 2024-04-18 13:46:59 +02:00
David Carter
ba20441935 Material: Material appearance
Uses new material system for appearance

Each feature object now has a property called ShapeMaterial that
describes its physical properties. If it has a shape, it has a
material.

The ShapeColor attribute is replaced by a ShapeAppearance attribute.
This is a material list that describes all appearance properties, not
just diffuse color. As a list in can be used for all elements of a
shape, such as edges and faces.

A new widget is provided to allow the user to select materials in a
consistent fashion. It can also launch the material editor with its
more advanced capabilities.
2024-04-04 07:39:58 -05:00
wmayer
ef9936a940 App: fixes #10460: App::PropertyPythonObject is not saving data
Since Py3.11 the methods names __setstate__ and __getstate__ conflict with the method names added to the object class.
Thus rename them to 'loads' and 'dumps'
2023-09-24 10:56:35 -05:00
Roy-043
8166fb8aea Arch: Fix Arch_Fence section placement
The code relied on the old implementation of Draft patharray where the calculated placements were not returned in sequence.

Forum topic:
https://forum.freecad.org/viewtopic.php?t=81246
2023-09-17 18:21:13 +02:00
luzpaz
fdca2d49f7 Arch: lint bad indentation, superfluous formatting (#9310) 2023-04-19 09:40:16 +02:00
Alex Young
80dbfd5814 Arch: removes unused imports
Removes unused imports as reported by LGTM.

There are exceptions: `import Arch_rc` is shown as an alert, but has side effects.  It's not clear what the best thing to do in those cases is, so I've left them for now.
2021-02-14 16:27:06 +00:00
luz paz
ec52d5fd28 Arch: Added licence blurbs with attributions to authors
[skip ci]
2020-11-16 14:51:53 +01:00
vocx-fc
9e871cf27b 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
050b13e10c Arch: division including a float to obtain correct result 2019-12-26 13:22:35 -03:00
Bernd Hahnebach
bdf1abacc7 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
019d209199 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
5be63a94e2 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
ac9cd38650 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
d18d98fe2b 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
72014ead53 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
fa504cc612 Add missing "Part" import to Arch Fence 2019-05-15 17:40:58 -03:00
furti
72b291ecff 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
bc0c959f49 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