Commit Graph

2068 Commits

Author SHA1 Message Date
luzpaz
216f4c1f45 PartDesign: convert indentations to spaces 2023-01-23 15:47:22 +01:00
Yorik van Havre
433b17b829 Merged crowdin translations 2023-01-23 11:25:49 +01:00
Yorik van Havre
48fdd4896a Updated ts files 2023-01-23 10:41:33 +01:00
Jonas Bähr
115b6e6bce PD: Cleanup InvoluteGear's Task Panel Code
Use new-style connect syntax and drop a lot of copy&paste code by
generating the value-assigning signal handlers on the fly.
2023-01-22 21:44:03 +01:00
Jonas Bähr
88928f7938 PD: Add new props to InvoluteGear's task panel 2023-01-22 21:44:03 +01:00
Jonas Bähr
2d497424c1 PD: Make involute gear's root fillet radius configurable
The original implementation always took 150% of the addendum/dedendum
difference as fillet radius. For a standard full-depth system this
results in a normalized value 0f 0.375, which is pretty close to the 0.38
definded by the basic ISO rack. However, when using much shorter teeth as
e.g. required for a splined shaft, the fillet becomes way too large.

In addition, I don't understand the approximation to calculate the
distance between the gear's center and the top of the fillet yet. It was
only refactored to allow the custom fillet radii, but it retuns the same
values as the original implementation.
However, with high pressure angles, up to 45° used for splines, this
approximation comes to its limits.
2023-01-22 21:44:03 +01:00
Jonas Bähr
0a7fa862d9 PD: Make the involute gear's toogh length configurable
Exposing the addednum and dedendum coefficients as properties allows to
change the tooth length above and below the pitch circle. This makes it
possible to use the profile beyond standard full-depth systems, e.g. for
stub tooths and most importantly: involute splined shafts and hubs.

Gear objets created with earlier versions automatically get the
additional properties on document restore. Its values match the hard-
coded values used in earlier versions.

There is a change when creating *new* internal gear profiles, though:
Previously, an addendum coefficient of 0.6 was used, presumably to reduce
the tip length beyond the base circle in order to avoid a non-involute
edge. This method is one proposal from the "Handbook of Gear Design" by
Gitin M. Maitra, as referenced in the original source code comments.

However, Maitra also states that this reduction of the anual gear's tip
in turn requires an enlagement of the mating gear of 1.25 instead of the
ordinary 1.0. And it is only required for a low numer of teeth and/or the
mating gear being quite large (less than 10 teeth in difference, to avoid
interferences).
Because those additional requirements and conditions have not been
implemented, the previously used values have been incomplete anyway. Thus
I decided to not implemented this special case and use the standard
values of 1.0/1.25 for newly created external and internal gears alike.
Internal gears need special care for other kind of interference anyway
and the newly exposed properties now allow to do so.

There is no entry in the task panel for those advanced properties yet.
2023-01-22 21:44:03 +01:00
Jonas Bähr
a51122e2fc PD: Refactor InvoluteGear's property creation
This is a pure refactor, without any change in visibile functionality.
However, the new structure allows easy addition of new properties without
breaking existing documents.
2023-01-22 21:44:03 +01:00
Jonas Bähr
fee0d451a1 PD: Refactor InvoluteGear's Bezier Approximation
The goal of this refactor is to get rid of gear-specific knowledge from
the implementation and argument list. This is to remove the duplicate
definition of addenddum and dedendum that was hidden there.
2023-01-22 21:44:03 +01:00
Jonas Bähr
a437939b77 PD: Add tests loading InvoluteGears created with v0.20
This is in preparation for new features, to ensure we don't break
existing documents created with FreeCAD-0.20.
The fixtures have been created with the official mac build of
FreeCAD-0.20.1 using mostly default parametrization -- only the number
of teeth has been reduced in order to keep the file size low.
2023-01-22 21:44:03 +01:00
Yorik van Havre
5033f64ce9 Merged crowdin translations 2023-01-17 09:40:31 +01:00
Yorik van Havre
12239f7f99 Updated ts files 2023-01-17 09:24:46 +01:00
wmayer
a122aa01a7 PD: move to new style connect() 2023-01-15 14:27:33 +01:00
Yorik van Havre
ec6b14bbee Merged crowdin translations 2023-01-09 14:06:28 +01:00
Yorik van Havre
c1160c598a Updated ts files 2023-01-09 13:24:16 +01:00
wmayer
05959a2beb PD: fix crash in TaskRevolutionParameters::fillAxisCombo
* Replacing the static_cast with a dynamic_cast in 668adaacdf is a regression because it cannot be guaranteed that the linked object is a sketch.
  In fact it can also be a shape binder which is explicitly allowed.
  Forum: https://forum.freecadweb.org/viewtopic.php?f=19&t=74939
* Move initialization of some variables into the if-statement
2023-01-02 09:49:27 +01:00
wmayer
52838aa6bd PD: fixes #7791: Linear Pattern With Single Occurrence Fails 2022-12-27 14:29:16 +01:00
Yorik van Havre
89147ef8de Regenerated ts files using lupdate6.6 2022-12-22 15:39:42 +01:00
Yorik van Havre
3376e387da Merged crowdin translations 2022-12-20 10:01:00 +01:00
Yorik van Havre
d206d5cd1f Updated ts files 2022-12-20 09:31:25 +01:00
Uwe
79aa19d920 [PD] enable padding to touching planes
- this patch is from @@FlachyJoe
- as reported here: https://forum.freecadweb.org/viewtopic.php?p=646231#p646231
it was impossible to pad to a face which is touching the sketch despite is is no parallel to the extrusion Direction
2022-12-12 13:04:05 +01:00
wwmayer
c64ca7b78f Revert "[PD] App: precompiled header fixes" 2022-12-10 00:22:55 +01:00
Uwe
ab0a15139b [PD] App: precompiled header fixes
- use same naming scheme ans CMakeLists structure as for all other WBs
2022-12-09 19:26:38 +01:00
wmayer
f3ec8f784e PD: [skip ci] Single-parameter constructors should be marked explicit 2022-12-08 00:26:35 +01:00
wmayer
f18c9a2391 PD: fixes #6000: auto-generated Body not placed under existing Part 2022-12-08 00:09:48 +01:00
wmayer
161e091e4b PD: refactor CmdPartDesignNewSketch::activated 2022-12-07 23:31:20 +01:00
Uwe
0424ddc598 [PD] improve PreCompiled.h handling 2022-12-07 21:31:16 +01:00
wmayer
319b63cbda PD: remove parameter 'supportface' from ProfileBased::getUpToFace as it's not used any more 2022-12-05 12:46:52 +01:00
Uwe
f79c66dc33 [PD] Pad/pocket: fix wrong error message
- the error can also occur when the mode it not UpToFace (ToFirst or ToLast)
- also add note when Reversed checkbox is enabled since this is no obvious (as discussed in the forum)
- also some whitespace unification and include sorting
2022-12-04 05:37:11 +01:00
Uwe
d02871298a [PD] FeatureSketchBased: fix orthogonal check
- same fix as #7879
- also fix wording on an error message and improve a variable name
2022-12-04 05:31:51 +01:00
luz paz
9e6af70140 PartDesign: fix header uniformity 2022-11-30 01:28:56 +01:00
luz paz
d265c9ff63 PD: remove trailing whitespace 2022-11-10 10:32:04 +01:00
wmayer
7b67ff7ea0 PD: fix crash in TaskRevolutionParameters::addAxisToCombo
and some warnings reported by GH actions
2022-11-09 18:56:11 +01:00
wmayer
a6be2a28bc PD: [skip ci] improve the exception text 2022-11-09 17:46:46 +01:00
Uwe
17730a12cb [PD] TaskDlgRevolutionParameters: fix some CI warnings
- reported here: https://github.com/FreeCAD/FreeCAD/pull/7667/commits/f0a0e563
- and here: https://github.com/FreeCAD/FreeCAD/pull/7719/commits/8f3f17f8
2022-11-09 17:33:33 +01:00
Uwe
f41bf23aa9 [PD] Helix: assure source Sketch is visible when in selection mode
- same as https://github.com/FreeCAD/FreeCAD/commit/a5dcf87d0 but for Helices (fixes #7629 also for helices)
- also modernize Qt connection
2022-11-06 12:48:11 +01:00
wmayer
93ab955873 PD: use Base::StateLocker to simplify handling of blockUpdate and make it exception-safe 2022-11-05 19:29:20 +01:00
wmayer
b5bd12a069 PD: fixes #7629: Keep sketch visible during revolution tasks 2022-11-05 19:09:54 +01:00
wmayer
056abcd3d4 PD: unit test to check offset of sub-shape binder (PR #7445) 2022-11-05 16:58:51 +01:00
Paddle
657ddeae29 PartDesign: Remove unusable 'Leave sketch' 'viewSketch' commands from menu.
Add 'EditSketch' 'MergeSketches' and 'mirrorSketch' usable commands to menu.
Add 'ValidateSketch' to toolbar.
2022-11-04 16:18:41 -05:00
wmayer
4b08850edb Qt6 port:
* QApplication::setFallbackSessionManagementEnabled has been removed
* QString::medRef() has been removed. Use QString::mid() again.
* QTextStream::setCodec has been removed
* Use operator QVariant of the QFont class to make code Qt5 and Qt6 compatible
* Signature of QTreeWidget::mimeData() has changed in Qt6. Remove TreeWidget::mimeData() because it doesn't change the implementation
* QLayout::setMargin() is deprecated in Qt5 and has been removed in Qt6. Use QLayout::setContentsMargins()
* QDateTime::toTime_t() is deprecated in Qt5 and has been removed in Qt6. Use QDateTime::toSecsSinceEpoch()
* QDesktopWidget is deprecated in Qt5 and has been removed in Qt6. Use QScreen
2022-11-01 16:55:40 +01:00
Flachy Joe
c2c23169e6 [PartDesign] Improve Helix calculation for straight shape (#7674) 2022-10-31 23:26:10 +01:00
Chris Hennes
1fac3fead0 cMake: Add support for compiling against Qt6 (#7647)
Removes the BUILD_QT5 flag and adds a new FREECAD_QT_VERSION option,
which can be set to either "Auto" (default), 5, or 6. Auto detects which
version of Qt is installed on the system and chooses it. If both version
are installed, Qt5 is used.

Note that this DOES NOT implement compiling against Qt6, it only adds
the necessary cMake infrastructure to begin work on the source code
changes that will be required.
2022-10-31 09:24:09 -05:00
Uwe
6d889db9d7 [PD] remove deprecated holes
- as discussed in https://github.com/FreeCAD/FreeCAD/pull/7642 the backwards compatibility for deprecated holes was already lost since FC 0.19
- this PR removes the deprecated types and transform holes created with FC 0.19 or 0.20 to the corresponding countersinks/counterbores.

- also add Counterdrill for translations
2022-10-27 14:24:32 +02:00
Uwe
c31dc73e62 [PD] FeatureHole.cpp: sort counterdrill
- will be necessary to push deprecated entries to the end of the combobox in the dialog (in a coming PR)
- also fix too long code line
2022-10-25 01:09:37 +02:00
wmayer
316ce9f13b PD: [skip ci] disable undo/redo for the tmp. document created by the SubShapeBinder 2022-10-24 16:50:50 +02:00
Stefan Klug
673be545fd PartDesign: Add HoleCuteType "Counterdrill" 2022-10-24 15:19:24 +02:00
Stefan Klug
c077f75159 PartDesign: Refactor geometry creation of counersink/counterbore
The counterbore is basically a special case of the countersink
with a countersink angle of 180 degrees and applied depth.
Handling it that way elimintaes some duplicate code and adds the ability to
combine countersinks and counterbore to form a counterdrill.

The sanity check on countersinkAngle can be safely dropped as it is ensured
by a constraint on the property itself.
2022-10-24 03:42:02 +02:00
Stefan Klug
477726806f PartDesign: Remove duplicate comment 2022-10-23 09:15:17 -05:00
Stefan Klug
264d0bb890 [Bugfix] PartDesign: Fix HoleCutDepth not being recalculated correctly
HoleCutDepth is reset to 0 to force a recalculation of te depth when
HoleCutType is set to a new value.
But the line
	pcHole->HoleCutCustomValues.setValue(false)
also forces a recalculation. So the depth was recalculated with the old
value in HoleCutType which was not expected behaviour.
2022-10-23 04:10:18 +02:00