Break a Wire

Hi all,

I have a wire, and I want to break it at any given point on the wire. I did the following, but it gave me the same result. anyone have idea what I did wrong?
please give me some advise. thanks a lot!!

TopoDS_Wire aWire=TopoDS::Wire(aShape);//aShape);
BRepAdaptor_CompCurve wireAdpt(aWire,1);
Handle_BRepAdaptor_HCompCurve aCurve= new BRepAdaptor_HCompCurve(wireAdpt);
Approx_Curve3d approx(aCurve,0.000001,GeomAbs_C2,500,1);

if(approx.IsDone() && approx.HasResult())
{
Handle_Geom_Curve aApproxCurve=approx.Curve();
First=aApproxCurve->FirstParameter();
Last=aApproxCurve->LastParameter();
GeomAPI_ProjectPointOnCurve myPrj(myPoint1,aApproxCurve);

Standard_Real bp;
myPrj.Parameter(1,bp);

if(myPrj.NbPoints()!=0)
{
Handle(Geom_TrimmedCurve) tCurve = new Geom_TrimmedCurve(aApproxCurve, First, Last);
tCurve->SetTrim (First,bp,Standard_True);
Handle(Geom_Curve) dCurve1=tCurve->BasisCurve();
TopoDS_Edge fE1=BRepBuilderAPI_MakeEdge(dCurve1);
Display(fE1);
}
}

(the wire is still the same...)

DeleDivaneeh's picture

What is the solution?Does anybody solve this?