# Geometry Nodes: How to connect two sets of points with the same Index using Bezier-curve?

I try to connect two sets of vertical aligned points with a Bezier-curve like shown in the picture below.

I’m at the very beginning of learning Blender and geometry nodes. I have a lot of experience and my background comes from CAD-Systems like CATIA and Siemens NX. So, my approach will probably be a little different. It isn’t quite that easy to understand the logic of node-based modeling as I expected. In this project I learn a lot by try and error, by searching in this forum and from YouTube tutorials.

The goal of my project is to have two separate curves / splines (they don’t have to be the same length), which are divided into an equal number of points. Then to connect the points with the same index of each side with a Bezier-curve. The left ending of the curve should be tangential to the x-axis (Bezier-handle horizontal), the right side should be free adjustable.

This is how I got so far:

I’m at a point now where I got stuck and have some questions:

• How can I create multiple Bezier-curves between the two sets of point with one node? So, that it would not depend on the number of points.
• Is there a way to save the left position of the handle and apply it to every other left handle, so that they are all tangent to the X-axis?
• Is it possible to create an attractor to in-/ decrease the tension of the curve in z-axis? Like a magnet placed on top of the curves?

I attached the blend file in case you want to have a closer look on 😊

How can I create multiple Bezier-curves between the two sets of point with one node? So, that it would not depend on the number of points.

A Grid is perfect for creating two vertical lines of points. Main issue we need to be careful about is to have the indices of these points read from left-to-right so when we create and move the endpoints of our Bezier curves to these points, they hang horizontally.

Unfortunately we don't yet have a native overlay option to see the indices of procedurally generated geometry so it's advisable to use a custom node group made for that purpose. Here, I'm using the free Index Viewer by Mohammed Riaz.

The default indices of a horizontally sub-divided Grid seem to go from bottom-to-top. It is possible to fight these numbers with some clever index math down the line, but when we can simply divide vertically and rotate by $$-90^\circ$$ instead, there's no need:

Creating multiple copies of a geometry is usually done in two ways: Instance on Points and Duplicate Elements. Since we're planning to move their endpoints after creating our curves, we don't really care to place them anywhere particular beforehand, so Duplicate Elements in Spline mode should do the trick. Using the same integer value socket we used for our Grid subdivison to feed the duplicate Amount will make sure we have as many curves as rows of points. We can then get the Positions of our points via a Sample Index node and use that to Set Position our curve endpoints:

Note that this works so simply because both the grid rows and the Bezier segments have two points to match. If we had used, say, a Quadratic Bezier with a middle point instead, we would have to employ some index math to deal with that extra point.

Is there a way to save the left position of the handle and apply it to every other left handle, so that they are all tangent to the X-axis?

The node that controls them, Set Handle Positions, affects all available splines at the same time by default, so you don't need to do anything specific for that. In the setup below, I'm using Set Handle Type to make all handles Free first, so we can be granular in our control. Set Handle Positions node can manipulate one side at a time, so we have two of them in Left and Right modes. At the moment, our curve handles are at pretty arbitrary positions in space. By feeding a Position input to these two nodes I'm moving all handles to their source points, resetting their positions, so to speak. That should give us a clearer starting point to move them from by using the Offset values:

Note that when we use the Offset values here, as I mentioned before, all relevant handles are moved at once. It's just that since these are simple curves with only two endpoints and their handles are set to Free, the movement of the left handle of the left endpoint, and the right handle of the right endpoint doesn't create any visible changes. If we had more than two control points in our curves (perhaps we used a Resample Curve, for instance), we would notice them. To control certain point handles, you can employ the Selection sockets. The unconnected Index > Modulo 2 > Not setup in the screenshot is one example.

Is it possible to create an attractor to in-/ decrease the tension of the curve in z-axis? Like a magnet placed on top of the curves?

Not really sure what that looks like. Do you mean something other than simply using the Offset—Z values? If so, you might wanna open another question just for that.

• Great post! A typical Kuboå response! Jan 10, 2023 at 23:33
• @quellenform Thanks! I try... Jan 10, 2023 at 23:45
• Thank you Kuboå for the super fast response and such detailed help! Unfortunately, I only got around to looking into this today. Your answer has already helped me a lot! In the next few days I will try to adapt the idea to a more complex component / mesh that is not based on a straight surface. But a surface that is three-dimensionally curved in space. It may well be that a few new questions will occur. Thanks again for the help 😊 I wish you a nice weekend! Jan 15, 2023 at 12:51
• @pb1893 You're welcome! If you feel this answer is satisfactory for the current question you can "accept" it by clicking the tick below the vote buttons. Looking forward to your more complicated questions—just try to make them singular and isolated, don't be shy about creating multiple posts if the questions are reasonably different than each other, so future visitors can find the relevant parts more easily. Have a nice weekend as well. Jan 15, 2023 at 13:06
• Perfect, that's how I'm gonna do it. Thank you so much!! 😊 Jan 15, 2023 at 13:23