Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gear generator classes #19

Merged
merged 42 commits into from
Jun 13, 2024
Merged

Conversation

Jojain
Copy link
Contributor

@Jojain Jojain commented Apr 22, 2021

I'm creating a new PR since I have rewrote most of the gear generator plugin (started here #13 ) with classes , becauseI think it is better to use and to work upon.

I have removed the gears that weren't mature enough, I may add them later as other PR but for now it will be easier to start with a few.

I've worked quite a lot on the maths of the bevel gears and they are now way more robust and flexible. However for the bevel gears and the spur gear, it happens that some set of parameters leads to non valid geometry. This happens mostly with helical gear. I don't have a set of parameter to reproduce the issue but one can try different value for the parameters and will enventually encounter it but I will post one when I got one
I am quite confident with my modelization so I assume that on these cases the problem comes from OCP/OCCT

Jojain added 6 commits April 22, 2021 21:49
I rewrote the plugin using OOP. For now there is only bevel gear and spur gear, I removed all the other ones cause they werent mature enough
change twist angle from radians to degrees
modified tests to handle the update in twistangle
@Jojain
Copy link
Contributor Author

Jojain commented Apr 24, 2021

An exemple of parameters that lead to wrong geometry, even though the parameters should yield a valid result.

from gear_generator import  Gear

m = 1.5
z = 22
b = 12
alpha = 14
helix_angle = 40

simple = Gear(m, z, b, alpha=alpha, raw = False, helix_angle=helix_angle).build()

image

@jmwright
Copy link
Member

@Jojain Is this ready to be reviewed?

@Jojain
Copy link
Contributor Author

Jojain commented Apr 26, 2021

@jmwright yes !

@jmwright jmwright requested review from jmwright and marcus7070 April 29, 2021 20:25
Copy link
Member

@jmwright jmwright left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That last test (test_gear) I think is worth a closer look. If needed, I can get a version of CQ-editor running on your branch to see what the resulting gear looks like in Ubuntu 18.04.

plugins/gear_generator/README.md Show resolved Hide resolved
plugins/gear_generator/README.md Show resolved Hide resolved
.gitignore Outdated Show resolved Hide resolved
tests/test_gear_generator.py Show resolved Hide resolved
tests/test_gear_generator.py Show resolved Hide resolved
tests/test_gear_generator.py Show resolved Hide resolved
marcus7070 and others added 4 commits April 30, 2021 16:52
Get lint action workflow file in this branch
modify precision due to difference with ubuntu 18.04
@Jojain
Copy link
Contributor Author

Jojain commented May 2, 2021

There is a serious bug here in cq/OCCT, I went to see why the windows Gear test was failing and the result is that upon runs without any changes the result is either valid or not.
image
image

I just hit twice the render button in cq-editor and I got the above result. And it's not a graphical bug but a kernel bug since the obtained volumes are respectively : 10033.574314576623 for the valid shape and -6642.4418367933495 for the wrong one

Jojain added 2 commits May 12, 2021 12:49
Trying hacky stuff and triggering the test
This reverts commit a37287b.
@Jojain
Copy link
Contributor Author

Jojain commented May 12, 2021

I gave it another look and the problem seems rather complicated to identify. The problem seems to be most likely happening on helical gears but by trying enough I also got a non valid spur gear.

If someone wants to look in depth in my implementation to try identify what's wrong that would be appreciate, otherwise I will let it like this for now, so you can reject the PR.

I might look at it again and more in depth in the future but right now I prefer focusing on other things.

@adam-urbanczyk
Copy link
Member

Maybe this is interesting/helpful for you https://github.com/meadiode/cq_gears ?

@Jojain
Copy link
Contributor Author

Jojain commented Sep 12, 2021

I have seen that. I'm not planning to modify my implementation any time soon and he said that his were stable so if people needs gears I think we are better to lead them to his repo than mine.

That being said, (about the bevel gear at least) he created his gear by constructing faces and then assemble them into solid while I worked with 3D operation and the result is less stable.

It think its something to keep in memory that when you want to make something quite complex and very reusable it's probably better to use the face stiching approach

@jmwright
Copy link
Member

jmwright commented Jun 8, 2024

@Jojain I don't know that the conversation on this PR ever finished, but how would you feel about me merging this plugin? We could put a note at the top of the readme if it will be buggy for users.

@Jojain
Copy link
Contributor Author

Jojain commented Jun 8, 2024

@jmwright Feel free to merge it. The issue encountered back then were from the kernel which I have no control over it. The issue might have disappeared with newer version of OCCT.

@jmwright jmwright removed the request for review from marcus7070 June 13, 2024 01:40
Copy link
Member

@jmwright jmwright left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Jojain !

@jmwright jmwright merged commit de5a349 into CadQuery:main Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants