Grasshopper

algorithmic modeling for Rhino

cranked line problem..with a bit of pythagoras' theorem !

Hi everybody

 i have a bit of a geometric problem that is related to a sculpture that im working on, i ve worked out the solution involves using pythagoras' theorem

here s a quick explanantion ( but is probably best if u take a moment to look at the jpeg that i have attached.

i basically have a polyline consisting of a given number of segments ( which vary), the points of which are extracted and then (apart from the first one) moved down so that the a line of fixed length can be built through them. the original polyline sits on the ground plane, as i have said the segments vary in lengh, this information is exrtracted using the 'length component' ....

basically for each segment you make a calculation using pythagoras' theorem to work out the length of short edge('c')of the right angled triangle, as you have the hypotenuse ( which is the fixed length) and you have the length of the original line ( 'b'), ie, the amount the point has to drop in the z-axis , but clearly each successicve vlaue needs to added together.

so what i would really appreciate is if some could give me some scripting asssitance ! as i feel that i need a way of adding the successive values of 'c' together and then adding them to the new 'c' value. i woudl count myself as a very proficient in general grasshopper but my scripting is nt up to much ! so any help would be really appreciated !

thanks in advance

louis

Views: 653

Attachments:

Replies to This Discussion

I think you could do that by drawing a cirlce at the start of the line, with the known radius (the fixed lenght) and check where it intersects the vertical lines (point C), that should be the start point of the new line and the center of the new circle that will intersect the next line... that done iteratively would do the job I think... you can do that by repeating nodes in case there are not too much segments, if you want that "porperly" done... yes, some code would be the solution

hope it helped somehow

cheers
hi pep

thanks for your reply, as you say using circles is an option, the reason i was reluctant to go down that route and was keen to pursue a coded approach was that i ve found in the past that when using a circle to generate an intersection you can end up with more intersections that you had expected as the circle can intersect with more than just the one line that you intended it to intersect with - if that makes sense ! ...thanks anyway though, cheers louis
hi pep

i actually managed to solve it in quite an elegant way using the mass addition component's partial result output.

here are the files if you are interested

cheers

louis
Attachments:

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service