palanglois / line-surface-reconstruction

Implementation for the "Surface Reconstruction from 3D Line Segments" paper.
https://imagine.enpc.fr/~langloip/index.html?page=line_recons
GNU General Public License v3.0
111 stars 14 forks source link

Segmentation fault #3

Closed Luo1Cheng closed 3 years ago

Luo1Cheng commented 3 years ago

hello, Palanglois! Thanks for your great work. I meet a problem when I run demo.sh and dont know how to solve it. I followed the instructions in the README file. Here is my computer environment:

CentOS Linux release 7.2 
gcc 8.3.0. 
cmake3 version 3.17.5

And then I run the command in demo.sh:

build/line_based_recons -i data/Andalusian/input_lines_from_residuals.json -o data/ -cp 1 -cv 1 -ca 0 -ce 0.1 -cc 0.1 -ext -v

Then I got a Segmentation fault

Loaded 14503 lines and 148 planes.
Nb of reoriented planes : 60
Segmentation fault

Then I use vscode to debug the program, I found the problem is in main.cpp line 87.

PlaneArrangement myArrangement(myLineSet.getBbox(bboxIncreaseFactor), myPrimitiveSet, voxel_size, verbose);

And In function PlaneArrangement in PlaneArrangement.cpp

#include "PlaneArrangement.h"

using namespace std;

PlaneArrangement::PlaneArrangement(const CGAL::Bbox_3 &_bbox, const PrimitiveSet &_myPrimitiveSet, double _voxelSize,
                                   bool _verbose) :
        myPrimitiveSet(_myPrimitiveSet),
        bbox(_bbox),
        voxelSize(_voxelSize),
        verbose(_verbose),
        plane_handle_to_prim(map<int, int>()),
        prim_to_plane_handle(map<int, int>()),
        facetToCells(map<int, OrientedCellsHandles>()),
        intersectionTree(nullptr),
        polyhedron(nullptr)
{
    // Set the bounding box to the internal set
    set_bbox(bbox);

    //Insert the voxel planes
    insertVoxelPlanes();

    //Insert the primitives
    insertPlanes(myPrimitiveSet);

    if (verbose) {
        cout << "Constructed plane arrangement bounding box : " << bbox;
        if (voxelSize != 0.)
            cout << " and with voxels of size : " << voxelSize;
        cout << endl;
    }
}

The "segmentation fault" occurs when running to the set_bbox()

I tried to solve this bug myself but I don't even know how it happened. It may be my computer's problem or the "plane arrangement library" problem. Could you please help me with it?

palanglois commented 3 years ago

Hello @Luo1Cheng !

Thanks for your interest in this project ! It looks like there is a binary incompatibility between the Plane Arrangement library and CentOS. I don’t have access to a CentOS machine right now, but I’ll try to compile the good binaries as soon as possible! Do you have by any chance access to a Debian/Ubuntu system?

Best regards, Pierre-Alain

Luo1Cheng commented 3 years ago

Thanks for your reply. As soon as I test on Ubuntu/Debian, i will let you know.

Luo1Cheng commented 3 years ago

I test on ubuntu docker. It work ! Thanks for your suggestion .