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:
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:
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.
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:
I also have a lot to learn, and new GN features are coming out all the time!
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.