Commit Graph

1547 Commits

Author SHA1 Message Date
wmayer
2d54d838cf PD: improve task panel for linear patterns:
* set range of Occurrences property to spin box
* connect signals after initializing widgets to avoid superfluous recomputes and possible inconsistencies
2021-03-03 10:32:02 +01:00
donovaly
7f1b47d118 [PD] disallow invalid polar and linear pattern settings
as discussed in 356db441a6 we should disallow invalid property settings
2021-03-03 07:45:08 +01:00
David Osterberg
52c0558f91 PartDesign: Allow use of circle edge as axis in PolarPattern 2021-03-01 14:48:24 +01:00
David Osterberg
f1d6c78cbe PartDesign: Allow use of circle edge as axis in ProfileBased 2021-03-01 14:48:24 +01:00
wmayer
356db441a6 PD: [skip ci] PolarPattern: Support 1 occurrence
This is analogous to support 1 occurrence of the linear pattern feature: 81a5ec5e55
2021-03-01 13:58:02 +01:00
donovaly
f481c47123 [PD] fix multi-transform View
- fixes bug 4581
  See the first issue reported here:
  https://forum.freecadweb.org/viewtopic.php?f=3&t=56093#p482553

- also fix issue that one could set 1 occurrence for polar patterns despite 2 are required at least

- also fix potential dereferencing null pointer (reported by MSVC)
2021-03-01 13:11:15 +01:00
David Osterberg
c7c420ca1d PartDesign: Hole. Address Donovaly bugs 7 and 8
bug 7: the update view checkbox should be enabled/disabled based on Model thread.
       the checked state should not change

bug 8: the Thread depth options should be disabled when Model thread is unchecked.
       because they don't do anything in the model it is confusing if they are enabled.
2021-02-28 20:13:14 +01:00
David Osterberg
1eeefeb8ae PartDesign: Hole: Always update view if modelthread is disabled
Also: Check the Update View checkbox and disable it, when turning off
model thread.
2021-02-28 20:13:14 +01:00
David Osterberg
d59e90a10f PartDesign: Hole: Turn off keyboard tracking on model thread spinboxex 2021-02-28 20:13:14 +01:00
David Osterberg
ebe2ce1034 PartDesign: Hole: Rename Automatic Tapped (DIN76) and change default to Hole depth. 2021-02-28 20:13:14 +01:00
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