Exception Thrown fom extract_mean_curvature_flow_skeleton

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Exception Thrown fom extract_mean_curvature_flow_skeleton

lulu5
Dear all,

I am new for CGAL and C++. In my project, I would like to generate the curve
skeleton of closed mesh. Here is my testing codes:

/#define CGAL_EIGEN3_ENABLED
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/extract_mean_curvature_flow_skeleton.h>
#include <CGAL/boost/graph/split_graph_into_polylines.h>
#include <fstream>
#include <boost/foreach.hpp>
typedef CGAL::Simple_cartesian<double>                        Kernel;
typedef Kernel::Point_3                                       Point;
typedef CGAL::Polyhedron_3<Kernel>                            Polyhedron;
typedef boost::graph_traits<Polyhedron>::vertex_descriptor  
vertex_descriptor;
typedef CGAL::Mean_curvature_flow_skeletonization<Polyhedron>
Skeletonization;
typedef Skeletonization::Skeleton                             Skeleton;
typedef Skeleton::vertex_descriptor                          
Skeleton_vertex;
typedef Skeleton::edge_descriptor                             Skeleton_edge;
//only needed for the display of the skeleton as maximal polylines

// This example extracts a medially centered skeleton from a given mesh.
int main(int argc, char* argv[])
{
        std::ifstream input((argc > 1) ? argv[1] : "data/hand.off");
        Polyhedron tmesh;
        input >> tmesh;
        if (!CGAL::is_triangle_mesh(tmesh))
        {
                std::cout << "Input geometry is not triangulated." << std::endl;
                return EXIT_FAILURE;
        }

        std::cout << CGAL::is_closed(tmesh) << "\n";
       
        Skeleton skeleton;
        CGAL::extract_mean_curvature_flow_skeleton(tmesh, skeleton);
       
        return 0;
}/

It works well with off files provided by CGAL example (for example,
hand.off <http://cgal-discuss.949826.n4.nabble.com/file/t376145/hand.off>
). However, when I create my own geometry ( sweep.off
<http://cgal-discuss.949826.n4.nabble.com/file/t376145/sweep.off>  ), it
shows the exception as below:

Exception thrown at 0x000000006AD20FA0 (libgmp-10.dll) in HelloCGAL.exe:
0xC0000005: Access violation executing location 0x000000006AD20FA0.

from CGAL::Mpzf::data() in Mpzf.h

After several testing, I think that it is
CGAL::extract_mean_curvature_flow_skeleton triggers the exception. Does
anyone know how to deal with this issue?

Any help will be greatly appreciated.




--
Sent from: http://cgal-discuss.949826.n4.nabble.com/

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


Reply | Threaded
Open this post in threaded view
|

Re: Exception Thrown fom extract_mean_curvature_flow_skeleton

Sebastien Loriot (GeometryFactory)
Could you try replacing CGAL::Simple_cartesian<double> with
CGAL::Exact_predicates_inexact_constructions_kernel and tell us if you
still have the issue?

Thanks,

Sebastien.

On 10/16/19 8:43 PM, lulu5 wrote:

> Dear all,
>
> I am new for CGAL and C++. In my project, I would like to generate the curve
> skeleton of closed mesh. Here is my testing codes:
>
> /#define CGAL_EIGEN3_ENABLED
> #include <CGAL/Simple_cartesian.h>
> #include <CGAL/Polyhedron_3.h>
> #include <CGAL/extract_mean_curvature_flow_skeleton.h>
> #include <CGAL/boost/graph/split_graph_into_polylines.h>
> #include <fstream>
> #include <boost/foreach.hpp>
> typedef CGAL::Simple_cartesian<double>                        Kernel;
> typedef Kernel::Point_3                                       Point;
> typedef CGAL::Polyhedron_3<Kernel>                            Polyhedron;
> typedef boost::graph_traits<Polyhedron>::vertex_descriptor
> vertex_descriptor;
> typedef CGAL::Mean_curvature_flow_skeletonization<Polyhedron>
> Skeletonization;
> typedef Skeletonization::Skeleton                             Skeleton;
> typedef Skeleton::vertex_descriptor
> Skeleton_vertex;
> typedef Skeleton::edge_descriptor                             Skeleton_edge;
> //only needed for the display of the skeleton as maximal polylines
>
> // This example extracts a medially centered skeleton from a given mesh.
> int main(int argc, char* argv[])
> {
> std::ifstream input((argc > 1) ? argv[1] : "data/hand.off");
> Polyhedron tmesh;
> input >> tmesh;
> if (!CGAL::is_triangle_mesh(tmesh))
> {
> std::cout << "Input geometry is not triangulated." << std::endl;
> return EXIT_FAILURE;
> }
>
> std::cout << CGAL::is_closed(tmesh) << "\n";
>
> Skeleton skeleton;
> CGAL::extract_mean_curvature_flow_skeleton(tmesh, skeleton);
>
> return 0;
> }/
>
> It works well with off files provided by CGAL example (for example,
> hand.off <http://cgal-discuss.949826.n4.nabble.com/file/t376145/hand.off>
> ). However, when I create my own geometry ( sweep.off
> <http://cgal-discuss.949826.n4.nabble.com/file/t376145/sweep.off>  ), it
> shows the exception as below:
>
> Exception thrown at 0x000000006AD20FA0 (libgmp-10.dll) in HelloCGAL.exe:
> 0xC0000005: Access violation executing location 0x000000006AD20FA0.
>
> from CGAL::Mpzf::data() in Mpzf.h
>
> After several testing, I think that it is
> CGAL::extract_mean_curvature_flow_skeleton triggers the exception. Does
> anyone know how to deal with this issue?
>
> Any help will be greatly appreciated.
>
>
>
>
> --
> Sent from: http://cgal-discuss.949826.n4.nabble.com/
>

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


Reply | Threaded
Open this post in threaded view
|

Re: Exception Thrown fom extract_mean_curvature_flow_skeleton

lulu5
Dear Sebastian,

Thank you for your replying. As your suggestion, I change /typedef
CGAL::Simple_cartesian<double>                        Kernel;/ to /typedef
CGAL::Exact_predicates_inexact_constructions_kernel  Kernel;/

Unfortunately, the same issue still appears. I tested four different .off
files provided by CGAL examples and here is their testing result.

hand.off <http://cgal-discuss.949826.n4.nabble.com/file/t376145/hand.off>  :
Create curve skeleton successfully
knot.off <http://cgal-discuss.949826.n4.nabble.com/file/t376145/knot.off>  :
Exception thrown at 0x000000006F552384 (libmpfr-4.dll) in HelloCGAL.exe:
0xC0000005: Access violation accessing location 0x0000000000000000.
u.off <http://cgal-discuss.949826.n4.nabble.com/file/t376145/u.off>  :
Exception thrown at 0x000000006AD20FA0 (libgmp-10.dll) in HelloCGAL.exe:
0xC0000005: Access violation executing location 0x000000006AD20FA0. (from
Mpzf.h)
part.off <http://cgal-discuss.949826.n4.nabble.com/file/t376145/part.off>  :
Exception thrown at 0x000000006AD20FA0 (libgmp-10.dll) in HelloCGAL.exe:
0xC0000005: Access violation executing location 0x000000006AD20FA0. (from
Mpzf.h)

Once again, thank you for your help!



--
Sent from: http://cgal-discuss.949826.n4.nabble.com/

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


Reply | Threaded
Open this post in threaded view
|

Re: Exception Thrown fom extract_mean_curvature_flow_skeleton

Sebastien Loriot (GeometryFactory)
Unfortunately I could not reproduce the pb. All the models you gave are
working correctly on my computer ( I tried with CGAL 4.14 and the master
branch).

Could you please tell us more about your platform (OS, compiler, ...)?
what versions of CGAL and Eigen are you using?

If you can compile in debug and run at least one case in the debugger,
it might help to provide the call stack.

Thanks,

Sebastien.

On 10/17/19 8:08 PM, lulu5 wrote:

> Dear Sebastian,
>
> Thank you for your replying. As your suggestion, I change /typedef
> CGAL::Simple_cartesian<double>                        Kernel;/ to /typedef
> CGAL::Exact_predicates_inexact_constructions_kernel  Kernel;/
>
> Unfortunately, the same issue still appears. I tested four different .off
> files provided by CGAL examples and here is their testing result.
>
> hand.off <http://cgal-discuss.949826.n4.nabble.com/file/t376145/hand.off>  :
> Create curve skeleton successfully
> knot.off <http://cgal-discuss.949826.n4.nabble.com/file/t376145/knot.off>  :
> Exception thrown at 0x000000006F552384 (libmpfr-4.dll) in HelloCGAL.exe:
> 0xC0000005: Access violation accessing location 0x0000000000000000.
> u.off <http://cgal-discuss.949826.n4.nabble.com/file/t376145/u.off>  :
> Exception thrown at 0x000000006AD20FA0 (libgmp-10.dll) in HelloCGAL.exe:
> 0xC0000005: Access violation executing location 0x000000006AD20FA0. (from
> Mpzf.h)
> part.off <http://cgal-discuss.949826.n4.nabble.com/file/t376145/part.off>  :
> Exception thrown at 0x000000006AD20FA0 (libgmp-10.dll) in HelloCGAL.exe:
> 0xC0000005: Access violation executing location 0x000000006AD20FA0. (from
> Mpzf.h)
>
> Once again, thank you for your help!
>
>
>
> --
> Sent from: http://cgal-discuss.949826.n4.nabble.com/
>

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