DiscussionsIssue archiveOther usage issues

Archived discussion

Copy Shape

Other usage issuesFri, 01/23/2009 - 17:062 replies

Browse this forum
QuestionAuthor

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

Discussion

2 archived replies

Posts are displayed in their archived order.

01Commenter-1

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.

Commenter-1

02Commenter-2

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();