Commit Graph

1466 Commits

Author SHA1 Message Date
wmayer
e43df16930 PartDesign: [skip ci] for PartDesign::Torus primitive use TopoShape::makeTorus 2020-12-03 15:06:22 +01:00
wmayer
7085bd751e PartDesign: [skip ci] fix -Wmissing-field-initializers 2020-12-01 18:23:00 +01:00
Chris Hennes
e73d8c555a 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
e06f2744ff 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
16b61c580a 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
5637c6a7a5 [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
faa8688ee5 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
371c23a584 [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
42ccdb8122 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
d819a62db2 PartDesign: [skip ci] support negative values as second length of a pocket 2020-11-16 11:35:05 +01:00
wmayer
f9d1538186 PartDesign: [skip ci] support negative values as second length of a pad 2020-11-16 11:26:51 +01:00
wmayer
691f259042 Part: allow to open attachment editor via context-menu 2020-11-15 19:16:22 +01:00
wmayer
55af73b07a 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
d5767cd3ba [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
b7d763a1c4 PartDesign: [skip ci] make cut type modes of hole feature translatable 2020-11-13 17:51:41 +01:00
donovaly
4246c902a5 [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
a58c4736a2 [PD] add measure tools
use Part's measure tools also for PartDesign
2020-11-13 12:38:42 +01:00
donovaly
e7af8b5c01 [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
68673c6ad1 [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
04be99a2aa 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
bdcbf316b9 PartDesign: [skip ci] fix whitespaces 2020-11-10 19:39:44 +01:00
donovaly
ea08a660eb [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
e76c857036 Merged crowdin translations 2020-11-10 14:58:06 +01:00
wmayer
c8e46ee555 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
70eb263eb3 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
ff5f3799d8 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
62f315df04 [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
9eb080488d PartDesign: [skip ci] minor cosmetic changes 2020-10-31 13:32:18 +01:00
M G Berberich
6d1b292280 [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
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