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: Thu, 3 Apr 2008 10:11:11 -0300
  • Organization: Geometry Factory

Hi Qianqian,
thank you Fernando

Now the code compiles normally. Unfortunately, the simplified surface mesh
is similar to the
old one:some of the border edges were collapsed.

[SNIP]

I don't want to spend too much of your time on this, but if you have some
quick
thoughts or ideas where to look at, that would be great help.

I'm afraid I would have to investigate this further but I can't do that now.
The only idea I can give you at this point is to wrap the GetCost function to prevent collpasing any edge adjacent to a border edge:

template<class GetCost_>
struct Cost_with_fixed_edges : GetCost_
{
typedef GetCost_ GetCost ;

typedef typename GetCost::Profile Profile ;
typedef typename GetCost::Point Point ;
typedef typename GetCost::result_type result_type ;

result_type operator()( Profile const& aProfile, boost::optional<Point> const& aPlacement ) const
{
if ( aProfile.border_edges().size() > 0 )
return boost::none ;
else
return this->GetCost::operator()(aProfile, aPlacement);
}
} ;

typedef Cost_with_fixed_edges< SMS::Edge_length_cost<Surface> > My_cost ;

int r = SMS::edge_collapse
(surface
,stop

,CGAL::vertex_index_map(boost::get(CGAL::vertex_external_index,surface))
.edge_index_map (boost::get(CGAL::edge_external_index ,surface))
.get_cost (My_cost())
.get_placement (SMS::Midpoint_placement<Surface>())
);

HTH

Fernando Cacciola
GeometryFactory




Archive powered by MHonArc 2.6.16.

Top of Page