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
Python 3 is fussy about match of data type for a file open or write. Python 2 does not seem to care if a string is written with a 'wb' indicating a binary type, but Python 3 flags it as an error.
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
To do this, the object snapping code has been refactored into a snapToObject function. This allows it to be called on different objects easily. A new base class which handles the tab event has been added.
- Replace relative Add-On Image Path with full file uri in StartPage.js file
- Fix a missing absolute file path
- Fix a duplicated data folder entry in the Resourcepath
To allow successful Collada Export for Py3 and Py2, tested import of DAE file with colours from Blender to ensure no regression on the import side. Note: I had to download Pycollada to enable testing in Conda build.