This article explains how to use Flip Curve to reverse the direction of a curve.


On the Grasshopper, it is represented by either of the two above.
Reversing the direction of a curve
By using Flip Curve, the direction of a curve can be reversed.

In this article, we will use this curve for this explanation.

By inputting line data to the Flip Curve(C), the direction of the curve is reversed.
In this case, we are connecting the curve set in Curve.

Components used: (1) Curve (2) Flip Curve (3) Divide Curve
Let’s check the direction of the curve.
Divide Curve is used to divide the curve at a point.
This time, 10 is input to the Divide Curve(N) and the curve is divided by 10 points.

As you can see, the curve is divided by points.

Additional Component: (1) Point Order
First, let’s look at the original direction of the curve.
Use Point Order.

This shows the order of the points and that the direction of the curve is from left to right.

Now, let’s check the direction of the curve when Flip Curve is used.

We see that the points are oriented from right to left and the direction of the curve is the opposite of the previous one.

To make it easier to understand, we have prepared two curves.

Additional component: (1) Line
First, the two original curves are divided by a point, and then the points are connected by a line with Line.

Thus, the points are connected by a line.

Now we used Flip Curve.

Then, the points are connected by a line as if they intersected.
Since the direction of one curve is reversed, the points are connected to each other on opposite sides.

Additional Component: (1) Ruled Surface
Now let’s check the surface.
First, using Ruled Surface, connect the two original curve data.

This creates a surface that connects the two curves.

Now, we used Flip Curve.

This time, a twisted surface is created.
As you can see, we have reconfirmed that the lines are facing the opposite direction.
Conversely, if a surface is twisted, the original direction of the curves may be reversed, and Flip Curve may be able to solve the problem.
Data output

Let’s look at the data connected to and output from the Flip Curve.
The Flip Curve(C) on the right side outputs curve data in the opposite direction.
The Flip Curve(F) outputs information on whether the direction is reversed or not.
True is output if the direction is reversed, and False is output if it is not.
In the case of the image above, the curve is facing the other way, so False is output.

By inputting another curve to the Flip Curve(G), the orientation can be determined according to the orientation of the other curve.
This time, we have another curve to look at.

In this case, since it is the same curve, the orientation of the curve is the same in its original state.
Therefore, the Flip Curve(F) outputs False.

Let’s connect the curves that are reversed by Flip Curve.
Since the direction of the curve is reversed, the direction is determined according to the curve.
Therefore, the direction is reversed and True is output from the Flip Curve(F).
List of Grasshopper articles using Flip Curve component↓
Comment