Parametric Curve

Hi all. I’m still learning grasshopper but and I hope the community can help me!

I want to make an adjustable flexible pipe. For that I will create 3d curve where I give my start point and end point. Then I give the desired length and minimum bending radius (bendind radius is an extra). My objective is to move the end point but make sure the line is always the same length.

See image below a 2d sketch of what I want to obtain:

For this my end point would start in the longest position, and if I adjust the end point closer, I would like the curve to go move up so that the total length remains the same.

All the help would be much appreciated!

Thank you for your time reading this!!

The problem needs a slightly clearer definition.

Will the pipe always have this shape (two clockwise turns, one anti-clockwise turn)?
Do the pipes simply have to match the length of the original, or do we need to specify a length?
Does the length of the arcs count towards the total length, or do you need the right-angled length?

Hey thank you for the interest!

So this is for a real application where I will buy a flexible hose and the end point will having this linear movement (left and right), therefore the length must be fixed, and yes, the length of the arcs count to the total length. The radius of the arcs is always the same. I only want the lines in between to adjust accordingly

For the shape I will constrain the moving are so that always have this shape (two clockwise turns, one anti-clockwise turn).

Ok, this is some simple mathematics. BRB with a .gh

So yes, it’s just some Deconstruct points then some addition/subtraction/division to generate the missing coordinates.

parametric hose.gh (10.0 KB)

The big MDsliders can be replaced with whatever method you have for generating the start and end points. Note that there is no error handling, so if you feed it impossible values you’ll still get a curve but it will be the wrong length. Keep an eye on the Length Check panel as you adjust the sliders.

I now realise that you said the actual problem will be in 3D. My solution is for 2D only.

However, if you study it and understand how it works, I think you’ll be well placed to figure out a 3D version :slight_smile:

Wow this is amazing works perfectly as I wanted!!

Is a little more math than what I initially think ahahah

I’m really thankfull, my goal was to get at least the 2D to have an idea on how it should work, now I will find my way to get it in 3D.

Thank you so much for your time and for helping Tom!