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