C# get normals of CVs

(HEXAGON) #1

Hey there,

i have got a question about the control vertices of a curve. I want to get the normals of the CVs but i don’t know the C# command. I think there must be a command because you can actually move the CVs in Rhino along thier normals. Sadly i’m a beginner but i hope that i discribed my problem properly.

In the meantime i will continue with searching for a solution. If i find a solution i will post it here.

0 Likes

(David Rutten) #2

Curve have normal planes and tangent vectors, however control-points are often not on the curve so they cannot really be said to have normal planes. Or do you mean the vector which is perpendicular to the control-polygon segments adjacent to the control-point? If so, then control-points between co-linear segments and the first and last control-points do not have well defined normals.

0 Likes

(HEXAGON) #3

Thanks for the quick answer!

I think i meant the first one:

But yeah, i got what you said. (would have been too easy)

The “normals” are actually the active/relative perpendiculars to their belonging curv-segments, right? So they are changing everytime i move the CVs. I think i can calculate them with the cooardinates from the CVs and their shortest distance to their segments and then turning the distances into vectors.

0 Likes

(David Rutten) #4

Some unrelated part of the curve may be closer to a control point than the point on the curve to which it most ‘belongs’. You however can get the greville parameter on a NurbsCurve which is the parameter associated with a specific control-point.

0 Likes

(HEXAGON) #5

Oh, yes i remember. There is a difference between “shortest distance” and the “sought distance”!

0 Likes

(HEXAGON) #6

Hi David,
I just had a little break but now im back and going on to solve my task…

Unfortunatly i discovered that i don’t really know what to do with the greville points to get the “normal” vectors to the control points. As you wrote the greville points are only segmenting the nurbs curve but are not the anchor/gravity point from the cpt on the crv.

I used the “moveUVN” command from rhino to move the cpt in normal direction and created manually in rhino the anchor pt on the curve. (And was then able to calculate a 2ptVec in Gh but that’s just a workaround and not a solution) But i don’t know how to calculate it in Grasshopper…

Can you please give me another tip?

0 Likes

(HEXAGON) #7

Well, I contacted @dale some time ago and he kindly replied with this forum post with his code. I have already tested the code and obtained the same results as with the Rhino-MoveUVN component. Unfortunately I’m not allowed to post my component in this forum…

Here the link to his Code:

0 Likes