Convert closed Shell to Solid

Hi everyone:
I have a question about how to convert a closed shell to a solid.

By doing following steps, I get a Shape.

BRepBuilderAPI_Sewing sew;
sew.Add(face1);
sew.Add(face2);
sew.Add(face3);
sew.Add(face4);
sew.Add(face5);
sew.Add(face6); // face1 to face6 form a closed space

sew.Perform();

TopoDS_Shape sew_shape=sew.SewedShape();

When I print sew_shape.ShapeType(), it returns 3 (Shell).

How can I convert sew)shape to a solid? (i.e. sew_shape.ShapeType() can return 2)

Thanks.

Sean

Thomas Paviot's picture

Hi Sean,

You can use the BRepBuilderAPI_MakeSolid class.

Just pass your shell to the .Add method, then get the result from the .Solid() method (it returns a TopoDS_Solid shape type).

Regards,

Thomas

seanliu's picture

Hi Thomas:
Thanks. It works.
I have another question about converting the shell to solid.
If the shell I have doesn't form a closed space, I still can convert the shell into a solid. Why is that?

Thanks.

Sean

Cesar A. Rivas's picture

Sean,

you need to check if there are open edges, by using the method "NbFreeEdges()"

regards,