Deep coopy on TopoDS_Shape

Does anybody know how to make a deepcopy of shape TopoDS_Shape? Any code snippets..

Stephane Routelous's picture

a looong time ago, I was trying to do that ( maybe with BRepBuilerAPI_Copy ? I don't remember ) but it was not working as expected.
Some topological or geometrical elements were still shared and not deep copied.

The only solution I found at that time was to write + read the shape to/from a file or stream with BRepTools::Write and BRepTools::Read

but maybe the problem was fixed or some new or lower level method are available somewhere else.


gianni's picture

In my application I have some threads that need to work on the same shape and I make a copy to avoid conflicts. I use BRepBuilderAPI_Copy
and it works very well.

Here is a code snippet
BRepBuilderAPI_Copy Builder;

TopoDS_Shape aShape;
aShape = aSequence1->Value(i);
aSequence2->Append(Builder.Shape() );