Commit Graph

218 Commits

Author SHA1 Message Date
Jonas Bähr
055aab2e07 Build the helical internal gear directly, not via boolen cut
The original, now replaced, way had the benefit of reusing the existing
helicalextrusion method, but the following boolean cut operation was a)
slow and b) suffered from co-planar issues. The new way extrudes the
face directly which does not have these shortcommings.
Unfortunaly, we had to use a different API: the original one is simple
and straight forward, gives no easy way to access the end of the sweep.
Collecting the wires manually, filtering on the position of all vertexes,
unvailed tolerances heigher then 0.1, so that a face created from it was
not planar and prevented ceating a valid solid.
The now used API requires more manual work in the initial setup, but the
end wires for construction the top face are directly accesible and the
tolerances are below 0.001 so we can create a planar face and valid solid.
This new way also much faster (1.6 sec vs. 5.0 sec on my machine
using default gear parameters on a double helix, naively measured via
`time.perf_counter()`).
Currently, the new helical extusion method is only used for the internal
gear. Migrating the other usages will be done as a separate commit.
2021-09-29 10:15:10 +02:00
Jonas Bähr
c40bae47b3 Give the internal involute gear its own icon 2021-09-29 10:14:41 +02:00
Jonas Bähr
6daa3114be Add an "internal involute gear" command and feature
This reuses the same (external) tooth profile from pygear but swap some
parameters to make the resulting gear internal.
This prototype is mostly a copy of the external involute gear. Eventually
we should refactor this to share more code but this has to be coordinated
with the megagrant endevour. Otherwise merging becomes a nightmere.
Note that in contrast to the involute rack I choose to base the
"thickness" on the pitch diameter, not the root diameter. This has the
benefit of keeping the outside diameter stable when e.g. adjusting the
clearance. And setting the outside diameter directly could result in an
invalid shape when chaning the numnber of teeth.
The default head value of "-0.4" is choosen to match the invernal gear
profile from the PartDewign WB.
2021-09-29 10:14:26 +02:00
looooo
4e16fd2560 merge error 2021-07-21 14:54:37 +02:00
looooo
56acace6ef Merge branch 'feature/fix-partdesign-tip' into megagrants 2021-07-21 14:39:43 +02:00
Jonas Bähr
37b99b119d Fix crown gear preview mode in PartDesign Bodies
Previously, the `preview_mode` of the crown gear returned a compound of
the base and the cut-outs. This caused problems in PD::Bodies where a
single solid is requried.
The solution in this commit changes the preview_mode to only output the
base, not generating the cutout shapes at all. This is consistent with
the involute gears having "simple=true" and saves again 0.5 Seconds
processsing time on my system using defaults (15 teeth, 4 loft profiles).

In addition, "preview = false" is also speed up by first collecting all
cut-outs, and then passing them all at once to a single cut operation.
This reduced the cutting time from 3.0 Seconds to 2.2 Seconds here.
So preview now generats the shape immediately (0.0008s vs 0.5s) and the
actual crown is generated in 2.7s instead of 3.5s (again, using the
defaut parameters, measued via Python's time.perf_counter).
2021-07-08 23:23:36 +02:00
Jonas Bähr
9983f5ee61 Extend the "additiveness" to all gears when used in PD:Bodies
There are still some issues when the generated Shape is not a solid,
e.g. in the preview mode of the Crown Gear.
2021-07-07 01:09:16 +02:00
Jonas Bähr
bd6c2107ee First proof of concept of "additive gears" in PartDesign bodies
In this PoC only the involute gears work, and there is still a lot of
cleanup pending.
What does work, however, is that those gears now play nicely with
PartDesign's concept of stacking features onto each other, i.e. that the
result of a feature is the fusion of all previous ones.

Special Thanks goes to DeepSOIC for his tutorial in the forum at [1] as
well as this Part-o-Matic which showed me how this works in real live [2]
[1]: https://forum.freecadweb.org/viewtopic.php?f=22&t=21097#p163340
[2]: https://github.com/DeepSOIC/Part-o-magic/blob/master/PartOMagic/Features/PartDesign/PDShapeFeature.py
2021-07-06 00:56:22 +02:00
lorenz
2c07938e0d Remove Attachment deprecation warning for version >=0.19 2021-07-05 00:01:02 +02:00
luz paz
9225b5b4ed Fix source comment typo 2021-07-04 21:54:27 +02:00
looooo
175b746a7a foot -> root, bevelgear add warning for max height 2021-07-04 21:54:27 +02:00
looooo
1f70e28ac1 root fillet 2021-07-04 21:54:27 +02:00
looooo
403505ae95 add cycloide gear foot- and headfillet 2021-07-04 21:54:27 +02:00
looooo
ae1c272c42 use correct license headers 2021-07-04 21:54:27 +02:00
looooo
9ddd493b82 add head parameter for cycloide gear 2021-07-04 21:54:27 +02:00
looooo
3c9f6f0c6b add property for fillets (head, foot) 2021-07-04 21:54:27 +02:00
looooo
8174345a38 refactor 2021-07-04 21:54:27 +02:00
looooo
3dedcf3e21 add todo list 2021-07-04 21:54:27 +02:00
looooo
6c6176b089 conditional to supress eprecation warning in 0.20 2021-07-04 21:54:00 +02:00
Jonas Bähr
7934657993 Make all gears attachable
The logic for attaching, repositioning and backward-compatibility check
was moved to the already existing base class.
2021-07-04 21:53:11 +02:00
Jonas Bähr
bc285f1ad4 Make Involute Gears Attachable
Heavy-lifting done using the "Part::AttachExtensionPython" extension
cf. https://wiki.freecadweb.org/Scripted_objects_with_attachment
Objects greated with earlier versions are automatically updated on
recompute.
Other types of gears not touched yet.
2021-07-04 21:53:11 +02:00
Jonas Bähr
765603dc1e Make the new properties backward compatibile
By checking whether the additional properties are available, gears
created with earlier versions can still be manipulated in FreeCAD.
And when first touching an older gear, it gets updated with the new
additional properties.
2021-06-11 20:21:43 +02:00
Jonas Bähr
4c8d1e672b Expose outside and root diameter to freecad
The values are already calculated by pygear and this change make them
available as properties in FreeCAD.
The naming should be in line with the rest of fcgear's nomenclature,
derived from https://qtcgears.com/tools/catalogs/PDF_Q420/Tech.pdf
2021-06-11 20:21:43 +02:00
lorenz
ffe86c85e8 Warnung -> PrintWarning 2021-02-17 13:40:45 +01:00
lorenz
ef4622e015 importError->ImportError 2021-02-17 12:23:24 +01:00
bevin
8b0d8e999e fix cam rotation fails for odd number teeth 2020-11-19 11:23:22 +01:00
bevin
ee40235fdc allow center hole radius to be zero, and bugfix for previous patch 2020-11-19 11:23:22 +01:00
bevin
aa3fa561a1 Update features.py
pin circle diameter actually used as radius in calculation
2020-11-15 22:02:09 +01:00
looooo
7b2fb1b429 increase version 2020-11-12 10:11:05 +01:00
looooo
f9feb65c70 add version-property to gears, define bevel-gear module at bigger end 2020-11-12 10:10:46 +01:00
looooo
ccdfad4a90 crowngear: properties: preview_edit -> preview_mode 2020-10-13 15:14:35 +02:00
looooo
e3df129b2f crowngear: property construct -> preview_mode 2020-10-13 15:08:31 +02:00
lorenz
830eb5e9f0 crown-gear: rename property construct ->editing-preview 2020-10-13 15:04:27 +02:00
looooo
5a9e17b29b wormgear: add property for reversed helical extrusion 2020-10-04 21:59:56 +02:00
looooo
6172eae385 pygears: fix profile 2020-09-30 17:26:52 +02:00
looooo
16b4c47402 minimal fix 2020-09-22 14:43:25 +02:00
Zheng, Lei
ffbbcd897f Fix adding object to PartDesign::Body 2020-09-22 14:37:16 +02:00
looooo
5e1b40834f grouping properties 2020-09-09 11:56:44 +02:00
looooo
b8e9fdcb93 fix typo 2020-09-09 11:50:55 +02:00
looooo
ef5c72e926 involute-gear: property docs 2020-09-09 11:17:40 +02:00
lorenz
4f94009f78 Update features.py 2020-09-09 09:21:33 +02:00
looooo
af0670e11d typo: cycloide->cycloid 2020-09-03 11:26:33 +02:00
looooo
95f0ed76ab typo: cycloide -> cycloid 2020-09-03 11:20:58 +02:00
looooo
081aa5fcea HypoCycloidGear: use bsplines 2020-09-03 11:10:49 +02:00
bevin
2b3ece4697 when all shapes are invisible, keep old shape 2020-09-02 17:23:51 +02:00
bevin
3875028685 bugfix and optimization 2020-09-02 17:23:51 +02:00
bevin
ce46429f6a overall fine now 2020-09-02 17:23:51 +02:00
bevin
933d962dc6 WIP for hypocycloid disk creation 2020-09-02 17:23:51 +02:00
looooo
beb484ea64 pep8 function 2020-08-30 09:37:42 +02:00
looooo
19a826cf1b remove gui commands if no gui is available 2020-08-30 04:49:12 +02:00