Copy Shape

Hi, how can I copy a shape with all its subshapes so that when I modify or transform the new shape, original shape is not affected. (no referenced subshapes, all copied)

Rob Bachrach's picture

Technically, your original shape is never "affected" when you transform a copy:

TopoDS_Shape newShape = oldShape;

The transform simply changes the location of the new shape, but the referenced geometry remains the same.

You can also try using BRepBuilderAPI_GTransform. This will actually create a new, transformed geometry and will not just change the location within the TopoDS_Shape.


gianni's picture

To make a copy of a shape you should use the class

Something like:

BRepBuilderAPI_Copy A;
TopoDS_Shape ShapeCopy;