Jump to content
Developer Wiki and Function Reference Links ×

Tangent and Perpendicular vectors at point on NURBS


jeandm

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

Link to comment
  • Marionette Maven

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
Link to comment

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
Link to comment

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.

Your thoughts?

Edited by jeandm
Link to comment
  • Marionette Maven

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.

Link to comment

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
Link to comment

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.

Link to comment

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.

Link to comment
  • Marionette Maven

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)

Link to comment

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

Link to comment

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.

Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

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

×
×
  • Create New...