* apps/mesh-segm-skel/mesh-complex-max-curv-2-collapse.cc,
* apps/mesh-segm-skel/mesh-complex-max-curv-1-collapse.cc:
New.
* apps/mesh-segm-skel/test-mesh-complex-max-curv-2-collapse.in,
* apps/mesh-segm-skel/test-mesh-complex-max-curv-1-collapse.in:
New.
* apps/mesh-segm-skel/Makefile.am (bin_PROGRAMS):
Add mesh-complex-max-curv-2-collapse.
And mesh-complex-max-curv-1-collapse
(mesh_complex_max_curve_2_collapse_SOURCES)
(mesh_complex_max_curve_1_collapse_SOURCES):
New.
(edit): New.
(test-mesh-complex-max-curv-2-collapse)
(test-mesh-complex-max-curv-1-collapse):
New target.
(TESTS, CLEANFILES): Add test-mesh-complex-max-curv-2-collapse
and test-mesh-complex-max-curv-1-collapse.
(MOSTLYCLEANFILES): Add teapot-max-curv-2-collapse.vtk,
bunny-holefilled-max-curv-2-collapse.vtk,
teapot-max-curv-1-collapse.vtk and
bunny-holefilled-max-curv-1-collapse.vtk.
---
milena/ChangeLog | 27 ++++
milena/apps/mesh-segm-skel/Makefile.am | 40 +++++
...skel.cc => mesh-complex-max-curv-1-collapse.cc} | 153 +++++++++++++-------
...skel.cc => mesh-complex-max-curv-2-collapse.cc} | 95 ++++++-------
...in => test-mesh-complex-max-curv-1-collapse.in} | 3 +-
...in => test-mesh-complex-max-curv-2-collapse.in} | 3 +-
6 files changed, 220 insertions(+), 101 deletions(-)
copy milena/apps/mesh-segm-skel/{mesh-complex-max-curv-skel.cc =>
mesh-complex-max-curv-1-collapse.cc} (68%)
copy milena/apps/mesh-segm-skel/{mesh-complex-max-curv-skel.cc =>
mesh-complex-max-curv-2-collapse.cc} (81%)
copy milena/apps/mesh-segm-skel/{test-mesh-complex-2-collapse.in =>
test-mesh-complex-max-curv-1-collapse.in} (77%)
copy milena/apps/mesh-segm-skel/{test-mesh-complex-2-collapse.in =>
test-mesh-complex-max-curv-2-collapse.in} (77%)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 0f526db..aa71fb7 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,32 @@
2011-03-14 Roland Levillain <roland(a)lrde.epita.fr>
+ New apps: max curvature-based thinnings using 2- and 1-collapses.
+
+ * apps/mesh-segm-skel/mesh-complex-max-curv-2-collapse.cc,
+ * apps/mesh-segm-skel/mesh-complex-max-curv-1-collapse.cc:
+ New.
+ * apps/mesh-segm-skel/test-mesh-complex-max-curv-2-collapse.in,
+ * apps/mesh-segm-skel/test-mesh-complex-max-curv-1-collapse.in:
+ New.
+ * apps/mesh-segm-skel/Makefile.am (bin_PROGRAMS):
+ Add mesh-complex-max-curv-2-collapse.
+ And mesh-complex-max-curv-1-collapse
+ (mesh_complex_max_curve_2_collapse_SOURCES)
+ (mesh_complex_max_curve_1_collapse_SOURCES):
+ New.
+ (edit): New.
+ (test-mesh-complex-max-curv-2-collapse)
+ (test-mesh-complex-max-curv-1-collapse):
+ New target.
+ (TESTS, CLEANFILES): Add test-mesh-complex-max-curv-2-collapse
+ and test-mesh-complex-max-curv-1-collapse.
+ (MOSTLYCLEANFILES): Add teapot-max-curv-2-collapse.vtk,
+ bunny-holefilled-max-curv-2-collapse.vtk,
+ teapot-max-curv-1-collapse.vtk and
+ bunny-holefilled-max-curv-1-collapse.vtk.
+
+2011-03-14 Roland Levillain <roland(a)lrde.epita.fr>
+
Add VTK versions of some OFF meshes.
* mesh/bunny-holefilled.vtk,
diff --git a/milena/apps/mesh-segm-skel/Makefile.am
b/milena/apps/mesh-segm-skel/Makefile.am
index 1b4d20f..4e06baf 100644
--- a/milena/apps/mesh-segm-skel/Makefile.am
+++ b/milena/apps/mesh-segm-skel/Makefile.am
@@ -209,6 +209,46 @@ TESTS += test-mesh-complex-2-collapse
CLEANFILES = test-mesh-complex-2-collapse
MOSTLYCLEANFILES += pseudo-manifold-2-collapse.vtk
+# Program computing the max curvature from a mesh, then performing a
+# 2-collapse on it.
+bin_PROGRAMS += mesh-complex-max-curv-2-collapse
+mesh_complex_max_curv_2_collapse_SOURCES = mesh-complex-max-curv-2-collapse.cc
+
+# FIXME: Factor action with test-mesh-complex-2-collapse's.
+test-mesh-complex-max-curv-2-collapse: test-mesh-complex-max-curv-2-collapse.in Makefile
+ rm -f $@ $@.tmp
+ srcdir=''; \
+ test -f ./$< || srcdir=$(srcdir)/; \
+ $(edit) $${srcdir}$< >>$@.tmp
+ chmod a-w,a+x $@.tmp
+ mv $@.tmp $@
+
+TESTS += test-mesh-complex-max-curv-2-collapse
+CLEANFILES += test-mesh-complex-max-curv-2-collapse
+MOSTLYCLEANFILES += \
+ teapot-max-curv-2-collapse.vtk \
+ bunny-holefilled-max-curv-2-collapse.vtk
+
+# Program computing the max curvature from a mesh, then performing a
+# 1-collapse on it.
+bin_PROGRAMS += mesh-complex-max-curv-1-collapse
+mesh_complex_max_curv_1_collapse_SOURCES = mesh-complex-max-curv-1-collapse.cc
+
+# FIXME: Factor action with test-mesh-complex-1-collapse's.
+test-mesh-complex-max-curv-1-collapse: test-mesh-complex-max-curv-1-collapse.in Makefile
+ rm -f $@ $@.tmp
+ srcdir=''; \
+ test -f ./$< || srcdir=$(srcdir)/; \
+ $(edit) $${srcdir}$< >>$@.tmp
+ chmod a-w,a+x $@.tmp
+ mv $@.tmp $@
+
+TESTS += test-mesh-complex-max-curv-1-collapse
+CLEANFILES += test-mesh-complex-max-curv-1-collapse
+MOSTLYCLEANFILES += \
+ teapot-max-curv-1-collapse.vtk \
+ bunny-holefilled-max-curv-1-collapse.vtk
+
## More complex skeletonization chains.
## ------------------------------------
diff --git a/milena/apps/mesh-segm-skel/mesh-complex-max-curv-skel.cc
b/milena/apps/mesh-segm-skel/mesh-complex-max-curv-1-collapse.cc
similarity index 68%
copy from milena/apps/mesh-segm-skel/mesh-complex-max-curv-skel.cc
copy to milena/apps/mesh-segm-skel/mesh-complex-max-curv-1-collapse.cc
index 2d55ff2..0cb29dd 100644
--- a/milena/apps/mesh-segm-skel/mesh-complex-max-curv-skel.cc
+++ b/milena/apps/mesh-segm-skel/mesh-complex-max-curv-1-collapse.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2008, 2009, 2010 EPITA Research and Development
+// Copyright (C) 2008, 2009, 2010, 2011 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of the Milena Library. This library is free
@@ -26,13 +26,13 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/// \file apps/mesh-segm-skel/mesh-complex-max-curv-skel.cc
+/// \file
/// \brief A program computing the maximal curvature values from the
-/// surface of the (triangle) mesh of a statue, then computing a
-/// skeleton of this surface (by thinning), using a complex-based
-/// image.
+/// surface of the (triangle) mesh of a statue, then performing a
+/// 1-collapse of this surface, using a complex-based image.
-// FIXME: Factor with mesh-complex-pinv-curv-skel.cc.
+// FIXME: Factor with mesh-complex-max-curv-skel.cc and
+// mesh-complex-pinv-curv-skel.cc, mesh-complex-max-curv-2-collapse.cc.
#include <iostream>
@@ -40,6 +40,7 @@
#include <mln/core/image/complex_neighborhoods.hh>
#include <mln/core/image/dmorph/image_if.hh>
+#include <mln/core/image/dmorph/sub_image.hh>
#include <mln/core/image/dmorph/mutable_extension_ima.hh>
#include <mln/core/routine/mutable_extend.hh>
#include <mln/data/paste.hh>
@@ -50,14 +51,12 @@
#include <mln/morpho/closing/area.hh>
#include <mln/topo/is_n_face.hh>
-#include <mln/topo/is_simple_cell.hh>
-#include <mln/topo/detach_cell.hh>
+#include <mln/topo/is_simple_pair.hh>
+#include <mln/topo/detach_pair.hh>
#include <mln/topo/skeleton/breadth_first_thinning.hh>
-#include <mln/io/off/load.hh>
-/* FIXME: Remove as soon as mln::io::off::save is able to save a
- morphed mln::complex_image (i.e., seen through image_if). */
-#include "save_bin_alt.hh"
+#include <mln/io/vtk/load.hh>
+#include <mln/io/vtk/save.hh>
#include "trimesh/misc.hh"
@@ -67,7 +66,7 @@ main(int argc, char* argv[])
{
if (argc != 4)
{
- std::cerr << "usage: " << argv[0] << " input.off
lambda output.off"
+ std::cerr << "usage: " << argv[0] << " input.vtk
lambda output.vtk"
<< std::endl;
std::exit(1);
}
@@ -88,11 +87,11 @@ main(int argc, char* argv[])
typedef mln_geom_(float_ima_t) G;
mln::bin_2complex_image3df bin_input;
- mln::io::off::load(bin_input, input_filename);
+ mln::io::vtk::load(bin_input, input_filename);
std::pair<float_ima_t, float_ima_t> curv =
mln::geom::mesh_curvature(bin_input.domain());
- // Compute the pseudo_inverse curvature at each vertex.
+ // Compute the max curvature at each vertex.
float_ima_t float_ima(bin_input.domain());
mln::p_n_faces_fwd_piter<D, G> v(float_ima.domain(), 0);
for_all(v)
@@ -103,7 +102,7 @@ main(int argc, char* argv[])
}
// Values on triangles.
- mln::p_n_faces_fwd_piter<D, G> t(float_ima.domain(), 2);
+ mln::p_n_faces_fwd_piter<D, G> t(float_ima.domain(), 2);
// For each triangle (2-face) T, iterate on the the set of vertices
// (0-faces) transitively adjacent to T.
typedef mln::complex_m_face_neighborhood<D, G> adj_vertices_nbh_t;
@@ -249,15 +248,15 @@ main(int argc, char* argv[])
mln_piter_(bin_ima_t) f(minima.domain());
for_all(f)
if (minima(f) != mln::literal::zero)
- surface(f) = false;
+ surface(f) = false;
- /*-----------.
- | Skeleton. |
- `-----------*/
+ /*-------------.
+ | 2-collapse. |
+ `-------------*/
- // ---------------- //
- // Skeleton image. //
- // ---------------- //
+ // ------------------------------- //
+ // Image restricted to triangles. //
+ // ------------------------------- //
// Predicate type: is a face a triangle (2-face)?
typedef mln::topo::is_n_face<mln_psite_(bin_ima_t), D> is_a_triangle_t;
@@ -273,58 +272,114 @@ main(int argc, char* argv[])
// Simple point predicate. //
// ------------------------ //
- // Neighborhood type returning the set of (n-1)- and (n+1)-faces
- // adjacent to a an n-face.
- typedef mln::complex_lower_higher_neighborhood<D, G> adj_nbh_t;
// Neighborhood type returning the set of (n-1)-faces adjacent to a
// an n-face.
typedef mln::complex_lower_neighborhood<D, G> lower_adj_nbh_t;
+ lower_adj_nbh_t lower_adj_nbh;
// Neighborhood type returning the set of (n+1)-faces adjacent to a
// an n-face.
typedef mln::complex_higher_neighborhood<D, G> higher_adj_nbh_t;
+ higher_adj_nbh_t higher_adj_nbh;
// Predicate type: is a triangle (2-face) simple?
- typedef mln::topo::is_simple_cell< bin_triangle_ima_t,
- adj_nbh_t,
+ typedef mln::topo::is_simple_pair< bin_triangle_ima_t,
lower_adj_nbh_t,
higher_adj_nbh_t >
is_simple_triangle_t;
- is_simple_triangle_t is_simple_triangle;
+ is_simple_triangle_t is_simple_triangle(lower_adj_nbh, higher_adj_nbh);
// ------------------------------- //
// Simple point detach procedure. //
// ------------------------------- //
- // Type of adjacency relationships between faces of immediately
- // lower and higher dimensions.
- adj_nbh_t adj_nbh;
// Functor detaching a cell.
- mln::topo::detach_cell<bin_triangle_ima_t, adj_nbh_t> detach(adj_nbh);
+ typedef mln::topo::detach_pair< bin_triangle_ima_t,
+ lower_adj_nbh_t,
+ higher_adj_nbh_t > detach_triangle_t;
+ detach_triangle_t detach_triangle(lower_adj_nbh, higher_adj_nbh);
- mln_concrete_(bin_ima_t) skel;
- mln::initialize(skel, surface);
+ // ------------------------ //
+ // Thinning by 2-collapse. //
+ // ------------------------ //
+
+ mln_concrete_(bin_ima_t) surface_2_collapse;
+ mln::initialize(surface_2_collapse, surface);
mln::data::paste
(mln::topo::skeleton::breadth_first_thinning
(mln::mutable_extend((surface | is_a_triangle).rw(), surface),
nbh,
is_simple_triangle,
- detach),
- skel);
+ detach_triangle)
+ /* Before pasting the result of the computation into
+ SURFACE_2_COLLAPSE, re-expand its domain to the initial site
+ set, to ensure data from all faces (i.e., both the 2-faces,
+ directly processed; and the 1-faces from the extension,
+ undirectly processed). */
+ | surface.domain(),
+ surface_2_collapse);
+
+ /*-------------.
+ | 1-collapse. |
+ `-------------*/
+
+ // --------------------------- //
+ // Image restricted to edges. //
+ // --------------------------- //
+
+ // Predicate type: is a face an edge (1-face)?
+ typedef mln::topo::is_n_face<mln_psite_(bin_ima_t), D - 1> is_an_edge_t;
+ is_an_edge_t is_an_edge;
+ // Surface image type, of which domain is restricted to edges.
+ typedef mln::image_if<bin_ima_t, is_an_edge_t> bin_edge_only_ima_t;
+ // Surface image type, of which iteration (not domain) is restricted
+ // to edges.
+ typedef mln::mutable_extension_ima<bin_edge_only_ima_t, bin_ima_t>
+ bin_edge_ima_t;
+
+ // ------------------------ //
+ // Simple point predicate. //
+ // ------------------------ //
+
+ // Predicate type: is a edge (1-face) simple?
+ typedef mln::topo::is_simple_pair< bin_edge_ima_t,
+ lower_adj_nbh_t,
+ higher_adj_nbh_t >
+ is_simple_edge_t;
+ is_simple_edge_t is_simple_edge(lower_adj_nbh, higher_adj_nbh);
+ // ------------------------------- //
+ // Simple point detach procedure. //
+ // ------------------------------- //
+
+ // Functor detaching a cell.
+ typedef mln::topo::detach_pair< bin_edge_ima_t,
+ lower_adj_nbh_t,
+ higher_adj_nbh_t > detach_edge_t;
+ detach_edge_t detach_edge(lower_adj_nbh, higher_adj_nbh);
+
+ // ------------------------ //
+ // Thinning by 1-collapse. //
+ // ------------------------ //
+
+ mln_concrete_(bin_ima_t) surface_1_collapse;
+ mln::initialize(surface_1_collapse, surface_2_collapse);
+ mln::data::paste
+ (mln::topo::skeleton::breadth_first_thinning
+ (mln::mutable_extend((surface_2_collapse | is_an_edge).rw(),
+ surface_2_collapse),
+ nbh,
+ is_simple_edge,
+ detach_edge)
+ /* Likewise, before pasting the result of the computation into
+ SURFACE_1_COLLAPSE, re-expand its domain to the initial site
+ set, to ensure data from all faces (i.e., both the 1-faces,
+ directly processed; and the 0-faces from the extension,
+ undirectly processed). */
+ | surface_2_collapse.domain(),
+ surface_1_collapse);
/*---------.
| Output. |
`---------*/
- /* FIXME: This does not work (yet).
- Use workaround mln::io::off::save_bin_alt instead (bad!)
-
- Moreover, even if it worked, it would not have the same meaning
- as mln::io::off::save_bin_alt. Maybe the latter is useful, after
- all. But we need to factor it with the code of
- mln::io::off::save, anyway. */
-#if 0
- mln::io::off::save(skel | mln::pw::value(skel) == mln::pw::cst(true),
- output_filename);
-#endif
- mln::io::off::save_bin_alt(skel, output_filename);
+ mln::io::vtk::save(surface_1_collapse, output_filename);
}
diff --git a/milena/apps/mesh-segm-skel/mesh-complex-max-curv-skel.cc
b/milena/apps/mesh-segm-skel/mesh-complex-max-curv-2-collapse.cc
similarity index 81%
copy from milena/apps/mesh-segm-skel/mesh-complex-max-curv-skel.cc
copy to milena/apps/mesh-segm-skel/mesh-complex-max-curv-2-collapse.cc
index 2d55ff2..233756d 100644
--- a/milena/apps/mesh-segm-skel/mesh-complex-max-curv-skel.cc
+++ b/milena/apps/mesh-segm-skel/mesh-complex-max-curv-2-collapse.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2008, 2009, 2010 EPITA Research and Development
+// Copyright (C) 2008, 2009, 2010, 2011 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of the Milena Library. This library is free
@@ -26,13 +26,13 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/// \file apps/mesh-segm-skel/mesh-complex-max-curv-skel.cc
+/// \file
/// \brief A program computing the maximal curvature values from the
-/// surface of the (triangle) mesh of a statue, then computing a
-/// skeleton of this surface (by thinning), using a complex-based
-/// image.
+/// surface of the (triangle) mesh of a statue, then performing a
+/// 2-collapse of this surface, using a complex-based image.
-// FIXME: Factor with mesh-complex-pinv-curv-skel.cc.
+// FIXME: Factor with mesh-complex-max-curv-skel.cc and
+// mesh-complex-pinv-curv-skel.cc, mesh-complex-max-curv-1-collapse.cc
#include <iostream>
@@ -40,6 +40,7 @@
#include <mln/core/image/complex_neighborhoods.hh>
#include <mln/core/image/dmorph/image_if.hh>
+#include <mln/core/image/dmorph/sub_image.hh>
#include <mln/core/image/dmorph/mutable_extension_ima.hh>
#include <mln/core/routine/mutable_extend.hh>
#include <mln/data/paste.hh>
@@ -50,14 +51,12 @@
#include <mln/morpho/closing/area.hh>
#include <mln/topo/is_n_face.hh>
-#include <mln/topo/is_simple_cell.hh>
-#include <mln/topo/detach_cell.hh>
+#include <mln/topo/is_simple_pair.hh>
+#include <mln/topo/detach_pair.hh>
#include <mln/topo/skeleton/breadth_first_thinning.hh>
-#include <mln/io/off/load.hh>
-/* FIXME: Remove as soon as mln::io::off::save is able to save a
- morphed mln::complex_image (i.e., seen through image_if). */
-#include "save_bin_alt.hh"
+#include <mln/io/vtk/load.hh>
+#include <mln/io/vtk/save.hh>
#include "trimesh/misc.hh"
@@ -67,7 +66,7 @@ main(int argc, char* argv[])
{
if (argc != 4)
{
- std::cerr << "usage: " << argv[0] << " input.off
lambda output.off"
+ std::cerr << "usage: " << argv[0] << " input.vtk
lambda output.vtk"
<< std::endl;
std::exit(1);
}
@@ -88,11 +87,11 @@ main(int argc, char* argv[])
typedef mln_geom_(float_ima_t) G;
mln::bin_2complex_image3df bin_input;
- mln::io::off::load(bin_input, input_filename);
+ mln::io::vtk::load(bin_input, input_filename);
std::pair<float_ima_t, float_ima_t> curv =
mln::geom::mesh_curvature(bin_input.domain());
- // Compute the pseudo_inverse curvature at each vertex.
+ // Compute the max curvature at each vertex.
float_ima_t float_ima(bin_input.domain());
mln::p_n_faces_fwd_piter<D, G> v(float_ima.domain(), 0);
for_all(v)
@@ -103,7 +102,7 @@ main(int argc, char* argv[])
}
// Values on triangles.
- mln::p_n_faces_fwd_piter<D, G> t(float_ima.domain(), 2);
+ mln::p_n_faces_fwd_piter<D, G> t(float_ima.domain(), 2);
// For each triangle (2-face) T, iterate on the the set of vertices
// (0-faces) transitively adjacent to T.
typedef mln::complex_m_face_neighborhood<D, G> adj_vertices_nbh_t;
@@ -249,15 +248,15 @@ main(int argc, char* argv[])
mln_piter_(bin_ima_t) f(minima.domain());
for_all(f)
if (minima(f) != mln::literal::zero)
- surface(f) = false;
+ surface(f) = false;
- /*-----------.
- | Skeleton. |
- `-----------*/
+ /*-------------.
+ | 2-collapse. |
+ `-------------*/
- // ---------------- //
- // Skeleton image. //
- // ---------------- //
+ // ------------------------------- //
+ // Image restricted to triangles. //
+ // ------------------------------- //
// Predicate type: is a face a triangle (2-face)?
typedef mln::topo::is_n_face<mln_psite_(bin_ima_t), D> is_a_triangle_t;
@@ -273,58 +272,54 @@ main(int argc, char* argv[])
// Simple point predicate. //
// ------------------------ //
- // Neighborhood type returning the set of (n-1)- and (n+1)-faces
- // adjacent to a an n-face.
- typedef mln::complex_lower_higher_neighborhood<D, G> adj_nbh_t;
// Neighborhood type returning the set of (n-1)-faces adjacent to a
// an n-face.
typedef mln::complex_lower_neighborhood<D, G> lower_adj_nbh_t;
+ lower_adj_nbh_t lower_adj_nbh;
// Neighborhood type returning the set of (n+1)-faces adjacent to a
// an n-face.
typedef mln::complex_higher_neighborhood<D, G> higher_adj_nbh_t;
+ higher_adj_nbh_t higher_adj_nbh;
// Predicate type: is a triangle (2-face) simple?
- typedef mln::topo::is_simple_cell< bin_triangle_ima_t,
- adj_nbh_t,
+ typedef mln::topo::is_simple_pair< bin_triangle_ima_t,
lower_adj_nbh_t,
higher_adj_nbh_t >
is_simple_triangle_t;
- is_simple_triangle_t is_simple_triangle;
+ is_simple_triangle_t is_simple_triangle(lower_adj_nbh, higher_adj_nbh);
// ------------------------------- //
// Simple point detach procedure. //
// ------------------------------- //
- // Type of adjacency relationships between faces of immediately
- // lower and higher dimensions.
- adj_nbh_t adj_nbh;
// Functor detaching a cell.
- mln::topo::detach_cell<bin_triangle_ima_t, adj_nbh_t> detach(adj_nbh);
+ typedef mln::topo::detach_pair< bin_triangle_ima_t,
+ lower_adj_nbh_t,
+ higher_adj_nbh_t > detach_triangle_t;
+ detach_triangle_t detach_triangle(lower_adj_nbh, higher_adj_nbh);
+
+ // ------------------------ //
+ // Thinning by 2-collapse. //
+ // ------------------------ //
- mln_concrete_(bin_ima_t) skel;
- mln::initialize(skel, surface);
+ mln_concrete_(bin_ima_t) surface_2_collapse;
+ mln::initialize(surface_2_collapse, surface);
mln::data::paste
(mln::topo::skeleton::breadth_first_thinning
(mln::mutable_extend((surface | is_a_triangle).rw(), surface),
nbh,
is_simple_triangle,
- detach),
- skel);
-
+ detach_triangle)
+ /* Before pasting the result of the computation into
+ SURFACE_2_COLLAPSE, re-expand its domain to the initial site
+ set, to ensure data from all faces (i.e., both the 2-faces,
+ directly processed; and the 1-faces from the extension,
+ undirectly processed). */
+ | surface.domain(),
+ surface_2_collapse);
/*---------.
| Output. |
`---------*/
- /* FIXME: This does not work (yet).
- Use workaround mln::io::off::save_bin_alt instead (bad!)
-
- Moreover, even if it worked, it would not have the same meaning
- as mln::io::off::save_bin_alt. Maybe the latter is useful, after
- all. But we need to factor it with the code of
- mln::io::off::save, anyway. */
-#if 0
- mln::io::off::save(skel | mln::pw::value(skel) == mln::pw::cst(true),
- output_filename);
-#endif
- mln::io::off::save_bin_alt(skel, output_filename);
+ mln::io::vtk::save(surface_2_collapse, output_filename);
}
diff --git a/milena/apps/mesh-segm-skel/test-mesh-complex-2-collapse.in
b/milena/apps/mesh-segm-skel/test-mesh-complex-max-curv-1-collapse.in
similarity index 77%
copy from milena/apps/mesh-segm-skel/test-mesh-complex-2-collapse.in
copy to milena/apps/mesh-segm-skel/test-mesh-complex-max-curv-1-collapse.in
index d2a286b..0bc967e 100644
--- a/milena/apps/mesh-segm-skel/test-mesh-complex-2-collapse.in
+++ b/milena/apps/mesh-segm-skel/test-mesh-complex-max-curv-1-collapse.in
@@ -20,4 +20,5 @@ set -ex
mesh_dir=@top_srcdir@/milena/mesh
-time ./mesh-complex-2-collapse $mesh_dir/pseudo-manifold.vtk
pseudo-manifold-2-collapse.vtk
+time ./mesh-complex-max-curv-1-collapse $mesh_dir/teapot.vtk 20
teapot-max-curv-1-collapse.vtk
+time ./mesh-complex-max-curv-1-collapse $mesh_dir/bunny-holefilled.vtk 50
bunny-holefilled-max-curv-1-collapse.vtk
diff --git a/milena/apps/mesh-segm-skel/test-mesh-complex-2-collapse.in
b/milena/apps/mesh-segm-skel/test-mesh-complex-max-curv-2-collapse.in
similarity index 77%
copy from milena/apps/mesh-segm-skel/test-mesh-complex-2-collapse.in
copy to milena/apps/mesh-segm-skel/test-mesh-complex-max-curv-2-collapse.in
index d2a286b..4edf55f 100644
--- a/milena/apps/mesh-segm-skel/test-mesh-complex-2-collapse.in
+++ b/milena/apps/mesh-segm-skel/test-mesh-complex-max-curv-2-collapse.in
@@ -20,4 +20,5 @@ set -ex
mesh_dir=@top_srcdir@/milena/mesh
-time ./mesh-complex-2-collapse $mesh_dir/pseudo-manifold.vtk
pseudo-manifold-2-collapse.vtk
+time ./mesh-complex-max-curv-2-collapse $mesh_dir/teapot.vtk 20
teapot-max-curv-2-collapse.vtk
+time ./mesh-complex-max-curv-2-collapse $mesh_dir/bunny-holefilled.vtk 50
bunny-holefilled-max-curv-2-collapse.vtk
--
1.5.6.5