Point at change of curve direction

Hi Good people,

I would like to place a point where a line/curve change the direction. Is in Dynamo any node for that or do you have any suggestion how to do ti?

Best Regards,
Adnan

Hi,

can you please post an example (a drawing, a screenshot…) of what do you exactly mean/want?

What do you mean for direction, the tangent vector? If it’s a curve it’s changing at every point, if it’s a polyline it’s changing at every segment.

Hi Luca,

Thank you for the feedback!

here is short example. With the line…
Line%20points%20at%20intersection

You just need Curve.EndPoint.
If you have a polycurve, you need first to use Geometry.Explode to get the segments.

…then I use node start and end point of line to get the points…
how can I filter/get points where is direction changed??

Compare the vectors of each line’s tangent at start and mid points as one method.

Ok, maybe now I got what you meant. You have Polycurves where each segment is actually made of multiple parallel contiguos lines, right?

Partially as @JacobSmall said, I would compare tangent vector at the end of a segment to the one at the beginning of the next one.

In this case I made a Polycurve with apparently 3 segments, but actually the last one is made of 3 lines (total 5).

PointCurve

End to beginning won’t catch curves that change radius but start tangent. :wink:

Tangent at the end of the first line to midpoint at the second will.

@JacobSmall good point, I was only thinking about linear segments, not for example lines and arcs together (point A).

But still this doesn’t work in other cases, in point B the vectors at the middle of the arc and at the beginning of the line are the same, so it would not be recognized as discontinuity.

Moreover I’m getting troubles with node List.Equals or Vector.IsAlmostEqualTo, they don’t work as expected.
An easy solution would be to have a node that joins 3 segments with same direction in one line, but this doesn’t exist, I am correct? Even when I join polycurves, Dynamo still recognize the previous subcurves

The tangent at endpoint of segment B is a vector approaching 0,-1,0. The tangent at parameter 0.5 of segment. C is 1,0,0. Ergo a change in plane.

The actual condition where the midpoint is parallel to the previous endpoint does exist though, not in simple lines and tangential arcs though (draw a speed bump in section, or a complex spline). Testing the start point and the endpoint would work in most simple geometries (misses splines). A comparison between the length of the curve and the distance between the start and endpoint can also help for that one.

That said, knowing that there are infinite tangent vectors on a curve, we might be able to pull non-linear curve start and endpoints as a inclusion method. Hard to say without knowing more of what @adnandj’s end game is though.

My bad, I was not precise enough in my example. What I meant was this (although it depends if we read/draw the curves from right to left or in the other way round):

I assumed the topic was related to find the non-smooth change of direction in a curve, like a cusp for example. In this case the only way is to analyze the direction of the curve at the point to find where, as in Mathematical Analysis is said, the directional derivative changes sign.

According to this definition I would classified the cases as follow:

Anyway the problem is a bit more complex, because it also depends on the drawing direction of the curve (end and start point might be messed up)

I perfectly agree

2 Likes

Hi @lucamanzoni and @JacobSmall,

thank you for your feedback. I had a little bit more of work and did not have time to play with Dynamo…

So more details about my use case…
I would like to analyse curves, which usually contains segments in different ways and lenghts (simple example attached in previous post).
With analyse I mean to divide a curve (to segment lenghts which is user input, to 90 angle corners and other corners).

STEPS (in my head):

  1. Define points on change of direction, start and end of curve
  2. Find corners with 90 deg and corners with different angle
  3. Create additional points on lines to fulfill parameter Max. lenght
  4. Connect points to create a new lnes
  5. Mark segment where is angle between segments different from 90 deg.

Thank you!
Adnan