Get direction(gp_Dir) from TopoDS_Edge

Hello,

I am trying to get direction (gp_Dir) from TopoDS_Edge object. Is there any way to do it?

Thanks,
Prajwal

Mikhail Sazonov's picture

Edge may have non-linear form. In that case the dir may be different along the edge. Do you know the curve parameter at which you need the dir?

Prajwal Shelar's picture

Hi Mikhail,
Thanks for the reply.
I am assuming my selected edge will be in linear form. How can we achieve it for this condition? I found one solution for this case: Get the vertices at ends and then get their coordinates (gp_Pnt) and finally get a vector (gp_Vec) from these points. Can there be any other solution?
Thanks,
Prajwal.

Mikhail Sazonov's picture

Yes, you can get 3D curve of the edge, and get derivative D1 at the parameter of, let's say, the beginning.

 

Prajwal Shelar's picture

Okay. Thanks Mikhail!