Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] fix border edges for mesh simplification

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] fix border edges for mesh simplification


Chronological Thread 
  • From: "Fernando Cacciola" <>
  • To: <>
  • Subject: Re: [cgal-discuss] fix border edges for mesh simplification
  • Date: Fri, 28 Mar 2008 19:17:21 -0300
  • Organization: Geometry Factory

Hi Qianqian,

The reason this doesn't just work is that border edges are not collapsed per-se but those non-border edges adjacent to the border vertices are, so the border vertices are moved.

One way to do what you need is via a placement policy wrapper whicch would return boost:::none for any edge adjacent to a border vertex.

Here's an example off the top of my head:

template<class GetPlacement_>
struct Placement_with_fixed_border_vertices : GetPlacement_
{
typedef GetPlacement_ GetPlacement ;

typedef typename GetPlacement::Profile Profile ;

typedef typename GetPlacement::result_type result_type ;

result_type operator()( Profile const& aProfile ) const
{
if ( is_border_vertex(aProfile.v0()) || is_border_vertex(aProfile.v1()) )
return boost::none ;
else
return this->GetPlacement::operator()(aProfile);
}

bool is_border_vertex( typename Profile::const_vertex_descriptor v )
{
// whatever works for you enriched polyhedron, i.e.: true if any adjacent halfedge is a border.
}
} ;


HTH

Fernando Cacciola
GeometryFactory




Archive powered by MHonArc 2.6.16.

Top of Page