Wire Approximation

Hi All,
Is there any way to approximate a closed TopoDS_Wire with a smooth curve?
Regards,
Akbari

Roman Lygin's picture

Hi Akbari,

I would consider using Approx_Curve3d and feeding it with an adaptor based on BRepAdaptor_CompCurve() that accepts your wire.

HTH.
Roman

akbari1358_31365's picture

Hi Roman,
Thank you for your response.
I use the following code to convert two wire to closed bspline-curve.
and one of them is inside the other one.
I want to make a parametric ruled surface between them, But it makes an unexpected face. Its due to their parametrization. I reverse the parametrization of one curve but it dont do any good.
I mean the first point(u=0) of them are too far from each other.
Is there any way to change the parametrization of one curve so that the first point of them be close to each other?
Regards,
Akbari

------------------------------
TopoDS_Wire F;
TopLoc_Location location;
BRepAdaptor_CompCurve AdaptedWire(F);
Standard_Real First,Last;
First=AdaptedWire.FirstParameter() ;
Last=AdaptedWire.LastParameter ();
Handle_Adaptor3d_HCurve AdaptedCurve=AdaptedWire.Trim(First,Last,0.000001);
Approx_Curve3d ApproxCurve(AdaptedCurve,0.000001,GeomAbs_C2,10000,8);
Handle_Geom_BSplineCurve myCurve1=ApproxCurve.Curve();
// my curve2 will made by above procedure

//now make a ruled surface
Handle(Geom_Surface) Surface =GeomFill::Surface(myCurve1,myCurve2);