Commit Graph

2105 Commits

Author SHA1 Message Date
Paddle
12588150c1 PartDesign: Chamfer/fillet/draft/thickness small fixes. 2023-03-28 13:30:13 +02:00
Paddle
18a9c164d6 PartDesign: Fillet/chamger/draft/thickness: change the button strings to 'Preview' and 'Select' 2023-03-28 12:52:42 +02:00
Paddle
de6038ff9b PartDesign: Fix placement issue with thickness tool when the feature was empty. 2023-03-28 12:52:42 +02:00
Paddle
d896d00d48 PartDesign: Fillet Draft Chamfer Thickness : Add warning message on empty feature creation 2023-03-28 12:52:42 +02:00
Paddle
47cc265b4f PartDesign: Fillet, Chamfer, Draft, Thickness : Enable tool to start with no selection. 2023-03-28 12:52:42 +02:00
Paddle
8ada7af302 PartDesign: Fillet/chamfer/draft/thickness: Merge Add & Remove buttons. 2023-03-28 12:52:42 +02:00
Uwe
5a1bd28631 [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
5ad97548ca PD: do not record Gui command as Doc command 2023-03-26 18:41:56 +02:00
Uwe
bdc704eaa0 [PD] revolve: remove unused code
- also come code style unification
2023-03-22 17:46:03 +01:00
luzpaz
eb852691df Fix typos and whitespace 2023-03-22 17:10:38 +01:00
Jonas Bähr
9404c032f4 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
4eafedb20f 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
b3ab9c1c3c 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
580b775690 clang: fix -Wunused-parameter, -Wunused-variable, -Wswitch 2023-03-12 15:05:21 +01:00
wmayer
2a970b3045 clang: fix -Wunused-but-set-variable 2023-03-12 15:05:21 +01:00
mosfet80
218269bdaf Update json (#8830)
* Update json from 3.9.1 to 3.11.2
2023-03-11 13:30:27 +01:00
wmayer
8532c96c20 PD: add unit test for PR #8763 2023-03-10 19:23:03 +01:00
wmayer
eb01e31174 PD: add unit test for issue #6156 or PR #8748 2023-03-10 19:05:50 +01:00
luzpaz
6802bed99d Fix various typos and whitespace 2023-03-10 14:40:46 +01:00
Uwe
d27e69bdc9 [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
fac0a1740f PartDesign: do not include transform for sub-object in Feature 2023-03-10 02:06:24 +01:00
Alexander Golubev
088f51632b 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
fb6fffa69f 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
46653420a6 merged crowdin translations 2023-02-27 16:01:15 +01:00
Yorik van Havre
3ad0e233d5 updated ts files 2023-02-27 15:35:51 +01:00
Jonas Bähr
d0b5b5fb6c 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
569154b73f 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
257629f9c7 PartDesign: better quantity values handling for primitives 2023-02-23 15:22:07 +01:00
Jonas Bähr
5fa3e021e8 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
3c0d63f8b3 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
c804549cfe 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
50fb6d6b46 merged crowdin translations 2023-02-13 15:45:26 +01:00
Jonas Bähr
4a77843845 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
4f56b2654e 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
c71e551556 Merged crowdin translations 2023-02-07 15:55:31 +01:00
wmayer
9a5d9880d5 PD: replace slots with member function pointers 2023-02-03 00:21:38 +01:00
Yorik van Havre
4eca103469 Merged crowdin translations 2023-01-30 10:04:15 +01:00
luzpaz
62974cd4d5 PartDesign: convert indentations to spaces 2023-01-23 15:47:22 +01:00
Yorik van Havre
166183e788 Merged crowdin translations 2023-01-23 11:25:49 +01:00
Yorik van Havre
d3149de589 Updated ts files 2023-01-23 10:41:33 +01:00
Jonas Bähr
2226d3a01b 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
4094e34ff2 PD: Add new props to InvoluteGear's task panel 2023-01-22 21:44:03 +01:00
Jonas Bähr
464c512e83 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
37595da316 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
d8118a4b11 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
647a2356b7 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
3933825840 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
199ef42f62 Merged crowdin translations 2023-01-17 09:40:31 +01:00
Yorik van Havre
4641218403 Updated ts files 2023-01-17 09:24:46 +01:00
wmayer
12ed13ddbe PD: move to new style connect() 2023-01-15 14:27:33 +01:00