I am trying to do a simple tasks and I am blocked. I have multiple curves. I import them as a collection in geometry nodes and then i would like to loft them. I know what i should do thanks to some tutorials.
My problem is that the curves are generated by another process and i need their origin to be “aligned” meaning as closed as possible. Imagine two 2 circles at different z. If the starting point (at least the x,y coordinates) are really close you can loft the 2 curves with good faces but if the starting points are really far then you got orrible faces.
All my curves are cyclic.
Is there a way to get the starting point of the first curve (SP0) and then for all the remaing curves set their starting point to the closest point to SP0?
Hello, if I understand well, then for your task is probably better to offset the curves to the world origin by its pivot/median, do the operation and then offset back.
Thanks for the answer but i am not sure that I understand how it works.
My curves are closed and cyclic and I do not need to move them. I just want to change their starting point so that they are as close as possible.
Let say that i have two bezier curves in the form of a circle for simplicity. I have SP0 of the first curve.
If i use a manual process i can select the second curve, go to edit mode, select one of the control point of the second curve and make it the starting point of the curve. Since my curves are closed and cyclic every point can be the starting point. Manually i can see which is the closest control point of my curve to SP0 and select it. I do not have any idea on how to do the same thing in geometry nodes
Hello, I hope I understand now better. So you want for each curve recognise the closets point to sp0 and change it to starting. You need to get that point index and shift the indices (sort elements). As you cannot sort point elements on curve you need to use curve to points and then back points to curves . I am away now, I can look and try when back.
This is literally amazing, Thank you it work perfectly and it does exactly what i need! Even better than i hoped.
I just had a small problem: for some reason in the downloaded file the first add node (between index and Points of Curve) was broken. I just deleted and recreated it. I’m just saying in case you want to make this wonderful approach available to all.
Good, glad it works;) This “add node” issue is related to blender version you using, I am using newer “integer math node” add and it is available from the 4.3 blender version only.
@filanek i used you setup and it is great. I found a limitation: this is working if the curves have either the same number of points or they are integer multiples like in the example file you gave me: 12 control points in the first bezier and 4 in the others. I made a small modification that should work for arbitrary number of points, it only change the math nodes after the Points on curves node. I’m uploading the file if you are interested.