get edges from a surface

hello,
i want to get the edges from a cylinder(gp_Cylinder); can you give me a hint?
Thank you for your attentation!

Fabian Hachenberg's picture

Have a look at TopExp_Explorer. It allows to iterate over specific subshapes.

TopExp_Explorer ex;
ex.Init(face, TopAbs_EDGE, 0)
for(;ex.More(); ex.Next())
{
...
}

hr's picture

I want to konw how can i translate the gp_Cylinder to face,
gp_cylinder clinder;
TopDs_Face face=....

Fabian Hachenberg's picture

Use
BRepPrimAPI_MakeCylinder
if you want to create a face on an infinite cylindrical surface

You can also create a cylinder primitive including the upper und lower circular planes via
BRepPrimAPI_MakeOneAxis

Fabian Hachenberg's picture

whoops, sorry

use
BRepBuilderAPI_MakeFace
for the face on the cylindrical surface and

use
BRepPrimAPI_MakeCylinder
to create a cylinder primitive