added: set parameters in SplineUtils::project
This commit is contained in:
parent
b142a0b54b
commit
733c9c51a9
@ -31,11 +31,13 @@ Vec3 SplineUtils::toVec3 (const Go::Point& X, int nsd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Vec4 SplineUtils::toVec4 (const Go::Point& X, Real time)
|
Vec4 SplineUtils::toVec4 (const Go::Point& X, Real time,
|
||||||
|
const double* u)
|
||||||
{
|
{
|
||||||
Vec4 Y;
|
Vec4 Y;
|
||||||
for (int i = 0; i < X.size() && i < 3; i++) Y[i] = X[i];
|
for (int i = 0; i < X.size() && i < 3; i++) Y[i] = X[i];
|
||||||
Y.t = time;
|
Y.t = time;
|
||||||
|
Y.u = u;
|
||||||
return Y;
|
return Y;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -195,7 +197,7 @@ Go::SplineCurve* SplineUtils::project (const Go::SplineCurve* curve,
|
|||||||
{
|
{
|
||||||
gpar[i] = basis.grevilleParameter(i);
|
gpar[i] = basis.grevilleParameter(i);
|
||||||
curve->point(X,gpar[i]);
|
curve->point(X,gpar[i]);
|
||||||
fOfX = f.getValue(toVec4(X,time));
|
fOfX = f.getValue(toVec4(X,time,&gpar[i]));
|
||||||
fval.insert(fval.end(),fOfX.begin(),fOfX.begin()+nComp);
|
fval.insert(fval.end(),fOfX.begin(),fOfX.begin()+nComp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -238,7 +240,8 @@ Go::SplineSurface* SplineUtils::project (const Go::SplineSurface* surface,
|
|||||||
for (i = 0; i < nu; i++)
|
for (i = 0; i < nu; i++)
|
||||||
{
|
{
|
||||||
surface->point(X,upar[i],vpar[j]);
|
surface->point(X,upar[i],vpar[j]);
|
||||||
fOfX = f.getValue(toVec4(X,time));
|
double u[2] = {upar[i], vpar[j]};
|
||||||
|
fOfX = f.getValue(toVec4(X,time,u));
|
||||||
fval.insert(fval.end(),fOfX.begin(),fOfX.begin()+nComp);
|
fval.insert(fval.end(),fOfX.begin(),fOfX.begin()+nComp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -288,7 +291,8 @@ Go::SplineVolume* SplineUtils::project (const Go::SplineVolume* volume,
|
|||||||
for (i = 0; i < nu; i++)
|
for (i = 0; i < nu; i++)
|
||||||
{
|
{
|
||||||
volume->point(X,upar[i],vpar[j],wpar[k]);
|
volume->point(X,upar[i],vpar[j],wpar[k]);
|
||||||
fOfX = f.getValue(toVec4(X,time));
|
double u[3] = {upar[i], vpar[j], wpar[k]};
|
||||||
|
fOfX = f.getValue(toVec4(X,time,u));
|
||||||
fval.insert(fval.end(),fOfX.begin(),fOfX.begin()+nComp);
|
fval.insert(fval.end(),fOfX.begin(),fOfX.begin()+nComp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,7 +38,8 @@ namespace SplineUtils //! Various utility functions on spline objects.
|
|||||||
//! \brief Helper method for casting a \a Go::Point object to Vec3.
|
//! \brief Helper method for casting a \a Go::Point object to Vec3.
|
||||||
Vec3 toVec3(const Go::Point& X, int nsd = 3);
|
Vec3 toVec3(const Go::Point& X, int nsd = 3);
|
||||||
//! \brief Helper method for casting a \a Go::Point and time object to Vec4.
|
//! \brief Helper method for casting a \a Go::Point and time object to Vec4.
|
||||||
Vec4 toVec4(const Go::Point& X, Real time = Real(0));
|
Vec4 toVec4(const Go::Point& X, Real time = Real(0),
|
||||||
|
const double* u = nullptr);
|
||||||
|
|
||||||
//! \brief Evaluates given spline curve at a parametric point.
|
//! \brief Evaluates given spline curve at a parametric point.
|
||||||
void point(Vec3& X, double u, Go::SplineCurve* curve);
|
void point(Vec3& X, double u, Go::SplineCurve* curve);
|
||||||
|
Loading…
Reference in New Issue
Block a user