Commit Graph

549 Commits

Author SHA1 Message Date
wmayer
ff69f7fba3 PartDesign: [skip ci] fix Hole feature
* by default ThreadDirection must be set read-only since Threaded by default is None
* use suitable values to initialize the class properties
2020-12-18 21:18:41 +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
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
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
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
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
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
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
3c6faae1f0 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
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
308baeaeab PartDesign: [skip ci] fix L2 parameter in pad feature when using custom direction 2020-09-12 17:26:41 +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
a507a533f3 [PartDesign] [skip ci] #fixes 4367: Thread size out of range using hole-feature 2020-08-24 17:36:48 +02:00
wmayer
8076c3394d PartDesign: [skip ci] fix broken tooltip of Pad property 2020-08-08 13:08:27 +02:00
Zheng, Lei
35007e30e5 PartDesign: fix pattern transformation 2020-07-31 14:46:33 +02:00
wmayer
e9ce75d544 LGTM: [skip ci] fix: Empty branch of conditional
An empty block after a conditional can be a sign of an omission and can decrease maintainability of the code.
Such blocks should contain an explanatory comment to aid future maintainers.
2020-07-26 15:49:14 +02:00
luz paz
e82f7f74f4 Fix Crowdin typos + trim superfluous whitespace [skip-ci]
Some issues that this PR fixes (but not all listed):  
https://crowdin.com/translate/freecad/27911/en-en#6581578  
https://crowdin.com/translate/freecad/27911/en-en#6579080  
https://crowdin.com/translate/freecad/27911/en-en#6581580  
https://crowdin.com/translate/freecad/27911/en-en#6579086
2020-07-23 13:52:44 +02:00
Zheng, Lei
da4ee7e526 PartDesign: fix DressUp SupportTransform
Skip multiple consequtive DressUp features when SupportTransform is
enabled.
2020-07-11 13:03:44 +02:00
Zheng, Lei
a045f58a85 PartDesign: change feature DressUp behavior when used for pattern
Repurpose DressUp.SupportTransform property to define the following
behavior,

* When disabled (default), only the dressing will be used for patterning.

* When enabled, the additive/subtractive shape of the dressed base
  feature will be used for patterning. Any dressing that is not applied
  to the based feature will be ignored.

* If the dressing is applied to non-additive/subtractive feature, then
  only the dressing will be used for patterning.

New API FreatureAddSub::getAddSubShape() is added to account for the
fact that a dressing (e.g. a fillet) can be either additive or
subtractive, which means that a DressUP feature may contain both
additive and subtractive shapes.

FeatureTransformed is modified to perform both fusion and cut if
required.
2020-07-11 13:03:21 +02:00
Zheng, Lei
8b23d814f8 PartDesign: fix line ending in source code 2020-07-11 13:02:49 +02:00
wmayer
acf3b5a256 boost: [skip ci] fix for boost < 1.60 2020-06-15 21:33:56 +02:00
wmayer
d6169d6478 boost: fix for boost < 1.60 2020-06-15 19:38:39 +02:00
wmayer
730154a684 boost 1.73.0: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated 2020-06-12 17:51:33 +02:00
wmayer
a9743b3471 PartDesign: [skip ci] fix typo 2020-06-08 00:59:46 +02:00
vocx-fc
b8dd14b01d PartDesign: replace unicode characters with simple hyphens 2020-06-03 14:51:01 +02:00
mwganson
6883f4687a [Part Design] fix refine feature in Hole feature 2020-06-02 17:44:20 +02:00
wmayer
e3a2f7f76d PartDesign: [skip ci] fix wrong property values in UI file
set step size of angle property to 1.0
2020-05-24 12:18:19 +02:00