Subject: CGAL users discussion list
List archive
- From: Pierre Alliez <>
- To: Qianqian Fang <>
- Cc:
- Subject: [cgal-discuss] Re: failed to read an OFF file
- Date: Tue, 16 Sep 2008 09:32:41 +0200
- Organization: INRIA
dear Qianqian,
Apparently Matlab's marching cubes algorithm does not provide guarantees about manifold-ness of the output mesh. I do not really know what wrong in your mesh but it can be anything among:
- one edge sharing more than two faces,
- one vertex having more than one umbrella,
- some duplicate faces,
- etc.
although it is always possible to fix a non-manifold mesh through cutting and/or removing duplicated faces - it is not a well-defined problem - the best is to go with a method with guarantees.
it is possible that CGAL will provide in the next release a 3D mesh generator which allows you to bypass the MC+decimation stage and generates as output a mesh with guaranteed properties.
pierre
Qianqian Fang a écrit :
thank you Pierre for your prompt reply and help.
I tried your new mesh with the cgal surface mesh simplification code. But
strangely, it exited with the error message "CGAL error: precondition
violation!".
Indeed, I am not really worry about this particular mesh. My real goals are
to understand the deficiency for the mesh produced by matlab's isosurface,
and being able to repair it automatically (for any 3D volume).
To explain it more, I am writing a meshing tool to create 3D tetrahedral
mesh from any binary volumetric image, for example, a thresholded
image from a MRI scan of a human head. So far, I have been coded
a matlab script to do the followings:
1. extract the surfaces from the binary volume image using matlab's isosurface
2. resample the surface calling CGAL's surface mesh simplification code
3. dump the simplified surfaces (must be closed surface, adding the bounding box
cut-out to make it close if necessary) into piecewise linear complexies (see [1])
4. call tetgen [2] externally to produce tetrahedral mesh from the boundaries
tetgen seems to be working fairly robustly. The mesh simplification was mostly causing
problems. In this case, it was matlab's isosurface produced problematic mesh
base on your comments. I am seeking either alternative path to do the above
work-flow, such as completely using CGAL as you suggested, or trying to figure
out what's wrong with matlab's isosurface (this is indeed preferred, as it is already
working for most of my cases, except for one or two as I reported earlier).
Comparing your modified mesh, I saw you added some duplicated nodes,
can you share me with more details on why the original matlab's mesh failed?
and is there a way to fix it automatically?
If using CGAL exclusively for my above workflow, are there examples to produce
surface mesh from a binary volumetric image? If it is not difficult to
deal with this in CGAL, I might consider the alternative path instead.
thank you
Qianqian
[1] http://tetgen.berlios.de/plc.html
[2] http://tetgen.berlios.de/
Pierre Alliez wrote:
apparently the matlab marching cubes is just bad - there exists some better marching cubes which guarantee 2-manifold - the attached mesh is better I think - but my fix was manual.
perhaps you could start considering CGAL surface mesh generator?
Qianqian Fang a écrit :
the modified mesh works ok with the surface mesh simplification program. However, the results after the operation present edges. We are expecting a closed surface for this mesh before and after the simplification.
I apologize that I don't have much experience with CGAL and can not put up with a "incremental builder" quickly to find out the error message. I am really curious to know what are the problems with the original mesh (it was produced from isosurface in matlab). Any tips for fixing this type of problems is also appreciated.
Qianqian
- [cgal-discuss] Re: failed to read an OFF file, Qianqian Fang, 09/13/2008
- [cgal-discuss] Re: failed to read an OFF file, Pierre Alliez, 09/16/2008
- Re: [cgal-discuss] Re: failed to read an OFF file, Marco Attene, 09/16/2008
- [cgal-discuss] Re: failed to read an OFF file, Pierre Alliez, 09/16/2008
Archive powered by MHonArc 2.6.16.