Commit Graph

1502 Commits

Author SHA1 Message Date
Chris Hennes
40c99417bd [PD] Catch Python exceptions in dtors (Coverity)
In some PartDesign task dialogs, the destructors call functions that may
throw exceptions. If that occurs and the exception is uncaught, this
will ususally end up terminating the program. This commit adds try-catch
blocks around each instance of that (identified by Coverity) and handles
the Python exception in the normal reporting workflow.
2021-02-08 21:30:22 +01:00
David Osterberg
bad8257370 PartDesign: Fix sign error in Helix 2021-02-06 08:22:37 +01:00
David Osterberg
a819a89ede PartDesign: fix regression in Helix 2021-02-05 20:55:34 +01:00
David Osterberg
a45e6038b7 PartDesign: [Helix] Fix helix starting point bug 2021-02-05 19:17:00 +01:00
donovaly
b483fc0518 [PD] make pointers to the UI std::unique_ptr
Same as PR #4293, just for PartDesign

as noted in https://github.com/FreeCAD/FreeCAD/pull/4271#discussion_r554673632
the pointer to the UI should be a unique pointer.

This PR does this for all PartDesign dialogs that don't already use a unique_ptr.
2021-02-05 18:01:57 +01:00
David Osterberg
cb2da22e86 PartDesign: New features AdditiveHelix and SubtractiveHelix
These features, based on the code for the Pipe class, allow the user
to simply create a helical sweep within PartDesign workbench.

Sample application is threads, springs, coils, augers, etc.

Also, remove needless requirement for positive cone angle on helixes.

Thanks to @bitacovir for helping with the icons
Thanks to @chennes for review
Thanks to @vosk for review
Thanks to @wwmayer for review

Enforce that links stay within scope for ProfileBased features
This also ensures that the Body itself is not used for creating features within
the body, causing a "Graph not a DAG" error.
2021-02-04 13:01:12 +01:00
Pierre LeMoine
67aee7cd21 Transform patterns can be created from multiple base features
The infrastructure/piping seems to have been in place for a long while.
Not tested for all variations of pattern transforms.
The major enabler was removing the `break`.
Some extra piping added to let the code at call-site decide if to select multiple features or not.
2021-02-04 11:58:47 +01:00
David Osterberg
c19341b866 PartDesign: Allow selection of sketch plane by double click in picker dialog
Thanks to @0penBrain for solving a tricky segmentation fault
2021-02-03 16:46:47 +01:00
donovaly
09385d9d00 fix issue reported by @chennes
also fix annoying variable naming - different variables representing different types should not have the same name

also update a comment according to depending PRs
2021-02-03 16:24:01 +01:00
donovaly
2a6d30da27 [PD] hole fix custom cut handling
This PR is based on PR #4344 and a spin-off of PR #4337. It fixes:

We have normed screw head cuts. These values can be overridden but we must store the info about the overriding. Why? - because when you have e.g. made a custom change to a normed countersink and then change to another countersink norm, you would either not get the values defined in the norm or you get these values but loose e.g. your depth settings
2021-02-03 16:23:28 +01:00
donovaly
c5fe2589d5 [PD] fix UTS clearance holes
This PR is based on PR #4343 and a spin-off of PR #4337. It fixes:

- the bug that we did not use the normed clearance hole diameters for UTS holes
- missing recompute when changing existing hole from Metric to UTS type
2021-02-03 16:19:24 +01:00
donovaly
19605200a1 [PD] hole dialog UI fixes
This PR is the first in a series of probably 3 PRs to fix known hole dialog bugs.

This one fixes:

- the .ui file issues
- readonly status issues of some widgets/properties (e.g. when the hole is through all, disable drill point settings)
- the bug that updateHoleCutParams() overwrote the previously correctly determined hole diameter
- just a trifle: change a function name to fit into the naming scheme
2021-02-03 16:14:36 +01:00
donovaly
69f2f3b9e1 [PD] fix typo in iso7046.json
This mistake was introduced by me in commit 51c9640f
2021-02-03 15:08:30 +01:00
wmayer
8adf2aac25 [PD] [skip ci] fix alignment in pad dialog
just a minor UI issue: when you decrease the width of the pad dialog (e.g. because you have a small screen), the alignment of the widgets is lost. This fixes it by grouping the widgets in a grid.
2021-01-31 16:26:22 +01:00
donovaly
a884ea703e [PD] fix alignment in pocket dialog
just a minor UI issue: when you decrease the width of the pocket dialog (e.g. because you have a small screen), the alignment of the widgets is lost. This PR fixes this by grouping the widgets in a grid.
2021-01-31 16:03:57 +01:00
donovaly
96cbb986e2 [PD] correct hole cut definitions
I was able to get the norms and could update the definitions accordingly.
For example in the ISO 10462, sizes smaller than M3 are not defined and your definition files should only contain what is really defined.
2021-01-31 13:45:57 +01:00
donovaly
d1071026e7 [PD] fix blind hole depth handling
as reported in https://tracker.freecadweb.org/view.php?id=3818
we treat the blind hole depth not according to the conventions. The size of the drill point due to the angle is normally not taken into account but FC does this in any case.

This PR adds therefore an option, that is by default off, to take the drill point size into account.
Without the option, (the new default) the depth is calculated according to the conventions.

The PR also removes unused widgets and restored the tab order in the .ui file. The thread parameters were never used. In case we made in future the decision to carve into holes real (modeled) threads, we need a special UI for that solution anyway so having the dead code in is not helpful at all.
2021-01-25 01:10:23 +01:00
Yorik van Havre
33c719a382 Merge pull request #4287 from bitacovir/PartDesign_Icons
[UI] Add SVG icons for three PartDesign commands
2021-01-21 13:33:41 +01:00
David Österberg
e6e77c7698 Update src/Mod/PartDesign/App/FeaturePipe.h
Co-authored-by: Benjamin Nauck <benjamin@nauck.se>
2021-01-18 17:38:15 +01:00
David Osterberg
de5c8574d3 PartDesign: Fix small bugs in the Pipe feature
- Previously a subtractive pipe on a body with no solids would create a solid. Now Pipe will generate an error.
- Fix incorrect property header. Previously Pipe was identifying itself as Pad (copy paste error)
2021-01-18 17:38:15 +01:00
bitacovir
154d510183 [UI] Add SVG icons for three PartDesign commands 2021-01-18 11:04:32 -03:00
vosk
d667dd7102 [PartDesign]: Fix refine boolean not being obeyed at multiple places
Related to issue #3927
2021-01-07 14:04:31 +01:00
Abdullah Tahiri
4facab0936 Gui: Colorful/Greyable overlay status in icons
===============================================

Before this implementation, specific status via former mergeOverlayIcon() was greyed out
with the visibility.

With this commit, the developer has two options:

a) override mergeGreyableOverlayIcons, in which case the overlay will
be greyed out when the item is greyed out as per former mergeOverlayIcon()

b) override mergeColorfulOverlayIcons, in which case the overlay will
be superimposed after the icon is greyed out as it is the case for stardard
error and recompute flags.
2021-01-06 13:54:00 +01:00
Yann Diorcet
ae68147d0b LinearPattern: Support 1 occurrence
When using linear pattern with expression, this can be usefull to have only one
occurence (the original one), which can't be done with the following
implemenation. This commit change this behaviour by allowing this value.
2020-12-30 14:49:54 +01:00
Mateusz Skowroński
98f63ba60f Fix build warnings from deprecated Boost headers (they are used internally by Boost). Thanks @wwmayer for the hint. 2020-12-29 10:20:53 +01:00
luz paz
f497f09238 Fix typos [skip ci]
Typos ffound via `codespell v2.1.dev0`  
Also includes fixes in deprecated code of `src/Mod/Assembly`
2020-12-28 23:14:04 +01:00
Yorik van Havre
22f7d5f3bc Merged crowdin translations 2020-12-23 15:13:05 +01:00
wmayer
ff69f7fba3 PartDesign: [skip ci] fix Hole feature
* by default ThreadDirection must be set read-only since Threaded by default is None
* use suitable values to initialize the class properties
2020-12-18 21:18:41 +01:00
wmayer
2db10d8236 PartDesign: [skip ci] fix order of controls so that by pressing TAB always the next control gets focus 2020-12-18 17:04:27 +01:00
M G Berberich
a2b1e6226a cleanup of hole dialog
* replaced widget with radiobuttons by button Group, to improve alignemt
  of DrillPointAngle with grid-layout

* made Thread Pitch/Angle/Cutoffs widgets wider
2020-12-18 16:38:46 +01:00
wmayer
d4bd0098c2 PartDesign: [skip ci] fix layout of Drill point controls 2020-12-18 16:28:35 +01:00
wmayer
b62aeaf6b7 PartDesign: [skip ci] make the spin box for the angle of the drill point wider 2020-12-17 17:10:42 +01:00
M G Berberich
f5be329c3f make the hole-cut-type dropdown-box wider
This drop-down box contains long names and did not use the space of
the dialog.
2020-12-17 16:59:26 +01:00
wmayer
0aa38c44f4 PD: [skip ci] in wizard shaft handle case where Plot module is not available 2020-12-11 16:09:01 +01:00
Chris Hennes
533814dd0f Silence Qt/Windows setGeometry Warning
Add the optional Qt::MSWindowsFixedSizeDialogHint parameter to all uses of the QInputDialog::getX static functions to silence a Qt/Windows debug mode warning about QWindowsWindow::setGeometry: Unable to set geometry. Increase the size of the unit calculator to eliminate the same warning. Finally, call adjustSize() on the "Unsaved Changes" dialog to silence the warning.
2020-12-11 09:58:09 +01:00
wmayer
c235b9fba9 PD: [skip ci] fix invalid strings 2020-12-09 16:59:34 +01:00
wmayer
eac5b9466f PartDesign: [skip ci] for PartDesign::Torus primitive use TopoShape::makeTorus 2020-12-03 15:06:22 +01:00
wmayer
c509fc486d PartDesign: [skip ci] fix -Wmissing-field-initializers 2020-12-01 18:23:00 +01:00
Chris Hennes
12f4abceab Add core hole info for fine threads.
These values are calculated exactly from (diameter-pitch), and are
included here only to silence warnings from some compilers about missing
initializers. These values are not (currently) used in the code, which
directly calculates the core hole as needed in this case.
2020-12-01 10:03:56 -06:00
Uwe
103086c31b Update src/Mod/PartDesign/App/FeatureHole.cpp
Commit suggestion

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2020-12-01 15:17:31 +01:00
Uwe
3347bf3eda Update src/Mod/PartDesign/App/FeatureHole.cpp
Commit suggestion - fixes a typo

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2020-12-01 15:17:31 +01:00
donovaly
5c5712932c [PD] make threaded holes norm-conform
- the diameters of holes for threaded holes were only norm-conform for metric fine
- add missing UNC/F/EF sizes
- add a clearance diameter
2020-12-01 15:17:31 +01:00
luz paz
a65b3788c6 PartDesign: Issue #0004473: Expose openCommand() to translation
Continuing the work to expose the undo/redo functionality to translation. This commit does so for the PartDesign Wb.  
Ticket: https://tracker.freecadweb.org/view.php?id=4473
2020-12-01 14:53:35 +01:00
donovaly
99208ec2f4 [PD] more hole fixes
- there is the ISO 273 describing clearance holes, so we need to take these values. Only if we have a size not defined in the norm, we calculate
- add the coarse (wide) type for clearance holes from ISO 273
- add all screw thread sizes defined in DIN 13/ISO 261
- rearrange thread dialog to make it more compact
- change name "fit" to "clearance" as discussed
- add tooltips to the dialog
- fix issue with TaperedAngle dialog field
- change a size name because the norms define "M1" not "M1.0"
2020-11-18 14:45:14 +01:00
wmayer
385e4df10c PartDesign: [skip ci] fixes #0004494: Error "Result is empty" for Pads and Pockets with non zero Offset 2020-11-16 14:45:55 +01:00
wmayer
5e07809384 PartDesign: [skip ci] support negative values as second length of a pocket 2020-11-16 11:35:05 +01:00
wmayer
2e83e95f3a PartDesign: [skip ci] support negative values as second length of a pad 2020-11-16 11:26:51 +01:00
wmayer
55e3aad3c7 Part: allow to open attachment editor via context-menu 2020-11-15 19:16:22 +01:00
wmayer
596077cf67 PartDesign: [skip ci] if numpy fails to load due a RuntimeError then handle this exception but still load the workbench 2020-11-15 11:47:19 +01:00
donovaly
c9c5f12629 [PD] Hole countersink angle work
- fix bug that custom angles were overwritten
- the norms only define screw heads, not the cut for them, so also a custom angle is possible to sink a metric screw
- use better step in UI since one changes the presets only in fractions of a millimeter (otherwise it would be a different hole size)
- handle case of no cut
- calculate change in diameter when adding depth to countersinks
2020-11-14 19:24:32 +01:00