Thu, 03/25/2004 - 11:23
Forums:
Hello,
I want to convert a TopoDS_Shape into a TopoDS_Edge. So I use the following instructions :
Handle (TopoDS_TEdge) newEdge= Handle (TopoDS_TEdge) :: DownCast (oldShape);
or
Handle (PTopoDS_TEdge) newEdge= Handle (PTopoDS_TEdge) :: DownCast (oldShape);
or
Handle (PTopoDS_TEdge1) newEdge= Handle (PTopoDS_TEdge1) :: DownCast (oldShape);
And I have include the following librairie :
#include "Handle_TopoDS_TEdge.hxx"
#include "Handle_PTopoDS_TEdge.hxx"
#include "Handle_PTopoDS_TEdge1.hxx"
But none of those commands work.
Do you have an Idea ?
Thanks for your attention
Jean-Sébastien Klein Meyer
Thu, 03/25/2004 - 13:53
Hi
Try this.
TopoDS_Edge newEdge;
if (oldShape.ShapeType()==TopAbs_EDGE)
newEdge=TopoDS::Edge(oldShape);
Joe
Thu, 03/25/2004 - 15:33
hey,
thanks for your idea, unfortunately it doesn't work :
if (oldShape.ShapeType()==TopAbs_EDGE))
--> this expression is always "false
Jean-Sébastien Klein Meyer
Thu, 03/25/2004 - 23:44
see if this works:
TopoDS_Shape myShape = ...;
.
.
.
for (TopExp_Explorer exp (myShape,TopAbs_Edge);exp.More();exp.Next())
{
TopoDS_Edge aCurrentEdge = TopoDS::Edge(exp.Current());
// do whatever with this edge
}
-vivek
Mon, 10/09/2023 - 09:52
Hi, JSKM! It's been a long time since you post your question.
Have you put the "#include <TopoDS.hxx>" header file at the beginning?
This is my code segment and it works:
TopExp_Explorer edgeExp1(topoNURBSSurface1, TopAbs_EDGE);
TopoDS_Edge surface1_edge1 = TopoDS::Edge(edgeExp1.Current());
Best Regards!