Make a Face from TopoDS_Shape

Hi all,

I want to make a face from a TopoDS_Shape as in following code.

TopTools_ListOfShape list;
list = prism.Generated(ftop);
TopoDS_Shape SolidTopFace = list.First();

I want to convert SolidTopFace in to TopoDS_Face in order to display it. How can I do this?

gishara's picture

I have converted it using TopExp_Explorer.
But I am not clear about what the argument in prism.Generated(ftop) means. Can anyone explain?
Thanks a lot.

Fabian Hachenberg's picture

What do you mean by "make a face from a shape"? You have a reference to a TopoDS_Shape object, which is actually a TopoDS_Face object? Then you can simply cast it using

TopoDS_Shape shape = ...;
TopoDS_Face face = TopoDS::Face(shape);

WenBo Zhang's picture

but there are some exceptions of TypeMismatch;
do you have methods to solve it?