Jump to content

Help needed for making Gear Generator


surt

Recommended Posts

hi guys

 

I'm new to the Houdini, and I'm having hard time understanding how to make loop nodes 

what i want to do is to create a gear generator, which allows me to spawn connected gears with correct rotation speed

something based on the link below, but using loop iteration number as gear name and doing the adding and multiplying based on previous gears information

http://deborahrfowler.com/MathForVSFX/GearRatio.html

where I'm stuck is figuring out the previous gears name and adding new gears info in it. 

any help will be appreciated!!! thank you in advance!

 

 

GearGenearatorWIP3.hipnc

Link to comment
Share on other sites

Are you in a hurry?
Because I was about to post a gear generation asset with a gear connexion part. I already do this but in another software.
Unfortunately, I'm really in a hurry to finish a job an I can't dive inside for now (not in yours, not in mine). I don't think I can get back to it for another week or two.

What I can say for now is the "connexion" is fairly simple and is more a UI problem. I think the for-each approch is not the best (but it's just a quick opinion).
At least the iteration use, cause the gears speeds is just about teeth numbers. You should create an attribute "numTeeth" and use it.
And by the way I get an "incomplet asset" message. At the object level I just see a line.

Link to comment
Share on other sites

hi flcc,

no- I'm not in a hurry but this thing has been giving me a trouble for a week and i just want a good solution to it. 

 I do have numTeeth attribute, and i am able to match gear rotation with previous one... but i just don't know how to generate it automatically in Houdini

and for the file... i wonder if its not showing up because I'm still using free learning edition..

well basically the connection is very similar to hip file thats in the link above (http://deborahrfowler.com/MathForVSFX/GearRatio.html)

well thanks for your time! and i would love to see how you have treated this problem in your way too

Link to comment
Share on other sites

The connection part is precisely what I wanted to try in houdini.
In my previous use it was semi manual. A script attached to each wheel with a link to the previous wheel, with known radius and position. It was for "real" machines.

For my "try" it will be more a UI exercise. How generate the gear :
Giving two points and a number of gear to create in between ?
Give a random (or not) grid of point and generate gear on these ?
random size or not ?
other ?
And then generate  all the links and speeds.
And then I probably discover it's not so easy :lol:

The gear building itself is done and almost "pure" VEX

 

  • Like 1
Link to comment
Share on other sites

thats awesome! very close to what i was hoping to achieve as well. but i'm still too new to Houdini, i'm still having hard time  figuring out the "getting info from the previous wheel" part here. 

I'm going to try out the loop tutorial thats stated here... (https://vimeo.com/222881605) and hope i can get something out from it. for now.

if things works out, ill post it here.

i also thought about the grid and point copy way as well. but i couldn't think of a way to distance the points that will change distance with different shaped gear that you create later on. but ... now that i think about it, it could be a good idea to just generate gears that matches the grid automatically .....  never thought about that.

maybe it can be a good idea to think about.. 

thanks for input! ill keep trying! 

 

 

Link to comment
Share on other sites

  • 4 weeks later...

Are you still working on the "getting info from previous wheel" part.

I'm working on a similar gear generator, and have had to deal with the same issue.

From my understanding, each point wrangle works on each point in parallel, meaning each point won't get real-time info on the other points effected by that wrangle.  But you could do something like this -

In a point wrangle -

int gear_number = @ptnum; //for example

i@gear_number = gear_number;  //free it from the wrangle context and copy it into an attribute

Then place another point wrangle beneath that one, and -

int previous_gear_number = point(0, 'gear_number', @ptnum-1);

Then if you were to do something like this in that same (last) wrangle -

i@previous_gear_number = previous_gear_number;

...you would see in the attribute spreadsheet that each point now has an attribute containing the number of the previous point.

You can use that method for any info, including arrays.

Hope that makes sense and helps!

 

Edited by ktonini
  • Like 1
Link to comment
Share on other sites

i have been little away from this project because.. i couldn't figured it out, and decided to learn more basics first. :blush:

but i kinda see what you mean.. ill definitely test it out today when i get home! thank you for the input! 

Link to comment
Share on other sites

  • 3 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...