nmwsharp / nonmanifold-laplacian

A robust Laplace matrix for general (possibly nonmanifold) triangle meshes, and point clouds [Sharp & Crane SGP 2020]
MIT License
124 stars 8 forks source link

Compilation problems (VIsual Studio 2017) #2

Closed PiotrGizaB3D closed 3 years ago

PiotrGizaB3D commented 3 years ago

Hi, first of all, I want to thank you for the code and publication! I downloaded this repo and went through cmake procedure to generate VS 2017 x64 project. I had to download some libs manually and put them in deps directory, but this was easy to overcome. On the other hand, the compilation itself was a little bit more difficult. I had encountered some problems with happly.h - its functions were designed to accept std::ifstream and std::ofstream references as input/output arguments while RichSurfaceMeshData routines provide std::istream and std::ostream respectively. After changing ofstream to ostream and ifstream to istream in happly.h there was still a missing constructor, which I just had to add:

/**
   * @brief Initialize a PLYData by reading from a stream. Throws if any failures occur.
   *
   * @param filename The file to read from.
   * @param verbose If true, print useful info about the file to stdout
   */
  PLYData(std::istream& inStream, bool verbose = false) {

    using std::cout;
    using std::endl;
    using std::string;
    using std::vector;

    if (verbose) cout << "PLY parser: Reading ply file from stream" << endl;

    // Open a file in binary always, in case it turns out to have binary data.
    //std::ifstream inStream(filename, std::ios::binary);
    if (!inStream.good()) {
      throw std::runtime_error("PLY parser: Could not open read file from stream");
    }

After doing that, I was able to compile and run the project. With regards, Piotr

nmwsharp commented 3 years ago

Thanks for the interest!

The dependencies are configured with git submodules, so running git clone --recurse-submodules https://github.com/nmwsharp/nonmanifold-laplacian should grab them automatically (most git gui tools have similar one way or another). I'm glad you were also able to sort it out with direct downloading!

For the compile error, thanks for the heads up! I will look in to it and follow-up.

nmwsharp commented 3 years ago

Just looked in to that compile error, I think that perhaps it may have been caused in your case by intermingling an older version of geometry-central with the latest version of happly. I don't see the error when using either the versions pinned in this repo, nor with the latest versions.

For good measure, I updated this repo's geometry-central (and transitively happly) dependencies to be the latest versions.

I'm closing this for now; please reopen if you're still seeing the compile error! Thanks again for reporting.

PiotrGizaB3D commented 3 years ago

Hi Nick! You are correct - instead of downloading the latest happly and geometry central I used older versions from the links inside github repo. So in fact this wasn't a real issue - the situation was caused rather by the lack of cmake and github skills on my side. Anyway it was worth mentioning, because surely I'm not the only unexperienced person here :) I've checked compilation after your updates (using recursive cloning). It compiles without errors now, so there's no need to reopen this.