Coder Social home page Coder Social logo

pmp-library / pmp-library Goto Github PK

View Code? Open in Web Editor NEW
1.2K 39.0 152.0 23.04 MB

The Polygon Mesh Processing Library

Home Page: https://www.pmp-library.org

License: Other

CMake 2.90% C++ 96.37% C 0.73%
mesh-processing geometry-processing polygon-mesh triangle-mesh c-plus-plus surface-mesh remeshing parameterization curvature smoothing

pmp-library's Introduction

Introduction

build Coverage Status Latest Release DOI

The Polygon Mesh Processing Library is a modern C++ open-source library for processing and visualizing polygon surface meshes. Its main features are:

  • An efficient and easy-to-use mesh data structure
  • Standard algorithms such as decimation, remeshing, subdivision, or smoothing
  • Ready-to-use visualization tools
  • Seamless cross-compilation to JavaScript (demo)

Get Started

Clone the repository:

git clone https://github.com/pmp-library/pmp-library.git

Configure and build:

cd pmp-library && mkdir build && cd build && cmake .. && make

Run the mesh processing app:

./mpview ../data/off/bunny.off

Build your own tool:

#include <pmp/surface_mesh.h>

int main()
{
    pmp::SurfaceMesh mesh;
    pmp::read(mesh,"input.obj");
    // .. do awesome things with your mesh
    pmp::write(mesh,"output.obj");
}

Read the Docs

The user guide contains all you need to get started using PMP, including a tutorial covering mesh processing basics.

Contribute

Contributions to PMP are welcome! There are many ways you can help: Report any issues you find, help to improve the documentation, join our discussions forum, or contribute new code.

Acknowledge

If you are using PMP for research projects, please acknowledge its use by referencing

@software{pmp23,
  author = {Sieger, Daniel and Botsch, Mario},
  title = {{The Polygon Mesh Processing Library}},
  year = {2023},
  month = aug,
  version = {3.0.0},
  doi = {10.5281/zenodo.10866532},
  url = {https://github.com/pmp-library/pmp-library}
}

We acknowledge that PMP evolved from our previous work on Surface_mesh and OpenMesh.

License

PMP is provided under a simple and flexible MIT-style license allowing for both open-source and commercial usage.

pmp-library's People

Contributors

afabri avatar amagill avatar cwsamuelson avatar dsieger avatar fabienpean avatar grassofsky avatar joaobaptmg avatar mbotsch avatar menzelt avatar mmuman avatar mokafolio avatar nikolaseu avatar pjk136 avatar sloriot avatar swenninger-1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pmp-library's Issues

Document supported file formats

Description

Provide a user-friendly overview of the file formats we support:

  • for each geometry representation
  • which features
  • explain usage

using non-gpl eigen only

Hi,

All (l)gpl licensed code is strictly forbidden in our company and pmp version 1.2.1 can be compiled with EIGEN_MPL2_ONLY, which ensures that no (l)gpl code from eigen is used.

However, latest master 6deb834 seems to be unable to build with that macro defined.

I would like to ask what to expect in future: will pmp require (l)gpl licensed code or will this be fixed?

Thanks.

building pmp under Ubuntu 20 in WSL

This is not a bug but I did not find a better place to ask - so I'll give it a shot:

I'm trying to build the pmp-library under Ubuntu 20 in the Windows subsystem for Linux (WSL). More than half way through the build, I get lots of undefined references like this one:

[ 59%] Linking CXX executable ../../mconvert

/usr/bin/ld: CMakeFiles/mconvert.dir/mconvert.cpp.o: in function std::__cxx11::basic_string<char, std::char_traits, std::allocator >::basic_string(char const*, std::allocator const&) [clone .isra.19]':
mconvert.cpp:(.text+0x86): undefined reference to std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)'

I found that it might be related to the compiler version, but got the same error using gcc-7 and gcc-9 (>https://github.com/preshing/junction/issues/37>, and https://stackoverflow.com/questions/33394934/converting-std-cxx11string-to-stdstring)

I also found that it might be related to the command used for compiling. Using gcc the c standard lib has to linked explicitly, using g++ it is linked automatically. But did not find the information in the make files.

Any idea how to fix this error? I posted the entire output below...

[ 59%] Linking CXX executable ../../mconvert /usr/bin/ld: CMakeFiles/mconvert.dir/mconvert.cpp.o: in function std::__cxx11::basic_string<char, std::char_traits, std::allocator >::basic_string(char const*, std::allocator const&) [clone .isra.19]':
mconvert.cpp:(.text+0x86): undefined reference to std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)' /usr/bin/ld: mconvert.cpp:(.text+0xbc): undefined reference to std::__throw_logic_error(char const*)'
/usr/bin/ld: CMakeFiles/mconvert.dir/mconvert.cpp.o: in function usage_and_exit()': mconvert.cpp:(.text+0xca): undefined reference to std::cerr'
/usr/bin/ld: mconvert.cpp:(.text+0xd8): undefined reference to std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, long)' /usr/bin/ld: mconvert.cpp:(.text+0xe6): undefined reference to std::cerr'
/usr/bin/ld: mconvert.cpp:(.text+0xf0): undefined reference to std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, long)' /usr/bin/ld: mconvert.cpp:(.text+0xf7): undefined reference to std::cerr'
/usr/bin/ld: mconvert.cpp:(.text+0x103): undefined reference to std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)' /usr/bin/ld: CMakeFiles/mconvert.dir/mconvert.cpp.o: in function main':
mconvert.cpp:(.text.startup+0xff): undefined reference to operator delete(void*)' /usr/bin/ld: mconvert.cpp:(.text.startup+0x116): undefined reference to std::cerr'
/usr/bin/ld: mconvert.cpp:(.text.startup+0x120): undefined reference to std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, long)' /usr/bin/ld: mconvert.cpp:(.text.startup+0x127): undefined reference to std::cerr'
/usr/bin/ld: mconvert.cpp:(.text.startup+0x12f): undefined reference to std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)' /usr/bin/ld: mconvert.cpp:(.text.startup+0x13e): undefined reference to std::basic_ostream<char, std::char_traits >& std::operator<< <std::char_traits >(std::basic_ostream<char, std::char_traits >&, char const*)'
/usr/bin/ld: mconvert.cpp:(.text.startup+0x19d): undefined reference to operator delete(void*)' /usr/bin/ld: mconvert.cpp:(.text.startup+0x1b0): undefined reference to std::cerr'
/usr/bin/ld: mconvert.cpp:(.text.startup+0x1ba): undefined reference to std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, long)' /usr/bin/ld: mconvert.cpp:(.text.startup+0x1c1): undefined reference to std::cerr'
/usr/bin/ld: mconvert.cpp:(.text.startup+0x1c9): undefined reference to std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)' /usr/bin/ld: mconvert.cpp:(.text.startup+0x1ee): undefined reference to operator delete(void*)'
/usr/bin/ld: CMakeFiles/mconvert.dir/mconvert.cpp.o: in function _GLOBAL__sub_I__Z14usage_and_exitv': mconvert.cpp:(.text.startup+0x21c): undefined reference to std::ios_base::Init::Init()'
/usr/bin/ld: mconvert.cpp:(.text.startup+0x223): undefined reference to std::ios_base::Init::~Init()' /usr/bin/ld: CMakeFiles/mconvert.dir/mconvert.cpp.o:(.data.rel.local.DW.ref.__gxx_personality_v0[DW.ref.__gxx_personality_v0]+0x0): undefined reference to __gxx_personality_v0'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to std::ostream& std::ostream::_M_insert<unsigned long>(unsigned long)' /usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to std::basic_ios<char, std::char_traits >::init(std::basic_streambuf<char, std::char_traits >)'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to std::ctype<char>::_M_widen_init() const' /usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to VTT for std::__cxx11::basic_ostringstream<char, std::char_traits, std::allocator >'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to std::_Rb_tree_decrement(std::_Rb_tree_node_base*)' /usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to std::ios_base::~ios_base()'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to operator new[](unsigned long)' /usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to typeinfo for std::bad_alloc'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to std::_Rb_tree_increment(std::_Rb_tree_node_base*)' /usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to __cxa_end_catch'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::~basic_ostringstream()' /usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to std::basic_ofstream<char, std::char_traits >::~basic_ofstream()'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to __cxa_allocate_exception' /usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to std::_Rb_tree_increment(std::_Rb_tree_node_base const
)'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to std::bad_alloc::~bad_alloc()' /usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to atan2'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to vtable for std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >' /usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to std::ios_base::ios_base()'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::compare(char const*) const' /usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to std::cout'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to vtable for std::basic_ios<char, std::char_traits<char> >' /usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to std::locale::locale()'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to std::basic_filebuf<char, std::char_traits<char> >::open(char const*, std::_Ios_Openmode)' /usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to typeinfo for float'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to std::ostream& std::ostream::_M_insert<double>(double)' /usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to VTT for std::basic_ofstream<char, std::char_traits >'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to __cxa_guard_release' /usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to std::ostream::flush()'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to acos' /usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to typeinfo for double'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to typeinfo for bool' /usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to std::ostream::put(char)'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' /usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to std::basic_filebuf<char, std::char_traits >::close()'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()' /usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to vtable for std::basic_streambuf<char, std::char_traits >'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to __cxa_pure_virtual' /usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to std::basic_filebuf<char, std::char_traits >::basic_filebuf()'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to __cxa_throw_bad_array_new_length' /usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to __dynamic_cast'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to sin' /usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to std::__throw_bad_cast()'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to vtable for std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >' /usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to operator delete'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to sqrtf' /usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to std::clog'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to std::basic_ios<char, std::char_traits<char> >::clear(std::_Ios_Iostate)' /usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to vtable for std::bad_alloc'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to tan' /usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to std::_Rb_tree_rebalance_for_erase(std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to __cxa_begin_catch' /usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to __cxa_rethrow'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to __cxa_throw' /usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to std::__cxx11::basic_string<char, std::char_traits, std::allocator >::rfind(char const*, unsigned long, unsigned long) const'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to std::locale::~locale()' /usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to vtable for std::basic_ofstream<char, std::char_traits >'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to cos' /usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to typeinfo for int'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to vtable for __cxxabiv1::__si_class_type_info' /usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to std::basic_filebuf<char, std::char_traits >::basic_filebuf()'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to operator new(unsigned long)' /usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to std::__basic_file::
__basic_file()'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to std::__throw_out_of_range_fmt(char const*, ...)' /usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to sqrt'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to sincosf' /usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to vtable for std::basic_filebuf<char, std::char_traits >'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to std::__throw_length_error(char const*)' /usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to vtable for __cxxabiv1::__class_type_info'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to std::ostream::operator<<(int)' /usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to std::_Rb_tree_insert_and_rebalance(bool, std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to std::__throw_bad_alloc()' /usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to vtable for __cxxabiv1::__vmi_class_type_info'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to __cxa_guard_acquire' collect2: error: ld returned 1 exit status make[2]: *** [src/apps/CMakeFiles/mconvert.dir/build.make:85: mconvert] Error 1 make[1]: *** [CMakeFiles/Makefile2:544: src/apps/CMakeFiles/mconvert.dir/all] Error 2 make: *** [Makefile:163: all] Error 2

Fitting a NURB surface to a mesh

Not sure if this is requested before.

We get asked about this a lot to convert a mesh generated from a volumetric image like CT to a NURB surface that can be imported to a 3D CAD package like Solidworks for modeling use. A STL file of triangle mesh can be problematic when the number of faces is huge.

It would be a powerful function to have.

Thanks

Ted

Very slow hole filling

Attempting to fill holes on a large mesh is extremely slow. At a fist look the reason seems to be the garbage collector run 10 times for each hole, garbage collector that is very slow, especially for large meshes:

  • is garbage collector really needed during hole filling or can it be avoided?
  • can the garbage collector be optimized?

I can provide an ex mesh, but any large mesh will do it. For ex a mesh with 8M faces and 81 small holes (<30 edges) takes 16min on a very fast CPU.
Windows 10 x64, Visual Studio 2019

How to use libpmp library on javascript?

Hi, I'd like to give it a shot to pmp-library with javascript, I've just followed the docs that says:

mkdir jsbuild
cd jsbuild
emconfigure cmake ..
make

and as a result I've got this:

>ls
CMakeCache.txt           curview.wasm     libimgui.a      mview.wasm             smoothing.html
CMakeFiles               decimation.data  libpmp.a        parameterization.data  smoothing.js
CPackConfig.cmake        decimation.html  libpmp_vis.a    parameterization.html  smoothing.wasm
CPackSourceConfig.cmake  decimation.js    libstb_image.a  parameterization.js    src
build.ninja              decimation.wasm  mpview.data     parameterization.wasm  subdiv.data
cmake_install.cmake      external         mpview.html     remeshing.data         subdiv.html
cmake_uninstall.cmake    fairing.data     mpview.js       remeshing.html         subdiv.js
curview.data             fairing.html     mpview.wasm     remeshing.js           subdiv.wasm
curview.html             fairing.js       mview.html      remeshing.wasm
curview.js               fairing.wasm     mview.js        smoothing.data

This is the first time I'm using emscripten so I'm a little bit lost... but I understand I should get a wasm file of libpmp, isn't? Could you please explain how to use just the library on javascript?

Missing EdgeSetIO write support

Description

EdgeSetIO currently does not support writing an EdgeSet to any file format.

How to Reproduce

  1. Call EdgeSet::write() and watch it fail

Expected behavior

Support at least .knt format used in tests

Actual behavior

Only supports writing .xyz files through PointSet but silently fails for .knt

Reproducibility

100%

Some problem about the Linear Algebra module

Hi,
I wanted to use your library to implement some algorithm. But I found that I can't input the matrix in the same way as Eigen.

Matrix3i m1;
m1 << 1, 2, 3,
      4, 5, 6,
      7, 8, 9;

And I can't find any methods in the API document. Can you please tell me if there is an elegant approach to input the matrix ?
Furthermore, I want to know that how to create a m * n matrix?
Thank you for your help.

Need help with the principle of implicit smoothing

Description

When i read the source code of SurfaceSmoothing::implicit_smoothing, i find below source code, the calculation of b for fixed boundary vertex -> right hand side, could not be understood.

    // setup matrix A and rhs B
    dvec3 b;
    double ww;
    Vertex v, vv;
    Edge e;
    for (unsigned int i = 0; i < n; ++i)
    {
        v = free_vertices[i];

        // rhs row
        b = static_cast<dvec3>(points[v]) / vweight[v];

        // lhs row
        ww = 0.0;
        for (auto h : mesh_.halfedges(v))
        {
            vv = mesh_.to_vertex(h);
            e = mesh_.edge(h);
            ww += eweight[e];

            // fixed boundary vertex -> right hand side
            if (mesh_.is_boundary(vv))
            {
                b -= -timestep * eweight[e] * static_cast<dvec3>(points[vv]);
            }
            // free interior vertex -> matrix
            else
            {
                triplets.emplace_back(i, idx[vv], -timestep * eweight[e]);
            }

            B.row(i) = (Eigen::Vector3d)b;
        }

        // center vertex -> matrix
        triplets.emplace_back(i, i, 1.0 / vweight[v] + timestep * ww);
    }

I look through the paper "Implicit fairing of irregular meshes using diffusion and curvature flow.", and not find the related explaination.

Can you give me some more related material for understanding the inner principle

How to effectively use the mesh smoothing function?

Hi,

I'm trying to use the "SurfaceSmoothing" class to smooth a surface mesh generated using MarchingCube algorithm.

I used the "ExplicitSmoothing" with the default parameters, but somehow I don't see any smoothing effect. The surface looks like before, with all the voxel edges etc. I'd like to get a smoother surface for the mesh.

This example is a portion of the mesh after 10 iterations of smoothing:

image

I'd like to get some feedback, if I'm using the right class and what values to use for the parameters.

Thanks for the great library you have developed, keep up the good work!

Ted

VCPKG integration

vcpkg is a relatively new library managing system, primarily developed for Windows, but running on Linux and Mac too. I find it extremely useful and easy to use, and I'm sure many other too. Are you considering adding your library to vcpkg in order to make it easy to access?

Add dllexport mechanism to allow dll usage

We currently only support static libs on Windows. Adding a dllexport mechanism would allow users to use shared libs as well, which might be necessary due to legal or other project requirements.

Geodesic path between two mesh points

Hi,

Given a mesh and two points represented as triples (triangleId,baricentricCoord1,baricentricCoord2), is it possible to compute the "geodesic path" (represented somehow) between such vertices on the mesh?

I can see you have a function for "geodesic distance" but I'm not sure about the path.

Can't build using CMake GUI

Describe the bug
am trying to build the source code using the CMake GUI but when generating i got the following error

Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.17134.
The C compiler identification is MSVC 19.16.27026.1
The CXX compiler identification is MSVC 19.16.27026.1
Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe
Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Detecting C compile features
Detecting C compile features - done
Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe
Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Detecting CXX compile features
Detecting CXX compile features - done
CMake Error at CMakeLists.txt:39 (add_subdirectory):
  The source directory

    D:/PythonInC#/pmp-library/pmp-library/external/glfw

  does not contain a CMakeLists.txt file.


CMake Warning (dev) at CMakeLists.txt:115 (if):
  Policy CMP0054 is not set: Only interpret if() arguments as variables or
  keywords when unquoted.  Run "cmake --help-policy CMP0054" for policy
  details.  Use the cmake_policy command to set the policy and suppress this
  warning.

  Quoted variables like "MSVC" will no longer be dereferenced when the policy
  is set to NEW.  Since the policy is not set the OLD behavior will be used.
This warning is for project developers.  Use -Wno-dev to suppress it.

No build type specified. Using 'Release' as default.
clang-tidy not found.
CMake Warning (dev) at src/pmp/CMakeLists.txt:4 (if):
  Policy CMP0054 is not set: Only interpret if() arguments as variables or
  keywords when unquoted.  Run "cmake --help-policy CMP0054" for policy
  details.  Use the cmake_policy command to set the policy and suppress this
  warning.

  Quoted variables like "MSVC" will no longer be dereferenced when the policy
  is set to NEW.  Since the policy is not set the OLD behavior will be used.
This warning is for project developers.  Use -Wno-dev to suppress it.

Found OpenMP_C: -openmp (found version "2.0") 
Found OpenMP_CXX: -openmp (found version "2.0") 
Found OpenMP: TRUE (found version "2.0")  
Found OpenGL: opengl32   
Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) 
Doxygen not found. Please get a copy http://www.doxygen.org
Doxygen version too old. Please get a copy http://www.doxygen.org
clang-format not found.
Configuring incomplete, errors occurred!
See also "D:/PythonInC#/pmp-library/build/CMakeFiles/CMakeOutput.log".

To Reproduce
Steps to reproduce the behavior:

  1. Clone the repo using git git clone https://github.com/pmp-library/pmp-library.git
  2. install and run Cmake Gui
  3. specify the folder of the source and the build folder then hit configure button
  4. select visual studio 15 2017 as the generator for this project
    Expected behavior
    to have the project configured then be able to generate a VS solution to build from as used in this tutorial
    Screenshots
    capture

Environment (please complete the following information):

  • OS: windows 10 64bit
  • Visual studio 2017 community

Additional context
the target to to build the libirary as a .dll file to use in a C# project

Viewer

Hi,
can i switch 3d model ortho and perspective mode?

best,
jignesh

Help needed

Description

Can you provide help on compiling/linking an example program? I'm trying to get SurfaceMeshBasics.cpp to compile and run on my Mac running OS 10.15.7 .

My first attempt failed because it couldn't find the Eigen/Dense header. I believe I fixed that. My second attempt failed because it couldn't understand constantexp (or something like that). I added the -std=c++11 flag, which seems to have fixed that.

My third attempt is to try to execute cc SurfaceMeshBasics.cpp -std=c++11 -lpmp -o test which now fails because of linker errors (undefined symbols).

I now get ...

cc SurfaceMeshBasics.cpp -std=c++11 -lpmp -o test
Undefined symbols for architecture x86_64:
"std::__1::locale::use_facet(std::__1::locale::id&) const", referenced from:
std::__1::ctype const& std::__1::use_facet<std::__1::ctype >(std::__1::locale const&) in SurfaceMeshBasics-4124ec.o
"std::__1::ios_base::getloc() const", referenced from:
std::__1::basic_ios<char, std::__1::char_traits >::widen(char) const in SurfaceMeshBasics-4124ec.o
"std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >::__init(unsigned long, char)", referenced from:
std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >::basic_string(unsigned long, char) in SurfaceMeshBasics-4124ec.o
"std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >::~basic_string()", referenced from:
std::__1::ostreambuf_iterator<char, std::__1::char_traits > std::__1::__pad_and_output<char, std::__1::char_traits >(std::__1::ostreambuf_iterator<char, std::__1::char_traits >, char const*, char const*, char const*, std::__1::ios_base&, char) in SurfaceMeshBasics-4124ec.o
"std::__1::basic_ostream<char, std::__1::char_traits >::put(char)", referenced from:
std::__1::basic_ostream<char, std::__1::char_traits >& std::__1::endl<char, std::__1::char_traits >(std::__1::basic_ostream<char, std::__1::char_traits >&) in SurfaceMeshBasics-4124ec.o
"std::__1::basic_ostream<char, std::__1::char_traits >::flush()", referenced from:
std::__1::basic_ostream<char, std::__1::char_traits >& std::__1::endl<char, std::__1::char_traits >(std::__1::basic_ostream<char, std::__1::char_traits >&) in SurfaceMeshBasics-4124ec.o

...

It looks to me like the linker is finding the pmp library, but that the library is not what it's expecting. I followed the instructions I found for building and installing the library.

My knowledge of and experience with C++ are obviously limited. But I have a reasonable expectation of accomplishing what I want to -- provided I can get past this step.

(Incidentally, have you considered providing Python bindings?)

Thanks for your help!

Murray

How to Reproduce

Described above.

Expected behavior

An executable which, when run, prints the expected output.

Actual behavior

Link fails.

Reproducibility

100%

Segmentation fault after using SurfaceRemeshing

Description

In SurfaceRemeshing.uniform() a segmentation fault can occur. I am not entirely sure as to why or how this happens.

How to Reproduce

  1. Download m1021.off from the Princeton Shape Benchmark by clicking here.
    • You will download a ZIP. The file is in benchmark/db/10/m1021/m1021.off
  2. Call the mpview example application that is provided as part of the PMP library with the just downloaded file
./mpview "path/to/m1021.off"
  1. Click the Uniform Remeshing button

Expected behavior

Either a succesful remeshing operation or a detectable error (return value or a thrown exception) that explains us why this mesh cannot be used with the remeshing algorithm.

Actual behavior

A segmentation fault.

Reproducibility

100%

run error in VS2015

ๅ›พ็‰‡

i generated in cmake successfully ,but occured error when i used in vs2015 win10.
please give me help ,thank you.

Surface parametrization failed

Describe the bug
I'm experiencing a lot of surface parametrization fails (lscm mode), even with simple meshes. At the beginning I thought it was due to non-manifold meshes. But seems is also happening with manifold ones.

To Reproduce

Added a patch of a bigger mesh where the parametrization is already failing.
Just load the mesh and

pmp::SurfaceParameterization param(mesh);
param.lscm();

The error I get is:

SurfaceParameterization: Could not solve linear system

Here you have the mesh:

v -0.7163615227 0.0070284996 -0.6694365144
v -0.7187205553 0.0072185006 -0.6963074803
v -0.7367604971 0.0071144998 -0.6924955249
v -0.7344155312 0.0081265010 -0.6661835313
v -0.7174115181 0.0070054997 -0.7214004993
v -0.7372324467 0.0062004998 -0.7174305320
v -0.6941875219 0.0069044996 -0.6741214991
v -0.6956804991 0.0083875004 -0.7014294863
v -0.6478462815 0.0043691583 -0.5512301326
v -0.6589392424 0.0047934959 -0.5512301326
v -0.6554839611 0.0046613216 -0.5512301326
v -0.6709845066 0.0052074995 -0.6796914935
v -0.6720294952 0.0064525008 -0.7061825395
v -0.6515884399 0.0051004998 -0.5662325025
v -0.6721204519 0.0068165008 -0.7349734902
v -0.6477094889 0.0047705006 -0.6854125261
v -0.6487824917 0.0062985010 -0.7109814882
v -0.6387109756 0.0040080207 -0.5512301326
v -0.6491094828 0.0071565006 -0.7308275104
v -0.6297174692 0.0044315010 -0.5712625384
v -0.6245731115 0.0042155883 -0.5512301326
v -0.6189453006 0.0038505008 -0.5512301326
v -0.5997148752 0.0024406761 -0.5512301326
v -0.7305405140 0.0059715007 -0.6389564872
v -0.6013924479 0.0025071856 -0.5512301326
v -0.7119884491 0.0064955000 -0.6418855190
v -0.5865994692 0.0021995008 -0.5834735036
v -0.5927397013 0.0022911043 -0.5512301326
v -0.5778506398 0.0021319501 -0.5512301326
v -0.6900445223 0.0075905006 -0.6463505030
v -0.5618433952 0.0024415101 -0.5618459582
v -0.5618433952 0.0024919698 -0.5659798384
v -0.5618433952 0.0025049262 -0.5779944062
v -0.5618433952 0.0026342745 -0.5921446085
v -0.6675474644 0.0060415007 -0.6515235305
v -0.5709935427 0.0031215008 -0.6189585328
v -0.5618433952 0.0033831855 -0.6222074628
v -0.5618433952 0.0039914711 -0.6375563145
v -0.5618433952 0.0041960650 -0.6431018114
v -0.5755004883 0.0040725004 -0.6471894979
v -0.5618433952 0.0032420789 -0.6122533083
v -0.6449904442 0.0041095000 -0.6570414901
v -0.7356004715 0.0062144995 -0.7349734902
v -0.7491245270 0.0033355001 -0.7349734902
v -0.7491245270 0.0035375003 -0.7152515054
v -0.7491245270 0.0041765012 -0.6373705268
v -0.7478195429 0.0077884998 -0.6642045379
v -0.7491245270 0.0069535002 -0.6737325191
v -0.5924414396 0.0034595001 -0.6117604971
v -0.5971264839 0.0051975008 -0.6403545141
v -0.6946295500 0.0076505002 -0.7349734902
v -0.6139675379 0.0033884998 -0.6055175066
v -0.6188185215 0.0040125009 -0.6341854930
v -0.7491245270 0.0000000000 -0.6649144888
v -0.7491245270 0.0000000000 -0.6737325191
v -0.7491245270 0.0000000000 -0.6640315056
v -0.6355965137 0.0048645008 -0.5998325348
v -0.7491245270 0.0000000000 -0.6903535128
v -0.7491245270 0.0000000000 -0.6752654314
v -0.7491245270 0.0000000000 -0.6922904253
v -0.7491245270 0.0000000000 -0.7152515054
v -0.6406924725 0.0054564998 -0.6284515262
v -0.7491245270 0.0000000000 -0.6431018114
v -0.7491245270 0.0000000000 -0.7162207961
v -0.7491245270 0.0000000000 -0.7349734902
v -0.7339679599 0.0000000000 -0.7349734902
v -0.7159885168 0.0000000000 -0.7349734902
v -0.7356004715 0.0000000000 -0.7349734902
v -0.6946295500 0.0000000000 -0.7349734902
v -0.7140588164 0.0000000000 -0.7349734902
v -0.6923664212 0.0000000000 -0.7349734902
v -0.6721204519 0.0000000000 -0.7349734902
v -0.6700392365 0.0000000000 -0.7349734902
v -0.6491425037 0.0000000000 -0.7349734902
v -0.6554839611 0.0000000000 -0.7349734902
v -0.7484960556 0.0000000000 -0.7349734902
v -0.7491245270 0.0000000002 -0.7349734902
v -0.7264585495 0.0055155009 -0.6120445132
v -0.7455455065 0.0061045010 -0.6373324990
v -0.7431335449 0.0020305011 -0.6109035015
v -0.6627974510 0.0066045001 -0.6231265068
v -0.7062654495 0.0055065006 -0.6145415306
v -0.5726109743 0.0022295041 -0.5512301326
v -0.5618433952 0.0025308651 -0.5512301326
v -0.6846865416 0.0054835007 -0.6184875369
v -0.5618433952 0.0025762089 -0.5886166692
v -0.6033835411 0.0062074997 -0.7349734902
v -0.5792384148 0.0000000000 -0.7349734902
v -0.5808744431 0.0000000000 -0.7349734902
v -0.5618433952 0.0038664537 -0.7349734902
v -0.5618433952 0.0000000000 -0.7349734902
v -0.5618433952 0.0047717923 -0.7349734902
v -0.6015117764 0.0000000000 -0.7349734902
v -0.6033835411 0.0000000000 -0.7349734902
v -0.7175284624 0.0034545008 -0.5578095317
v -0.7223434448 0.0054145008 -0.5849955082
v -0.7419434786 0.0034414995 -0.5837435126
v -0.7355521321 0.0032537105 -0.5512301326
v -0.6959334612 0.0041405000 -0.5594105124
v -0.7011774778 0.0047705006 -0.5870954990
v -0.6737794876 0.0056325011 -0.5622094870
v -0.6793215275 0.0054465011 -0.5903185010
v -0.6072021127 0.0000000000 -0.7349734902
v -0.6075545549 0.0000000000 -0.7349734902
v -0.6244798303 0.0000000000 -0.7349734902
v -0.6261655092 0.0000000000 -0.7349734902
v -0.6470394731 0.0000000000 -0.7349734902
v -0.5618433952 0.0045137140 -0.6517116427
v -0.5785734653 0.0048855003 -0.6749745011
v -0.5618433952 0.0047299732 -0.6799957156
v -0.5618433952 0.0048280000 -0.6997354031
v -0.6712123156 0.0051663811 -0.5512301326
v -0.6795884967 0.0050035608 -0.5512301326
v -0.6941789985 0.0040637068 -0.5512301326
v -0.7003914118 0.0039176587 -0.5512301326
v -0.7161245346 0.0034299418 -0.5512301326
v -0.7205038667 0.0033654438 -0.5512301326
v -0.5618433952 0.0050669205 -0.7049937844
v -0.5801324844 0.0061655007 -0.7007204890
v -0.7491245270 0.0008645002 -0.5563964844
v -0.7454285622 0.0012955334 -0.5512301326
v -0.7491245270 0.0010908043 -0.5512301326
v -0.7491245270 0.0000000000 -0.6104965210
v -0.5618433952 0.0048167096 -0.6612778306
v -0.7491245270 0.0000000000 -0.6105730534
v -0.7491245270 0.0000000000 -0.6373705268
v -0.6005444527 0.0061544999 -0.6686275005
v -0.6024965048 0.0068635009 -0.6951605082
v -0.7491245270 0.0000000000 -0.6389039159
v -0.7491245270 0.0000000000 -0.5833604932
v -0.7491245270 0.0000000000 -0.5567328334
v -0.7491245270 0.0000000000 -0.5563964844
v -0.7491245270 0.0000000000 -0.5836412311
v -0.6225805283 0.0053805001 -0.6626535058
v -0.7491245270 0.0005596421 -0.5512301326
v -0.7491245270 0.0000000000 -0.5512301326
v -0.6249915361 0.0060364995 -0.6902045012
v -0.6259135008 0.0060035009 -0.7153034806
v -0.6032265425 0.0068354998 -0.7192485332
v -0.5618433952 0.0048708180 -0.7273030281
v -0.5618433952 0.0049936040 -0.7089808583
v -0.5618433952 0.0049470384 -0.7252701521
f 1//1 2//2 3//3
f 3//3 4//4 1//1
f 5//5 6//6 3//3
f 3//3 2//2 5//5
f 7//7 8//8 2//2
f 2//2 1//1 7//7
f 8//8 5//5 2//2
f 9//9 10//10 11//11
f 12//12 13//13 8//8
f 8//8 7//7 12//12
f 14//14 10//10 9//9
f 8//8 13//13 15//15
f 13//13 16//16 17//17
f 13//13 12//12 16//16
f 14//14 9//9 18//18
f 15//15 13//13 19//19
f 20//20 14//14 18//18
f 13//13 17//17 19//19
f 20//20 18//18 21//21
f 20//20 21//21 22//22
f 23//23 20//20 22//22
f 1//1 4//4 24//24
f 23//23 22//22 25//25
f 1//1 24//24 26//26
f 27//27 23//23 28//28
f 7//7 1//1 26//26
f 29//29 27//27 28//28
f 30//30 7//7 26//26
f 29//29 31//31 32//32
f 27//27 29//29 32//32
f 27//27 32//32 33//33
f 34//34 27//27 33//33
f 12//12 7//7 30//30
f 30//30 35//35 12//12
f 36//36 37//37 38//38
f 36//36 38//38 39//39
f 36//36 39//39 40//40
f 12//12 35//35 16//16
f 36//36 34//34 41//41
f 35//35 42//42 16//16
f 6//6 43//43 44//44
f 44//44 45//45 6//6
f 46//46 47//47 48//48
f 48//48 47//47 4//4
f 48//48 4//4 3//3
f 36//36 41//41 37//37
f 3//3 6//6 45//45
f 45//45 48//48 3//3
f 49//49 36//36 40//40
f 50//50 49//49 40//40
f 49//49 27//27 34//34
f 43//43 6//6 5//5
f 5//5 51//51 43//43
f 51//51 5//5 8//8
f 34//34 36//36 49//49
f 51//51 8//8 15//15
f 52//52 49//49 50//50
f 50//50 53//53 52//52
f 52//52 23//23 27//27
f 27//27 49//49 52//52
f 46//46 48//48 54//54
f 48//48 55//55 54//54
f 46//46 54//54 56//56
f 57//57 52//52 53//53
f 48//48 58//58 59//59
f 48//48 59//59 55//55
f 48//48 45//45 60//60
f 45//45 61//61 60//60
f 48//48 60//60 58//58
f 53//53 62//62 57//57
f 57//57 20//20 23//23
f 56//56 63//63 46//46
f 45//45 44//44 64//64
f 44//44 65//65 64//64
f 45//45 64//64 61//61
f 43//43 51//51 66//66
f 51//51 67//67 66//66
f 43//43 66//66 68//68
f 23//23 52//52 57//57
f 51//51 69//69 70//70
f 51//51 70//70 67//67
f 51//51 15//15 71//71
f 15//15 72//72 71//71
f 51//51 71//71 69//69
f 62//62 14//14 57//57
f 73//73 15//15 74//74
f 73//73 74//74 75//75
f 15//15 73//73 72//72
f 44//44 43//43 76//76
f 43//43 68//68 76//76
f 44//44 76//76 77//77
f 78//78 24//24 79//79
f 79//79 80//80 78//78
f 79//79 4//4 47//47
f 79//79 24//24 4//4
f 62//62 81//81 14//14
f 82//82 26//26 24//24
f 24//24 78//78 82//82
f 20//20 57//57 14//14
f 31//31 83//83 84//84
f 29//29 83//83 31//31
f 85//85 30//30 26//26
f 34//34 33//33 86//86
f 26//26 82//82 85//85
f 62//62 35//35 81//81
f 87//87 88//88 89//89
f 81//81 35//35 30//30
f 85//85 81//81 30//30
f 88//88 90//90 91//91
f 88//88 92//92 90//90
f 87//87 92//92 88//88
f 87//87 93//93 94//94
f 87//87 89//89 93//93
f 95//95 96//96 97//97
f 97//97 98//98 95//95
f 78//78 80//80 97//97
f 97//97 96//96 78//78
f 99//99 100//100 96//96
f 96//96 95//95 99//99
f 82//82 78//78 96//96
f 96//96 100//100 82//82
f 101//101 102//102 100//100
f 100//100 99//99 101//101
f 85//85 82//82 100//100
f 100//100 102//102 85//85
f 87//87 103//103 104//104
f 87//87 94//94 103//103
f 102//102 101//101 14//14
f 87//87 105//105 106//106
f 81//81 85//85 102//102
f 102//102 14//14 81//81
f 87//87 104//104 105//105
f 15//15 107//107 74//74
f 87//87 106//106 107//107
f 15//15 87//87 107//107
f 15//15 19//19 87//87
f 108//108 40//40 39//39
f 101//101 10//10 14//14
f 109//109 110//110 111//111
f 101//101 112//112 10//10
f 101//101 113//113 112//112
f 101//101 99//99 113//113
f 99//99 114//114 113//113
f 99//99 115//115 114//114
f 99//99 95//95 115//115
f 95//95 116//116 115//115
f 95//95 117//117 116//116
f 95//95 98//98 117//117
f 109//109 111//111 118//118
f 119//119 109//109 118//118
f 120//120 121//121 98//98
f 120//120 122//122 121//121
f 80//80 79//79 46//46
f 46//46 123//123 80//80
f 40//40 108//108 124//124
f 109//109 40//40 124//124
f 79//79 47//47 46//46
f 120//120 98//98 97//97
f 109//109 124//124 110//110
f 97//97 80//80 123//123
f 123//123 120//120 97//97
f 123//123 46//46 125//125
f 46//46 126//126 125//125
f 127//127 109//109 119//119
f 119//119 128//128 127//127
f 127//127 50//50 40//40
f 129//129 46//46 63//63
f 46//46 129//129 126//126
f 40//40 109//109 127//127
f 120//120 130//130 131//131
f 120//120 131//131 132//132
f 120//120 123//123 133//133
f 134//134 127//127 128//128
f 120//120 133//133 130//130
f 120//120 135//135 122//122
f 120//120 132//132 135//135
f 132//132 136//136 135//135
f 128//128 137//137 134//134
f 134//134 53//53 50//50
f 127//127 134//134 50//50
f 42//42 134//134 137//137
f 137//137 16//16 42//42
f 42//42 62//62 53//53
f 137//137 138//138 17//17
f 17//17 16//16 137//137
f 87//87 19//19 17//17
f 17//17 138//138 87//87
f 128//128 139//139 138//138
f 138//138 137//137 128//128
f 138//138 139//139 87//87
f 134//134 42//42 53//53
f 42//42 35//35 62//62
f 119//119 140//140 139//139
f 139//139 128//128 119//119
f 87//87 140//140 92//92
f 87//87 139//139 140//140
f 140//140 141//141 142//142
f 140//140 119//119 141//141
f 119//119 118//118 141//141

Expected behavior
Create a parametrization for the mesh.

Environment (please complete the following information):

  • OS: Ubuntu 16.04
  • Compiler: clang-6
  • Build type: Debug/Release

MeshViewer

I met some problems with MeshViewer

I have installed the pmp-library and try to run some example. Everything was all right until I tried to use the MeshViewer. I found that there in no folder visualization in my pmp but there is a folder named gl
my pmp folder
I renamed the gl to visualization but when I build my project there is an error:
image
my code:

#include <iostream>
#include <string>
#include <pmp/visualization/MeshViewer.h>
using namespace std;
using namespace pmp;
int main() {
    MeshViewer viewer("test", 400, 300);
    return 0;
}

please give me some help

Bounding Selection in the viewer

There are some codes in algorithm relating on whether the nodes/elements are selected or not. Will pmp-library add the mouse selction api or functions? For example

  1. Interactive rectangle selection of nodes or elements;
  2. Hiding the selected nodes and elements.

Document custom property conventions

Description

In several places we use custom properties in a specific, pre-defined manner such as selecting a set of vertices. However, those conventions are rarely documented as they should be.

Regression in adaptive remeshing

Description

Performing adaptive remeshing with sharp features selected yields sub-optimal results in comparison to previous (internal) version.

How to reproduce

  1. Open fandisk.off from pmp-data repository
  2. Select sharp features with an angle of 22 degrees
  3. Perform adaptive remeshing with default parameters:
    • error: 0.001
    • min: 0.001
    • max: 1.0
    • iters: 10
    • relative edge length enabled
    • projection enabled

Expected behavior

Should at least perform as well as old version, see screen shots.

Screenshots

Current version:
image

Old version:
image

Environment

  • OS: Ubuntu 18.04
  • Compiler: gcc 7.4.0
  • Build type: Release

Planar Face offset

Hi,

Is there any feature in pmp-library that allows to offset mesh faces so that all connecting faces stays planar including x>3 valence?
The problem is described in more detailed here:

image
For 3 valence vertices the offset is granted but not for n valence not.

Any reference to possible implementations, would much appreciated.

Mesh repair

First of all thank you for sharing this great library.

I am developing an photogrammetry module (OpenMVS) and so I am using meshes at very low level. While this library would be enough for 99% of my needs, it has one feature missing, like most of the mesh libraries out there: repair a non-manifold mesh. During MVS reconstruction it is possible to get meshes with few non-manifold vertices/edges, so before doing any further processing I need to fix them (preferably not by simply deleting them, but by repairing: add a new vertex for non-manifold vertices, etc).

Is this library supporting this? I'm not able to find it. If I'd had that feature I will immediately switch OpenMVS to use it instead of VCG, which offers a lot of functionality, but has a very strange structure and many bugs.

Circulator compatibility with STL

Hi and thanks for this library. I like the interface a lot.

It seems like you strive to be compatible with the STL as much as possible, but I noticed that your circulators do not specialize std::iterator_traits. This is a shame, because it prevents me from using some STL algorithms or functions that are usually possible with pairs of iterators. For example, if I wanted to add all vertices of a vertex circulator to a container, I would call container.insert(container.end(), mesh.vertices(v).begin(), mesh.vertices(v).end()). This fails to compile with gcc, because it requires std::iterator_traits to be specialized (or the relevant typedefs to be directly included into the circulator type). Is there a specific reason why this can't be implemented? Are the circulators incompatible with the STL's LegacyIterator concepts? Or has it simply not been implemented yet? Some STL algorithms that theoretically require these concepts to be implemented seem to work fine, so maybe it just hasn't come up yet.

Best,

Timo

pmp fails to link

Describe the bug
The build fails to link.

[ 59%] Linking CXX executable ../../mconvert
ld: ../../libpmp.so.1.2.1: undefined reference to `GOMP_loop_nonmonotonic_dynamic_next'
ld: ../../libpmp.so.1.2.1: undefined reference to `GOMP_loop_nonmonotonic_dynamic_start'

To Reproduce
Clone the repo and build the project, i used no special option.

System Info

NAME="Ubuntu"
VERSION="20.04.1 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.1 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
gcc (Ubuntu 9.3.0-10ubuntu2) 9.3.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Cmake Output

-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Using X11 for window creation
-- Found X11: /usr/include   
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- No build type specified. Using 'Release' as default.
-- clang-tidy not found.
-- Found OpenMP_C: -fopenmp (found version "4.5") 
-- Found OpenMP_CXX: -fopenmp (found version "4.5") 
-- Found OpenMP: TRUE (found version "4.5")  
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so   
-- Found Doxygen: /usr/bin/doxygen (found version "1.8.17") found components: doxygen dot 
-- clang-format found: /home/mfg/.guix-profile/bin/clang-format
-- Configuring done
-- Generating done
-- Build files have been written to: /home/mfg/Documents/pmp-library/build

Locking vertices and edges instead/in addition to the selection

In function SurfaceRemeshing::preprocessing(), locked property is forcefully added as follows:

    vlocked_ = mesh_.add_vertex_property<bool>("v:locked", false);
    elocked_ = mesh_.add_edge_property<bool>("e:locked", false);

It would be convenient if the property is added only if it doesn't exist, so that users themselves can lock vertices and edges, instead of selecting remeshable vertices. So this locked property may be used later for future mesh manipulations, not only for remeshing. Something like:

    vlocked_ = mesh_.vertex_property<bool>("v:locked", false);
    elocked_ = mesh_.edge_property<bool>("e:locked", false);

And locked property should not get deleted in postprocessing functions. Also, "locked" would have greater priority than "selected".

Just a suggestion... Don't know if it makes sense... I agree that users can manipulate selections before an operation.

Cmake error

To Reproduce
Steps to reproduce the behavior:
I tried to use this library in VS2015 x64
However, when I build on a cmake application,
I saw these errors.
As I went to the external folder, some of the folder's contents are not exist.
How can I compile this? I want to use this library on a window 10!.

Expected behavior
generate sln file in a correct way.

Screenshots
image
image
image
image
image
image

Environment (please complete the following information):

  • OS: Windows 10
  • Compiler: c++ (VS 2015 x64)
  • Build type: Debug

Additional context
Add any other context about the problem here.

Non-manifold meshes

I'm trying to deal with non-manifold meshes, and for example I'd like to separate non-manifold mesh into manifold parts via the flood fill algorithm. Flooding stops when edge has != 2 adjacent faces. But I see no FaceAroundEdgeCirculator, is_nonmanifold(Edge) and similar functions which I think would be nice to have. How does one find all neighbour faces over face's (half)edge with current functionality?

Multi-threaded

Hello,

I am using remeshing code which is great but it is very slow. I assume that all the pieces
have good potential to exploit multi-cores. Are threads supported ?

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Edge is locked by its single vertex instead of both its vertices

Sometimes a single edge or polyline needs to be preserved when remeshing, but this should not include vertices adjacent to the edge or polyline.

So formally, there should be the and && operator instead of the or || operator, when checking if an edge should be locked based on its vertices:
https://github.com/pmp-library/pmp-library/blob/master/src/pmp/algorithms/SurfaceRemeshing.cpp#L134

Sorry to annoy with issues, this is my last one :)

CMake error

I use pmp library in win10,but when i configure it ,it occured CMake Error at CMakeLists.txt:54(add_subdirectorty):The source directory ../pmp-library-master/external/glfw does not contain a CMakeLists.txt file.
pls help me to solve it ,thank you very much.

Extend BoundingBox to 2D and support collision detection

template <typename Scalar, int M>
class BoundingVolume {
  ....
    bool is_intersected(const BoundingVolume<Scalar, M>& bv);
private:
    Vector<Scalar, M> min_, max_;
}
typedef BoundingVolume<Scalar, 3> BoundingBox;
typedef BoundingVolume<Scalar, 2> BoundingRect;

Question: Texture Coordinate support

Hi,

Sorry if it is not a feature request or a bug, more a question.

First of all just wanted to congratulate you for the work on PMP book and library (I own a paper version of the book).

Second, I'm wondering what kind of texture support (if any) you have for the decimator. meaning support for uv's, seam detection/blcoking, boundaries etc.
I'm using OpenMesh right now with partial success, it is quite good for decimation but I also need also parametrization and OpenMesh does not have it.

Does PMP-library support texture coords in simplification?
Thanks!

SurfaceSmoothing introduces NAN vertices

For some meshes the smoothing creates vertices with NAN position.
Windows 10 x64, Visual Studio

Ex mesh:

pmp::SurfaceSmoothing smoother(mesh);
smoother.explicit_smoothing(2, false);

creates 8 NAN vertices:

invalid vertex 3991526 position: -nan(ind) -nan(ind) -nan(ind)
invalid vertex 3991527 position: -nan(ind) -nan(ind) -nan(ind)
invalid vertex 3991532 position: -nan(ind) -nan(ind) -nan(ind)
invalid vertex 3991542 position: -nan(ind) -nan(ind) -nan(ind)
invalid vertex 3991557 position: -nan(ind) -nan(ind) -nan(ind)
invalid vertex 3991559 position: -nan(ind) -nan(ind) -nan(ind)
invalid vertex 3991562 position: -nan(ind) -nan(ind) -nan(ind)
invalid vertex 3991563 position: -nan(ind) -nan(ind) -nan(ind)

PointSetIO does not respect IOOptions

Description

PointSetIO does not respect IOOptions

How to Reproduce

  1. Load .XYZ point set with normals, set IOOptions set to not process normals

Expected behavior

Normals should not be added

Actual behavior

Normals are added

Reproducibility

100%

Improve the API returning success/error values

I'm trying pmp-library, and while seems easy to setup and start using the lib in my own code I have some issues with the API. Maybe I'm missing something but to be more exact:

https://github.com/pmp-library/pmp-library/blob/master/src/pmp/algorithms/SurfaceParameterization.h#L35-L38

There is no way to know if the parametrization failed or succeed. (In my case it is failing sometimes). Would be nice to have a boolean return parameter or similar (error enum etc) to know the result state.

Thanks

Convert to a STL file

Is there any methods to convert from obj files to STL files? I want to use pmp library by connecting to the vtk library!.

volumes

Hi there,

The pmp-library project looks very interesting. I like the way you build the inheritance bottom up. In fact it seems that it can be easily extended to volumes (i.e. VolumeMesh, inherited from SurfaceMesh).

Is something like that planned? or would you be interested in it ?

best
Angelos

LSCM not a m*n matrix, Why?

According the paper "Least Squares Conformal Maps for Automatic Texture Atlas Generation", the left Matrix is mn, m is the face number and n is the vertice number. But the code is nn matrix. What is the material according to setup the matrix, Can you give me some clue? Thanks.

Irregularities in surface after uniform remeshing

Description

In some cases uniform remeshing causes irregularities in the surface. This is a regression from a previous (internal) version of remeshing. See the attached screen shots for a comparison

How to reproduce

  1. Open the attached mesh anchor.off
  2. Select sharp features with an angle of 44 degrees
  3. Perform uniform remeshing with an edge length of 0.01

Expected behavior

Surface should be smooth after remeshing.

Screenshots

Current version:
image

Old version:
image

Environment

  • OS: Ubuntu 18.04
  • Compiler: gcc 7.4.0
  • Build type: Release

Support for general properties in pmp format

Hello,

the pmp format stores and restores texture properties on half-edges. Shouldn't it use properties on vertices (they are stored in vertex properties in SurfaceGeodesic and SurfaceCurvature),

Thanks

BTW, I love your library!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.