Hi,
that assertion is because the routine was not able to add all the faces
the it was supposed
to add.
Most probably it depends on the topology..in your specific case the mesh
is not oriented (but orientable).
change
face 1 from 0,2,1 to 0,1,2
face 3 from 3,2,5 to 3,5,2
you can use: IsOriented(..) to check if your mesh is oriented
(in vcg/complex/trimesh/clean.h )
cheers,
fabio
> Hi all,
>
> still working on the retopology plugin, i needed to use the "Refine"
> method (in refine.h) to subdivide
> an auto-generated surface.
>
> To do so i've looked in the "meshfilter" plugin code, and then i've
> tryed using it with
> my fresh allocated mesh. Here's an example of my code (the point3f
> coords are debug values;
> "out" is my mesh, and the rest of the code is the standard mesh
> generation code):
>
>
> ...
>
> out.cm.Clear();
> vcg::tri::Allocator<CMeshO>::AddVertices(out.cm, 6);
> vcg::tri::Allocator<CMeshO>::AddFaces(out.cm, 5);
>
> QVector<CMeshO::VertexPointer> ivp(6);
>
> CMeshO::VertexIterator vi=out.cm.vert.begin();
>
> ivp[0] = &*vi; (*vi).P() = Point3f(-0.053, 0.104, 0.040); ++vi;
> ivp[1] = &*vi; (*vi).P() = Point3f(-0.031, 0.113, 0.034); ++vi;
> ivp[2] = &*vi; (*vi).P() = Point3f(-0.031, 0.094, 0.044); ++vi;
> ivp[3] = &*vi; (*vi).P() = Point3f(-0.012, 0.105, 0.043); ++vi;
> ivp[4] = &*vi; (*vi).P() = Point3f(-0.046, 0.082, 0.043); ++vi;
> ivp[5] = &*vi; (*vi).P() = Point3f(-0.017, 0.084, 0.057);
>
> CMeshO::FaceIterator fi=out.cm.face.begin();
>
> (*fi).V(0) = ivp[0]; (*fi).V(1) = ivp[2]; (*fi).V(2) = ivp[4]; fi++;
> (*fi).V(0) = ivp[0]; (*fi).V(1) = ivp[2]; (*fi).V(2) = ivp[1]; fi++;
> (*fi).V(0) = ivp[3]; (*fi).V(1) = ivp[2]; (*fi).V(2) = ivp[1]; fi++;
> (*fi).V(0) = ivp[3]; (*fi).V(1) = ivp[2]; (*fi).V(2) = ivp[5]; fi++;
> (*fi).V(0) = ivp[4]; (*fi).V(1) = ivp[2]; (*fi).V(2) = ivp[5];
>
> out.updateDataMask(MeshModel::MM_FACETOPO | MeshModel::MM_BORDERFLAG);
> Refine<CMeshO,MidPoint<CMeshO>>(out.cm, MidPoint<CMeshO>(), 0, false, 0);
> out.clearDataMask( MeshModel::MM_VERTFACETOPO);
>
> out.fileName = "Retopology.ply";
> tri::UpdateBounding<CMeshO>::Box(out.cm);
> vcg::tri::UpdateNormals<CMeshO>::PerVertexNormalizedPerFace(out.cm);
>
> ...
>
>
> Well, the initial mesh is allocated correctly, but after that, the
> method "Refine" causes an assertion failure:
> [...] Assertion failed! ... File: .../refine.h - Line: 495 -
> Expression: lastf==m.face.end()
>
>
> I've done more and more tests, and the only thing i've noticed is that
> this failure occours often (but not for every mesh), and coocurs
> expecially when the mesh i'm going to generate has an high number of
> vertices and faces (for 2 faces and 4 vertices, for example,
> the same code goes well and no assertion failures).
>
> Of course it's higliy probable that the problem should be only on my
> mesh allocation code, but where?
> Is there any relation with the order of faces allocation?
> I've searched for some complex examples in
> vcg/complex/trimesh/create/platonic.h,
> but, in relation of the methods in that file, i didn't find any
> problem in my code.
>
> Any suggestion on where am i going wrong?
>
> Thanks in advance,
> D.
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Meshlab-devel mailing list
> Mes...@li...
> https://lists.sourceforge.net/lists/listinfo/meshlab-devel
>
>
|