CGAL / cgal

The public CGAL repository, see the README below
https://github.com/CGAL/cgal#readme
Other
4.67k stars 1.35k forks source link

CGAL error: assertion violation! When using "CGAL::Polygon_mesh_processing::extrude_mesh()" #7689

Open Dwight98 opened 10 months ago

Dwight98 commented 10 months ago

Issue Details

I loaded my own mesh file (.obj) which is creadted by another library called "open3D". The reconstruction method is “Ball pivoting”. I want to use the"Extrude_mesh()" to get an extrusion model, and the direction of extrusion is only negative to the z-axis. The code compiles fine, but when I run it after a few minutes I get an error like this:

CGAL error: assertion violation! Expression : idx < data.size() File : D:\Programs\dev\CGAL-5.5.1\include\CGAL\Surface_mesh\Properties.h Line : 193 Explanation: Refer to the bug-reporting instructions at https://www.cgal.org/bug_report.html

Source Code

head file:

#include<ctime>
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <CGAL/Surface_mesh.h>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Polygon_mesh_processing/compute_normal.h>
#include <CGAL/Polygon_mesh_processing/extrude.h>
#include <CGAL/boost/graph/IO/polygon_mesh_io.h>
#include <CGAL/Polygon_mesh_processing.h>
#include <CGAL/IO/OBJ.h>       
#include <CGAL/Polygon_mesh_processing/IO/polygon_mesh_io.h>
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include<CGAL/Polygon_mesh_processing/border.h>

typedef:
typedef CGAL::Exact_predicates_exact_constructions_kernel  Kernel;
typedef Kernel::Point_3 Point;
typedef CGAL::Surface_mesh<Point> SM;
typedef Kernel::Vector_3 Vector;

code:
        auto start = std::clock();
    double extrudeVector[3] = { 0, 0, -500 };
    SM mesh;
    SM outMesh;
    CGAL::IO::read_polygon_mesh(v2, mesh);
    CGAL::Polygon_mesh_processing::extrude_mesh(mesh, outMesh, *new Vector(extrudeVector[0], extrudeVector[1], extrudeVector[2]));
    mesh.clear();
    CGAL::IO::write_polygon_mesh(v82, outMesh, CGAL::parameters::stream_precision(17));
    endTime = clock();
    std::cout << "时间是(ms):" << endTime - startTime;
    return EXIT_FAILURE;

Environment

sloriot commented 10 months ago

Without the model it is hard to tell what is going wrong. Could you share it? My guess is that the model is closed and we did not check that in the function.

Dwight98 commented 10 months ago

Without the model it is hard to tell what is going wrong. Could you share it? My guess is that the model is closed and we did not check that in the function.

how to share it to you

sloriot commented 10 months ago

you can attach it in the issue or put it on gist.github.com

Dwight98 commented 10 months ago

OK I will share it to you. Apart from that, I also want tell you another issue which I also submitt on github , and its title is the same as this issue. I will share both two mesh modeles with you, please help me analyze this problem as well. Thank you very much!

tips: Could you please provide your email address? My file is too large to upload directly as an attachment

Dwight98 commented 10 months ago

OK I will share it to you. Apart from that, I also want tell you another issue which I also submitt on github , and its title is the same as this issue. I will share both two mesh modeles with you, please help me analyze this problem as well. Thank you very much!

tips: Could you please provide your email address? My file is too large to upload directly as an attachment

Another issue https://github.com/CGAL/cgal/issues/7690

sloriot commented 10 months ago

Maybe try to decimate the model and see if there is still an issue. Otherwise using an only file sharing online (dropbox, wetransfer, google drive, ...).

Dwight98 commented 10 months ago

Maybe try to decimate the model and see if there is still an issue. Otherwise using an only file sharing online (dropbox, wetransfer, google drive, ...). I could use the wetransfer, but that also needs your email.

Dwight98 commented 10 months ago

Maybe try to decimate the model and see if there is still an issue. Otherwise using an only file sharing online (dropbox, wetransfer, google drive, ...).

Oh,sorry, I forget that I can generate a link to you. Below is the wetransfer link for the shared file: https://we.tl/t-KR136DuBtB