Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 4159

Moving a point using an existing vector3d but changing its length?

$
0
0

So my code has a vector that I already created (from a centroid to a specific curve), now I want a point in the middle of that curve to move back using the same vector (aka direction), but not to the same exact point (a different length).

I’m a lot more fluent with using simple Grasshopper tools, and I would just reverse the vector (which I did with .Reverse() ) and then use the component “Amplitude” to designate a new length for the vector and “Move” command, but I can’t seem to find the same workaround in rhinocommon…

This is where I’m at:

    #Front Curve Middle
    midFrCrv = frontCrv.PointAt(0.5)
    vecChange = vectorY
    vecChange.Reverse()
    midFrCrv = rg.Point3d.Add(midFrCrv, vecChange)

vectorY being the original vector of course.

Hope I was clear enough…
Thanks!

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 4159

Latest Images

Trending Articles



Latest Images