本文整理汇总了C++中MeshObject::getKernel方法的典型用法代码示例。如果您正苦于以下问题:C++ MeshObject::getKernel方法的具体用法?C++ MeshObject::getKernel怎么用?C++ MeshObject::getKernel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MeshObject
的用法示例。
在下文中一共展示了MeshObject::getKernel方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: writeInventor
PyObject* MeshPy::writeInventor(PyObject *args)
{
float creaseangle=0.0f;
if (!PyArg_ParseTuple(args, "|f",&creaseangle))
return NULL;
MeshObject* mesh = getMeshObjectPtr();
const MeshCore::MeshFacetArray& faces = mesh->getKernel().GetFacets();
std::vector<int> indices;
std::vector<Base::Vector3f> coords;
coords.reserve(mesh->countPoints());
for (MeshObject::const_point_iterator it = mesh->points_begin(); it != mesh->points_end(); ++it)
coords.push_back(Base::Vector3f((float)it->x,(float)it->y,(float)it->z));
indices.reserve(4*faces.size());
for (MeshCore::MeshFacetArray::_TConstIterator it = faces.begin(); it != faces.end(); ++it) {
indices.push_back(it->_aulPoints[0]);
indices.push_back(it->_aulPoints[1]);
indices.push_back(it->_aulPoints[2]);
indices.push_back(-1);
}
std::stringstream result;
Base::InventorBuilder builder(result);
builder.addIndexedFaceSet(coords, indices, creaseangle);
builder.close();
return Py::new_reference_to(Py::String(result.str()));
}