Commit Graph

1537 Commits

Author SHA1 Message Date
David Osterberg
6ea6b48c0e PartDesign: [Hole] Add Entire Depth thread depth mode 2021-02-28 20:13:14 +01:00
David Osterberg
d3ddbe8549 PartDesign: Add true threads to Hole
- Thread runout according to DIN 76-1
- Through all length updated to be calculated based on bounding box
- New properties: ModelThread, ThreadDepthType, ThreadDepth,
                  UseCustomThreadClearance, CustomThreadClearance
- Rename Old but unused parameters related to thread modeling.
- Functionality exposed in UI
2021-02-28 20:13:14 +01:00
Chris Hennes
b1789ae7d2 [PD] Fix minor static analysis issues in FCGear
LGTM has identified a number of minor issues with the FCGear Part Design
scripts. This commit addresses each of them, and also corrects two minor
spelling errors in the dialog. None of the errors or their fixes are
expected to result in changes to the functionality of the script.
2021-02-27 18:20:32 +01:00
David Osterberg
16ff933b09 PartDesign: Transformded. Align the "property category" of Refine with other PD commands 2021-02-27 18:19:14 +01:00
Yorik van Havre
958009c2ca Merged crowdin translations 2021-02-25 13:27:48 +01:00
luz paz
4e5cfec623 Crowdin: removing obsolete strings from PartDesign.ts [skip ci]
Uncertain to why but lupdate is not removing obsolete strings from `PartDesign.ts`. This PR manually removes obsoletes strings from it.

ref:
https://crowdin.com/translate/freecad/564/en-de?filter=basic&value=0#6500474
https://crowdin.com/translate/freecad/564/en-en?filter=basic&value=0#6500475
2021-02-25 10:41:58 +01:00
wmayer
a95cd106bb PD: [skip ci] remove invalid static_cast 2021-02-24 20:12:26 +01:00
Yorik van Havre
5ba28fa7ff Merged crowdin translations 2021-02-24 18:07:59 +01:00
wmayer
bc5311b3ee PD: fixes #0004567: Pattern from a feature type UpToFace and Offset > copy whole body 2021-02-24 17:08:20 +01:00
wmayer
2389b4779a PD: [skip ci] code refactoring
Move adding offset to face from getUpToFace() to addOffsetToFace()
2021-02-24 16:08:03 +01:00
wmayer
eed7357674 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
482884cfd4 PD: [skip ci] fix regression caused by e0d07257b7
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
43de589732 PartDesign: Fix throughall distance when throughall is used together with midplane 2021-02-20 20:12:47 +01:00
wmayer
13ed4bc6e8 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
eb240c219c 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
0d97fb6f5a PartDesign: Fix helix for OCC versions < 7.5.0 2021-02-19 20:02:11 +01:00
donovaly
e0d07257b7 [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
c107ca3100 PartDesign: Check closedness in AddSub refine function 2021-02-19 14:33:56 +01:00
wmayer
ed02d1bbdd PD: [skip ci] recompute document when canceling task dialog, fix also possible crash 2021-02-19 11:33:58 +01:00
wmayer
98f9397939 PD: [skip ci] drop some superfluous static_cast 2021-02-18 22:51:15 +01:00
Chris Hennes
30c24ae0bc [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
6bcd37093c PartDesign: Mild code cleanup of Helix 2021-02-18 21:51:44 +01:00
wmayer
313fc6294f PD: [skip ci] fix typo in comment 2021-02-17 15:55:47 +01:00
wmayer
2661e0ea47 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
8e16225b03 PartDesign: Helix: fix preview 2021-02-17 13:19:06 +01:00
David Osterberg
7803740edd 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
1d0466d6f2 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
08de4809c4 PD: [skip ci] fixes #0004205: Bad behavior when entering manually PD/AdditivePipe path 2021-02-15 00:06:29 +01:00
David Osterberg
f0d3e19a4e 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
17af884e50 PartDesign: Fix broken outdated icon filenames
This fixes some cases that were missed in commit 2834075d6a
2021-02-12 17:46:27 +01:00
wmayer
eaae425c64 PD: [skip ci] fix ViewProviderPrimitive::getIcon() after renaming of icon files 2021-02-12 13:20:16 +01:00
donovaly
2834075d6a [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
3ef6e1c6d0 [OTHER] Catch only Exception, not BaseException 2021-02-11 11:52:45 +01:00
Chris Hennes
ea67e77e81 [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
bcb5c8786f merged crowdin translations 2021-02-09 16:12:18 +01:00
Chris Hennes
41a40c1c31 [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
3e2780a511 PartDesign: Fix sign error in Helix 2021-02-06 08:22:37 +01:00
David Osterberg
692900d085 PartDesign: fix regression in Helix 2021-02-05 20:55:34 +01:00
David Osterberg
8efbe8861f PartDesign: [Helix] Fix helix starting point bug 2021-02-05 19:17:00 +01:00
donovaly
2ac84872ec [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
59ec3cb141 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
7999536858 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
99b2cba5f1 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
45dd1a7f60 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
1c58c3b677 [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
c676c07316 [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
7eb9b5ed42 [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
cc3a30a221 [PD] fix typo in iso7046.json
This mistake was introduced by me in commit 4ab3c955
2021-02-03 15:08:30 +01:00
wmayer
93a956e70d [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
b50838c7a5 [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