
Mon, 11/11/2013 - 21:42
Forums:
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.
Tue, 11/12/2013 - 22:57
Hello Sam,
CheckOut GCPnts_UniformAbscissa
BRepAdaptor_Curve curveAdaptor;
curveAdaptor.Initialize(yourEdge);
GCPnts_UniformAbscissa uniformAbscissa;
uniformAbscissa.Initialize(curveAdaptor, yourTolerance);
if(uniformAbscissa.IsDone())
{
}
Thu, 11/14/2013 - 02:17
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!
Thu, 11/14/2013 - 18:34
Hi Sam,
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,
Arjan
Fri, 11/15/2013 - 03:29
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!