Sketcher: BSpline FreeGCS geometry definition

=============================================

multiplicities, degree and periodic are left as non-parameters of the solver, while still allowing certain manipulations to be effected from the solver
in certain situations (for example modifying the multiplicity of start/end nodes when applying G1,G2,G3 constraints between BSplines).
This commit is contained in:
Abdullah Tahiri
2017-01-04 01:19:18 +01:00
parent b277620138
commit 80adf30da3
2 changed files with 99 additions and 0 deletions

View File

@@ -607,4 +607,75 @@ ArcOfParabola* ArcOfParabola::Copy()
return crv;
}
// bspline
DeriVector2 BSpline::CalculateNormal(Point& p, double* derivparam)
{
// place holder
DeriVector2 ret = DeriVector2();
return ret;
}
DeriVector2 BSpline::Value(double u, double du, double* derivparam)
{
// place holder
DeriVector2 ret = DeriVector2();
return ret;
}
int BSpline::PushOwnParams(VEC_pD &pvec)
{
int cnt=0;
for(VEC_P::const_iterator it = poles.begin(); it != poles.end(); ++it) {
pvec.push_back( (*it).x );
pvec.push_back( (*it).y );
}
cnt = cnt + poles.size() * 2;
pvec.insert(pvec.end(), weights.begin(), weights.end());
cnt = cnt + weights.size();
pvec.insert(pvec.end(), knots.begin(), knots.end());
cnt = cnt + knots.size();
pvec.push_back(start.x); cnt++;
pvec.push_back(start.y); cnt++;
pvec.push_back(end.x); cnt++;
pvec.push_back(end.y); cnt++;
return cnt;
}
void BSpline::ReconstructOnNewPvec(VEC_pD &pvec, int &cnt)
{
for(VEC_P::iterator it = poles.begin(); it != poles.end(); ++it) {
(*it).x = pvec[cnt]; cnt++;
(*it).y = pvec[cnt]; cnt++;
}
for(VEC_pD::iterator it = weights.begin(); it != weights.end(); ++it) {
(*it) = pvec[cnt]; cnt++;
}
for(VEC_pD::iterator it = knots.begin(); it != knots.end(); ++it) {
(*it) = pvec[cnt]; cnt++;
}
start.x=pvec[cnt]; cnt++;
start.y=pvec[cnt]; cnt++;
end.x=pvec[cnt]; cnt++;
end.y=pvec[cnt]; cnt++;
}
BSpline* BSpline::Copy()
{
BSpline* crv = new BSpline(*this);
return crv;
}
}//namespace GCS