I'm trying to figure out how to do it, I only neeed the angle from the X-Y axis between one segment and the next one. I checked out some other similar questions, but none of the ones I found were about curve segments.
When I ask to chat GPT it gives me this formula, and I interpret it like that. The problem is the results don't seem accurate at all. But I feel that would be the way to go. The only thing in this example is that I haven't considered only the X-Y axis.
Replies
If your geometry is a square box between 4 Vertices with XY coords:
V1: 0,0
V2: 500,0
V3: 500,500
V4: 0,500
Then the Lines making up that box will go [from,to]:
Line1: V1,V2
Line2: V2,V3
Line3: V3,V4
Line4: V4,V1
Skipping a few steps because I assume you're already here, ultimately they'll have Vector Angles of:
Line1Vector: 0°
Line2Vector: 90°
Line3Vector: 180°
Line4Vector: 270°
What you're looking for is the DeltaVectorAngle of the Next and Previous Lines of any Vertex.
Vertex 1: Line1Vector - Line4Vector. But for you, nothing, I guess?
Vertex 2: Line2Vector - Line1Vector.
Vertex 3: Line3Vector - Line2Vector.
Vertex 4: Line4Vector - Line3Vector. Also nothing for you because spline?
However, that'll create some issues of creating negative values. Let's clamp it back to 0°-360°:
TempVertexAngle2: if (Line2VectorAngle - Line1VectorAngle < 0) {Line2VectorAngle - Line1VectorAngle + 360} else {Line2VectorAngle - Line1VectorAngle}
Etc.
You also seem to only want cutiepie angles, and that can be fixed by only accepting values lower than 180:
VertexAngle2: if (TempVertexAngle2 > 180) {TempVertexAngle2 - 180} else {TempVertexAngle2}
Etc.
How to attach those values to the UI tho. And the cutie part of the geo, lol.
IDK if that's useful, but it's what I got. Maybe it'll help you get to where you're going.
Also don't expect any of that code to work, I was merely translating logic to something that might be more readable. This was translating the gibberish I have to something that you might be able to read :P
2. Connect the normalized vectors to a dot product.
3. Output the dot product to an arc cosine (NOT an arc sine!)
I'm not sure offhand if the radian to degrees node is necessary, but otherwise that should be all you need.