* add precision Parameter for importSVG to preferences
* rewrite svgpath import
reorganize the existing svg interpretation code snippets by dividing the responsibilities for data provision and actual shape generation.
That bears the opportunity to optimize the resulting construction data regarding consistency and precision.
* create cuts from inner paths
organize paths in a tree structure where completely contained paths are children of their sorrounding paths
In a second step the even depth paths are cut with their respective (uneven depth) children.
* move svg path import logic into its own module
* Restructure how the import result is controlled by preferences.
* reintroduce alternative transform function
Using transformGeometry() on shapes results in degenerations like lines mutating to bsplines of 1st order. For non-orthogonal Transformations this can't be avoided. But for orthogonal transformations (the majority) we can apply those transformations without degeneration.
The necessary function including fallback to transformGeometry() is already in the code but was disabled due to a regression.
See: https://tracker.freecad.org/view.php?id=2062
Associated commits: f045df1e2509e59bd4f3cb72
I reactivate the code since the degeneration of paths seems a bigger issue to me than misformed svg files producing incorrect measurements. Degenrated paths are often the culprit for later arising 3D-calculation errors.
* avoid path degeneration by keeping scale transformations uniform
* repair style application on shapes
the style should be based on the configured svgstyle mode in the svgimport preferences.
* improve logging of face generation.
* refactor: rename _precision_step to _tolerance
naming according to example set in draft utils.
* fix: indentation
* spelling
If a window is a variant Link there will be a hidden source object in the document. That hidden object shares properties with the visible Link object. The Hosts property may be one of them, yet the hidden object should never be hosted.
Forum topics:
https://forum.freecad.org/viewtopic.php?p=817743#p817743 (sample file)
https://forum.freecad.org/viewtopic.php?t=96115 (code discussion)
To test the code:
1. Open the mentioned sample file.
2. Change the Hosts property of Window001 to Wall.
3. Recompute.
Improvement to User Interactive Experience:
- Now with the stock BIM Window Interactive Tool and SketchArch-addon, the required SketchArch parametric placement information of an Arch Object (Window currently) are automatically completed, no more manual input is required.
FreeCAD Forum Discussion:
- https://forum.freecad.org/viewtopic.php?p=822493#p822493
YouTube Demo:
- https://youtu.be/BNZFk03_eGE
* BIM: Improve grid handling for some commands
The updated commands did not handle the 2 grid options ("always", "only during commands") correctly. The proposed code follows the example of BimWall.py and ArchStructure.py where this issue has already been addressed.
* Rebase
For some reason PropertyEnumeration in our type information system was
said to be inherited from App::PropertyInteger, wich is not the case.
This commit fixes that mistake.
If PR consists of one commit with long description, github does put it
as the first lines of PR so above our header, it can result in inconsistencies.
The header is also needlessly duplicated in every PR preview.
An operator precedence error in new sanity checking code within
ElementMap::restore() causes <X>.Shape.Map.txt files with more than
2 element maps to be rejected as invalid. This silently corrupts
projects upon loading, potentially unrecoverably.
The preexisting code comment is still appropriate if ironic.
* Gui: Fix value field for DlgAddPropertyVarSet
The value field would only appear if a name was provided resulting in a
strange user experience. This commit fixes this and simplifies the
logic of the dialog.
* Process comments from review
Co-authored-by: Kacper Donat <kadet1090@gmail.com>
---------
Co-authored-by: Kacper Donat <kadet1090@gmail.com>
As the title says. I've noticed during reproducing of #18921, that
after in `PagePrinter::renderPage` we call `setTemplateMarkers`
twice, which results in deleting `childItems` allocated memory
(in `setTemplateMarkers`->`setMarkers`->`updateView`->`clearClickHandles`),
and then we are calling `setTemplateMarkers` (also in `PagePrinter::renderPage`) second time,
accessing `textFields` in `setMarkers` method, which still contain hanging pointers
from the previous deallocation. This results in segfaults as we iterate through `textFields`.
So, instead of keeping sychronization between childs of QGISVGTemplate
and textFields vector - this patch removes this variable at all and uses
childs directly to return text fields.
The Add Property Dialog for VarSets creates an editor based on the type.
This editor has no frame by default because it is mostly used in the
property view as part of a table. With this change we enable the frame
for the editor (the value field)