Copying Curve2d object

Helllo everyone,

I am trying to make a copy of my AIS_Shape created from Geom2d_Curve, like this:

    gp_Pnt2d location(0.0, 0.0);
    gp_Circ2d circ2d(gp::OX2d(), 10.0);
    circ2d.SetLocation(location);

    double staangle = 10 * UB_PI / 180;
    double endangle = 100 * UB_PI / 180;

    Handle(Geom2d_TrimmedCurve) arc = GCE2d_MakeArcOfCircle(circ2d, staangle, endangle);
    Handle(AIS_Shape) shape = new AIS_Shape(BRepBuilderAPI_MakeEdge2d(arc));
   
    BRepBuilderAPI_Copy copy;
    copy.Perform(shape->Shape());

    Handle(AIS_Shape) shapeCopy = new AIS_Shape(copy.Shape());

  

But I can't see the copy. What am I doing wrong ?

Guido van Hilst not specified's picture

Are you sure both ais objects are not overlapping?

Guido van Hilst not specified's picture

Hello Anton,

I have tried and saw that a BRepLib::BuildCurve3d(shape) is required after BRepBuilderAPI_MakeEdge2d.

Here is an example:

MakeCurve2D

Best regards,

Guido

Anton Shabalin's picture

Thank you for your help!

It's really strange that we have to call BuildCurve3d, because I can see the object, but can not see the copy.

P.S. Your website is great! =) Good work!

Guido van Hilst not specified's picture

"It's really strange that we have to call BuildCurve3d, because I can see the object, but can not see the copy."

Yes indeed. Very dumb question: You are sure that you see the original, and not the copy, because they overlap?

"P.S. Your website is great! =) Good work!"

 Thanks!

Anton Shabalin's picture

Very dumb question: You are sure that you see the original, and not the copy, because they overlap?

Yes, I am sure.