Commit Graph

1437 Commits

Author SHA1 Message Date
M G Berberich
e84fa25c0b [PartDesign] Hole countersink for metric
fix a problem with counterbore and countersink in PartDesign Hole feature.

It was not possible to custom define counterbores or countersinks if a
metric thread hole was selected.

Handle the cut-types None, Counterbore and Countersink euqal
regardless of type of thread and let the user customize:
None:        none
Counterbore: diameter and depth
Countersink: diameter and angle
2020-10-31 12:49:00 +01:00
Yorik van Havre
7c9e0f3a99 Merged crowdin translations 2020-10-28 12:04:37 +01:00
donovaly
896a1bcb45 [PD] more holes fixes
- initialization: thread direction only sensible if there is a thread
- initialization: hole diameter can only be changed if there is no profile
- initialization: only enable allowed hole cut parameters
- also for the ISO profiles it is allowed to countersink/bore deeper/less deep
- UI file: add some tooltips (the other changes were done automatically by Qt's designer)
2020-10-22 13:01:57 +02:00
donovaly
783f8dc784 [PD] fix thread UI bugs
- initialization: if a threaded, the fit must not be enabled
- when changing the profile type setReadOnly for the fit and class according to if threaded or not
- when changing if threaded or not, setReadOnly accordingly for the fit and class
2020-10-20 15:47:52 +02:00
donovaly
ec46265bc3 [PD] initialize hole dialog properly
as described in https://forum.freecadweb.org/viewtopic.php?f=3&t=50611, the task dialog should just read out the parameters on initialization and not invoke automatically change actions.

This PR also fixes a bug that opening a document with a cheesehead hole leads to an error about an invalid index. The reason is that we access the hole cut type before we set its enums. Thus initialize the cut type with all possible enums since, if necessary, the reduced enum set will be set later on parsing the file.
2020-10-19 16:48:49 +02:00
wmayer
6e6f2c8a0a PartDesign: [skip ci] some improvements in TaskHoleParameters
+ do not rely on translated strings but set user data for the items of the combo box
+ do not use tr() to convert the C strings to QString of the hole feature, use QString::fromLatin1
+ do not use findText() twice for the same search but store the result
2020-10-19 16:08:26 +02:00
donovaly
99dd4460c5 [PD] keep hole size when changing type
as mentioned in https://forum.freecadweb.org/viewtopic.php?f=13&t=47584&start=10#p433116
a typical use case is that one changes the hole type from e.g. ISO normal to ISO fine. The size should however be the same.

This PR enables this and also takes care for the thread class and cut type, see the attached screencast.
2020-10-19 14:44:08 +02:00
wmayer
c0b2188ada PartDesign: [skip ci] make the hole feature more forgiving in case of inconsistent configuration 2020-10-19 14:42:32 +02:00
wmayer
1f0b7793e6 Revert "PartDesign: [skip ci] fixes #0004371: Changing Hole profile from ISO to nothing is not possible: "Hole: Cannot get value from invalid enumeration""
This reverts commit fe3f1b51b7.
2020-10-18 17:08:18 +02:00
wmayer
8ffbabb605 Py3: suppress warnings about un-initialized/deprecated tp_print slot 2020-10-18 14:45:31 +02:00
wmayer
b33f92898b PartDesign: [skip ci] Improve revolution function
+ Fix hard crash when selecting an edge or face of the created feature before selecting option to choose a reference.
+ In ProfileBased::getAxis() convert OCCT into FreeCAD exception to simplify handling of calling instances.
+ Change return value of getReferencedSelection() from void to bool to mkae it easier for calling instance to detect if the selection failed.
  This is needed to avoid to add invalid items to the combo box of the revolution task panel
2020-10-14 15:20:52 +02:00
wmayer
7825eef62e PartDesign: [skip ci] Prevent crash when pressing delete key without feature selected to remove in mirror and scale pattern dialog 2020-10-12 18:56:12 +02:00
marioalexis
08edc39a50 [PartDesign] Prevent crash when pressing delete key without feature selected to remove in linear and polar pattern dialog 2020-10-12 16:37:46 +02:00
marioalexis
5dfc061d49 [PartDesign] Prevent crash when pressing delete key without feature selected to remove in linear and polar pattern dialog 2020-10-12 16:37:46 +02:00
mwganson
432ac985e7 [PartDesign Multitransform] prevent crash when pressing delete key without feature selected to remove in multitransform dialog 2020-10-12 16:36:11 +02:00
wmayer
f8a45e6b3c PartDesign: [skip ci] remove automatic adjustment of view frustum when creating a body
In v0.17 this was needed to fix bug 2503 and was done with commit 798a57e2b7.
Now a more sensible view frustum is already set on document creation.

The automatic adjustment is even annoying now if the document is not empty and nothing is selected because
the view frustum can become too big and thus the objects appear quite small.
2020-10-06 15:32:35 +02:00
Yorik van Havre
089ed768cc Merged crowdin translations 2020-09-30 14:37:02 +02:00
wmayer
fe3f1b51b7 PartDesign: [skip ci] fixes #0004371: Changing Hole profile from ISO to nothing is not possible: "Hole: Cannot get value from invalid enumeration" 2020-09-23 11:11:27 +02:00
donovaly
4a1f81395e [PD] fix 2 hole dialog bugs
- 1. reported here: https://forum.freecadweb.org/viewtopic.php?p=432936#p432851
also unthreaded holes can have a close or standard fit

- 2. reported here: https://forum.freecadweb.org/viewtopic.php?p=432936#p432944
the thread direction is always left. The reason is that this property is an enum but the dialog returns a bool.

- also fix an UI issue with the spin boxes (automatically found and repaired by Qt's designer, thus the many changes in the UI file)
2020-09-23 09:58:53 +02:00
wmayer
37c4d51501 PartDesign: [skip ci] Coverity: Structurally dead code 2020-09-22 20:22:26 +02:00
wmayer
46ab178102 PartDesign: [skip ci] Coverity: Bad use of null-like value 2020-09-22 20:03:42 +02:00
wmayer
60443034a4 PartDesign: [skip ci] fix method to access main window in shaft wizard 2020-09-22 19:15:59 +02:00
wmayer
901ee4e5e1 PD: [skip ci] fix msvc warning 2020-09-21 13:28:56 +02:00
donovaly
a44f8ffd42 [PD] simplify item handling
according to https://github.com/FreeCAD/FreeCAD/commit/2b676020

"QListWidget::takeItem() returns a pointer to the removed item. So a previous call of QListWidget::item() is superfluous"
2020-09-18 17:30:09 +02:00
donovaly
03c2c76963 [PD] make sections sortable
- allow to sort loft sections by dragging: https://forum.freecadweb.org/viewtopic.php?f=19&t=50222

- fix bug of uninitialized options: https://forum.freecadweb.org/viewtopic.php?f=19&t=50221

- use better code for the context menu of the listWidget (the same we use in other placed of PD)

- add missing tooltip for mirror feature
2020-09-17 23:59:15 +02:00
wmayer
b9e5bce0f0 PD: improve reference highlighting of a pipe
This change allows to highlight the spline, auxiliary spine, profile and sections of a pipe.
This gives the user a much better feedback of what external shapes are already used to build the pipe
2020-09-17 16:19:38 +02:00
wmayer
a3fda6f9ed PD: [skip ci] fixes for pipe task panel
+ Add/Remove are checkable buttons so if user unchecks it then disable highlighting of spine
+ Avoid superfluous char* -> QString conversion
2020-09-17 14:04:36 +02:00
wmayer
2b676020d2 PD: fixes for pipe task panel
+ fix Qt4 build failure
+ fix handling of adding items to spine/auxiliary spine/sections to allow to remove them again
+ QListWidget::takeItem() returns a pointer to the removed item. So a previous call of QListWidget::item() is superfluous
2020-09-17 11:35:41 +02:00
donovaly
5d96f01cf7 [PD] add context menus to sweep Dialog
- elements in the list of edges/spines/sections can now be deleted by pressing DEL and there is a context menu for this action

see https://forum.freecadweb.org/viewtopic.php?f=19&t=50222&p=431021#p431021
2020-09-17 00:45:43 +02:00
wmayer
a028ea94cc PartDesign: [skip ci] hide base feature of pad after it successful recompute 2020-09-16 17:18:49 +02:00
wmayer
53a500ecf5 PartDesign: make sure to remove selection gate when closing task panel 2020-09-16 12:15:19 +02:00
donovaly
5abb45f7cf [PD] fix wording for skew prisms
the UI and the property is not consistent. In the dialog we use the term angle upon user feedback while the property still has the name "skew" in it.
I simply forgot this change in my PR that implemented skew prisms.

This is now corrected by this PR.
2020-09-15 22:13:26 +02:00
wmayer
42d643c8f7 PD: whitespace improvements 2020-09-15 14:20:24 +02:00
wmayer
5635f87d0e PD: do not use active document in task dialogs because this is error-prone
and optimize string creation in TaskSketchBasedParameters::getFaceReference
2020-09-15 14:13:23 +02:00
wmayer
1c730a7f00 PD: do not use active document in task dialogs because this is error-prone 2020-09-15 13:21:32 +02:00
mwganson
74e4a3e976 [Part Design] allow for preselecting loft sections and pipe spines prior to invoking command 2020-09-15 10:48:09 +02:00
wmayer
6199fbb25e Base: [skip ci] Coverity: Uncaught exception 2020-09-14 18:34:25 +02:00
wmayer
4cad62e315 PartDesign: [skip ci] fix L2 parameter in pad feature when using custom direction 2020-09-12 17:26:41 +02:00
donovaly
7cbc9cf5f0 [PD] allow to pad in any direction
It saves a lot of work if one can directly pad in any direction and OCC allows this.

This PR adds the possibility to define a custom vector for the padding direction.
2020-09-12 16:33:44 +02:00
donovaly
d4519d5aec [PD and Part] add possibility to create skew prisms 2020-09-12 13:28:00 +02:00
wmayer
30bc9fc6be [PartDesign] [skip ci] #fixes 4367: Thread size out of range using hole-feature 2020-08-24 17:36:48 +02:00
wmayer
666682d4e7 [PartDesign Hole] Restore value of reversed checkbox when opening dialog 2020-08-22 16:14:14 +02:00
mwganson
faed39ded2 [PartDesign Hole] Add reversed checkbox to dialog 2020-08-22 15:32:42 +02:00
wmayer
50aa73da9d PD: [skip ci] add missing forward declaration 2020-08-10 14:10:43 +02:00
donovaly
a8ea844e0b [PD] [skip ci] add Sketch top level menu 2020-08-10 14:00:06 +02:00
donovaly
acecdd8c57 [PD] allow expression for pocket offset
- also disable KeyboardTracking for some fields to avoid unnecessary and often time consuming recomputes while typing in
2020-08-10 13:39:50 +02:00
donovaly
940c27288b [PD] [skip ci] disable keyboardTracking for primitives and attachment
When modifying primitives in complex geometries having a recompute for every keystroke can be annoying. Disabling keyboardTracking fixes this but keeps the immediate preview when using the spin buttons.
2020-08-10 10:14:17 +02:00
wmayer
278219b7cd PartDesign: [skip ci] fix broken tooltip of Pad property 2020-08-08 13:08:27 +02:00
donovaly
81a98a4476 [PD] bind expression to pad offset
It is strangely not possible to use an expression for a pad offset, but this works fine, see the forum for an example.

Thus allow this.
2020-08-08 13:04:34 +02:00
luz paz
59e3ea096e Crowdin: Merge new translations [skip-ci] 2020-08-07 17:17:35 +02:00