GCPnts_UniformAbscissa issue

devdscm

CAD practitioner
Hello,
I would get discrete 3d points on a 3d Curve , using GCPnts_UniformAbscissa class.
I have built a 3d BSpline curve from array of points , using a call like this :
Handle(Geom_BSplineCurve) aBSplineCurve = aBSpline.Curve(); aBSpline comes from GeomAPI_PointsToBSpline.
So aBSplineCurve is an handle<Geom_Curve>
The costructor of GCPnts_UniformAbscissa accepts only "const Adaptor3d_Curve&"
My final question is :
How convert a 'const opencascade::handle<Geom_Curve> (aBSplineCurve) to a 'const Adaptor3d_Curve , to be used in GCPnts_UniformAbscissa ?
Thanks in advance
 

natalia

Moderator
Staff member
Hi @devdscm,

To know how to prepare some structure basing on some another structure, don't hesitate to try to find some example of doing this in OCCT sources.
For example, when I tried to find 'GCPnts_UniformAbscissa', the search gives me class 'BRepBuilderAPI_Sewing', where there is the next code:
C++:
{
  ...
  Handle(Geom_Curve) c3d;
  ...
  GeomAdaptor_Curve adapt(c3d);
  GCPnts_UniformAbscissa uniAbs(adapt, npt, first, last);
  ...
}

So, try to use the 'GeomAdaptor_Curve' class.

Regards, Natalia
 
Top