Commit Graph

2101 Commits

Author SHA1 Message Date
Paddle
bc22bf9c0d PartDesign: Fillet, Chamfer, Draft, Thickness : Enable tool to start with no selection. 2023-03-28 12:52:42 +02:00
Paddle
1689c99930 PartDesign: Fillet/chamfer/draft/thickness: Merge Add & Remove buttons. 2023-03-28 12:52:42 +02:00
Uwe
1b6e97066c [PD] FeaturePipe.cpp formatting fixes
- remove commented includes (once mistakenly added by me)
- also fix too long lines
2023-03-28 01:56:30 +02:00
wmayer
7c2b91cfdc PD: do not record Gui command as Doc command 2023-03-26 18:41:56 +02:00
Uwe
b74425b441 [PD] revolve: remove unused code
- also come code style unification
2023-03-22 17:46:03 +01:00
luzpaz
f1bbcd9e13 Fix typos and whitespace 2023-03-22 17:10:38 +01:00
Jonas Bähr
e05231aa7f PD: Implement Profile Shift for InvoluteGear
This commit adds the ability to shift the involute profile inside or
outside. Profile shift is implemented as coefficient, i.e. normalized by
the module, so that it the whole profile scales with the module without
chaning shape.
To verify the profile, the tests implement an "over pins measurement"
using formulae found in literature.
Backward compatibility with FreeCAD-v0.20 is garanteed by already
existing tests, not touched by this commit.

This addresses issue #5618.
2023-03-17 22:22:34 +01:00
Jonas Bähr
503c878810 PD: Harmonize ExternalInvoluteGear and InternalInvoluteGear
There has been lots of duplicated code between those two, and the recent
changed introduced even more copy/paste code. This commit consolidates
both implementations. The two "public" entry points, `CreateExternalGear`
and `CreateInternalGear` have been kept and now call a shared helper.
2023-03-13 22:10:41 +01:00
Jonas Bähr
24578466bc PD: some cleanup of InvoluteGear
This commit removes obsolete files, gets rid of py2 habits like `xrange`
and fixes some comments and blank lines.
2023-03-13 22:10:41 +01:00
wmayer
82ac24de5c clang: fix -Wunused-parameter, -Wunused-variable, -Wswitch 2023-03-12 15:05:21 +01:00
wmayer
2a0e52e71e clang: fix -Wunused-but-set-variable 2023-03-12 15:05:21 +01:00
mosfet80
0505449776 Update json (#8830)
* Update json from 3.9.1 to 3.11.2
2023-03-11 13:30:27 +01:00
wmayer
243088a8c3 PD: add unit test for PR #8763 2023-03-10 19:23:03 +01:00
wmayer
f93122e12c PD: add unit test for issue #6156 or PR #8748 2023-03-10 19:05:50 +01:00
luzpaz
01e8bbc2bf Fix various typos and whitespace 2023-03-10 14:40:46 +01:00
Uwe
31fa8187d5 [PD] add tooltip for Hole feature
- tooltip makes clear what the depth means for countersinks
- add comment why a calculation cannot be performed
- shorten some long lines
2023-03-10 05:14:24 +01:00
Zheng, Lei
99c9d9b468 PartDesign: do not include transform for sub-object in Feature 2023-03-10 02:06:24 +01:00
Alexander Golubev
bc4eaff234 PD: Fix Loft's Closed option
Closes: https://github.com/FreeCAD/FreeCAD/issues/6156
2023-03-09 01:48:32 +01:00
Jonas Bähr
0397618094 PD: Retranslate InvoluteGear's Task Panel on language change
This makes use of the recent additions to `TaskPanelPython` and
`UiLoader`, cf. #8602, to retranslate the UI without having to close and
reopen it again.
Retranslation of the part from the UI file is now handled by FreeCAD
internally, but the tool tips from the property descriptions still need
to be reassigned with the translated versions.
2023-03-06 00:19:04 +01:00
Yorik van Havre
be6a654b3e merged crowdin translations 2023-02-27 16:01:15 +01:00
Yorik van Havre
2cd27ce328 updated ts files 2023-02-27 15:35:51 +01:00
Jonas Bähr
d5e341b044 PD: Fix exception from InvoluteGear with zero fillets
While gears without a root fillet may have limited real-live use cases,
during number-input it happens regulary to have a zero fillet radius as
intermediate state. With this commit such a situation is now handled
gracefully.
2023-02-26 23:28:33 +01:00
0penBrain
0d577a8789 Base: introduce 'getSafeUserUnit' that fallbacks to full precision and internal unit ...
... in case unit schema would zero a non-zero quantity

 For example, using '1 mil' with UnitsSchemaImperialDecimal schema
2023-02-23 15:22:07 +01:00
0penBrain
65f8321e27 PartDesign: better quantity values handling for primitives 2023-02-23 15:22:07 +01:00
Jonas Bähr
ecd660ed7e PD: Fix the internal InvoluteGear's root/tip arc directions
The arcs on the tip (around the addendum) and the root (between the
fillets) used to have their bulge in the wrong direction for the internal
gear profile: their center points has been on the outside.
Since this error existed since the very first introcution of the internal
gear I assume this was done by accident: Instead of only the fillets, all
arcs have been inverted when the external profile was copied.
This commit now inverts the tip and root arcs again, to be concentric
with the pitch circle -- same as for the external profile.
2023-02-23 12:49:10 +01:00
Jonas Bähr
3e50af581b PD: Make InvoluteGear's property docs translatable
As the property descriptions are translated at a central place in the
GUI, we have to use the generic "App::Property" category.
For details see https://tracker.freecadweb.org/view.php?id=0002524

As the property docs are also used as tool tips in the InvoluteGear's
task panel, this is also needed to achive a fully translatable GUI.
2023-02-21 23:21:56 -06:00
Jonas Bähr
0887950f64 PD: Enhance InvoluteGear's Task Panel with Tool Tips
In order to not maintain the same information in two places, the property
docs are reused as tool tips for their input fields. And for user
convenience, the same tool tip is assigned to the respective label as
well.
2023-02-21 23:21:56 -06:00
Yorik van Havre
0566d90cc5 merged crowdin translations 2023-02-13 15:45:26 +01:00
Jonas Bähr
dc1130bf28 PD: Improve InvoluteGear's fillet generatrion
Previously, the fillet started at a fixed value, tailored at 20° pressure
angle, a fillet radius of 0.375 and a dedendum of 1.25. With PR #8184
those values became user-adjustable and thus the assumptions of the
original code are not fullfilled any more. This resulted in significant
artefacts, especially for higher pressure angles or smaller dedendums as
commonly found in splines.

This commit actually calculates the junction between fillet and involute
so that the tangents of the both curves match.
The mathematical approach is described in source code comments.

The change in the fillet calculation also affects compatibility with
files generated by earlier versions of FreeCAD. Those changes are way
below 0.1% per tooth, however the earlier test required absolute equality
down to the micron. This was relaxed and also changed to a relative, per
tooth, tolerance.

There is one particular case where the new algorithm performs slightly
worse, though. That is when the fillet radius is too large to the
dedendum, i.e. resulting in a single arc instead of two fillets, and
effectively cannibalizes some of the clearance. This happens with internal
gears having less than 25 teeth. At about 15 teeth it becomes visible
that the fillet is not 100% tanget any more. However, as such a low
number of teeth is highly unusual for internal gears and the effect,
although noticeable, is minor, the overall benefits of the new algorithm
outweighs the drawbacks. And now with the fillet radius being adjustable
it is easy to fix, too.
The technical reason is that the tangency is calculated correctly, but
the fillet circle is displaced aferwards to avoid an overlap of the two
fillets. For the new fillet position, the tangents do not align any more.
2023-02-13 02:31:28 +01:00
Jonas Bähr
b053c58308 PD: Expose new gear properties to the SVG generator
This little script has proven to be a vauable debugging aid, so it got
some love. All the new properties from #8184 can now be set, together
with the option to generate internal gears.
2023-02-13 02:31:28 +01:00
Yorik van Havre
d8b0e64e14 Merged crowdin translations 2023-02-07 15:55:31 +01:00
wmayer
a0548860d2 PD: replace slots with member function pointers 2023-02-03 00:21:38 +01:00
Yorik van Havre
80c68fa4df Merged crowdin translations 2023-01-30 10:04:15 +01:00
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