Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Re: Area of convex polygons with non-constant density

Subject: CGAL users discussion list

List archive

[cgal-discuss] Re: Area of convex polygons with non-constant density


Chronological Thread 
  • From: liudaisuda <>
  • To:
  • Subject: [cgal-discuss] Re: Area of convex polygons with non-constant density
  • Date: Tue, 28 May 2013 04:20:59 -0700 (PDT)

I looked at the demo you referred and came up with my custom mesh criteria as
defined in the attached file.
Using this criteria, I test it with a rectangle (-8,-8) (8,-8) (8,8) and
(-8,8). However, the mesher always divided the polygon into 2 faces no
matter what bound I specify for the criteria. Below is my code applying mesh
algorithm to my polygon.

CDT cdt;
CDT::Vertex_handle
v_prev=cdt.insert(*CGAL::cpp11::prev(this->vertices_end()));
for (Polygon_2::Vertex_iterator
vit=this->vertices_begin();
vit!=this->vertices_end();++vit)
{
CDT::Vertex_handle vh=cdt.insert(*vit);
cdt.insert_constraint(vh,v_prev);
v_prev=vh;
}
Mesh_area_criteria criteria(0.000001);
Mesher mesher(cdt);
mesher.set_criteria(criteria);
mesher.refine_mesh();

int count = 0;
for (CDT::Finite_faces_iterator
fit=cdt.finite_faces_begin();
fit!=cdt.finite_faces_end();++fit)
{ custom_mesh_trait.h
<http://cgal-discuss.949826.n4.nabble.com/file/n4657607/custom_mesh_trait.h>
count++;
}
std::cout << "Number of meshed triangles is " <<
count << std::endl;


The mesh criteria is in the attached file as I said. It always showed the
number of meshed triangles is 2, but I didn't know where I did wrong with
it. Please help, and if you need more information, let me know.



--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/Area-of-convex-polygons-with-non-constant-density-tp4657579p4657607.html
Sent from the cgal-discuss mailing list archive at Nabble.com.



Archive powered by MHonArc 2.6.18.

Top of Page