DiscussionsIssue archiveOther usage issues

Archived discussion

Getting geometric points from TopoDS_Edge

Other usage issuesMon, 11/11/2013 - 21:424 replies

Browse this forum
QuestionAuthor

Is there a way to get the geometric points from a curved TopoDS_Edge? I know I can use TopExp_Explorer to get the endpoints, but I want to get the geometric coordinates of a series of intermediate points by a certain tolerance.

Discussion

4 archived replies

Posts are displayed in their archived order.

01Commenter-1

Hello Author,

CheckOut GCPnts_UniformAbscissa

BRepAdaptor_Curve curveAdaptor;
curveAdaptor.Initialize(yourEdge);

GCPnts_UniformAbscissa uniformAbscissa;
uniformAbscissa.Initialize(curveAdaptor, yourTolerance);

if(uniformAbscissa.IsDone())
{
}

02Author

Hi Arjan,

I think I'm missing something. Are there any initializers which take only the curve adaptor and the tolerance? It looks like they all require either a NbPoints value or Abscissa value; I don't know ahead of time how many points I want (I need them within a physical tolerance, however many that requires), nor do I understand what the Abscissa value would be.

However if I understand correctly, could I then get the points out via something like this?

Standard_Real parameter = uniformAbscissa.Parameter(i);
gp_Pnt p = curveAdaptor.Value(parameter);

Thanks!

03Commenter-1

Hi Author,

My mistake, I confused tolerance with abscissa.

If you use it like,

GCPnts_UniformAbscissa uniformAbscissa;
uniformAbscissa.Initialize(curveAdaptor, 5.0);

it will generate points evenly spaced at 5mm along your edge.

You then loop through the number of generated points.

Kind Regards,

Commenter-1

04Author

Hi Arjan,

That makes sense, but what's the call to get each point out? The function "Parameter" returns a double/Standard_Real, but I don't really understand what it's in terms of- is it a U or V parameter I can use to get a point? Is there a function I'm missing that returns a geometric point?

Thanks!