Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweaks and instructions for a workable windows build #13

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,21 @@ cmake ..
make -j
```

### Installing on Windows

The usual CMake dance changes a little on Windows. Instead of using `make -j`, on Windows, CMake will produce a visual studio solution that you can use to build the project. The following procedure was tested on Windows 10 using Visual Studio 2022.

1. Open the Remesher.sln solution in Visual Studio.
2. Build the `ALL_BUILD` project.
3. The `.pyd` file will be in `build/[Debug OR Release]`. Add this directory to your path.

#### Troubleshooting

- The `remesh` project needs to output a static library (`.lib`) but by default may output a dynamic library (`.dll`). To fix this, open the project properties and change `Configuration Properties > General > Configuration Type` to `Static Library (.lib)` and change `Configuration Properties > Advanced > Target File Extension` to `.lib`.
- The `pyremesh` project needs to find python on the path to build. The simplest (but probably wrong) way seems to be: disable the `python` execution alias in `System Settings > Manage App Execution Aliases` (OS settings, not visual studio). And then manually add a python executable to the system path.
- There is currently [a pybind11 bug](https://github.com/pybind/pybind11/issues/3459) that causes errors on debug builds. Simplest fix: build with a Release config.


### Setting the Path

Once you built the project, a script `setpath.sh` will be copied to your build
Expand Down
4 changes: 2 additions & 2 deletions src/collapse_edges.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
#define COLLAPSE_EDGES



#include "macros.h"
#include <Eigen/Core>

BOTSCH_EXPORT
void collapse_edges(Eigen::MatrixXd & V,Eigen::MatrixXi & F, Eigen::VectorXi & feature, Eigen::VectorXd & high, Eigen::VectorXd & low);


Expand Down
4 changes: 2 additions & 2 deletions src/equalize_valences.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
#define EQUALIZE_VALENCES



#include "macros.h"
#include <Eigen/Core>

BOTSCH_EXPORT
void equalize_valences(Eigen::MatrixXd & V,Eigen::MatrixXi & F, Eigen::VectorXi & feature);


Expand Down
5 changes: 5 additions & 0 deletions src/macros.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#if defined(_MSC_VER)
# define BOTSCH_EXPORT __declspec(dllexport)
#else
# define BOTSCH_EXPORT
#endif
20 changes: 10 additions & 10 deletions src/remesh_botsch.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@
#define REMESH_BOTSCH



#include "macros.h"
#include <Eigen/Core>

BOTSCH_EXPORT
void remesh_botsch(Eigen::MatrixXd & V,Eigen::MatrixXi & F,Eigen::VectorXd & target,int iters, Eigen::VectorXi & feature, bool project);


BOTSCH_EXPORT
void remesh_botsch(Eigen::MatrixXd & V,Eigen::MatrixXi & F,Eigen::VectorXd & target,int iters, Eigen::VectorXi & feature);

BOTSCH_EXPORT
void remesh_botsch(Eigen::MatrixXd & V,Eigen::MatrixXi & F, Eigen::VectorXd & target,int iters);

BOTSCH_EXPORT
void remesh_botsch(Eigen::MatrixXd & V,Eigen::MatrixXi & F, Eigen::VectorXd & target,int iters, bool project);

BOTSCH_EXPORT
void remesh_botsch(Eigen::MatrixXd & V,Eigen::MatrixXi & F, Eigen::VectorXd & target);

BOTSCH_EXPORT
void remesh_botsch(Eigen::MatrixXd & V,Eigen::MatrixXi & F, double target_double,int iters);

BOTSCH_EXPORT
void remesh_botsch(Eigen::MatrixXd & V,Eigen::MatrixXi & F, double target_double,int iters, bool project);

BOTSCH_EXPORT
void remesh_botsch(Eigen::MatrixXd & V,Eigen::MatrixXi & F, double target_double);

BOTSCH_EXPORT
void remesh_botsch(Eigen::MatrixXd & V,Eigen::MatrixXi & F);


Expand Down
4 changes: 2 additions & 2 deletions src/split_edges.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
#define SPLIT_EDGES



#include "macros.h"
#include <Eigen/Core>

BOTSCH_EXPORT
void split_edges(Eigen::MatrixXd & V,Eigen::MatrixXi & F, Eigen::MatrixXi & E0, Eigen::MatrixXi & uE, Eigen::VectorXi & EMAP0, std::vector<std::vector<int>> & uE2E,Eigen::VectorXd & high, Eigen::VectorXd & low,const std::vector<int> & edges_to_split);


Expand Down
4 changes: 2 additions & 2 deletions src/split_edges_until_bound.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
#define SPLIT_EDGES_UNTIL_BOUND



#include "macros.h"
#include <Eigen/Core>

BOTSCH_EXPORT
void split_edges_until_bound(Eigen::MatrixXd & V,Eigen::MatrixXi & F, Eigen::VectorXi & feature, Eigen::VectorXd & high, Eigen::VectorXd & low);


Expand Down
4 changes: 2 additions & 2 deletions src/tangential_relaxation.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
#define TANGENTIAL_RELAXATION



#include "macros.h"
#include <Eigen/Core>

BOTSCH_EXPORT
void tangential_relaxation(Eigen::MatrixXd & V,Eigen::MatrixXi & F, Eigen::VectorXi & feature,
Eigen::MatrixXd & V0 ,Eigen::MatrixXi & F0, Eigen::VectorXd & lambda);

Expand Down