PLib_JacobiPolynomial_Data.pxx

I dont know where W(t) data come from.
When Gauss Point Number is 20, They are as following from book:
GaussPoint = [0.076526521133497338312 0.2277858511416450682 0.37370608871541954876 0.5108670019508271265 0.63605368072651502498 0.74633190646015079572 0.83911697182221878233 0.91223442825132594614 0.96397192727791380928 0.99312859918509488466];
GuassWeight = [0.15275338713072586505 0.14917298647260374134 0.14209610931838206893 0.13168863844917663708 0.11819453196151842589 0.10193011981724042769 0.083276741576704782499 0.062672048334109053958 0.040601429800386917846 0.017614007139152162984];

In OCCT The weights data from PLib_JacobiPolynomial_Data.pxx, iorder = 1, They are as following:
W(t) = [ 0.167465158656542995065379389214204e+00 0.148746322297449425576468624738889e+00 0.116670620232278307010412953362970e+00 0.797792590619282915161661357102545e-01 0.464838874609574251788319199857504e-01 0.221882523544627736582311661494119e-01 0.808720005775368665825997856607112e-02 0.195812233998606140901321601241170e-02 0.225491011563304401158935013021125e-03 0.366483703933378281051040317914262e-05 ]
...
...

PLib_JacobiPolynomial.hxx say as follwoing
//! This class provides method to work with Jacobi Polynomials
//! relatively to an order of constraint
//! q = myWorkDegree-2*(myNivConstr+1)
//! Jk(t) for k=0,q compose the Jacobi Polynomial base relatively to the weight W(t)
//! iorder is the integer value for the constraints:
//! iorder = 0 <=> ConstraintOrder = GeomAbs_C0
//! iorder = 1 <=> ConstraintOrder = GeomAbs_C1
//! iorder = 2 <=> ConstraintOrder = GeomAbs_C2
//! P(t) = R(t) + W(t) * Q(t) Where W(t) = (1-t**2)**(2*iordre+2)

Dmitrii Pasukhin's picture

Hello.

Could you please specify a question or faced issue?

Best regards, Dmitrii.

Eric Pang's picture

Thanks for your reply.
Suppose I encounter the following problem:
An arc represented precisely with Nurbs, It would have weights. Now I want to approximate with bspline.
AdvApprox_SimpleApprox would be called in OCCT.
PLib_JacobiPolynomial would be used. I could find Gauss Point Number is 20 through debugging. I could find GaussPoint and the GuassWeight from the references. But I couldnot find where the data come from in PLib_JacobiPolynomial_Data.pxx.
The comments say they come from the formular as following: W(t) = (1-t**2)**(2*iordre+2). But I still couldnot compute them correctly. Could you help me?

Dmitrii Pasukhin's picture

Could you share a code sample if something in output is invalid.

Or are you investigating the algorithm logic from mathematics point of view?

Best regards, Dmitrii.

Eric Pang's picture

Thanks for your reply.
I want to know how to get the data in the PLib_JacobiPolynomial_Data.pxx. I guess they come from the formular. But I donnot know it.
Yes, I am investigating the approximating algorithm logic.
The extraction of the Gauss Weights is in the file AdvApprox_SimpleApprox.cxx. They are as following:
myTabPoints = new TColStd_HArray1OfReal(0, NbGaussPoints / 2);
JacobiBase->Points(NbGaussPoints, myTabPoints->ChangeArray1());

// the extraction of the Gauss Weights
myTabWeights = new TColStd_HArray2OfReal(0, NbGaussPoints / 2, 0, DegreeQ);
JacobiBase->Weights(NbGaussPoints, myTabWeights->ChangeArray2());

The sample code maybe like the following:
#include <fstream>
#include <iostream>
#include <sstream>
#include <vector>
#include <string>

#include "gp_Pnt.hxx"
#include "gp_Ax2.hxx"
#include "gp_Circ.hxx"
#include "GC_MakeArcOfCircle.hxx"
#include "Geom_TrimmedCurve.hxx"
#include "GeomConvert_ApproxCurve.hxx"

int main(int argc, char *argv[])
{
gp_Pnt center(0,0,0);
gp_Ax2 axis(center, gp::DZ(), gp::DX());
gp_Circ circle(axis, 10);
GC_MakeArcOfCircle makeArc(circle, 0, M_PI, Standard_True);
Handle(Geom_TrimmedCurve) curve = makeArc.Value();

Handle (Geom_BSplineCurve) TheCurve;
Standard_Real Tol3d = 1.e-4;
GeomAbs_Shape Order = GeomAbs_C1;
Standard_Integer MaxSegments = 16, MaxDegree = 5;
GeomConvert_ApproxCurve ApprCOffs(curve, Tol3d, Order, MaxSegments, MaxDegree);
if (ApprCOffs.HasResult())
TheCurve = ApprCOffs.Curve();

std::cout << "Done!" << std::endl;
return 0;
}

Best regards, EricPang.