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)
Thanks
Rob Bachrach Fri, 01/23/2009 - 17:29
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.
Fri, 01/23/2009 - 17:29
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.
Rob
Fri, 01/23/2009 - 18:14
To make a copy of a shape you should use the class
BRepBuilderAPI_Copy.
Something like:
BRepBuilderAPI_Copy A;
A.Perform(aShape);
TopoDS_Shape ShapeCopy;
ShapeCopy=A.Shape();