本文整理汇总了C++中MFnNurbsCurve::getKnots方法的典型用法代码示例。如果您正苦于以下问题:C++ MFnNurbsCurve::getKnots方法的具体用法?C++ MFnNurbsCurve::getKnots怎么用?C++ MFnNurbsCurve::getKnots使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MFnNurbsCurve
的用法示例。
在下文中一共展示了MFnNurbsCurve::getKnots方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: write
//.........这里部分代码省略.........
{
samp.setType(Alembic::AbcGeom::kVariableOrder);
}
}
orders[i] = static_cast<Alembic::Util::uint8_t>(curve.degree() + 1);
Alembic::Util::int32_t numCVs = curve.numCVs(&stat);
MPointArray cvArray;
stat = curve.getCVs(cvArray, MSpace::kObject);
mCVCount += numCVs;
nVertices[i] = numCVs;
for (Alembic::Util::int32_t j = 0; j < numCVs; j++)
{
MPoint transformdPt;
if (mIsCurveGrp)
{
transformdPt = cvArray[j]*transformMatrix;
}
else
{
transformdPt = cvArray[j];
}
points.push_back(static_cast<float>(transformdPt.x));
points.push_back(static_cast<float>(transformdPt.y));
points.push_back(static_cast<float>(transformdPt.z));
}
MDoubleArray knotsArray;
curve.getKnots(knotsArray);
knots.reserve(knotsArray.length() + 2);
// need to add a knot to the start and end (M + 2N + 1)
if (knotsArray.length() > 1)
{
unsigned int knotsLength = knotsArray.length();
if (knotsArray[0] == knotsArray[knotsLength - 1] ||
knotsArray[0] == knotsArray[1])
{
knots.push_back(knotsArray[0]);
}
else
{
knots.push_back(2 * knotsArray[0] - knotsArray[1]);
}
for (unsigned int j = 0; j < knotsLength; ++j)
{
knots.push_back(knotsArray[j]);
}
if (knotsArray[0] == knotsArray[knotsLength - 1] ||
knotsArray[knotsLength - 1] == knotsArray[knotsLength - 2])
{
knots.push_back(knotsArray[knotsLength - 1]);
}
else
{
knots.push_back(2 * knotsArray[knotsLength - 1] -
knotsArray[knotsLength - 2]);
}
}