1
$\begingroup$

enter image description hereI am currently trying to make a race track generator with geometry nodes and I came to a halt because I don't really understand how I can calculate the turn angle in various points of the curve and set a threshold for where to put kerbs and run offs. I haven't really been able to find any resource on it and using the sample curve tangent hasn't yielded any results so far. I started with a drawn curve that then i resampled, converted to a mesh and then extruded. Thank you very much.

The grease pencil lines are where ideally the kerbs should go.

$\endgroup$
3
  • $\begingroup$ So, you want to get an approximation if curvature in XY (not including up/down).. or ore there other constraints on these features? $\endgroup$
    – Robin Betts
    Oct 15, 2023 at 11:17
  • $\begingroup$ can you please add a sketch/image, what angle you are talking of? $\endgroup$
    – Chris
    Oct 15, 2023 at 11:51
  • $\begingroup$ the constraints are only X and Y, the only other constraint is the turn angle, Ideally I would like to be able to control the depth of each kerbs based on how narrow the angle is. $\endgroup$
    – AetherDust
    Oct 15, 2023 at 12:20

1 Answer 1

2
$\begingroup$

This is how you can calculate a signed angle for each point of a curve:

It doesn't use Tangents, so the angle is clearly defined as an angle between the evaluated line segments:

  • segment 1: between the previous point and currently evaluated point
  • segment 2: between currently evaluated point, and the next point

The angle is $0$ if either segment is missing because it's the first or the last point. If you want an angle spanning across multiple points, just pass the calculated value to Accumulate Field node, capture it again, and now you can compare currently evaluated point's value with any other point to check the angle between those.

$\endgroup$
4
  • $\begingroup$ sorry, why are the two offset point in curve different? Also I plugged it in the original geometry but it doesnt seem to be working. What do i need to plug in the point index? $\endgroup$
    – AetherDust
    Oct 16, 2023 at 9:52
  • $\begingroup$ "why are the two offset point in curve different" - one represents the previous point, one the next point. This is why one has negative offset, one positive. "it doesnt seem to be working." - it's not clear what your geometry is exactly and how you want it to work exactly. Maybe upload your .blend file using blend-exchange.com $\endgroup$ Oct 16, 2023 at 11:35
  • $\begingroup$ my geometry currently is a bezier curve, my current goal is to be able to add an additional extrusion along the side of the track but only in the areas where there is a turn that meets a specific threshold in order to create the kerbs. $\endgroup$
    – AetherDust
    Oct 17, 2023 at 20:14
  • $\begingroup$ Resample Curve, "Evaluated" mode. $\endgroup$ Oct 17, 2023 at 20:38

You must log in to answer this question.

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