Fri, 03/04/2011 - 07:51
Forums:
Hi. I make a face object made of lots of edge. I want to calculate normal vector to each edge. In my opinion, To caclulate it, maybe need the information about the each edge direction or vector. so I use the TopExp_Explorer class.
TopExp_Explorer a;
for(a.Init(TopoDSShape, TopAbs_Vertex); a.More(); a.Next())
{
TopoDS_Shape CurrentShape = a.Current();
..
..
..
}
so. I Get the CurrentShape. But I don't know how to convert TopoDS_Vertex to gp_Pnt.
If there is no way to convert, would you suggest a idea ?
have a nice day
Fri, 03/04/2011 - 10:33
def vertex2pnt(vertex):
'''returns a gp_Pnt from a TopoDS_Vertex
'''
from OCC.BRep import BRep_Tool
return BRep_Tool.Pnt(vertex)
Fri, 03/04/2011 - 12:05
Thanks alot.
using this method, i can make a gp_Vec or gp_Dir.
Yeon cheol
Tue, 08/30/2016 - 09:34
Hi,
if you have already the faces belonging to the the edges, you can also try the static methods of TopOpeBRepBuild_Tools class:
or:
look also in the docs.
nice day
H1