Grasshopper

generative 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 and some very very simple scipting that is beyond me, and with which i would really appreciate some help with !!

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
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

Tags: cranked, line, pythagoras, scripting, theorm

Views: 51

Attachments:

### Replies to This Discussion

Does the attached do what you're looking for?

--
David Rutten
david@mcneel.com
Poprad, Slovakia
Attachments:
Hi David

thank so much for your speedy response, its actually subtley different from your attached example, as you know in your example the original line segment and the generated cranked line segment have the same length.

what i looked to solve is a situation where all the generated cranked line segments have the same length irrespective of the length of the original line segement, like your solution the new and original points have the same x and y coordinates and is only the z value that varies, it is just that the new z value is calculated so that each segment in the chained/cranked line has exactly the same length, this is controlled by a slider that connected to lots of other stuff in the gig definition that im working on. i appreciate that there is potentialy a geometric breaking point as there is no guarantee that a line of a pre determined length can be built between two of these generated points, but i have taken measures 'up-stream' to prevent this from happening so hopefully it should nt happen !

this is actually for a sculpture that is being designed by a london based architect, that im producing a model for, so that we, the engineers can i analyse it , it is essentially a cable net structure one direction of which has segements of a fixed legth, and the reason why the length have to be fixed is because forks ( as in the thing you eat with ) are connected to pairs of adjacent nodes on this 'net' - a bit bizare i know !

cheers

louis
louis,

that shouldn't happen. Assuming a long enough segment can be created, they should all end up with the length you input via the slider control. If the new segments had the same length as the old segments then the shape is necessarily fixed.

--
David Rutten
david@mcneel.com
Poprad, Slovakia
hi david

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

cheers

louis
Attachments:

• Add Photos
• View All

## Videos

• ### Authorized RhinoFabLab GulfStream Middle School, How Math and Design play a special rule.

Added by Andres Gonzalez

• ### the best position of solar panels

Added by reza salehi

• ### DIGITALAB_CLUSTER 01_ADVANCED TWEEN BETWEEN TWO 3D CURVES

Added by DIGITALAB

• ### GH-AEC Metric Pro the Column and Roof components WIP 003

Added by Andres Gonzalez

• ### Fixing Machine

Added by stefano

• Add Videos
• View All

© 2013   Created by Scott Davidson.   Powered by