Grasshopper

algorithmic modeling for Rhino

Hey Everyone,

I am new to VB and I am trying to write something that will divide an angle in a particular way.

I have attached an image of an angle and some components that i was using to think through the problem. I have also attached the gh file.

1. I would like to have the inputs be an angle and a number of divisions.

2. Then i need to take the number of divisions and add one to it (example: # of Divisions = 4 so then the number we are actually dividing the angle by would be 5)

In this example the angle 83.53 is divided by 5 to give you a 16.706 angle.

3.Then the divided angle number gets divided by 2 (16.706/2=8.353)

4. The smaller angle number should always be the end angles and the other angles should be the larger number.

I need this to be recursive so that when the number of divisions changes you dont have to copy another rotate component.

I know this was probably a little unclear. I hope the attached file and image help.

I am not sure how to start writing this in a vb component.

If anyone could help me get started I would sincerely appreciate it.

Thanks,

Michelle

Views: 1113

Attachments:

Replies to This Discussion

Hi Michelle,

see the definition attached for 2 different ways of dividing an angle and how to use the angles to manipulate geometry then.

i didn't really understand, what you're trying to do and why you'd make a vb component. Anyhow, i made you an example in vb and c# so you can think about it and compare it with the other example, that was done with gh components only.

Hope this helps,

FF

Attachments:

Thanks Florian,

The reason I was looking to do this in vb was that the end angles always have to be half of the other angles. So in your example you have 6 interior angles and then the sides would equal half so the overal angle would be divided by 7. That would make the interior angles 12 and the ends 6.

The number of angle divisions will be constantly changing so  instead of copy and pasting rotate components in gh I thought it would be better to use a recursive process.

I have attached the solution I ended up with.

Thanks again 

Attachments:

Ah i see, sorry missed the point with the half angles. But anyhow...this can be done without using vb...unless you wan't to learn vb at all costs ;-)

GH components allow you to do basically everything you can do with loops in scripting. Only recursive stuff can't be done in GH easily...well there is hoopsnake...but that's a different story.

the definition is attached.

Have a nice day,

FF

Attachments:

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service