我想用c ++打开一个sketchup模型。我下载了sdk,编译了这个例子,然而,当我尝试运行它时,它没有读取任何面,模型名称,什么也没有。有人可以帮我吗?
SUInitialize();
// Load the model from a file
SUModelRef model = SU_INVALID;
SUResult res = SUModelCreateFromFile(&model, "model.skp");
if (res != SU_ERROR_NONE)
{
std::cout << "error" << std::endl;
return 1;
}
// Get the entity container of the model.
SUEntitiesRef entities = SU_INVALID;
SUModelGetEntities(model, &entities);
size_t faceCount = 0;
SUEntitiesGetNumFaces(entities, &faceCount);
// faceCount = 0..., why???!!!
答案 0 :(得分:1)
这将仅返回模型根中的面数,而不是任何组件或组内的面数。 model.skp有免费面孔吗? (即不在组件内)