How to save multiple shapes?

Hi
If I have shape1, shape2, shapeN, how I can I put all these shapes into a shape (say shape_all) so that I can use BRepTools::Write(shape_all,"filename") to save all the shapes.

Thanks.

Sean

Patrik Mueller's picture

Hi, try something like this:

BRep_Builder builder;
TopoDS_Compound shapeCollector;
builder.MakeCompound(shapeCollector);
builder.Add(shapeCollector,shape1);
builder.Add(shapeCollector,shape2);
...
BRepTools::Write(shapeCollector,"filename")

Greets,

Patrik

PG's picture

Thanks Patrick.

But how do I retrieve those shapes again
after using BRepTools::Read() function
from the compound.

thanks
-PG

Patrik Mueller's picture

Hi,

how about using TopoDS_Iterator?

Greets,

Patrik