Commit Graph

34446 Commits

Author SHA1 Message Date
Roy-043
92c6a36925 Draft: Update the Plane class (step 1)
After this PR the `Plane` class inherits from the `PlaneBase` class.

Related issue:
#5603.

Previous PR:
#10766

The following functions have been updated:

`__init__`
* `u` argument can be a WP now.
* Input vectors are copied.
* Added the `weak` argument.
* the `doc` attribute was not used and has been removed.

`__repr__`
* Inherited.
* The `position` is now also shown.

`copy`
* Uses `match` from the parent class which uses the local `_get_prop_list` function. Again vectors are copied.

`offsetToPoint`
* I could not find evidence that this function is used anywhere.
* The `direction` argument did not make a lot of sense (only worked in 2D). It is now ignored.
* Removed the overly long docstring.
* The function now uses an external function: `DraftGeomUtils.distance_to_plane`.

`projectPoint`
* The function calls `super().project_point` which in turn calls `DraftGeomUtils.project_point_on_plane`.
* `from sys import float_info` is no longer required.

`projectPointOld`
* Obsolete and removed.

`align*`
* All align* functions now have an `offset` argument.
* All align* functions return `True` or `False`.

`alignToPointAndAxis`
* The function ignored `upvec` if `axis` was parallel to the global X axis. This meant that the "Set WP" button of the Draft_Wire command did not work properly if the WP was aligned with the Right or Left view.
* The function calls `align_to_point_and_axis` which determines the rotation with `FreeCAD.Rotation(Vector(), upvec, axis, "ZYX")`.

`alignToPointAndAxis_SVG`
* The function calls `super().align_to_point_and_axis_svg` which contains the code from the old function.

`alignToCurve`
* Was not implemented.

`alignToEdges`
* Original code required two parallel edges (for example from an axis system), else the `u` and `v` vectors would not be perpendicular.
* The function calls `super().align_to_edges_vertexes` now.

`alignToFace`
* The function now uses an external function: `DraftGeomUtils.placement_from_face`. The rotation algorithm for the `u` and `v` vectors has been moved there.

`alignTo3Points`
* Basically unchanged. `Part` is already imported at the top of the file.

`alignToSelection`
* Basically unchanged. Will be replaced in the `PlaneGui` class.
2023-09-27 11:25:04 +02:00
wmayer
3433ce70a6 Gui: fix automatic spinning of DemoMode 2023-09-26 15:41:12 +02:00
wmayer
759e83859b Mesh: C++ core guidelines 2023-09-26 13:10:23 +02:00
Roy-043
56d3d3d5b1 Draft: ShapeString: improve ObliqueAngle (#10811)
Calculation of the justification required the use of `optimalBoundingBox` and should happen after applying the oblique angle.
2023-09-26 12:53:53 +02:00
wmayer
bd0a3122b6 Mesh: C++ core guidelines 2023-09-26 11:20:35 +02:00
wmayer
eec9bdcefa Gui: do not create the commands StdCmdSelBack and StdCmdSelForward twice 2023-09-26 11:07:51 +02:00
Yorik van Havre
79a74e722b Merge pull request #10790 from Rexbas/rotation-center-preferences
Gui: Add rotation center indicator color, transparency and size preferences
2023-09-26 11:01:19 +02:00
Yorik van Havre
247df99391 Merge pull request #10816 from Roy-043/Arch-ArchSectionPlane.getSVG-add-linespacing-argument
Arch: ArchSectionPlane.getSVG add linespacing argument
2023-09-26 10:59:14 +02:00
Roy-043
0a2f47fefd Arch: ArchSectionPlane.getSVG add linespacing argument
Forum topic:
https://forum.freecad.org/viewtopic.php?t=81470
2023-09-25 22:09:41 +02:00
sliptonic
70894e7cbd Merge pull request #10800 from Syres916/Sanity_FollowUp
[Path] Sanity Follow up improvements...
2023-09-25 14:19:50 -05:00
Ajinkya Dahale
4435a3974f [Part] Optimize snippet of code in ShapeMerge.py
Some notes:

Earlier, when adding to the list `connected_to`. the numbers are added in order
from `range(len(groups)`, so we are already in order and every `i_group` is unique.
2023-09-25 11:27:55 -05:00
Yorik van Havre
84cb841f3f Merge pull request #9446 from Rexbas/navigation-animation
Gui: Refactor navigation animations
2023-09-25 18:15:43 +02:00
andrea
f6ca5040b3 update glext.h 2023-09-25 11:00:01 -05:00
howie-j
acbf135b78 [Sketcher] Fix angle constraint expression regression (#10743)
* fix 10742

* moved expression string modifier to helper function

* Tests: Add example tests for SketchObject

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* made expr modifier func static, pass by value and added unit tests

---------

Co-authored-by: Chris Hennes <chennes@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-09-25 10:44:31 -05:00
Chris Hennes
8945ab642d Merge pull request #10761 from Ondsel-Development/ui_view_toolbar
Toolbar View and Structure cleaning
2023-09-25 10:42:26 -05:00
sliptonic
c380d78877 Merge pull request #10789 from haraldhartmann/PathAddEstlcamPP-patch-2
Path: refactor Utils imports in estlcam_post.py
2023-09-25 10:36:18 -05:00
sliptonic
292952d91e Merge pull request #10792 from jffmichi/fix_leadinoutdressup
Path: fix LeadInOutDressup throwing an exception due to floating poin…
2023-09-25 10:34:17 -05:00
wmayer
563dc0b0cc Part: Add method Part.Compound.setFaces() 2023-09-25 15:31:30 +02:00
Syres916
4c666d1454 [Path] Sanity fixed another bug found in testing 2023-09-25 14:18:38 +01:00
Yorik van Havre
cdbc778513 Arch: fixed leftover in OfflineRenderingUtils 2023-09-25 15:00:26 +02:00
Yorik van Havre
afdbd4c094 Removed the use of SoGui in Arch OfflineRenderingUtils module 2023-09-25 15:00:26 +02:00
wmayer
836c237d3c Fem: Apply clang-format 2023-09-25 14:50:43 +02:00
wmayer
b8b94c249e Fem: Apply clang-format 2023-09-25 14:50:43 +02:00
wmayer
59c7653584 Fem: Apply clang-format 2023-09-25 14:50:43 +02:00
wmayer
91a40b2007 Fem: Apply clang-format 2023-09-25 14:50:43 +02:00
wmayer
800006a505 Fem: Add to pre-commit hooks 2023-09-25 14:50:43 +02:00
wmayer
58adf212d9 App: still support __getstate__/__setstate__ for add-ons for < Py3.11 2023-09-25 14:48:54 +02:00
wmayer
c1d1a4fd1f Test: add unit tests for PropertyPythonObject 2023-09-25 14:48:54 +02:00
Syres916
0b6b72059a [Path] Sanity fix based on user feedback and further testing...
...of stacked substitutions and static folder paths.
2023-09-25 13:25:05 +01:00
wmayer
37e477d3e7 Import: fixes #8666: Enable support to read glTF files 2023-09-25 13:02:59 +02:00
wmayer
0aa9ea99b4 Import: move glTF writer to its own source files 2023-09-25 13:02:59 +02:00
FEA-eng
9260cd9502 FEM naming fix part 2 2023-09-25 12:17:43 +02:00
Yorik van Havre
93cb1b3158 Merge pull request #10778 from Roy-043/Start-use-Gui-FileChooser-Directory-where-applicable
Start: use Gui::FileChooser::Directory where applicable
2023-09-25 10:58:20 +02:00
Yorik van Havre
951aafde60 Merge pull request #10555 from Syres916/Font_8514oem_exclude
[Preferences] Exclude 8514oem from Monospace fonts
2023-09-25 10:57:26 +02:00
Yorik van Havre
be84810aa9 Merge pull request #10783 from Roy-043/Draft-ShapeString-add-ObliqueAngle-property
Draft: ShapeString: add ObliqueAngle property
2023-09-25 10:54:53 +02:00
Yorik van Havre
f883a77ca0 Merge pull request #10766 from Roy-043/Draft-Introduction-of-the-PlaneBase-class
Draft: Introduction of the PlaneBase class
2023-09-25 10:09:48 +02:00
Syres916
883de466ae [Path] Fix multiple substitutions 2023-09-25 08:27:20 +01:00
wmayer
9728e60753 Gui: fixes #10782: Unable to cancel Select module Open obj messagebox 2023-09-24 16:08:02 -05:00
Roy-043
432ba3adde Draft: ShapeString: add ObliqueAngle property (improvement) 2023-09-24 19:04:32 +02:00
Syres916
7e92729c50 [Path] Sanity Follow up improvements...
... and removal of remaining asciidoc generating code
2023-09-24 17:23:23 +01:00
wmayer
83d4080fe8 App: fixes #10460: App::PropertyPythonObject is not saving data
Since Py3.11 the methods names __setstate__ and __getstate__ conflict with the method names added to the object class.
Thus rename them to 'loads' and 'dumps'
2023-09-24 10:56:35 -05:00
Rexbas
97d84ec184 Add Rexbas to contributors 2023-09-24 12:17:40 +02:00
Chris Hennes
d95b26dfb5 Merge pull request #10788 from wwmayer/format_no_sorting
clang-format: disable sorting of includes
2023-09-23 23:59:43 -05:00
jffmichi
1f11b1ca06 Path: fix LeadInOutDressup throwing an exception due to floating point inaccuracy when comparing z-positions 2023-09-24 03:13:28 +02:00
Rexbas
148f4adef0 Gui: Add rotation center indicator color, transparency and size preferences 2023-09-23 22:42:20 +02:00
Harald Hartmann
3bb891eaf6 fix #10396 - refactor Utils imports 2023-09-23 22:05:36 +02:00
wmayer
b65ae56f1f clang-format: disable sorting of includes
Sorting the included headers regularly leads to build failures. Especially when PCH is enabled the PreCompiled.h must be the very first include
2023-09-23 19:17:33 +02:00
wmayer
5a81fcd7a5 MSVC: fix warnings and build failure 2023-09-23 19:10:32 +02:00
wmayer
15b11bc360 Mesh: Apply clang-format 2023-09-23 14:03:11 +02:00
wmayer
4e328682d9 Mesh: Apply clang-format 2023-09-23 14:03:11 +02:00