Commit Graph

1470 Commits

Author SHA1 Message Date
M G Berberich
f5be329c3f make the hole-cut-type dropdown-box wider
This drop-down box contains long names and did not use the space of
the dialog.
2020-12-17 16:59:26 +01:00
wmayer
0aa38c44f4 PD: [skip ci] in wizard shaft handle case where Plot module is not available 2020-12-11 16:09:01 +01:00
Chris Hennes
533814dd0f Silence Qt/Windows setGeometry Warning
Add the optional Qt::MSWindowsFixedSizeDialogHint parameter to all uses of the QInputDialog::getX static functions to silence a Qt/Windows debug mode warning about QWindowsWindow::setGeometry: Unable to set geometry. Increase the size of the unit calculator to eliminate the same warning. Finally, call adjustSize() on the "Unsaved Changes" dialog to silence the warning.
2020-12-11 09:58:09 +01:00
wmayer
c235b9fba9 PD: [skip ci] fix invalid strings 2020-12-09 16:59:34 +01:00
wmayer
eac5b9466f PartDesign: [skip ci] for PartDesign::Torus primitive use TopoShape::makeTorus 2020-12-03 15:06:22 +01:00
wmayer
c509fc486d PartDesign: [skip ci] fix -Wmissing-field-initializers 2020-12-01 18:23:00 +01:00
Chris Hennes
12f4abceab Add core hole info for fine threads.
These values are calculated exactly from (diameter-pitch), and are
included here only to silence warnings from some compilers about missing
initializers. These values are not (currently) used in the code, which
directly calculates the core hole as needed in this case.
2020-12-01 10:03:56 -06:00
Uwe
103086c31b Update src/Mod/PartDesign/App/FeatureHole.cpp
Commit suggestion

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2020-12-01 15:17:31 +01:00
Uwe
3347bf3eda Update src/Mod/PartDesign/App/FeatureHole.cpp
Commit suggestion - fixes a typo

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2020-12-01 15:17:31 +01:00
donovaly
5c5712932c [PD] make threaded holes norm-conform
- the diameters of holes for threaded holes were only norm-conform for metric fine
- add missing UNC/F/EF sizes
- add a clearance diameter
2020-12-01 15:17:31 +01:00
luz paz
a65b3788c6 PartDesign: Issue #0004473: Expose openCommand() to translation
Continuing the work to expose the undo/redo functionality to translation. This commit does so for the PartDesign Wb.  
Ticket: https://tracker.freecadweb.org/view.php?id=4473
2020-12-01 14:53:35 +01:00
donovaly
99208ec2f4 [PD] more hole fixes
- there is the ISO 273 describing clearance holes, so we need to take these values. Only if we have a size not defined in the norm, we calculate
- add the coarse (wide) type for clearance holes from ISO 273
- add all screw thread sizes defined in DIN 13/ISO 261
- rearrange thread dialog to make it more compact
- change name "fit" to "clearance" as discussed
- add tooltips to the dialog
- fix issue with TaperedAngle dialog field
- change a size name because the norms define "M1" not "M1.0"
2020-11-18 14:45:14 +01:00
wmayer
385e4df10c PartDesign: [skip ci] fixes #0004494: Error "Result is empty" for Pads and Pockets with non zero Offset 2020-11-16 14:45:55 +01:00
wmayer
5e07809384 PartDesign: [skip ci] support negative values as second length of a pocket 2020-11-16 11:35:05 +01:00
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
wmayer
596077cf67 PartDesign: [skip ci] if numpy fails to load due a RuntimeError then handle this exception but still load the workbench 2020-11-15 11:47:19 +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
M G Berberich
983ca52aed cut-profiles with identical names for different threads
Allow cut-profiles with identical names for different threads.
see:
https://forum.freecadweb.org/viewtopic.php?f=19&t=51491&start=60#p446854
https://forum.freecadweb.org/viewtopic.php?f=19&t=51491&start=60#p446902
2020-11-12 17:38:18 +01:00
wmayer
371c5ba5ee PartDesign: [skip ci] fix whitespaces 2020-11-10 19:39:44 +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
wmayer
7ae13688bf PartDesign: [skip ci] do not write error but log message when reading thread definitions of hole feature 2020-11-05 15:40:49 +01:00
M G Berberich
7e11afabb9 fixes bug not enabling ui-elements
see:
https://forum.freecadweb.org/viewtopic.php?p=445186&sid=45bd75e3ab8c4d830decf91e946f7391#p443362
2020-11-05 15:35:05 +01:00
luz paz
f839820817 Fix various typos [skip-ci]
Found via `codespell v2.0.dev`  
```
codespell -q 3 -L aci,ake,aline,alle,alledges,alocation,als,ang,anid,ba,beginn,behaviour,bloaded,byteorder,calculater,cancelled,cancelling,cas,cascade,centimetre,childs,colour,colours,commen,connexion,currenty,dof,doubleclick,dum,eiter,elemente,ende,feld,finde,findf,freez,hist,iff,indicies,initialisation,initialise,initialised,initialises,initialisiert,ist,kilometre,lod,mantatory,methode,metres,millimetre,modell,nd,noe,normale,normaly,nto,numer,oder,orgin,orginx,orginy,ot,pard,pres,programm,que,recurrance,rougly,seperator,serie,sinc,strack,substraction,te,thist,thru,tread,uint,unter,vertexes,wallthickness,whitespaces -S ./.git,*.po,*.ts,./ChangeLog.txt,./src/3rdParty,./src/Mod/Assembly/App/opendcm,./src/CXX,./src/zipios++,./src/Base/swig*,./src/Mod/Robot/App/kdl_cp,./src/Mod/Import/App/SCL,./src/WindowsInstaller,./src/Doc/FreeCAD.uml
```
2020-11-04 10:18:30 +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
wmayer
c9c9ab9a6b PartDesign: [skip ci] minor cosmetic changes 2020-10-31 13:32:18 +01:00
M G Berberich
7f328ac376 [PartDesign] Dynamic hole cut-types
‣ Make countersink and counterbore on metric holes freely definable by user.

‣ Fixed the Naming of M1.6, M2, M2.5 and M3.5

‣ Added constructor for custom enums from Enums to PropertyEnumeration

‣ Put definitions of cut-types (counterbore/countersink) for
  screwtypes into json-files for easy modification.

‣ Allow users to put its own definitions in json-files in
  [UserDir]/Mod/PartDesign/Resources/Hole

‣ Contains several examples of cut-type definition json-files that are
  propably not production-ready.

This uses a local copy of nlohmann::json¹ to read json-files.

__________
¹ This is a very nice,header-only C++ library under the MIT License
  (https://github.com/nlohmann/json). I copied the single-file-version
  and the forward-declaration-header into …/PartDesign/App/ so no new
  dependencies arise.
2020-10-31 12:49:00 +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
eb9985500b PartDesign: [skip ci] make the hole feature more forgiving in case of inconsistent configuration 2020-10-19 14:42:32 +02:00
wmayer
730994945b 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 afefc4ede20f04a37ac6cf0808e9eaf55b7d5775.
2020-10-18 17:08:18 +02:00
wmayer
5c35325cc0 Py3: suppress warnings about un-initialized/deprecated tp_print slot 2020-10-18 14:45:31 +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