Commit Graph

57 Commits

Author SHA1 Message Date
David Osterberg
d7ae53d597 PartDesign: [Hole] Add Entire Depth thread depth mode 2021-02-28 20:13:14 +01:00
David Osterberg
d94946781e PartDesign: Add true threads to Hole
- Thread runout according to DIN 76-1
- Through all length updated to be calculated based on bounding box
- New properties: ModelThread, ThreadDepthType, ThreadDepth,
                  UseCustomThreadClearance, CustomThreadClearance
- Rename Old but unused parameters related to thread modeling.
- Functionality exposed in UI
2021-02-28 20:13:14 +01:00
wmayer
45079ca2ac PD: [skip ci] AddressSanitizer: stack-use-after-scope
Axis() returns a tmp. object and thus we cannot use a const reference to get its Location() method
2021-02-23 13:57:51 +01:00
Chris Hennes
e7e794753a [PD] Add missing ctor variable init (Coverity)
The "angle" variable was not being initialized in any of the
constructors for the CutDimensionSet, and nothing was being initialized
by the default constructor. This commit adds angle as an optional final
argument to the parameterized constructors, defaulting to 0.0, and adds
default values to the default constructor using the first of each enum
and 0.0 for the angle. The default constructor is required elsewhere in
the code so cannot be trivially removed. Issue identified by Coverity.
2021-02-09 20:19:38 +01:00
donovaly
09385d9d00 fix issue reported by @chennes
also fix annoying variable naming - different variables representing different types should not have the same name

also update a comment according to depending PRs
2021-02-03 16:24:01 +01:00
donovaly
2a6d30da27 [PD] hole fix custom cut handling
This PR is based on PR #4344 and a spin-off of PR #4337. It fixes:

We have normed screw head cuts. These values can be overridden but we must store the info about the overriding. Why? - because when you have e.g. made a custom change to a normed countersink and then change to another countersink norm, you would either not get the values defined in the norm or you get these values but loose e.g. your depth settings
2021-02-03 16:23:28 +01:00
donovaly
c5fe2589d5 [PD] fix UTS clearance holes
This PR is based on PR #4343 and a spin-off of PR #4337. It fixes:

- the bug that we did not use the normed clearance hole diameters for UTS holes
- missing recompute when changing existing hole from Metric to UTS type
2021-02-03 16:19:24 +01:00
donovaly
19605200a1 [PD] hole dialog UI fixes
This PR is the first in a series of probably 3 PRs to fix known hole dialog bugs.

This one fixes:

- the .ui file issues
- readonly status issues of some widgets/properties (e.g. when the hole is through all, disable drill point settings)
- the bug that updateHoleCutParams() overwrote the previously correctly determined hole diameter
- just a trifle: change a function name to fit into the naming scheme
2021-02-03 16:14:36 +01:00
donovaly
d1071026e7 [PD] fix blind hole depth handling
as reported in https://tracker.freecadweb.org/view.php?id=3818
we treat the blind hole depth not according to the conventions. The size of the drill point due to the angle is normally not taken into account but FC does this in any case.

This PR adds therefore an option, that is by default off, to take the drill point size into account.
Without the option, (the new default) the depth is calculated according to the conventions.

The PR also removes unused widgets and restored the tab order in the .ui file. The thread parameters were never used. In case we made in future the decision to carve into holes real (modeled) threads, we need a special UI for that solution anyway so having the dead code in is not helpful at all.
2021-01-25 01:10:23 +01:00
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
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
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
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
wmayer
a507a533f3 [PartDesign] [skip ci] #fixes 4367: Thread size out of range using hole-feature 2020-08-24 17:36:48 +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
e91c2d6afd fixes #0004286: PartDesign hole: angle of the tapered hole does not match the tapered angle specified [skip ci]
See https://forum.freecadweb.org/viewtopic.php?f=13&t=44056#p375915
2020-03-12 11:39:09 +01:00
luz.paz
2b02659010 Misc. typo and whitespace fixes
Found via `codespell`
2019-05-30 19:56:12 +02:00
Abdullah Tahiri
7b0a501c0a PartDesign: 3rdParty to PCH 2019-05-02 07:12:27 +02:00
wmayer
f7704607a0 fixes 0003524: The PartDesign hole feature should respect the Reverse property and provide a checkbox in the panel 2019-02-22 21:10:05 +01:00
wmayer
2888ff2557 improve error messages for Pocket, Hole and Groove feature 2018-12-31 18:30:13 +01:00
wmayer
052296ebce fixes 0003547: Linear pattern, mirrored and polar pattern feature not working on a hole just on pocket 2018-09-27 13:30:30 +02:00
Eivind Kvedalen
5670ef0e2a Fix for issue #3541: Normalize xDir vector for Hole feature to correct hole diameter. 2018-07-29 01:03:17 +02:00
wandererfan
a712d49685 Revise multiple solids message 2018-07-13 10:23:42 -03:00
wandererfan
0d3008e4eb Fix #3401 warning on multiple solid
- PartDesign only uses the first result shape
  of an operation and discards the rest without
  warning.

- this also fixes #1707
2018-07-13 10:23:42 -03:00
wmayer
fde42545ba fix various coverity issues 2017-09-15 11:48:38 +02:00
wmayer
0d617f97d6 Port to occ7.2:
+ Standard_Failure::Caught() is now marked as deprecated and should be replaced with standard C++ exception handling
2017-09-01 16:27:46 +02:00
Eivind Kvedalen
91bafde563 PartDesign Hole Feature implemented.
Minor contributions from Mateusz Skowroński <skowri@gmail.com>
2017-07-26 23:39:00 +02:00
Wolfgang E. Sanyer
d1d2f1f811 This commit adds getShape and setShape to TopoShape 2016-08-06 23:42:55 +02:00