
Tue, 05/10/2011 - 17:42
Forums:
I have a code:
BRepPrimAPI_MakeCylinder MKCyl(r, h);
TopoDS_Shape cyl = MKCyl.Shape();
...
BRepBuilderAPI_Transform aBRepTrsf(cyl, aTrsf);//some transformation
cyl = aBRepTrsf.Shape();
How can i get face of shape cyl?
I tryed to use:
TopoDS_Face face=TopoDS::Face(cyl); but it does not work,leading to a breakpoint.What can I do?
Tue, 05/10/2011 - 17:53
Hi Giogii,
Use for this TopExp_Explorer.
Take into account that the mentioned cylinder
has 3 faces (bottom, top and lateral).
Regards
Thu, 05/12/2011 - 11:00
Sorry,but i don't get how to use it,where can i find tutorial or smth.
Thu, 05/12/2011 - 12:48
Try this:
TopoDS_Shape cyl = MKCyl.Shape();
...
TopoDS_Face cylindricalFace;
for( TopExp_Explorer ex(cyl, TopAbs_FACE); ex.More(); ex.Next() )
{
TopoDS_Face currentFace = TopoDS::Face( ex.Current() );
BRepAdaptor_Surface brepAdaptorSurface( currentFace,Standard_True );
if( brepAdaptorSurface.GetType() == GeomAbs_Cylinder )
{
// be happy
cylindricalFace = currentFace;
break;
}
}
Cheers,
Dennis
Sat, 05/14/2011 - 12:23
Thank you!!