For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings

 

Need to speed up your development?
Have a look at our:

Samples & Tools

 

Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Related pages

Break a Wire

RicePotato2006's picture
Forums: 

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?

Contact us

Attention: DO NOT use this form for all kind of request for the removal of your personal data. Please follow this link for such cases.