Geonodes use curve angle to pick from instances

Hey, I missed the geonodes train and I am only now starting to use them.

I’m trying to make a procedural wire fence system. The poles are instanced on a curve and rotated according to the curve’s orientation via an align euler to vector node / sample curve node set up.

However there is something I can’t figure out how to do : I have two different types of poles (planning to add more in the future) and I’d like to pick the object to instance in relation to the curve’s angle : An angle of 90° would result in a certain type of pole to be selected while a less sharp angle would be another type, the result would look something like that:

My issue is the following : how can I get the angle value for each point of the curve? I(ve tried this set up but it doesn’t work :

Can use my curve-deltas node-group included here:

Or you can just use my curve-to-chain-link fence.

Good luck.

Hey thanks ! I had a quick look at your set up and it’s way over my head!

This simple setup seems to work:


curve_angle_instance.blend (109.8 KB)

I use the indices to access the neighboring vertices and the respective positions to compute the (cosine of) the corner angle (Modulo point count for circular curves).

I don’t know whether this works for general curves (or meshes, I used a mesh as an input)

Issue with your solution is that it will only work on a single curve (which means it has limited application as a one-off and cannot be used as part of a curve-generator network (or mesh-to-curve on anything with more that one face))
See the “.Curve-Deltas” node-group in the link I provided (Split Splines Node-Group) if you’d like to know how to have a more general solution that works with multiple curves (can be a mix of cyclic or non-cyclic curves and it will work)

E.g. Can use “.Spline Poly-Dot” group from my example to do something more general-purpose:


(converting to degrees for clarity here)… I try keep my node-groups generator-safe :wink:

Good luck.

1 Like

Yeah, you were a lot more thorough in getting the right points on the splines :grinning:

It seems though that you can get the angle of a curve point by looking at the bezier handles:

(Multiple curves in that picture)

Of course, only works it the mesh input has no vertices with more than 2 connecting edges… But those cases probably need special handling in a fence-generator anyway.

Where do you think this approach could fail?

curve_angle_instance_2.blend (106.9 KB)

1 Like

Yup - I use an accumulator where the group index is the point index transferred by closest - this allows you to “count” how many points occupy the same space ( method required since curves don’t know about “connecting edges”, only meshes have that concept )

Your method appears like it would work best with vector-type handles… aligned or auto would always give a dot product of -1… Which is why I stick to Poly-Curves or evaluated curves for these types of calculations.

P.S. forgot to add that I scaled the “previous” delta-vector by -1 in my example’s dot-product to make the point-angles easier to interpret:

Also, Check out higgsas’ method for calculating mesh point-tangents here (which you can use to calculate the point-angles):

Good luck…

1 Like

Thank you both for your inputs, for the moment I barely understand what you do in your setups and have a lot to learn it seems !

I also have a lot to learn, and new GN features are coming out all the time! :sweat:

If it is something you’d like to understand, then you can look into the curve-deltas node-group and puzzle your way through that. It is using a lot of GN Curve and Utility nodes to calculate the curve deltas (taking into account multiple cyclic and non-cyclic curves)… but even so, it is a small sub-set of nodes it uses, so it should still be a digestible. The Field at Index node plays a big role, so getting your head around how indices work would also be a good exercise.

Another thing the Split Splines node-group will enable you to do is to resample curves by length, while preserving sharp corners… (not something GN can do out the box and I don’t think I would have been able to implement my curve-to-fence project without it.)

The Split Splines node-group is a lot more useful than it may at first appear.

Good luck!