Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Segfault when generating a mesh from an implicit surface

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Segfault when generating a mesh from an implicit surface


Chronological Thread 
  • From: Mael Rouxel-Labbé <>
  • To:
  • Subject: Re: [cgal-discuss] Segfault when generating a mesh from an implicit surface
  • Date: Tue, 29 May 2018 11:57:39 +0200
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=None ; spf=None
  • Ironport-phdr: 9a23:1tgG2hBsrriN24T3HUTHUyQJP3N1i/DPJgcQr6AfoPdwSPT9oMbcNUDSrc9gkEXOFd2Cra4c0KyO6+jJYi8p2d65qncMcZhBBVcuqP49uEgeOvODElDxN/XwbiY3T4xoXV5h+GynYwAOQJ6tL1LdrWev4jEMBx7xKRR6JvjvGo7Vks+7y/2+94fcbglUijexe69+IAmrpgjNq8cahpdvJLwswRXTuHtIfOpWxWJsJV2Nmhv3+9m98p1+/SlOovwt78FPX7n0cKQ+VrxYES8pM3sp683xtBnMVhWA630BWWgLiBVIAgzF7BbnXpfttybxq+Rw1DWGMcDwULs5Xymp4aV2Rx/ykCoJKiA38G/XhMJzgqxUrh2uqB5jzIPPeo6ZKOBzc7nBcd4UR2dMWNtaWSxbAoO7aosCF+0PMvxGoIn5v1QAsRy+BRSjBezxzj9En3n40rch3Os6CwbNwQstH9cUv3vKqNX5Lr0SUeeozKjH0zrDa+la2TPn54fTaR8uv+qBXb1ufsrWzEkgCR/Fjk+QqIzrJTyayvgNs2+B7+tgT+6gl2knqwRorzWp28wihI7JhocPxVDF8yV02Ik1JdykSE57fN6rC4FcuD2dN4tzRM4pXmJmuD4ix7AJuJO3ZjUGxIgnyhLFZfGKd5KE7xP+WOqJJTp0mGhpdbG+ihqo9UWs1PfwW8aw3VtMsyFLiMPDtmoX2BzW8sWHSuVy/kOm2TuXyQzf8OREIUcpmafZKJMt2LswmYASsUTHByP2n1j2jLOMekUj5Oio6/7rYrP4qZ+AL4N0iwf+PboymsGnDuk1MxICU3WH9em8zrHu80n0TK9Lg/EriqXZtYrVJcUfpq63GQ9V1YMj5g66Dzi8ztsYmWMLLEhCeBKagInmJVXOLOr8DfilmFujiylkyuvJPrL/BZXNK2bMkKv7fbd95U5T0hY8zcxY55JOCrANOu78Wkj0tNDAFB82LxS0w/r7CNV6zo4RRW2PDbWdMK/LrFCI5/kvLPWRZI8OozbwMOMl5v7rjX8hg1ARZ6ip3Z0NaHC5BPtqOUuZYWC/yusGRGwFtw57QO3xg0CZShZSYWyzVuQy/GIVEoWjWKLKS4SauruczCq/W7lfbGrHQgSJGHrsMZ+DRucBbGSWK8VrnxQLWL+kRpM7xB+nvxP90ashJe3RrH5L/an/3cR4srWA3So58iZ5WpzEgjO9Clpsl2ZNfAcYmaV2oEhz0FCGi/EqjPFfENFP/eJHWwwmMoTNied9DoKqA16TTpKyUF+jB+6eL3QpVNtrmo0BbkF4Fsm4nx7K1DatGa5TnLuOVsRtr/DsmkPpLsM48E7okaksi158HJkVc2ih3/EvsQ3aBoqMlFiF0aG0deIa0TKfrGo=

Hello,

The issue actually entirely comes from Mesh_3 and the Surface_mesher never needs to be included (but it is exclusive to 'Release' mode for me). It stems from your 'Function' type alias:

using Function = double (*)(const Point_3&);

which is an alias to a function pointer. There is actually a known bug in a mesh domain wrapper class when pointer functions are used. This will be fixed very soon in our master branch (and will be in the release CGAL 4.13) by the following pull request (which will rework the API for Mesh_3 domains): https://github.com/CGAL/cgal/pull/2739.

In the meantime, you can use the type alias that we use in the examples:

typedef double (Function)(const Point_3&);

or

using Function = double (const Point_3&);

Using either, the program runs just fine for me.

Best,
Mael

PS: Note that the Surface_mesher is eventually going to be replaced by Mesh_3 (which is more developed).

On 26/05/2018 21:01, Raphael Grimm wrote:
Hi,

I wanted to compare different methods to turn implicit surfaces into a mesh.

In the attached code I compared CGAL::make_mesh_3 with CGAL::make_surface_mesh.
I can deactivate the code using either of these functions using the defines at the top of the file.

If  I activate only one of these functions, the executable generates the meshes.
So far all is good.

If I activate both functions to do the conversion, the executable segfaults:

void impl_mesh_via_all(double) 4
void impl_mesh_via_make_surface_mesh(double) 4
    impl
    convert
    save
void impl_mesh_via_make_mesh_3(double) 4
    impl
    convert
Segmentation fault (core dumped)


I do not understand this, since both functions work if I only use one in the executable.
Can anyone tell me what the reason for this is?

Best Regards,
Raphael





Archive powered by MHonArc 2.6.18.

Top of Page