Confused about shells

Hi,

I'm confused about what a shell is exactly. The documentation tells me that BRepBuilderAPI_MakeShell can be used to make a shell from a set of faces. But when I look at the constructor for MakeShell it asks for a surface not a face and it looks like it just wants one surface. Do I some how make a big suface out of my set of faces? Does anyone have a sample of code showing how to use BRepBuilderAPI_MakeShell to create a shell from a set of faces?

Thanks.

Cathy

Michael Sazonov's picture

Hi Cathy,

The documentation tells that "MakeShell breaks down the surface into several faces which are all C2 continuous". So if you have faces to compose to a shell this class is not suitable for you.

If you are sure that all the faces are sewed together (each pair of neighboring faces has common shared edges along the border) then you may use the low-level class BRep_Builder to make the empty shell and to add your faces to the new shell.

Otherwise you should use the class BRepOffsetAPI_Sewing to generate the new shell with your faces sewed.

Best regards, Michael

Cathy Roberts's picture

Thanks for the info but I'm still confused. I looked at the BRep_Builder class and the BRepOffsetAPI_Sewing class and could not find anyway to pass my TopoDS_Face entities to them to make a shell. I really think I am missing some key point in the OpenCascade data structure but I can't seem to get it by reading and rereading the documentation. Is my problem that you just can't make a shell from TopoDS_Face variables? The Sewing class seems to want to sew together TopDS_Shapes not faces. Or if I have a Face is there some way to extract a Shape from it???

Cathy

Nagarajan's picture

Hi Cathy,
I am also having the exact problem you had, ie making shell from faces. I hope you would have resolved it by now.

Please help me out, ow to do that.
Thanks.

Gerhard Hofmann's picture

Hi Cathy,
a TopoDS_Face is a (special kind of) a TopoDS_Shape. TopoDS_Shape is the base class. So if a function needs a TopoDS_Shape, you can give it any TopoDS_* object. The Sewing class probably sews all kind of objects, not only faces.
best regards, Gerhard

Andras's picture

Hi all,

You may try this. It work just fine in my case.

BRepOffsetAPI_Sewing SEW;
TopoDS_Shell SHELL;

TopoDS_Face aFace = YourFace;
while (aFace)
{
if(!aFace.IsNull())
SEW.Add(aFace);
aFace = YourNextFace;
};

//create the shell
SEW.Perform();

//Check if the sewed shape is TopAbs_SHELL type
//be care because if you have only one face the returned type
//will be TopoDS_Face :(
if(SEW.SewedShape().ShapeType() == TopAbs_SHELL)
{
//retrieve the TopoDS_Shell from the SEW
SHELL = TopoDS::Shell(SEW.SewedShape());
}

//display in the context
if(display)
{
Handle (AIS_Shape) aShell = new AIS_Shape(SHELL);
theContext->Display(aShell, Standard_True);
}

Shizhou Luo's picture

My advisor also asked me to make a shell out of two surfaces without using the sewing function. He required a bottome-up technique to bulid this. I am now also confused about the BRepBuilderAPI_MakeShell function which only allows add one surface in it!