I tried the raycast node based on this post but I can't get it to work since some of the nodes....
I think using Raycast method in cases where your objects don't have faces can be quite tricky, especially when working with curves. I'd suggest using Transfer Attribute node instead where you can take the positions of the points on both of your curves and transfer them to a new curve line object (which will be used to create the connecting columns/rods between your curves)
It'll look something like this:
Explanation of why this is working:
The general idea is to transfer the position of every point on both of your curves twice (or to have them repeated twice).
Once you've done so, the next thing you need to do is pick out the coordinate, in an alternating pattern. Since the connecting lines are
Curve Lines objects that are instanced on both of the curves, you can use the Spline Parameter node with the
Factor output (which will be outputting 0-1-0-0-1-0-1... value) to pick out the coordinate.
The final coordinate (or positions) will look like this. And you can use this to set the position of your
Curve Lines objects so that they'll connecting your curves objects.
Here's a small demo of this method:
Here's the node setup:
UPDATE (to Khristos's comment):
I can however not get the vertical rods to be truly vertical or parallel when the two curves have different shapes...
If that's the case (the rods have to be vertical and parallel) then you'd want to use Raycast instead. The idea is simple: In order for the lines to be vertical and parallel to each other, from every point on your 1st curves, you'll want to find the position of all the points on the other opposite side of your 2nd curves. Because of that, you'll need to shoot rays in a straight direction from 1st curve -> 2nd curves. To be able to cast ray towards any object, the targeted object need to have faces so you'll need to add extra geometry (faces) to the curves for this method to fully work. This can be achieved by turning the 2nd curves to mesh and then using the Extrude Mesh node to create some additional geometry for raycast.
A comparison between 1st method (
Position transferring) & 2nd method (
The node setup:
A reminder: since the direction vectors used to cast the rays were derived from the center points of the splines, there'd be cases where the lines got a little skewed or tilted, so you'd want to adjust the
Ray Angles to achieve better results.
I also attached the blend.file in case you want to take a closer look later on.