Commit f707f943 authored by Philip Trettner's avatar Philip Trettner

working on decimation test

parent 159c01cb
Pipeline #12978 failed with stage
in 66 minutes and 15 seconds
Subproject commit 1d149fb8aaa0f06ca1256faffb9dea5268eaf1d5
Subproject commit 9c176da4bd277934e58379506ce8cb01777a71ec
#include <doctest.hh>
#include <polymesh/Mesh.hh>
#include <polymesh/algorithms/decimate.hh>
#include <polymesh/algorithms/triangulate.hh>
#include <polymesh/objects/cube.hh>
#include <typed-geometry/tg.hh>
#include <glow-extras/viewer/view.hh>
TEST_CASE("decimate")
{
pm::Mesh m;
auto pos = m.vertices().make_attribute<tg::pos3>();
pm::objects::add_cube(m, pos);
pm::triangulate_naive(m);
m.compactify();
auto fnormals = pm::triangle_normals(pos);
auto errors = m.vertices().map([&](pm::vertex_handle v) {
auto p = pos[v];
return v.faces().avg([&](pm::face_handle f) {
auto n = fnormals[f];
return tg::probabilistic_plane_quadric(p, n, 0.05f, 0.05f);
});
});
pm::decimate_config<tg::pos3, tg::quadric3> cfg;
cfg.max_error = 0.2f;
cfg.max_normal_dev = 0.05f;
pm::decimate(m, pos, errors, cfg);
auto v = view(pos);
view(lines(pos).line_width_world(0.01f));
}
......@@ -15,8 +15,6 @@
TEST_CASE("topo fuzzer")
{
// return; // fails currently
for (auto _ = 0; _ < 20; ++_)
{
tg::rng rng;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment