Project VectDg onto a surface to get a 2D vector

Everything DG Kernel: Technical discussions and issues
Post Reply
Jim Herron
Posts: 1
Joined: Thu Nov 21, 2024 4:07 am

Project VectDg onto a surface to get a 2D vector

Post by Jim Herron »

Hello,

I have a vector in 3D space (VectDg) and I want to project it onto a IUVSurface_DG/IBRepFace_DG at a certain position. I can do this using VectDg n = IUVSurface_DG.GetNormal() and then use myVector.MakeOrtho(n).
Then I can use

Code: Select all

dirU = GetTangent(uv, true); dirV = GetTangent(uv, false);
Then du = myVector.Product(dirU) and dv = myVector.Product(dirV) will be the 2D coordinates of the projection in uv space.
Is there a simpler way?

Thank you for your answers,
Herron
Eric Rayner
Posts: 1
Joined: Thu Nov 21, 2024 4:38 am

Re: Project VectDg onto a surface to get a 2D vector

Post by Eric Rayner »

This should work. After the myVector.MakeOrtho(n) you vector will be tangential to the surface.

A little shorter way:

Code: Select all

IFrame_DG frame = IUVSurface_DG.GetUVAlignedFrame(uv);
VectDg vectTangential = frame.ToLocal(myVector);
vectTangential[0] and vectTangential[1] will be the coordinates in the parameters space.
Post Reply