Let me start saying that I’m just starting with Grasshopper, so the steps I took are probably not very clean, so any help in optimizing the process is very welcome (and please be clement whith what I did ).
A bit of context: I have to take a piece of art that is made by a bended tube, divide it into sections and send it to the factory, that will take straight tubes and bend them in the shape I need. The problem is that they can bend the tubes in only one fixed axis, and the art piece has sections that are bended in more than one axis.
The Structure
I created a structure that takes a curve as input, divides it into sections and allows me to flatten and manipulate the radius in every section. this is the way I structured it:
-
Take curve, divide it into sections (with a number slider, so I can decide the precision). I actually divided the curve, and then create single curves to work on them, and have a number slider to choose on which section of the curve I want to work.
-
I create a plane from 3 points: starting point, end point and the chosen point on the curve where I want to manipulate the curvature.
-
I use a Curvature component to find the radius on the precise point I want, and extract its center point. From that I can manipulate the position of this center point (x,y) and the radius of a circle, created from this center point.
-
I create tangent lines from the 2 boundary points to the circle. I tried to use Trim to create a final curve, but it was not working, so I used the circle to manipulate the tangent lines, and then created the final curve using an Arc between the tangent lines.
-
After all this, I saw that I actually wasn’t able to recreate the curve, because I cannot swap the new modified section with the old one on the curve list. So I used a Data Recorder with a stream gate and a boolean, so when I was done modifying the curve, I would change the boolean from false to True to save the curve on the data stream, and then tur it to false again and go work on a new section.
-
The final piece of the puzzle is a simple pipe and boolean to create a tube from the final curve.
The problems: There are some unsolved problems on the file that I’ll be working on, mostly safegards, like "what happens when the tangent becomes null, etc (but feel free to offer solutions to any issue you find on the file, as they can be better and help me improve)
Main problem 1: The initial idea was that I could take this curve and modify it, seeing the result in real time. What I achieve with this is to see in real time one section of the curve being modified, but I can’t see how it impacts the rest. I only see the result of the pieces of curves that I “save” on the Data Recorder. Is there a way to do it using the lists?
Main Problem 2: As I cannot see the hole end result, Sometimes I get sharp corners between sections, as I’m modifying single segments and not the whole curve. That could be solved maybe if I was able to see the whole new curve while modifying a segment, or, maybe the approach is wrong and I should think about working on the tangents of the starting and end point, so the connection between the tubes is always smooth.
I hope I explained it well. This is my first grasshopper project, so I have a bit of a knot in my head, and it’s probably visible on how I structured the file:
Pipes.gh (49.1 KB)
Every help is welcome. Thanks!