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
If `get_diffuse_color` returned a list with a single color, the list was wrongly multiplied. Regression introduced in V0.21, but in that version the error was masked by how Core handled the diffuse color.
Fixes#17052.
* [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.
To harmonize the various CAM operations, the helical drill shall also be
configured using the cut mode (Climb/Conventional) just like Pocket or
FaceMill.
This means, the path direction (CW/CCW) is now a hidden read-only output
property, calculated from the side (Inside/OutSide) and the here newly
introduced cut mode.
The spindle direction is not yet taken into account and is always assumed
to be "Forward".
The GUI strings are kept compatible with what RP#14364 introduced becasue
of the v1.0 release string freeze. They need revision once back on the
main branch.
This reverts commit 7e62d07538 and adapts
to the in between commits where necessary.
- CAM: apply precommit 7274dac185
- CAM: rename "Tests" to "CAMTests" 2ff4914fd8
Motivations for the revert:
- Instead of actually implementing #14364 only a search and replace in
the enums values has been performed. But this does not mean the
feature is there, becasue "climb"/"conventional" milling depends not
only on the path's direction, but also on the spindle direction and
whether the milled feature is "inside" or "outside".
- In half of the cases of every changed operation or dressup, depending
on whether we mill "inside" or "outside", we now get the wrong results.
- In the (rarer) case of a reversed spindle direction, the "other half"
is wrong.
- Files created with previous versions of FreeCAD cannot be recomputed
any longer because there were no precautions on document restore.
- In files created with previous versions of FreeCAD one cannot change
the broken operation as the choices are now invalid.
- The original search/replace was incomplete.
- Only property values have been changed, the property names are still
inconsistent ("Direction" vs "Cutting Mode").
- The original search/replace also changed internal APIs where the
"climb"/"conventional" wording is not applicable as there is no
notation of "inside"/"outside" or "forward"/"reverse". If only the
path's direction is concerned, "CW"/"CCW" fits better.
Since the fixture in use has holes smaller than the default tool dimeter,
executing a helix operation with default parameters (i.e. all holes)
used to fail with an exception. Some tests work around this by actively
chaning the tool diameter, and this fix is now moved into the global
setup where the respective fixture is loaded.
The reason why the tests got disabled in the first place is unclear.
This demonstrates a regression introduced with PR #14364, where documents
containing helix operations cannot be recomputed any more (see #15643).
This is in preparation for a fix and to ensure we don't break it again.
The fixture has been created with the official mac build of FreeCAD-0.21.1
This commit improves the performance of Python code from FreeCAD macros by:
* using the chrono C++ stdlib header instead of QTime
* checking for the elapsed time ONLY every 1000th Python opcode execution
And this commit fixes time measurement by using a monotonic time source
instead of a normal one.
The previous implementation using QTime would give a negative time duration
if the start time is 23:59:59 and the end time is 00:00:01.
related commit: e78f74b01a
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.
* Gui: Improve localization support in VarSet dialog
* Gui: Adopt QObject translate
This is not the ideal implementation but for the 1.0 release this is
currently the better option. A separate issue has been filed for post
1.0 in https://github.com/FreeCAD/FreeCAD/issues/17510 that also covers
the `DlgAddProperty`.