Help, Geom_Curve => TopoDS_Edge for display ?

We can convert the TopoDS_Edge to the Geom_Curve by using of BRepTool::Edge(). However how can we convert inversely the Geom_Curve to TopoDS_Edge for display. Thanks

Hugues Delorme's picture

I think you have to recreate a topologic edge, use class BRepBuilderAPI_MakeEdge for that.
It may be better to keep a mapping between curves and edges for your application, a std::map for example.

tmacedo29's picture

Hi Jun,

try to use void BRep_Builder::MakeEdge(TopoDS_Edge& E,
const Handle(Geom_Curve)& C,
const Standard_Real Tol)const

Regards,

Jun WANG's picture

Hi, Thiago Macedo. Do you konw what is the difference between "BRepBuilderAPI_MakeEdge" and "BRep_Builder::MakeEdge". In addition, what should I set the third parameter "onst Standard_Real Tol" in your BRep_Builder::MakeEdge, maybe be "1.0e-7"? Thanks a lot.

tmacedo29's picture

Hi Jun WANG,

the third parameter is Tolerance, you can use any value you want! =)

About the difference between BRepBuilderAPI and BRep_Builder I don't know. I read somethings here in Forum about performance, but I don't have a exact answer. But wait, maybe some OCCT developer answer soon.

Regards,

Jun WANG's picture

Hi, Thiago Macedo, the parameter is set as "1e-7" and the API works well. Thanks a lot.