Add dynamic attributes to report the physical attributes of a part that
are automatically recalculaated when the shape or material changes.
These values are accessible from the part data display and as attributes
within Python
* [Draft gui_stretch] Improve Stretch Rectangle Behaviour
Feature Improvement discussed at FreeCAD Forum :
- https://forum.freecad.org/viewtopic.php?t=92124#p792118 (Draft_Stretching the whole rectangle creates a new wire)
Currently, 3 cases in general, proposed PR improve Case 3 below :
1. The original object is a Rectangle, if after stretching it is no longer a rectangle, it makes a copy turning it into a Wire which reflect the result of stretching.
- Current behanviour is good for user, no change.
2. If after stretching it is still a rectangle, the code just resize the original.
- Current behanviour is good for user, no change.
3. Now, if the user 'stretch' the whole rectangle, the code creates a copy as DWire in the 'stretched location'.
** - Users find this not intuitive, better just move the whole rectangle.
* For the human figure attached to the Draft grid a hard-coded point list is used (instead deriving the points from human figure.brep). This is more efficient and avoids a dependency on the BIM WB.
* The default for the human figure preference of the grid was changed to false. And the tooltip adjusted.
* BIM: Fix calculation of fence sections
The length and placement of fence sections was only correct if they were cut to size.
* Fix required another change.
Fixes#16832.
In V1.0 the two Draft status bar widgets appear as checkboxes without label in the toolbar area context menu. They should not be listed in that menu, as was the case in V0.21. Their visibility is controlled via preferences.
Additionally, in case the Draft WB is only preloaded, the widgets would display in another workbench. This is prevented by using a delay.
In ../src/Mod/Part/App/Geom2d/ sixteen out of seventeen XML
files needed repair as per the GitHub issue. Tabbing in those
sixteen files set to 4-spaces no-tab-chars. Other minor
changes as needed.
It's basically a port of #10951 to the new start page implementation.
Note: Icon files are not removed but re-used instead.
The commit adds some new functions:
* getThumbnailsImage()
Returns the name of the PNG inside a project file
* getThumbnailsName()
Returns the directory name containing the image files
* getThumnailsParentDir()
Returns the parent directory of the directory containing the image files
* getThumbnailsDir()
Returns the path to the thumbnail directory. There is no need to always create a unique directory
after each restart because it doesn't harm if the thumbnail directoy contains deprecated files.
* createThumbnailsDir()
Creates the thumbnail directoy if it doesn't exist yet.
* getSha1Hash
Helper function to compute a SHA-1 hash of a given path. If the same path is passed
then the hash value will be the same.
This way it can be avoided to create a different image file from a project file
after each restart.
* getUniquePNG
Computes the path of a PNG image file for a given project file. It's also possible
to pass an arbitrary string as argument.
* useCachedPNG
If the PNG image exists and if it's newer than the project file True is returned
and False otherwise.
For a given project file it is checked if the thumbnail directory already contains
a cached image. If it's newer than the project file it will used, otherwise it will
be re-created.
Fix freecadCanOpen() abd DisplayedFilesModel::addFile() to also check for lower-case
file extensions.
The old CAD model created by the development version of FreeCAD
(in which the Assembly workbench was used) contained joints that,
for some reason, had an empty Joint Connector 1 reference (Reference1).
This was causing an exception and a crash of the Python function
called migrationScript4. The FreeCAD Report view contained:
23:28:29 pyException: Traceback (most recent call last):
File "/FreeCAD/Mod/Assembly/JointObject.py", line 175, in onDocumentRestored
self.createProperties(joint)
File "/FreeCAD/Mod/Assembly/JointObject.py", line 181, in createProperties
self.migrationScript4(joint)
File "/FreeCAD/Mod/Assembly/JointObject.py", line 514, in migrationScript4
if hasattr(joint, "Reference1") and joint.Reference1[0] is not None:
~~~~~~~~~~~~~~~~^^^
<class 'TypeError'>: 'NoneType' object is not subscriptable
This patch attempts to avoid such exceptions by validating the type of
the property variable before accessing it.
Qt handles resize to content on double clicking the separator in the header, by default.
However this does not work in FreeCAD.
There are no comments on why this was done and is therefore treated as bug instead of feature.
Manual testing has been performed after the change and:
* Scaling by double clicking separator in header works
* Sizes are correctly stored in sheet when resizing to content
* BIM: Optimized leader UI - fixes#17284
* Correct task panel icon for BIM Leader.
* Make BIM Leader task panel title translatable.
* Use a single mode parameter for the Line class.
---------
Co-authored-by: Roy-043 <info@b-k-g.nl>