
Tue, 09/12/2006 - 18:13
Forums:
Hello,
I have a problem with GCPnts_AbscissaPoint. It should compute 100 points on a curve, but it does compute 101 points. Here is the code example:
GeomAdaptor_Curve acrv(crv);
TColgp_Array1OfPnt pkte(1, 100);
GCPnts_UniformAbscissa algo(acrv, 100);
if(algo.IsDone() && algo.NbPoints() > 0)
{
int n = algo.NbPoints();
...
}
The last two points are equal. Does anybody knows this problem and has found a solution?
Regards,
Gernot
Thu, 09/14/2006 - 14:07
I have not solved this problem, but I found, that it will only occur if the curve has been interpolated from exactly 100 points.
Fri, 10/12/2007 - 09:08
Hello
I also used GCPnts_* class to compute uniform distribution of
points on an ellipse.
If I create an ellipse with major/minor as 100/50 units, the
API computes 10 points if I want 10 points.
But if the ellipse becomes sharper i.e make an ellipse with
100/15 units, the function 'NbPoints' computes 11 points
instead of required 10.
I checked the parameter of 10 and 11th point, it is
6.28317 and 6.28319 respectively.
Theoretically the last/10th point parameter should have been 6.28318 and no 11th point to be created.
Is it a bug or is there an alternative API which is better than
GCPnts_* class ?