Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Simplify function doesn't work?

Subject: CGAL users discussion list

List archive

[cgal-discuss] Simplify function doesn't work?


Chronological Thread 
  • From: tang <>
  • To:
  • Subject: [cgal-discuss] Simplify function doesn't work?
  • Date: Wed, 3 Oct 2012 22:54:46 -0700 (PDT)

Dear all,

I found that the OFF file generated by CGAL has some duplicated vertices
(a1.off), I tried to remove these vertices by simplifying surface mesh with
short edge rule:
SimplifySurfaceMeshCGAL(1.0e-4);

Howerver, the duplicated vertices are still here after simplification
(a11.off). Could anyone help me to take a look at it?

Thanks,
Zhanghong Tang


PS: the simplification function is here
a1.off <http://cgal-discuss.949826.n4.nabble.com/file/n4655966/a1.off>
a11.off <http://cgal-discuss.949826.n4.nabble.com/file/n4655966/a11.off>
void SimplifySurfaceMeshCGAL(double edgelengthmin)
{
Polyhedron obj;
std::ifstream stream("a1.off");
stream >> obj;
// edges will be removed until there is at most one edge
// shorter than this:
double minimum_edge_length = edgelengthmin*edgelengthmin; // squared
Cost_stop_predicate<Polyhedron> stop(minimum_edge_length);

int r = SMS::edge_collapse(obj, stop,

CGAL::vertex_index_map(boost::get(CGAL::vertex_external_index, obj))

.edge_index_map(boost::get(CGAL::edge_external_index,obj))

.get_cost(SMS::Edge_length_cost<Polyhedron>())

.get_placement(SMS::Midpoint_placement<Polyhedron>())
);
std::ofstream log("a11.off");
log << obj;
}




--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/Simplify-function-doesn-t-work-tp4655966.html
Sent from the cgal-discuss mailing list archive at Nabble.com.



Archive powered by MHonArc 2.6.18.

Top of Page