使用vcglib示例时断言失败

编程入门 行业动态 更新时间:2024-10-27 16:26:58
本文介绍了使用vcglib示例时断言失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想使用vcglib重建基于点云的曲面.但是每当我运行程序时(也提供了提供的示例,例如/vcglib/apps/sample/trimesh_allocate),我都会得到以下输出:

I want to use vcglib for reconstructing a surface based on a point cloud. But whenever I run my program (also with the provided examples, e.g. /vcglib/apps/sample/trimesh_allocate) I get the following output:

trimesh_allocate:../../../vcg/simplex/vertex/component.h:50:intvcg :: vertex :: EmptyCore :: cFlags()const [with TT = MyUsedTypes]:断言"0"失败.

trimesh_allocate: ../../../vcg/simplex/vertex/component.h:50: int vcg::vertex::EmptyCore::cFlags() const [with TT = MyUsedTypes]: Assertion `0' failed.

任何想法如何解决这个问题?我在Ubuntu 12.04上使用QT-Creator 2.4.1.我确实得到任何编译器或链接器错误.

Any ideas how to solve this? I am using QT-Creator 2.4.1 on Ubuntu 12.04. I do net get any compiler or linker errors.

Mirco,请多多关照

Thanks a lot in advance, Mirco

推荐答案

为了消除这种错误,通常需要更改顶点,边,面,网格定义的定义.我可以使用以下示例来工作:

In order to get rid of such an error you typically need to change the definition of the vertex, edge, face, mesh definition. I could get this example to work using:

class MyFace; class MyVertex; struct MyUsedTypes : public vcg::UsedTypes< vcg::Use<MyVertex>::AsVertexType, vcg::Use<MyFace>::AsFaceType>{}; class MyVertex : public vcg::Vertex< MyUsedTypes, vcg::vertex::Coord3f, vcg::vertex::Normal3f, vcg::vertex::VFAdj, vcg::vertex::BitFlags, vcg::vertex::Mark>{}; class MyFace : public vcg::Face < MyUsedTypes, vcg::face::VertexRef, vcg::face::Normal3f, vcg::face::FFAdj, vcg::face::Mark, vcg::face::VFAdj, vcg::face::BitFlags > {}; class MyMesh : public vcg::tri::TriMesh< std::vector<MyVertex>, std::vector<MyFace> > {};

我相信 vcg :: xx :: BitFlags 是您需要为顶点和面添加的对象.从关于cFlags()的错误中可以看出这一点.

I believe the vcg::xx::BitFlags are the ones that you need to add for both vertex and face. This can be seen from the error you have that is about cFlags().

此外,在 trimesh_allocate.cpp 示例中,您需要注释掉以下部分:

Furthermore in the trimesh_allocate.cpp example, you need to comment out the following section:

// WRONG WAY of iterating: FN() != m.face.size() if there are deleted elements /*for(int i=0;i<m.FN();++i) { if(!fi->IsD()) { MyMesh::CoordType b = vcg::Barycenter(*fi); } }*/

更多推荐

使用vcglib示例时断言失败

本文发布于:2023-11-23 08:53:37,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1620831.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:断言   示例   vcglib

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!