Commit Graph

43 Commits

Author SHA1 Message Date
Florian Foinant-Willig
c7d85ff9d9 [PartDesign] Still a helix fix (#12977)
* [PartDesign] Still a helix fix

If we don't break the helix path at each turns we get a vaild path for
MakePipe (solid) even with an angle.

* Decrease helix tests requirements
2024-03-25 18:31:20 +01:00
Josh Coalson
a8ae56e06a Part: Rename AttachExtension::Support property to AttachmentSupport, to avoid name conflict with base features. Fixes #7052 2024-03-04 18:22:43 +01:00
wmayer
8173e4474b Tests: use the correct value as reference 2024-02-27 08:47:47 -06:00
wwmayer
d3049deaa9 PD: Add test for helix (#11601)
Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2024-01-10 07:26:18 -06:00
bgbsww
bf3ccbc5b6 Correct mistaken Helix patch; use MakePipe for frenet for speed; add tests (#11598)
* Cleanup and switch to using MakePipe

* Cleanup unused include

* Use Frenet mode in building pipe

* Restore original code, add a control property

* Hide property, and init on new objects

* Restore prior behavior for legacy objects

* Clean up git blame; add missing move to keep helix same with new makePipe call

* Remove debug include

* Use doxygen syntax for deprecation comment

* Add unit tests; restore code for angled helixes; optimize zero angle helixes

* Lower test precision to accept platform variations

* Loosen more

* Correct restoration

* Tweak test volumes to match restored helix creation

* Restore helix generation parameter

* Fix test; delint
2024-01-08 13:43:38 -03:00
wmayer
1245c3f3b2 Python: deprecated aliases have been removed in Py 3.12 2023-12-02 14:45:55 +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
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
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
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
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
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
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
luz paz
c726b69d7e PD: remove trailing whitespace 2022-11-10 10:32:04 +01:00
wmayer
63e74c848f PD: unit test to check offset of sub-shape binder (PR #7445) 2022-11-05 16:58:51 +01:00
mwganson
663d4fe93a PartDesign: Fillets / Chamfers add unit tests for UseAllEdges property 2022-03-01 18:42:14 +01:00
wmayer
f9b37729fe PD: add PD test modules to __init__.py 2022-01-18 18:02:10 +01:00
Jonas Bähr
96e7c6b3b5 PD: Add tests for InvoluteGear
There are some basic tests to cover the gear profile and its parameters
and some integration tests for the interaction with PD Pad and Pocket.

I followed the same pattern as the other PartDesign tests, e.g. not using
PEP8 style method names. Eventually some helper methods could be
extracted and moved to the common base framework in Mod/Test, but that's
another step.
2022-01-18 17:43:52 +01:00
wmayer
6461f9f6d2 PD: [skip ci] make uniform the license text of test modules 2022-01-17 16:38:10 +01:00
donovaly
cf11f38875 [PD] add along length option for pad
- as discussed here: https://forum.freecadweb.org/viewtopic.php?f=17&t=50466&start=10#p433327
this PR is the first step for new Pad features.
It implements 3 features requested by users:
1. an option to measure the pad length along its direction if there is a custom direction
2. when there are two lengths, the reverse feature should be active
3. the pad dialog shows now always the used pad direction, no matter if it is a custom one or the sketch's normal

- Furthermore there are some code improvements (avoid rounding and blocking signals)

- Also adapt TestPad.py because its test used the case two lengths + reversed but this was not possible before this PR - the reverse option was not take into account for two lengths in FeatureSketchBased.cpp)
Now it is and therefore the test must be updated:
In the test the second sketch has the normal vector 0, -1, 0. As the reverse option is set the pad direction is 0, 1, 0. So in y direction is the length (1mm) and in -y direction is length2 (2mm). This gives together with the other pad of volume 1, a total volume of 4.

- fix UI issue: either reversed or midplane
As noticed by @chennes, when the pad uses symmetric, reversed is not sensible and vice versa.
This commit fixes the missing Gui side for the case midplane is checked and the App side.

- the PR also fix two typos
2021-03-22 16:36:04 +01:00
wmayer
f55c46cc86 PD: adjust unit test for mirrored offset that doesn't fail any more 2021-03-13 14:48:16 +01:00
donovaly
7306ed28b0 [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
lorenz
8be2c08141 partdesign: fix failing tapered hole test
The given parameters return an invalid shape. This fails with occt7.4 but doesn't with occt7.3. If the angle is 45 degree the cone is self-intersecting as Hole.Depth > Hole.Diameter/2. Changing the Hole.TaperedAngle to 60 degree solves this issue.
2020-05-03 17:49:13 +02:00
luz.paz
d38f18af23 PartDesign: [skip ci] fix header uniformity
This PR fixes header uniformity across all PartDesign WB files
2019-12-22 00:58:38 +01:00
Zheng, Lei
1d274f6697 Test cases changes
Slight adjustment of various test cases due to various API changes.
2019-08-17 15:32:48 +02:00
wandererfan
c74ea1d999 Fix PD Pocket Through All Unit Test
- test for Pocket Through All case
  generated a multi-solid solution.
  Now returns single solid.
2018-07-13 10:23:42 -03:00
Peter Lama
926b844409 Rename superPlacement property to AttachmentOffset
The name Attachment Offset gives a better picture of what the
property does.
2017-11-05 16:41:25 +01:00
Stefan Tröger
d92b631dad Make Origins work well with scoped links 2017-09-09 16:55:55 +02:00
Stefan Tröger
5b58fc77a7 PartDesign: Fix multi pattern test 2017-09-09 16:55:55 +02:00
Stefan Tröger
972b89d0a0 Make PartDesign::Boolean work with new Link structure
This is the first feature that used GeoFeatureGroupExtension and required links to the groups inside as well as to things on the same level. Hence a few modifications to link scopes have been nesseccary.
2017-09-09 16:55:55 +02:00
Kurt Kremitzki
6e7952ec67 PDN: Add several Hole tests 2017-08-30 10:41:55 -03:00
Kurt Kremitzki
44f163178a PDN: Add simple hole test 2017-08-30 10:41:55 -03:00
Kurt Kremitzki
394c9f12c0 PDN: Update ellipsoid primitive test for OCC < 7 2017-07-26 23:16:12 +02:00
Kurt Kremitzki
c62a773cee PDN: Add tests for Boolean, MultiTransform, Primitives, Shapebinder 2017-07-26 23:16:12 +02:00
Kurt Kremitzki
4331a8073c Add missing assertions for PartDesign Datum tests 2017-07-11 06:23:25 -05:00
Kurt Kremitzki
58d0b31752 Revise PartDesign Draft base test approach 2017-07-11 06:22:52 -05:00
Kurt Kremitzki
544e6587cb Add linear and polar pattern tests 2017-07-11 02:27:38 -05:00
Kurt Kremitzki
d9277c4567 Flesh out basic dressup feature tests 2017-07-11 02:27:38 -05:00
Kurt Kremitzki
fb5aeeaa7b Add dressup feature test structure 2017-07-11 02:27:38 -05:00
Kurt Kremitzki
4eb59453e7 Break out PartDesign tests into own folder 2017-07-11 02:27:38 -05:00