Skip to content

Commit

Permalink
Merge branch 'main' into deftrans
Browse files Browse the repository at this point in the history
  • Loading branch information
dsieger committed Sep 5, 2022
2 parents 842534a + 3f0d607 commit bcb1c85
Show file tree
Hide file tree
Showing 34 changed files with 261 additions and 213 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -15,6 +15,7 @@ This project aims to adhere to [Semantic Versioning](https://semver.org/spec/v2.

### Changed

- Move example apps from `src/apps` to `examples`. Remove `PMP_BUILD_APPS` CMake option.
- Rename `Simplification` to `Decimation`
- Rename `Factory` to `Shapes`
- Drop `Surface` prefix from algorithms
Expand Down
15 changes: 2 additions & 13 deletions CMakeLists.txt
Expand Up @@ -7,7 +7,6 @@ project(
cmake_minimum_required(VERSION 3.16.3)
cmake_policy(SET CMP0072 NEW)

option(PMP_BUILD_APPS "Build the PMP applications" ON)
option(PMP_BUILD_EXAMPLES "Build the PMP examples" ON)
option(PMP_BUILD_TESTS "Build the PMP test programs" ON)
option(PMP_BUILD_DOCS "Build the PMP documentation" ON)
Expand Down Expand Up @@ -180,14 +179,11 @@ include(clang-tidy)
# which directories to process
if(EMSCRIPTEN)
add_subdirectory(src/pmp)
if(PMP_BUILD_APPS)
add_subdirectory(src/apps)
if(PMP_BUILD_EXAMPLES)
add_subdirectory(examples)
endif()
else()
add_subdirectory(src/pmp)
if(PMP_BUILD_APPS)
add_subdirectory(src/apps)
endif()
if(PMP_BUILD_DOCS)
add_subdirectory(docs)
endif()
Expand All @@ -200,13 +196,6 @@ else()
endif()
endif()

set(CPACK_PACKAGE_VERSION ${PMP_VERSION})
set(CPACK_SOURCE_PACKAGE_FILE_NAME
"${CMAKE_PROJECT_NAME}-${CPACK_PACKAGE_VERSION}")
set(CPACK_SOURCE_IGNORE_FILES "/build/;/.git/;~$;${CPACK_SOURCE_IGNORE_FILES}")
set(CPACK_SOURCE_GENERATOR "ZIP")
include(CPack)

if(NOT EMSCRIPTEN AND PMP_INSTALL)

# Generate package configuration files
Expand Down
2 changes: 1 addition & 1 deletion README.md
@@ -1,7 +1,7 @@
# Introduction

[![build](https://github.com/pmp-library/pmp-library/workflows/build/badge.svg)](https://github.com/pmp-library/pmp-library/actions?query=workflow%3Abuild)
[![Coverage Status](https://coveralls.io/repos/github/pmp-library/pmp-library/badge.svg?branch=master)](https://coveralls.io/github/pmp-library/pmp-library?branch=master)
[![Coverage Status](https://coveralls.io/repos/github/pmp-library/pmp-library/badge.svg?branch=master)](https://coveralls.io/github/pmp-library/pmp-library?branch=main)
[![Latest Release](https://img.shields.io/github/v/release/pmp-library/pmp-library?sort=semver)](https://github.com/pmp-library/pmp-library/releases/latest)

The Polygon Mesh Processing Library is a modern C++ open-source library for processing and visualizing polygon surface meshes. Its main features are:
Expand Down
10 changes: 9 additions & 1 deletion cmake/clang-format.cmake
Expand Up @@ -12,7 +12,15 @@ if(CLANG_FORMAT_EXE)
message(STATUS "clang-format found: ${CLANG_FORMAT_EXE}")

# get all sources
file(GLOB_RECURSE ALL_SOURCES "src/*.cpp" "src/*.h" "tests/*.cpp" "tests/*.h")
file(
GLOB_RECURSE
ALL_SOURCES
"src/*.cpp"
"src/*.h"
"tests/*.cpp"
"tests/*.h"
"examples/*.cpp"
"examples/*.h")

add_custom_target(clang-format COMMAND ${CLANG_FORMAT_EXE} -style=file -i
${ALL_SOURCES})
Expand Down
1 change: 1 addition & 0 deletions docs/news.md
@@ -1,5 +1,6 @@
# News {#news}

- @subpage version-2-0-1-released-2022-08-26 - Aug 26, 2022
- @subpage version-2-0-released-2022-08-14 - Aug 14, 2022
- @subpage version-1-2-1-released-2020-05-10 - May 10, 2020
- @subpage version-1-2-released-2020-03-15 - March 15, 2020
Expand Down
42 changes: 42 additions & 0 deletions docs/posts/2022-08-26-version-2.0.1-released.md
@@ -0,0 +1,42 @@
# Version 2.0.1 Released {#version-2-0-1-released-2022-08-26}

_Aug 26, 2022_

We just released version 2.0.1 of the Polygon Mesh Processing Library! This is a minor bug fix release fixing the following issues:

- Fix shared library version
- Fix compilation with `PMP_SCALAR_TYPE=64`
- Use correct C++ standard (C++14) in public target compile options
- Fix crash in smoothing demo app

See the [changelog](https://github.com/pmp-library/pmp-library/blob/master/CHANGELOG.md) for a full summary of changes.

## Obtaining the pmp-library

Get your own copy by cloning:

```sh
git clone --recursive https://github.com/pmp-library/pmp-library.git
```

Checkout the 2.0.1 release tag:

```sh
cd pmp-library && git checkout 2.0.1
```

Configure and build:

```sh
mkdir build && cd build && cmake .. && make
```

Run the mesh processing app

```sh
./mpview ../external/pmp-data/off/bunny.off
```

## Reporting Bugs or Problems

If you encounter any glitches or problems please [report the issue](https://github.com/pmp-library/pmp-library/issues) on GitHub.
11 changes: 4 additions & 7 deletions docs/tutorial.md
Expand Up @@ -36,14 +36,11 @@ number of vertices, edges, and faces is printed to standard output.
// instantiate a SurfaceMesh object
SurfaceMesh mesh;

// instantiate 4 vertex handles
Vertex v0,v1,v2,v3;

// add 4 vertices
v0 = mesh.add_vertex(Point(0,0,0));
v1 = mesh.add_vertex(Point(1,0,0));
v2 = mesh.add_vertex(Point(0,1,0));
v3 = mesh.add_vertex(Point(0,0,1));
const auto v0 = mesh.add_vertex(Point(0,0,0));
const auto v1 = mesh.add_vertex(Point(1,0,0));
const auto v2 = mesh.add_vertex(Point(0,1,0));
const auto v3 = mesh.add_vertex(Point(0,0,1));

// add 4 triangular faces
mesh.add_triangle(v0,v1,v3);
Expand Down
157 changes: 140 additions & 17 deletions examples/CMakeLists.txt
@@ -1,24 +1,147 @@
if(WITH_EXAMPLES)
add_executable(basics basics.cpp)
target_link_libraries(basics pmp)

add_executable(SurfaceMeshBasics SurfaceMeshBasics.cpp)
target_link_libraries(SurfaceMeshBasics pmp)
add_executable(io io.cpp)
target_link_libraries(io pmp)

add_executable(SurfaceMeshIO SurfaceMeshIO.cpp)
target_link_libraries(SurfaceMeshIO pmp)
add_executable(iterators iterators.cpp)
target_link_libraries(iterators pmp)

add_executable(SurfaceMeshIterators SurfaceMeshIterators.cpp)
target_link_libraries(SurfaceMeshIterators pmp)
add_executable(barycenter barycenter.cpp)
target_link_libraries(barycenter pmp)

add_executable(SurfaceMeshBarycenter SurfaceMeshBarycenter.cpp)
target_link_libraries(SurfaceMeshBarycenter pmp)
add_custom_target(
examples
COMMAND
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
COMMENT "")

add_custom_target(
examples
COMMAND
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
COMMENT "")
add_dependencies(examples basics io iterators barycenter)

add_dependencies(examples SurfaceMeshBasics SurfaceMeshIO
SurfaceMeshIterators SurfaceMeshBarycenter)
# example apps
if(EMSCRIPTEN AND PMP_BUILD_VIS)

endif(WITH_EXAMPLES)
add_executable(mview mview.cpp data/shell.html)
target_link_libraries(mview pmp_vis)
set_target_properties(
mview PROPERTIES LINK_FLAGS
"--shell-file ${CMAKE_CURRENT_SOURCE_DIR}/data/shell.html")

add_executable(curvature curvature.cpp data/shell.html)
target_link_libraries(curvature pmp_vis)
set_target_properties(
curvature
PROPERTIES
LINK_FLAGS
"--shell-file ${CMAKE_CURRENT_SOURCE_DIR}/data/shell.html --preload-file ${PROJECT_SOURCE_DIR}/external/pmp-data/off/bunny.off@input.off"
)

add_executable(smoothing smoothing.cpp data/shell.html)
target_link_libraries(smoothing pmp_vis)
set_target_properties(
smoothing
PROPERTIES
LINK_FLAGS
"--shell-file ${CMAKE_CURRENT_SOURCE_DIR}/data/shell.html --preload-file ${PROJECT_SOURCE_DIR}/external/pmp-data/off/fandisk.off@input.off"
)

add_executable(fairing fairing.cpp data/shell.html)
target_link_libraries(fairing pmp_vis)
set_target_properties(
fairing
PROPERTIES
LINK_FLAGS
"--shell-file ${CMAKE_CURRENT_SOURCE_DIR}/data/shell.html --preload-file ${PROJECT_SOURCE_DIR}/external/pmp-data/off/hemisphere.off@input.off"
)

add_executable(mpview mpview.cpp MeshProcessingViewer.cpp
MeshProcessingViewer.h data/shell.html)
target_link_libraries(mpview pmp_vis)
set_target_properties(
mpview
PROPERTIES
LINK_FLAGS
"--shell-file ${CMAKE_CURRENT_SOURCE_DIR}/data/shell.html --preload-file ${PROJECT_SOURCE_DIR}/external/pmp-data/off/bunny.off@input.off"
)

add_executable(subdivision subdivision.cpp data/shell.html)
target_link_libraries(subdivision pmp_vis)
set_target_properties(
subdivision
PROPERTIES
LINK_FLAGS
"--shell-file ${CMAKE_CURRENT_SOURCE_DIR}/data/shell.html --preload-file ${PROJECT_SOURCE_DIR}/external/pmp-data/obj/suzanne.obj@input.obj"
)

add_executable(remeshing remeshing.cpp data/shell.html)
target_link_libraries(remeshing pmp_vis)
set_target_properties(
remeshing
PROPERTIES
LINK_FLAGS
"--shell-file ${CMAKE_CURRENT_SOURCE_DIR}/data/shell.html --preload-file ${PROJECT_SOURCE_DIR}/external/pmp-data/off/bunny.off@input.off"
)

add_executable(decimation decimation.cpp data/shell.html)
target_link_libraries(decimation pmp_vis)
set_target_properties(
decimation
PROPERTIES
LINK_FLAGS
"--shell-file ${CMAKE_CURRENT_SOURCE_DIR}/data/shell.html --preload-file ${PROJECT_SOURCE_DIR}/external/pmp-data/off/fandisk.off@input.off"
)

add_executable(parameterization parameterization.cpp data/shell.html)
target_link_libraries(parameterization pmp_vis)
set_target_properties(
parameterization
PROPERTIES
LINK_FLAGS
"--shell-file ${CMAKE_CURRENT_SOURCE_DIR}/data/shell.html --preload-file ${PROJECT_SOURCE_DIR}/external/pmp-data/off/hemisphere.off@input.off"
)

else()

find_package(OpenGL)

# build mconvert only on unix / OS-X
if(NOT WIN32)
add_executable(mconvert mconvert.cpp)
target_link_libraries(mconvert pmp)
endif()

if(OpenGL_FOUND AND PMP_BUILD_VIS)
add_executable(mview mview.cpp)
target_link_libraries(mview pmp_vis)

add_executable(curvature curvature.cpp)
target_link_libraries(curvature pmp_vis)

add_executable(subdivision subdivision.cpp)
target_link_libraries(subdivision pmp_vis)

add_executable(smoothing smoothing.cpp)
target_link_libraries(smoothing pmp_vis)

add_executable(fairing fairing.cpp)
target_link_libraries(fairing pmp_vis)

add_executable(parameterization parameterization.cpp)
target_link_libraries(parameterization pmp_vis)

add_executable(decimation decimation.cpp)
target_link_libraries(decimation pmp_vis)

add_executable(remeshing remeshing.cpp)
target_link_libraries(remeshing pmp_vis)

add_executable(mpview mpview.cpp MeshProcessingViewer.cpp
MeshProcessingViewer.h)
target_link_libraries(mpview pmp_vis)

add_executable(deformation_transfer deformation_transfer.cpp)
target_link_libraries(deformation_transfer pmp_vis)

endif()

endif()
File renamed without changes.
File renamed without changes.
File renamed without changes.
13 changes: 5 additions & 8 deletions examples/SurfaceMeshBasics.cpp → examples/basics.cpp
Expand Up @@ -5,21 +5,18 @@

using namespace pmp;

int main(void)
int main()
{
//! [basics]

// instantiate a SurfaceMesh object
SurfaceMesh mesh;

// instantiate 4 vertex handles
Vertex v0, v1, v2, v3;

// add 4 vertices
v0 = mesh.add_vertex(Point(0, 0, 0));
v1 = mesh.add_vertex(Point(1, 0, 0));
v2 = mesh.add_vertex(Point(0, 1, 0));
v3 = mesh.add_vertex(Point(0, 0, 1));
const auto v0 = mesh.add_vertex(Point(0, 0, 0));
const auto v1 = mesh.add_vertex(Point(1, 0, 0));
const auto v2 = mesh.add_vertex(Point(0, 1, 0));
const auto v3 = mesh.add_vertex(Point(0, 0, 1));

// add 4 triangular faces
mesh.add_triangle(v0, v1, v3);
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 0 additions & 6 deletions src/apps/subdiv.cpp → examples/subdivision.cpp
Expand Up @@ -55,12 +55,6 @@ void Viewer::process_imgui()
update_mesh();
}

if (ImGui::Button("Quad-Tri Subdivision"))
{
Subdivision(mesh_).quad_tri();
update_mesh();
}

if (ImGui::Button("Catmull-Clark Subdivision"))
{
Subdivision(mesh_).catmull_clark();
Expand Down

0 comments on commit bcb1c85

Please sign in to comment.