Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] CGAL marching cubes is very slow?

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] CGAL marching cubes is very slow?


Chronological Thread 
  • From: Christian Walder <>
  • To:
  • Subject: Re: [cgal-discuss] CGAL marching cubes is very slow?
  • Date: Fri, 17 Jul 2009 13:13:40 +0200
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=rg/+8JMWQe4cdQqxOjMfgXsjXTHjFrCq5PvmtIHImqYUnI/KU5Ln720K588H+rWglU Qn2zNG1ZuuN35Gw6vMFuq4lM2VtDQ/kOWsoeknztpZSxnqaCiQK0b2axhGLWOp/5X1lK P+FS6oqb7TxUl/ZxxLTP0whhHBi6Voj8G4Bpk=

Thanks. I agree, but as I only need to construct thousands of meshes and render them (on a cluster), it is not important how nice the mesh is.

Also note that the VTK function works on voxel grids, and so is cubic in time with respect to resolution...

I am sure that marching cubes plus mesh simplification can be made to work much faster than the CGAL surface mesher, but then I see that the CGAL function comes with theoretical guarantees which I would tend to prefer in a less speed oriented setting!

Does anyone else have a pointer to a marching cubes implementation in C++?

Best,

Christian

On Fri, Jul 17, 2009 at 11:43 AM, Andreas Fabri <> wrote:
Hi Christian,

You might further investigate the surface mesher, as comparing it with
a marching cubes algorithm is comparing apples and pears. The surface
mesher will produce quality triangles, and you can have uniform sized
triangles or triangles with the size adapted to the curvature, that
is few triangles where the surface is flat, and many triangles where
you have high curvature.   So in order to have a fair comparison,
you should compare it to marching cubes followed by mesh simplification.

Obvioulsly if badly shaped triangles are not a problem for your use case,
the added value I try to point out, is not valuable for you.

Best regards,

andreas

Christian Walder wrote:
I see, thanks. Can anyone recommend a good c++ implementation of the marching cubes algorithm? I am quite surprised that this is not easier to find...

On Fri, Jul 17, 2009 at 11:09 AM, Mariette Yvinec < <mailto:>> wrote:

   CGAL Surface mesher is not a marching cube.
   It builds  iteratively a sampling adapted to the surface geometry
   so that the restricted triangulation  of this sampling is
   an accurate approximation of the surface and a nice
   surface mesh formed with well shaped triangles.


   Christian Walder wrote:

       Dear All,

       I have used the CGAL library to perform marching cubes on an
       implicit surface. Unfortunately it is extremely slow -
       previously I have used a different implementation from an
       unknown author, and it is orders of magnitude faster for roughly
       the same resolution. I am wondering if I have called the
       functions correctly, and whether there are any easy ways attempt
       to speed it up.

       Best Regards,

       Christian

       ps.

       The key snippet of code is the following:

        Tr tr;            // 3D-Delaunay triangulation                                                                   C2t3 c2t3 (tr);   //
       2D-complex in 3D-Delaunay triangulation                                                     Surface_3 surface(implicit_function,
       Sphere_3(Point_3(center[0],center[1],center[2]), radius));
        // defining meshing criteria                                                                                           CGAL::Surface_mesh_default_criteria_3<Tr> criteria(30.,  //
       angular bound                                                                                          radius_bound,  // radius bound                                                                                        distance_bound); // distance bound                           CGAL::make_surface_mesh(c2t3, surface, criteria,
       CGAL::Non_manifold_tag());
       

   --    Mariette Yvinec
   Geometrica project team
   INRIA  Sophia-Antipolis  

   --    You are currently subscribed to cgal-discuss.
   To unsubscribe or access the archives, go to
   https://lists-sop.inria.fr/wws/info/cgal-discuss



--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss




Archive powered by MHonArc 2.6.16.

Top of Page