Face and Edges after rotation

Hi,
May i Ask for help with Face after rotation and moving? It creates new object Face and it lost information which Edge before is Edge after.
How to distinguish them, and know which is which?
Thank you for help
Piotr

Dmitrii Pasukhin's picture

Hello,  how are you apply transformation?
TopoDS_Face aFace = ...;

aFace.Move(gp_Trsf());

or BRepBuiladerAPI_Transform?

Best regards, Dmitrii.

Piotr Dusiński's picture

I do it by transform object BRepBuiladerAPI_Transform, am i rights?

Mikhail Sazonov's picture

If you apply just rotation/translation transformation then it is enough to create an object TopLoc_Location and use it to transform the shape. Your "edge before" is not modified, except for its moving using the same location object. So, in order to obtain the "edge after" you need to do smth like this:

TopoDS_Shape shape = ...;
TopoDS_Edge edgeBefore = TopExp_Explorer(shape, TopAbs_EDGE).Current();
gp_Trsf trsf = ...;
TopLoc_Location loc(trsf);
TopoDS_Shape shapeTransformed = shape.Moved(loc);
TopoDS_Edge edgeAfter = TopoDS::Edge(edgeBefore.Moved(loc));

If you need to create a fully separate shape not sharing the geometry with the initial one you have to use BRepBuilderAPI_Transform with the option copyGeom = true. In this case you need to use the Modified() method of BRepBuilderAPI_Transform to obtain the "edgeAfter".

Piotr Dusiński's picture

Thank you,
Can i do it simpler for TopoDS_FACE after, I want for all Edges before a list of Edges after?
Or do i need repeat transformation for each Edges?
Also for TopoDS_Edge edgeAfter i need real edge which belongs to faceAfter.

Piotr