Smoothing closed polysurface

Well… what a mess!

I’ve used an old cluster of mine for gear creation (output should be much more accurate than your original script) because i needed to extract a single tooth…

I’ve rotated in-place the single tooth n times.
Then, instead of working with solid union/difference, i’ve worked with planar sections.
Merged iteratively the curve sections and (rebuilt+trim) lofted through them to achieve a final cutter surface:
1
2
3
4
5

3 min script time:

You should triple-check everything here… I’m not sure if the construction is what you wanted.
(but I’m personally sure it is good… :boom: )

ruota_dentata_maje_V3_90gradi-cilindrica.gh (95.2 KB)
(Lock solver before opening the file… enable sequentially …)

… probably it could have been faster… but i like to use high subdivision count for precision
:D

Hope it’s good.

Good luck!

But nothing on rhino+grasshopper level…

21191986_1483333435036745_3350345084417157092_n

gear

Coming up on four hours now and this loop is still running (3600 SDiff iterations). Apparently it gets slower as it creates more teeth. What a pity. Might revert to Anemone “Classic” components just for the satisfaction of seeing results but this approach to get the full crown gear is painfully slow.

I see you are all-out “brute force”!
… you are almost literally simulating the hobbing!
I hope your pc will survive :laughing:

I finally killed the Anemone loop without getting any result. :frowning:

Since then I’ve been messing with the jagged edges, trying to isolate one tooth and Rebuild the edge curves to smooth them. I used both the baked crown gear in your Rhino file and my own effort to cut the crown gear teeth. It would be much easier to isolate the middle tooth if the pinion gear were “zeroed” on a peak or valley but neither appears to be the case, its initial angle of rotation is arbitrary? :frowning:

Given the 12:1 gear ratio and ten teeth on the pinion, there will be 120 teeth on the crown, one every three degrees (right?). I tried zeroing the pinion gear by eye before starting the Anemone loop to cut the teeth but the SDiff failed about half way through 15 degrees (5 teeth). :frowning:

This job would be far easier if you can isolate a single, well cut crown “tooth”? Doing it by counting control points (basically by eyeball) is unsatisfactory.

I still haven’t isolated one tooth but this is where I was going… internalized crown gear from Rhino file.



Crown_gear_generator_2020Mar4e.gh (1.5 MB)

Adjust slider for Rebuild Curve control points count.

Have you bailed on this thread? Feels like you’re not responding to our comments. The Anemone loop in your model didn’t work at all, but looking back at it (and one of your posts above), I noticed that your gear ratio is 9:1, not 12:1? So you expect 90 teeth (4 degree spacing), not 120 teeth (3 degree spacing)?

After a tremendous amount of work, I have achieved success! The result is here, internalized in a 38 MByte GH file: http://islandcad.com/Mholper/Crown_gear_smooth_2020Mar5a.gh

The steps I went through to get this were extensive.

  1. I recreated your pinion gear from the pinion geo curve in your GH model. In the process, I “zeroed” it very carefully using control points.

  2. I obtained a “crown_fragment”, 1/90th of the blank crown ring in your Rhino file, corresponding to one tooth. Centered on the zeroed pinion gear at first, then counter rotated 8 degrees before running it through my Anemone loop for 16 degrees (accounting for the ‘x-1’ iteration quirk of Anemone!).

  3. I isolated the two edges that define the tooth shape and applied Rebuild Curve very carefully to make sure the smoothed curves don’t overlap the original cuts (yellow curves). I was able to reduce the number of control points from 247 to 26 on one edge and from 355 to 37 on the other:



  1. I used the new lofted tooth surface to split my original single tooth crown gear “blank” and reconstruct a new, smoother single tooth brep.

  2. Then I used Polar Array (ArrPolar) and SUnion to complete the full crown gear.

Crown_gear_generator_2020Mar5a4


Crown_gear_generator_2020Mar5a.gh (39.9 KB)

This uses your Rhino file and has a couple of Data Dams (manually activated) to wait for each of the steps to finish.

If you are using Rhino 5 or older(?), there might be some incompatibilities to work around, like A×B (Multiplication) but it otherwise uses simple bits.

Hi Riccardo and Joseph,

Sorry for the delay in my reply. I did not leave the tread… but I do have a day job to attend :slight_smile:
Let me start by saying I am so grateful for all the time you guys are putting in! Now that it’s evening and my children are sound asleep I can dive into your coding.
I’ll get back to you! But once again, thanks so much for all the help!
michel

ps. Joseph: I am not sure where you got the 1:12 ratio from. I wrote in one of my earlier messages the following: [quote=“mholper, post:9, topic:97571”]
bevel gears work best in transmission ratios not much bigger than 1 to 5; but I need 1 to 9
[/quote]

Hi Joseph,

So I finally managed to inspect the crown your code generated. I make a deep bow to you and Riccardo when it comes to your coding skills (and dedication)… my attempt feels more like a caveman trying to get this thing done.

Your crown is definitely smoother and the shape of the profile looks right. Unfortunately the generated file indeed is monstrously large. When I import the file into a Solidworks assembly my computer bogs down in pain.

So in retrospect my assumption that a smooth surface results in a small file size was a faulty one… which sounds pretty obvious now as it is easily possible to create huge jpeg photos if you upres is. This does not change anything to the photo, but it does to the file size…

Riccardo’s approach on the other hand seems promising as the file size of the output file is much more manageable. I will reply to his approach below.

You’re right, it was “heavy”. So I just did a slight re-arranging, using a method I saw in Riccardo’s model and it’s much lighter now! Only 671 Kb instead of 38 Mb. Thanks @maje90.

The internalized “smooth” gear alone: Crown_gear_smooth_2020Mar5b.gh (671.7 KB)

The slightly reorganized file that creates it: Crown_gear_generator_2020Mar5b.gh (40.9 KB)

I arrayed the lofted surface for one tooth (90 times), joined them together and split the blank crown gear with it, then put the pieces back together again. Easy peasy. :sunglasses:

Hi Riccardo,

Thanks for your work. The end result is smooth and of workable file size!

Your approach of using a single tooth is awesome. Kudos for not listening to my idea of using multiple teeth to make the cut. I have caused enough trouble for you and Joseph as it is :slight_smile:

I will take more time in the upcoming week to truly try to understand your code. This is because I am really a beginner at Grasshopper.
As a newbie maybe you can point me to the right location where I can adjust the subdivision count? (I assume that this question quite neatly illustrates my newbie level…)

I also notice that the gear generated by the gear module is different from the one that my code generated. That is unexpected as I was hoping they would both follow the same evolvent gear formulas. Either way: this last thing is the least of my concern because the code you wrote was the real hard part.

Thanks again.

michel

Hi Joseph,
Jep. Thanks. That seems to do the trick! Although also for your code I will need some time to dive into it also. I really want to understand!
This is probably going to sound incredibly stupid, but I am positively surprised by the “data dam” block! I have never seen it before but it is so nice if you iteratively want to work with different parts of the Grasshopper code.

As a final thought (but I am pushing it, I know) is the question: whose surface is better: yours or Riccardo’s? :slight_smile: mathematically of course both can be carried out until infinity. In the end, nobody really cares as long as the print resolution with which I want to produce this crown is bigger than the step size, but I always have a hard time letting go of stupid questions like these :slight_smile:

Resolution in my code is determined by two things:

  1. The ‘degrees fraction’ slider, currently set to 10, meaning 1/10th degree increments in the Anemone loop. If you increase it to 20, for example (1/20th degree increments), you’ll need to double the iterations (‘Repeat’ slider) from 160 to 320. This is because I want the crown gear blank to rotate through 16 degrees (from -8 to +8 degrees), so 20 X 16 = 320.

  2. The two sliders labeled ‘white’ and ‘blue’ determine the ‘Count’ (N) input for Rebuild Curve. I used the lowest values I thought were reasonable from comparing the resulting loft to the original surface. It’s a judgement call.

The yellow group rebuilds and “zeroes” the pinion gear, I think you should ignore that.


Check the red ellipses in the screenshot.

Note: the final cut or “hole” surface is as heavier and accurate as long U and V count is high.
(U and V are the subdivision of the surface)

1-

1- is the amount of in-place rotated cutter teeth to “dig” the hole.
Here, the higher the number doesn’t mean heavier geometry directly (as the script rebuild the curves later), but with a small number you’ll surely have low quality/precision.
Higher number here means also slower computation for all the next steps.

2-

2- number of the planes, this determine the U amount

3-

3- rebuilding the sectioned curve result, this determine the V amount and also make the surface smooth and not fragmented (that would mean a polysurface instead)

I used “high” numbers because, as i said before, i like to have the highest precision possible…
I think actually the gear surface is under 0.001 rhino unit accurate.
If you lower the numbers it will increase the roughness and lower the accuracy.


My 2D gear generator uses a evolvent with 50+ control points … the evolvent in your original script had 8-10 points…
Regardless of this, I’ve checked, and the shape is the same.
If you see small differences, mine is the correct one :smiley: (i hope)
My script generate the gear slightly rotated, but controlling its parameter you can build any gear in a correct shape.
It doesn’t have fillets… but i think that’s a secondary problem… right?

Is there reason to believe that these teeth “valleys” are not just a straight Loft between the two edges, as I did?

@mholper, I forgot to mention that accuracy may also be affected by ‘Display Options’ settings. ‘Units | Absolute tolerance’ and 'Angle tolerance as well as ‘Mesh | Smooth and slower’.


I’ve seen you doing loft.
Honestly i have no idea if the final shape should mathematically/theoretically be straight/loft or not.
Without knowing, i’ve used 20-ish sections, but yes… if that could be avoided that would simplify almost everything in the simulation.

Here a 3:15 gear test…just to exaggerate and highlight the nature of the shape (does it make sense?)
… surface seems not straight …
export.3dm (1.1 MB)
(I’ve removed all but one tooth for lighten the file upload/download… just do the array polar)

I’m not sure about this all, as my “official” (high school) knowledge finish at the construction of the 2D involute.

My “istinct” would tell me that conical gear have much better, larger contact line than this type of gear… i think this type touch in just 1 single point… which seems bad to me…

Someone pro in the field should check our shapes.

Note: @mholper in my script , inside the c# component “Sequential curve boolean union” i’ve used “t/100” as tolerance.
If you rhino file have already a good tolerance set up, use just “t”, otherwise it will take infinite time to finish.

I’m not a gear pro but just tried to compare your crown gear to mine and found some disturbing differences, like the diameters aren’t the same? Their thickness isn’t the same either, so their volumes differ wildly. (~198 for yours vs, ~310 for mine) Yours takes 51.1 seconds to compute the volume where mine takes 2.2 seconds. That’s a huge difference. It’s hard to compare the tooth surfaces because the peaks don’t align due to the difference in thickness (‘X’ dimension).

I see the compound surface in your export.3dm file but am not sure it applies to the bigger crown gear because it’s much smaller in diameter with only 15 teeth instead of 90. And frankly, I haven’t understood how your process works yet. Cutting teeth with solid difference in the Anemone loop is much easier for me to grasp and feel confident about. Faster too. :wink:

I’ll look again at the raw cut before smoothing to see if I can verify compound curvature… If so, I can imagine ways to sample the raw cut with concentric cylinders to get intermediate “stations” for my loft.

Here it is, not obvious so not much, if any? Perhaps a slight hint using Zebra (not shown here).


raw_cut_tooth_2020Mar5a.gh (352.5 KB) (big file for one tooth!)

Not sure how much more time I want to spend on this…


For reference i’ve made “primitive” circles which just have diameters = n° of teeth * module.

To achieve the “ring” of the crown, at the first attempt i made offset internally … with very ugly result.

Then i did external offset… and continued that way…

I hoped mholper would fix this as he needs (like addendum/dedendum stuff etc etc… )

Just writing to say that I bow down to @Joseph_Oster and @maje90 for their expertise and taking the time to help an internet stranger figure out this whole thing.

@mholper I understand what you’re saying about feeling like a caveman.

Indeed, I did not expect this much help when I posted my message. It took me over a week to write my cave-man code and initially I was very pleased with the result… until I started multiplying the tooth number by 99 and my computer gave up. Joseph and Riccardo are awesome!

@Joseph_Oster and @maje90: I can’t make any promises for now as it is still hobby project, but I am working on a watch design in which I need this tooth. If I ever make it to production I will send a watch your way as a huge thank you!

@Joseph_Oster: the tooth profile will not be a straight loft as the rotation of the crown creates an angular surface. The curvature of this surface is dependent on the relative angular movement between the crown and pinion. In my case roughly speaking: the crown has a big diameter and runs quite slow due to the 1:9 ratio. So the pinion tooth is out of the crown before it has cause a large curve on it’s surface. As soon as the gear ratio is reduced to say 1:5 the effect is much more pronounced.

Here you see an example of a tooth profile. I used solidworks color coding in order to evaluate the surface curvature. This tooth has a ration that is (I think) 1:5.

Here I did the same with Riccardo’s tooth

I see some strange curvature variations here, but I assume that these are mainly rounding artefacts made in the calculations.

Which brings me to my last conclusion; and it has been quite a journey. It seems that the bigger the gear ratio the more it is allowed to simplify the gear creation by approximating it with a straight loft. This is still quite theoretical so what the effect on the functionality of the gear will be when working at this tiny scale (a pinion with a modulus of 0.3 is really small but not uncommon in watches) I really don’t know. I figured as we are simulating anyway I might as well strive for perfection… thanks to you guys I am pretty much there!