Commit Graph

1051 Commits

Author SHA1 Message Date
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
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
wmayer
679731f75e PartDesign: [skip ci] make cut type modes of hole feature translatable 2020-11-13 17:51:41 +01:00
donovaly
0c34461410 [PD] fix issue 3968
https://tracker.freecadweb.org/view.php?id=3968

Don't set the tip to features that cannot hold the tip
2020-11-13 17:03:19 +01:00
donovaly
49a94ca14b [PD] add measure tools
use Part's measure tools also for PartDesign
2020-11-13 12:38:42 +01:00
donovaly
83f6c27be7 [PD] hole UTS fixes
- propose cut values also for UTS profiles
- the UTS defines coarse and fine while for ISO it is regular and fine, thus fix the name
- for the dialog: set minimum values to zero (angles etc. cannot be negative)
2020-11-13 09:07:27 +01:00
donovaly
58168f4e89 [PD] more hole cut work
- add definitions for IS 2009, 7046 and 12474
- remove useless file for a ISO 14583 since there are no such screws on the market
- rename "coarse" to "regular" since this what it actually is according to the norms
- uniform the x1 threads (for x2.0 etc we use a trailing zero and for some we use x1, for some already x1.0, thus consistently use x1.0)
- add some ISO 10642 entries
- correct ISO 4762:
  - correct some values
  - the does does not define a size M27
  - add the two missing sizes
2020-11-12 17:41:53 +01:00
donovaly
27e10c52f0 [PD] hole creation
- propose valid values for the cut depth and diameter when creating new holes
- add new definitions for metric fine
- some code simplification and comments
2020-11-10 19:34:53 +01:00
Yorik van Havre
ae2c707892 Merged crowdin translations 2020-11-10 14:58:06 +01:00
donovaly
722e4ed3c0 [PD] hole - fix typo
- also update profile changing method since fraction diameters no longer end with a '0' in profile ISO coarse
2020-11-03 14:54:01 +01:00
M G Berberich
c66a6be944 [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
43596a68af Merged crowdin translations 2020-10-28 12:04:37 +01:00
donovaly
d702536f3a [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
9985a5a883 [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
025fd9dce9 [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
db093ed0e0 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
a442dbdfa2 [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
ad48dd2538 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
5d82ef08c9 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
2236c50e57 [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
97dd610c43 [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
4c85faa0a4 [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
c7b8ff16b7 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 d4ff570bf9.
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
c2cec2c38a Merged crowdin translations 2020-09-30 14:37:02 +02:00
donovaly
3ca1bc2495 [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
423c374258 PD: [skip ci] fix msvc warning 2020-09-21 13:28:56 +02:00
donovaly
78efc9c34f [PD] simplify item handling
according to https://github.com/FreeCAD/FreeCAD/commit/c1fd0320

"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
8217e0f0d0 [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
c69612c748 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
44b1a27cd4 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
8fa096f23b 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
329c763916 [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
1f1048d7c9 PartDesign: [skip ci] hide base feature of pad after it successful recompute 2020-09-16 17:18:49 +02:00
wmayer
e426c12787 PartDesign: make sure to remove selection gate when closing task panel 2020-09-16 12:15:19 +02:00
donovaly
b0faf1197c [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
fb03c31b28 PD: whitespace improvements 2020-09-15 14:20:24 +02:00
wmayer
17859d5ffb 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
dc7de6b195 PD: do not use active document in task dialogs because this is error-prone 2020-09-15 13:21:32 +02:00
mwganson
7d392d1209 [Part Design] allow for preselecting loft sections and pipe spines prior to invoking command 2020-09-15 10:48:09 +02:00
wmayer
033e4d900b Base: [skip ci] Coverity: Uncaught exception 2020-09-14 18:34:25 +02:00
donovaly
91ef59fdbe [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
6bbab49723 [PD and Part] add possibility to create skew prisms 2020-09-12 13:28:00 +02:00
wmayer
cd7a6a237a [PartDesign Hole] Restore value of reversed checkbox when opening dialog 2020-08-22 16:14:14 +02:00
mwganson
95ef4f40f7 [PartDesign Hole] Add reversed checkbox to dialog 2020-08-22 15:32:42 +02:00
wmayer
e3bb32146e PD: [skip ci] add missing forward declaration 2020-08-10 14:10:43 +02:00
donovaly
5fcc109e5a [PD] [skip ci] add Sketch top level menu 2020-08-10 14:00:06 +02:00
donovaly
5978435a27 [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
5c96cec1c7 [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
donovaly
ca03e64776 [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