I want to get all the planes of a shape.But the explore can only iterate the faces.However,the face may be a curved face or a plane.How can I make this difference?
Any advices will be appreciated!
Stephane Routelous Thu, 11/07/2002 - 06:00
TopoDS_Face theFace = GetFaceFromIterator(); //pseudo-code
Handle_Geom_Surface theSurface = BRep_Tool::Surface(theFace);
if ( theSurface->IsKind(STANDARD_TYPE(Geom_Plane)))
{
//THIS IS A PLANE
}
this code will get you all the planes. But take care ! You could have a planar face describe as a BSpolineSurface for example !
Thanks for your earnest!
But IsKind() is not the method of TopoDS_Shape.
I use try{}catch{} to tell the user to select a flat plane.
I downcast Geom_Surface to Geom_Plane.If the surface is not a plane,the exception will be throwed!
Thu, 11/07/2002 - 06:00
TopoDS_Face theFace = GetFaceFromIterator(); //pseudo-code
Handle_Geom_Surface theSurface = BRep_Tool::Surface(theFace);
if ( theSurface->IsKind(STANDARD_TYPE(Geom_Plane)))
{
//THIS IS A PLANE
}
this code will get you all the planes. But take care ! You could have a planar face describe as a BSpolineSurface for example !
HTH
Fri, 11/08/2002 - 16:56
Thanks for your earnest!
But IsKind() is not the method of TopoDS_Shape.
I use try{}catch{} to tell the user to select a flat plane.
I downcast Geom_Surface to Geom_Plane.If the surface is not a plane,the exception will be throwed!
Fri, 11/08/2002 - 17:03
Sorry!
You are right!
Best regards!