# Tangent and Perpendicular vectors at point on NURBS

## Recommended Posts

Hello,

I am trying to get extract the tangents at certain points located on a NURBS curve.

I cannot seem to find a "Get tangent at Point on curve" node

The idea, is to then use this tangent vector to set the orientation of objects located along (and tangent) to the curve.

Thank you.

Jean

I do love this question!

I don't have a great solution for this though.

I can tell you, there is a node for 2D polys which will allow you to get the point and the tangent vector to that point... which I know isn't really what you're looking for. I thought it might work for 3D polys because it returns a 3D point and 3D vector, but it failed when I tested it. It does return correct values if you use a 2D poly as the input, though.

I'll keep looking to see, but since NURBS are often interpolated, I don't know the best way to go about it at the moment. It doesn't look like there's a predefined function for this in Vectorscript.

Edited by MarissaF

Hi Marissa,

Thank you for your reply. I was curious about how the Shell node works then, because in order to produce a shell from a surface it must find the local perpendicular vector to the NURBS surface, doesn't it? Then if it is possible to find the vector perpendicular to a surface, finding the tangent to a contour curve taken on that NURBS isn't too much of a stretch.

Mhh, I will keep digging... Worst case scenario, I can always draw a line between two points located on either side and extremely close to the point I am trying to analyze and get an approximate tangent from there.

I think I will start digging into the Shell node definition first though.

Thanks!

Edited by jeandm

Marissa,

I am very thrown off by the fact that a 2 dimensional object located in 3d space is does not seem to be interpreted as a planar object.. is that correct?

Planar does not mean in XY plane.. It means contained in a plane somewhere in 3d space. It seems that vectorworks can only perform a lot of the operations on objects that are located only in the XY plane and is not able to switch to local systems to perform in 3d space on 2dimensional objects. It seems very cumbersome to have to convert the geometry back and forth.

Contours for example are 2D objects which exist in space.

Edited by jeandm

Could you give me an example of what you're trying to accomplish? Vectorworks is generally able to work with planar objects in any orientation as long as you approach it from the right mindset.

Marionette is also usually able to accomplish the same things, sometimes it takes a little more thought though.

I'm more than happy to try to help you out with whatever you're trying to do.

For sure! Yes, I think I am having a hard time grasping the 2D-3D workflow in VW.

I attached a small definition below.

Basically, I have a base NURBS surface, from which I extract the contours. Then, I would like to distribute a set number of squares along these contours (same number of squares on each contour) and have one side of the squares oriented tangent to the contour.

So, where I am having trouble is to orient a 2 dimensional polygon in 3D to be normal to have one of its sides tangent to the contour line.

Thank you!

Edited by jeandm

Hi,

Look at this post down the bottom and DomC produced a CW node and I used it in the stair networks that will do what you want i think.

HTH

Also not sure if you are wanting to place platforms like this.

Refer attached.

Edited by Alan Woodwell

If you chop up the NURBS into a lot of points, you can calculate the tangent yourself.

Just create a direction vector based on

`dir = next-current point`

. Normalize it and place it on the current point.

calculating the perp is also manually possible, but you need to choose a plane as in 3D you have unlimited perp vectors.

Hi,

This places the surfaces at right angles to the curves.

courtesy of DomC's nodes.

HTH

Thank you all for your help! I am currently looking into all these.

it seems pretty heavy handed though considering Marionette is technically able to extract a local perpendicular plane to a NUBRS surface, as it is able to SHELL it.

We need a node where you simply feed in a NURBS and a point on the NURBS and it returns a 3d vector normal to the surface for which you can specify a direction. There is no need for any other parameter really.

It seems that there is a lot of 2D-3D back and forth because of the 2D oriented nature of Vectorworks. When modeling, there is no difference between x, y and z and the Top/plan view seems kind of reductive for marionette.

On a surface you should be able to use the "Point On Surface" node.

for the inputs:

surface = handle to surface

dir = (u,v)

outputs:

pt3D = the 3D point at that respective place

normal = 3D vector normal to the surface at that point

You originally asked about a curve, which there isn't a good response to.

Hope this helps.

(I haven't checked the results for total accuracy)

Thank you Marissa,

I tried this node, but I am struggling to remap the domain and get the (U,V) for specific points on the NURBS surface. I cannot seem to find a node that takes a 3d point as input and returns the closest point on the surface with its UVs.

Thank you.

J

Does anyone know if there is a way to convert a contour into a 2D bezier curve. Since a contour is by definition 2 dimensional, it should be possible to convert it into a 2D curve and then use the "Get Point On Poly" on it? Am I missing something?

I cannot seem to find much 2D curve functions in Marionette, is that normal?

Thank you.

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

×   Pasted as rich text.   Restore formatting

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×