Who can tell me how get the face's type such as plane or cylind?
thanks
Miguel Costa Tue, 08/08/2006 - 07:30
Hi Wanghs,
This is how I did it. It hope it can help you somehow. Starting with a TopoDS_Shape theShape that is supposes to be a TopoDS_Face (i.e. theShape.ShapeType() == TopAbs_FACE)
if(theTypeElement==GeomAbs_Cylinder)//Si le type de surface est un cylindre
{
gp_Cylinder theCylinder= aFaceElementAdaptor.Cylinder();
//Get the data on the cylinder using the gp_Cylinder functions
}
else if(theTypeElement==GeomAbs_Plane
{
gp_Pln thePlane= aFaceElementAdaptor.Plane();
//Get the data on the plane using the gp_Pln functions
}
I hope I understood your question and I hope this could help you. You may also search the forum, many others said very useful thing on that subject.
Tue, 08/08/2006 - 07:30
Hi Wanghs,
This is how I did it. It hope it can help you somehow. Starting with a TopoDS_Shape theShape that is supposes to be a TopoDS_Face (i.e. theShape.ShapeType() == TopAbs_FACE)
TopoDS_Face aFaceElement= TopoDS::Face(Face);
BRepAdaptor_Surface aFaceElementAdaptor(aFaceElement, true);
GeomAbs_SurfaceType theTypeElement= aFaceElementAdaptor.GetType();
if(theTypeElement==GeomAbs_Cylinder)//Si le type de surface est un cylindre
{
gp_Cylinder theCylinder= aFaceElementAdaptor.Cylinder();
//Get the data on the cylinder using the gp_Cylinder functions
}
else if(theTypeElement==GeomAbs_Plane
{
gp_Pln thePlane= aFaceElementAdaptor.Plane();
//Get the data on the plane using the gp_Pln functions
}
I hope I understood your question and I hope this could help you. You may also search the forum, many others said very useful thing on that subject.
Miguel
Fri, 08/11/2006 - 11:11
thanks