Demonstrates flattening of a closed, triangular pyramid by introducing a border/seam along two edges.
#include <iomanip>
#include <iostream>
#include "OpenABF/OpenABF.hpp"
int main()
{
auto mesh = ABF::Mesh::New();
mesh->insert_vertex(0, 0, 0);
mesh->insert_vertex(2, 0, 0);
mesh->insert_vertex(1, std::sqrt(3), 0);
mesh->insert_vertex(1, std::sqrt(3) / 3, std::sqrt(6) * 2 / 3);
mesh->insert_faces({{1, 3, 0}, {3, 2, 0}, {3, 1, 2}, {1, 0, 2}});
std::cout << std::boolalpha;
std::cout << "Is manifold: " << IsManifold(mesh) << std::endl;
std::cout << "Has boundary: " << HasBoundary(mesh) << std::endl;
std::cout << "Edges: " << std::endl;
for (const auto& e : mesh->edges()) {
std::cout << " " << e->vertex->idx << " -> " << e->pair->vertex->idx << std::endl;
}
std::cout << "Splitting path 0 -> 1 -> 2" << std::endl;
mesh->split_path({0, 1, 2});
std::cout << "Is manifold: " << IsManifold(mesh) << std::endl;
std::cout << "Has boundary: " << HasBoundary(mesh) << std::endl;
std::cout << "Edges: " << std::endl;
for (const auto& e : mesh->edges()) {
std::cout << " " << e->vertex->idx << " -> " << e->pair->vertex->idx << std::endl;
}
std::size_t iters{0};
std::cout << "ABF++ Final gradient: " << grad << std::endl;
std::cout << "ABF++ Iterations: " << iters << std::endl;
WriteMesh("openabf_example_split_path.obj", mesh);
}
Compute parameterized interior angles using ABF++.
Definition OpenABF.hpp:2640
static void Compute(typename Mesh::Pointer &mesh, std::size_t &iters, T &gradient, const std::size_t maxIters=10, T gradThreshold=T(0.001))
Compute parameterized interior angles.
Definition OpenABF.hpp:2678
Compute parameterized mesh using Angle-based LSCM.
Definition OpenABF.hpp:2987
static void Compute(typename Mesh::Pointer &mesh)
Compute the parameterized mesh using automatic pin selection.
Definition OpenABF.hpp:3018
constexpr T INF
Inf, templated for floating-point type.
Definition OpenABF.hpp:69