When the Arch SectionPlane was rendered via TechDraw in Solid mode, the
last parameter "fillSpaces" was not set for the svgcache.
So the next render operation threw an exeption because there where only
4 instead of 5 elements in the cache list.
Previously when setting the "Show Fill" property of the TechDraw Arch
Section View to true, the areas where always filled with a default grey
color.
This commit adds a property called "UseMaterialColorForFill" to the
ArchSectionPlane. When set to true, it will use the objects material
color to fill the cut shapes and fall back to the default color
when no Material is found.
When a DWG file is imported into FreeCAD it gets imported as a Part
object with a compound shape. One would imagine, that such an object
should be rendered like a symbol inside a TechDraw View. But when the
imported shape is inside a SectionPlane that also contains solids, the
shape is not included in the SVG.
The problem is, that getCutShapes only uses solid shapes, when a volume
was cut before. But the imported DWG is a flat 2D object and has no solids
inside.
To fix it, the getSVG method will check if an object looks like a draft
object, meaning:
- It has a shape
- It has no solids
- It has no volume
When it finds such a shape, it will treat it like a draft object. So
it is displayed like a symbol in the resulting SVG.
https://forum.freecadweb.org/viewtopic.php?f=3&t=34079
The ArchSectionPlane has a built in SVG Cache. But the door symbols and
a few other things are not inside the cache. This things not inside the
cache rely on the presence of a cutface. But this cutface was only built
when the cache is not available.
So the First invocation after the cache was cleared added the symbols.
The next invocations of the method, with a cached SVG did not calculate
the symbols again, because the cutfaces where missing.
This commit fixes it by calculating the cutfaces independent from the
cache.
Reported in https://forum.freecadweb.org/viewtopic.php?f=3&t=33987
getSVG puts placeholders in the generated SVG code and replaces them
afterwards with length values. With the changes of the previous commits
this seems not to be necessary anymore.
I replace them in a separate commit so this change can be reverted easily.
* Both properties are automatically added to old section planes
with the help of onDocumentRestored.
* A bit of style clean up to improve the readability of touched code lines.
* getSVG provides new style parameters for every kind of line:
V, V0, V1, H, H0, H1.
* Old line width parameters are removed. The style parameters
can be used instead.
* A style is a map container for svg attribute keys and values
(string, string).
* The Python interface is updated to offer the new style parameters
accordingly as a dict.
* Because there are many parameters on the function call now,
the Python interface supports keyword parameters.
* Update ArchSectionPlane to take advantage of the new style parameters.
This simplifies the code. String replacements could be removed
(done in a later commit).
* FeatureViewPy.cpp is – to my knowledge – the only function that used the
old line width parameters. I rewrote it to use the new style parameters.