DiscussionsIssue archiveOther usage issues

Archived discussion

iterate face

Other usage issuesThu, 11/07/2002 - 05:023 replies

Browse this forum
QuestionAuthor

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!

Discussion

3 archived replies

Posts are displayed in their archived order.

01Commenter-1

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

02Author

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!

03Author

Sorry!
You are right!

Best regards!