Everything DG Kernel: Technical discussions and issues
Jim Herron
Posts: 1 Joined: Thu Nov 21, 2024 4:07 am
Post
by Jim Herron » Thu Nov 21, 2024 4:22 am
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
Post
by Eric Rayner » Thu Nov 21, 2024 4:44 am
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.