2
$\begingroup$

I would like to create columns/rods between two curves generated in geometry nodes similar to this:

Target model

I tried the raycast node based on this post but I can't get it to work since some of the nodes have been updated and they are slighly different from what is in the post.

This is what I have so far (I am not concerned about the shape of the top and bottom curves at the moment. Just the connecting vertical members).

Progress status

What would be the best means of modeling the connecting elements in geometry nodes?

$\endgroup$

1 Answer 1

2
$\begingroup$

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: enter image description here

Explanation of why this is working:

  1. The general idea is to transfer the position of every point on both of your curves twice (or to have them repeated twice). enter image description here

  2. 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. enter image description here

  3. 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. enter image description here

Here's a small demo of this method: enter image description here

Here's the node setup: enter image description here


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 (Raycast) enter image description here

The node setup: enter image description here

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. enter image description here

I also attached the blend.file in case you want to take a closer look later on.

$\endgroup$
3
  • $\begingroup$ Thanks for the detailed explanation @CubicSpaceMonkN. This is 'almost' what I was looking for. I can however not get the vertical rods to be truely vertical or parallel when the two curves have different shapes. Here is an example i.stack.imgur.com/KgTog.png $\endgroup$
    – Khristos
    Apr 19, 2022 at 0:25
  • $\begingroup$ Ah, if that's the case (you want the rods to not only be connected but also vertical and parallel) then you have no other choice but to use the Raycast node. The idea is the same as in my original answer but you want to find the center point of each spline, subtract them to get the directional vector, and use it for ray cast. I'll make an update to my answer and attach the blend.file so you can take a look at it later on. $\endgroup$ Apr 20, 2022 at 3:31
  • 1
    $\begingroup$ This is great, thanks! $\endgroup$
    – Khristos
    Apr 20, 2022 at 23:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .