Skip to content

Commit c38cc91

Browse files
committed
Merge branch 'version-1-fixes' into 'develop'
Version 1.0 release See merge request educelab/OpenABF!3
2 parents 8de8f43 + 3fca4c9 commit c38cc91

File tree

18 files changed

+741
-467
lines changed

18 files changed

+741
-467
lines changed

.gitlab-ci.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,15 @@ test:debian:10:
3131
image: volcart/vcbuilder-debian:10_v1.static
3232
variables:
3333
EXTRA_CMAKE_FLAGS: "-DOPENABF_BUILD_TESTS=ON"
34+
tags:
35+
- docker
36+
37+
examples:debian:10:
38+
extends: .build
39+
stage: test
40+
needs: []
41+
image: volcart/vcbuilder-debian:10_v1.static
42+
variables:
43+
EXTRA_CMAKE_FLAGS: "-DOPENABF_BUILD_EXAMPLES=ON"
3444
tags:
3545
- docker

.zenodo.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"title": "OpenABF",
3-
"description": "A header-only library of angle-based flattening algorithms for C++.",
3+
"description": "A single-header C++ library of angle-based flattening algorithms.",
44
"upload_type": "software",
55
"license": "other-open",
66
"creators": [
@@ -13,7 +13,8 @@
1313
"keywords" : [
1414
"c-plus-plus",
1515
"parameterization",
16-
"flattening"
16+
"flattening",
17+
"angle-based flattening"
1718
],
1819
"related_identifiers": [
1920
{

CMakeLists.txt

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,18 +62,23 @@ install(
6262

6363
# Docs
6464
find_package(Doxygen OPTIONAL_COMPONENTS dot)
65-
CMAKE_DEPENDENT_OPTION(OPENABF_BUILD_DOCS "Build Doxygen documentation" on "DOXYGEN_FOUND" off)
65+
CMAKE_DEPENDENT_OPTION(OPENABF_BUILD_DOCS "Build Doxygen documentation" off "DOXYGEN_FOUND" off)
6666
if(OPENABF_BUILD_DOCS)
6767
add_subdirectory(docs)
6868
endif()
6969

70+
# Examples
71+
option(OPENABF_BUILD_EXAMPLES "Compile OpenABF example applications" off)
72+
if(OPENABF_BUILD_EXAMPLES)
73+
add_subdirectory(examples)
74+
endif()
75+
7076
# Tests
7177
option(OPENABF_BUILD_TESTS "Compile OpenABF unit tests" off)
7278
if(OPENABF_BUILD_TESTS)
7379
enable_testing()
7480
add_subdirectory(tests)
7581
endif()
7682

77-
# Example app
78-
add_executable(abf_test main.cpp)
79-
target_link_libraries(abf_test OpenABF::OpenABF)
83+
# Install
84+
include(InstallProject)

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ feature requests, and code contributions.
88
If you think you have found a bug or if you would like to request a new
99
feature, please check our
1010
[issue tracker](https://gitlab.com/educelab/OpenABF/-/issues) to make sure
11-
an issue has not already been opened on your topic.
11+
that an issue has not already been opened on your topic.
1212

1313
## Workflow
1414
1) Fork this repository
@@ -49,7 +49,7 @@ always process an entire branch's diff by comparing against the default
4949
branch:
5050

5151
```shell
52-
git clang-format dev
52+
git clang-format develop
5353
```
5454

5555
Unfortunately, `clang-format` does not handle all style issues. For a general
@@ -58,7 +58,7 @@ overview of the EduceLab C++ style, please refer to our
5858

5959
## License
6060
Any changes intentionally contributed to this repository are assumed to
61-
be licensed under the terms outlined in `LICENSE`.
61+
be licensed under the terms outlined in [LICENSE](LICENSE).
6262

6363
## Attribution
6464
This project actively maintains a citable record on Zenodo.

NOTICE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
OpenABF
1+
OpenABF (https://gitlab.com/educelab/OpenABF)
22
Copyright 2021 EduceLab
33

44
This product includes software developed at

README.md

Lines changed: 112 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,26 @@
11
[![OpenABF](docs/images/banner.svg)](https://gitlab.com/educelab/OpenABF)
22

3-
**OpenABF** is a header-only library of angle-based flattening algorithms for
4-
C++. It is designed to be as simple as possible to integrate into existing
5-
projects.
3+
**OpenABF** is a single-header C++ library of angle-based flattening algorithms.
4+
The templated interface is designed for simple out-of-the-box use, and
5+
integration with existing geometric processing pipelines is quick and easy.
66

7-
## Requirements
8-
* [Eigen 3.3+](http://eigen.tuxfamily.org/)
9-
10-
## Installation
11-
### CMake
12-
This project is configured and installed using the CMake build system:
13-
14-
```shell
15-
mkdir build
16-
cmake -S . -B build/
17-
cmake --install build/
18-
```
19-
20-
This will install the OpenABF header(s) to your default system path and provide
21-
an easy method to link OpenABF against your own CMake project:
22-
23-
```cmake
24-
# Find OpenABF libraries
25-
find_package(OpenABF REQUIRED)
26-
27-
# Link to an executable
28-
add_executable(MyTarget main.cpp)
29-
target_link_libraries(MyTarget OpenABF::OpenABF)
30-
```
31-
32-
The CMake project provides a number of flags for configuring the installation:
33-
- `OPENABF_MULTIHEADER`: Install the multi-header version of OpenABF
34-
(Default: OFF)
35-
- `OPENABF_BUILD_TESTS`: Build project unit tests. This will download and build
36-
the Google Test framework. (Default: OFF)
37-
- `OPENABF_BUILD_DOCS`: Build documentation. Dependencies: Doxygen, Graphviz
38-
(optional). (Default: ON if Doxygen is found)
39-
40-
### Manual
41-
Copy and paste the contents of `single_include` to your project or include path.
42-
As this project requires Eigen, you also need to add that project to your
43-
include path.
7+
## Dependencies
8+
- C++14 compiler
9+
- [Eigen 3.3+](http://eigen.tuxfamily.org/)
10+
- CMake 3.15+ (optional)
4411

4512
## Usage
13+
The following example demonstrates how to construct and parameterize a mesh
14+
with OpenABF:
15+
4616
```c++
4717
#include <OpenABF/OpenABF.hpp>
4818

4919
// Alias algorithms for convenience
5020
using ABF = OpenABF::ABFPlusPlus<float>;
5121
using LSCM = OpenABF::AngleBasedLSCM<float, ABF::Mesh>;
5222

53-
// Make a new mesh
23+
// Make a triangular pyramid mesh
5424
auto mesh = ABF::Mesh::New();
5525
mesh->insert_vertex(0, 0, 0);
5626
mesh->insert_vertex(2, 0, 0);
@@ -67,36 +37,120 @@ for (const auto& v : mesh->vertices()) {
6737
}
6838

6939
// Compute parameterized angles
70-
ABF abf;
71-
abf.setMesh(mesh);
72-
abf.compute();
40+
ABF::Compute(mesh);
7341

7442
// Compute mesh parameterization from angles
75-
LSCM lscm;
76-
lscm.setMesh(mesh);
77-
lscm.compute();
43+
LSCM::Compute(mesh);
7844

7945
// Print new coordinates
8046
for (const auto& v : mesh->vertices()) {
8147
std::cout << v->idx << ": " << v->pos << std::endl;
8248
}
8349
```
50+
**Note:** The `HalfEdgeMesh` class
51+
[currently assumes](https://gitlab.com/educelab/OpenABF/-/issues/4) that the
52+
surface has a boundary, is manifold, and that the winding order of all faces is
53+
the same. Care should be taken that this assumption is not violated when
54+
constructing your mesh.
55+
56+
## Installation
57+
### CMake
58+
This project can be configured and installed using the CMake build system:
59+
60+
```shell
61+
mkdir build
62+
cmake -S . -B build/
63+
cmake --install build/
64+
```
65+
66+
This will install the OpenABF header(s) to your system include path and provide
67+
an easy method for including OpenABF inside of your own CMake project:
68+
69+
```cmake
70+
# Find OpenABF libraries
71+
find_package(OpenABF REQUIRED)
72+
73+
# Link to an executable
74+
add_executable(MyTarget main.cpp)
75+
target_link_libraries(MyTarget OpenABF::OpenABF)
76+
```
77+
78+
**Note:** For best performance, configure your CMake project with the
79+
`-DCMAKE_BUILD_TYPE=Release` flag.
80+
81+
#### Configuration
82+
The OpenABF CMake project provides a number of flags for configuring the
83+
installation:
84+
- `OPENABF_MULTIHEADER`: Install the multi-header version of OpenABF
85+
(Default: OFF)
86+
- `OPENABF_BUILD_EXAMPLES`: Build example applications. (Default: OFF)
87+
- `OPENABF_BUILD_TESTS`: Build project unit tests. This will download and build
88+
the Google Test framework. (Default: OFF)
89+
- `OPENABF_BUILD_DOCS`: Build documentation. Dependencies: Doxygen, Graphviz
90+
(optional). Unavailable if Doxygen is not found. (Default: OFF)
91+
92+
#### FetchContent (CMake 3.11+)
93+
Another option for providing OpenABF to your project is by using CMake's
94+
[FetchContent module](https://cmake.org/cmake/help/latest/module/FetchContent.html):
95+
96+
```cmake
97+
include(FetchContent)
98+
FetchContent_Declare(
99+
openabf
100+
GIT_REPOSITORY https://gitlab.com/educelab/OpenABF.git
101+
GIT_TAG v1.0
102+
)
103+
104+
# Populate the project but exclude from All targets
105+
FetchContent_GetProperties(openabf)
106+
if(NOT openabf_POPULATED)
107+
FetchContent_Populate(openabf)
108+
add_subdirectory(${openabf_SOURCE_DIR} ${openabf_BINARY_DIR} EXCLUDE_FROM_ALL)
109+
endif()
110+
```
111+
112+
This downloads the OpenABF source code and adds it to your CMake project as a
113+
subproject. Link it against your targets as you would any library added with
114+
`find_package`:
115+
116+
```cmake
117+
add_executable(MyTarget main.cpp)
118+
target_link_libraries(MyTarget OpenABF::OpenABF)
119+
```
120+
121+
### Manual
122+
Copy and paste the contents of `single_include/` to your project or include
123+
path. As OpenABF depends upon the Eigen library, you will also need to add the
124+
Eigen headers to your include path:
125+
126+
```shell
127+
g++ -I /path/to/eigen/ -DNDEBUG -std=c++14 -O3 main.cpp -o main
128+
```
129+
130+
**Note:** For best performance, compile your application with the `NDEBUG`
131+
preprocessor definition.
84132

85133
## License
86134
OpenABF is licensed under [the Apache 2.0 license](LICENSE). This allows you to
87135
use OpenABF freely in open source or proprietary software. However, any software
88136
released in source or binary form must include and preserve a readable copy of
89-
the attributions provided in the [NOTICE](NOTICE).
137+
the attributions provided in [NOTICE](NOTICE).
138+
139+
The OpenABF logo and banner graphic are by Seth Parker (EduceLab, University
140+
of Kentucky) and are licensed under
141+
[CC BY-NC-SA 4.0](http://creativecommons.org/licenses/by-nc-sa/4.0/).
90142

91143
## Contributors
92-
If you would like to fix bugs or develop new features for OpenABF, please see
93-
[CONTRIBUTING.md](CONTRIBUTING.md) for more information.
144+
OpenABF is glad to welcome contributors of all skill sets. If you have found a
145+
bug or wish to contribute a new feature, please see
146+
[CONTRIBUTING](CONTRIBUTING.md) for more information on how to get started.
94147

95148
### Updating the single-header file
96-
All code changes should be made to the multi-header library files in
97-
`include/OpenABF`. Before your Merge Request can be accepted, yoy need to update
98-
the single-header library with your changes by running the following command
99-
in the root of the source directory:
149+
OpenABF is deployed as a single-header library, but is developed as a
150+
multi-header library. All code changes should be made to the multi-header
151+
files in `include/OpenABF/`. Before your Merge Request can be accepted, please
152+
update the single-header file with your changes by running the following
153+
command from the root of the source directory:
100154

101155
```shell
102156
python3 thirdparty/amalgamate/amalgamate.py -c single_include.json -s .
@@ -105,7 +159,7 @@ python3 thirdparty/amalgamate/amalgamate.py -c single_include.json -s .
105159
## References
106160
This project implements data structures and algorithms derived from the
107161
following publications:
108-
* Alla Sheffer and Eric de Sturler. Parameterization of faceted surfaces for meshing using angle-based flattening. Engineering with Computers, 17(3):326–337, 2001.
109-
* Bruno Lévy, Sylvain Petitjean, Nicolas Ray, and Jérome Maillot. Least squares conformal maps for automatic texture atlas generation. ACM Transactions on Graphics (TOG), 21(3):362–371, 2002.
110-
* Alla Sheffer, Bruno Lévy, Maxim Mogilnitsky, and Alexander Bogomyakov. Abf++: fast and robust angle based flattening. ACM Transactions on Graphics (TOG), 24(2):311–330, 2005.
111-
* S. Marschner, P. Shirley, M. Ashikhmin, M. Gleicher, N. Hoffman, G. Johnson, T. Munzner, E. Reinhard, W.B. Thompson, P. Willemsen, and B. Wyvill. Fundamentals of computer graphics. 4th edition, 2015.
162+
* Alla Sheffer and Eric de Sturler. Parameterization of faceted surfaces for meshing using angle-based flattening. _Engineering with Computers_, 17(3):326–337, 2001.
163+
* Bruno Lévy, Sylvain Petitjean, Nicolas Ray, and Jérome Maillot. Least squares conformal maps for automatic texture atlas generation. _ACM Transactions on Graphics (TOG)_, 21(3):362–371, 2002.
164+
* Alla Sheffer, Bruno Lévy, Maxim Mogilnitsky, and Alexander Bogomyakov. Abf++: fast and robust angle based flattening. _ACM Transactions on Graphics (TOG)_, 24(2):311–330, 2005.
165+
* S. Marschner, P. Shirley, M. Ashikhmin, M. Gleicher, N. Hoffman, G. Johnson, T. Munzner, E. Reinhard, W.B. Thompson, P. Willemsen, and B. Wyvill. _Fundamentals of computer graphics._ 4th edition, 2015.

docs/images/banner.svg

Lines changed: 1 addition & 1 deletion
Loading

0 commit comments

Comments
 (0)