Commit Graph

1527 Commits

Author SHA1 Message Date
wmayer
45079ca2ac PD: [skip ci] AddressSanitizer: stack-use-after-scope
Axis() returns a tmp. object and thus we cannot use a const reference to get its Location() method
2021-02-23 13:57:51 +01:00
wmayer
48f56169de PD: [skip ci] fix regression caused by fdf7e6acbe120
In the accept() method the view provider of the edited object must be made visible if it's valid as otherwise it can happen that the view is empty.

See https://forum.freecadweb.org/viewtopic.php?f=13&t=55915
2021-02-23 11:20:45 +01:00
David Osterberg
59dd9d72c5 PartDesign: Fix throughall distance when throughall is used together with midplane 2021-02-20 20:12:47 +01:00
wmayer
7c4ff63079 PD: [skip ci] fixes #0004540: When manual size of DatumPlane is selected its Length property is not saved to the file and consequently not restored on opening 2021-02-20 13:33:54 +01:00
wmayer
fab2a0d1fa PD: [skip ci] do not pop-up dialog when creating a body while another body is selected 2021-02-19 21:44:48 +01:00
David Osterberg
0e8e5c8d49 PartDesign: Fix helix for OCC versions < 7.5.0 2021-02-19 20:02:11 +01:00
donovaly
3fdce54be7 [PD] fix dressup feature display when broken
As discussed in https://forum.freecadweb.org/viewtopic.php?p=479647#p479377
the user can end up without either seeing nothing or an inexisting dressup feature.

This PR fixes this.
2021-02-19 14:51:52 +01:00
David Osterberg
1b07835aa5 PartDesign: Check closedness in AddSub refine function 2021-02-19 14:33:56 +01:00
wmayer
55cdfefce1 PD: [skip ci] recompute document when canceling task dialog, fix also possible crash 2021-02-19 11:33:58 +01:00
wmayer
da90fa3ba7 PD: [skip ci] drop some superfluous static_cast 2021-02-18 22:51:15 +01:00
Chris Hennes
da7c6d9172 [PD] Fix isFeatureMovable() to check null status of property
As reported by @donovaly, if you try to move a pipe that does not have
an auxilliary spine, the code segfaults. This commit adds a check to ensure
that not only does the property exist (which in this case it always does), but
also that it does not contain a null. That is a valid value for the property
to have, but cannot be itself interrogated for moveability by the isFeatureMovable
recursive call. This fix is also applied to the other similar conditions in that
function to ensure they never yield the same segmentation fault.

Forums topic: https://forum.freecadweb.org/viewtopic.php?p=479388#p479388
2021-02-18 22:44:13 +01:00
David Osterberg
fc6b98e4d7 PartDesign: Mild code cleanup of Helix 2021-02-18 21:51:44 +01:00
wmayer
6a3e76addb PD: [skip ci] fix typo in comment 2021-02-17 15:55:47 +01:00
wmayer
1955848194 PartDesign: [skip ci] make base object visible again if initial additive helix fails to recompute 2021-02-17 13:33:02 +01:00
David Osterberg
b0773e2b99 PartDesign: Helix: fix preview 2021-02-17 13:19:06 +01:00
David Osterberg
60c634c275 PartDesign: Subtractive Loft. Raise error when base is null.
Previously Subtractive loft would create a shape if there is no base
object. This is because the code is shared with Additive Loft, where
that is the right thing to do. Now we check for this, and return error
if there is nothing to subtract from.
2021-02-15 19:50:51 +01:00
David Osterberg
86f148175f PartDesign: Improve Helix parameter proposals
The previous initial proposed parameters could cause self intersection
when the user switches axis
2021-02-15 16:48:42 +01:00
wmayer
abed4bd421 PD: [skip ci] fixes #0004205: Bad behavior when entering manually PD/AdditivePipe path 2021-02-15 00:06:29 +01:00
David Osterberg
bff55def04 PartDesign: Fix hardcoded through all distance in ProfileBased
Before the throughall distance was 10 m, which is not enough for
many applications. The fix is to use the bounding box of the base shape
together with the sketch profile to calculate dynamically a large enough
length.
2021-02-12 18:37:56 +01:00
David Osterberg
ec51691a43 PartDesign: Fix broken outdated icon filenames
This fixes some cases that were missed in commit 1814270d53afd1c51c
2021-02-12 17:46:27 +01:00
wmayer
0df2105ad8 PD: [skip ci] fix ViewProviderPrimitive::getIcon() after renaming of icon files 2021-02-12 13:20:16 +01:00
donovaly
bcadbe3b1b [PD] rename icons to match Wiki files
For the What#s this feature we need to have a uniform naming of the features and its icons. For some PD icons this is not the case and since we are in feature freeze, this is the right time to address this.
(I see the same is already done for Mesh.)
2021-02-11 12:47:25 +01:00
Chris Hennes
6b16e12d7c [OTHER] Catch only Exception, not BaseException 2021-02-11 11:52:45 +01:00
Chris Hennes
e7e794753a [PD] Add missing ctor variable init (Coverity)
The "angle" variable was not being initialized in any of the
constructors for the CutDimensionSet, and nothing was being initialized
by the default constructor. This commit adds angle as an optional final
argument to the parameterized constructors, defaulting to 0.0, and adds
default values to the default constructor using the first of each enum
and 0.0 for the angle. The default constructor is required elsewhere in
the code so cannot be trivially removed. Issue identified by Coverity.
2021-02-09 20:19:38 +01:00
Yorik van Havre
97379e035a merged crowdin translations 2021-02-09 16:12:18 +01:00
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