mirror of https://github.com/CGAL/cgal
Bug fix in face width
This commit is contained in:
parent
303d579941
commit
19d7e197c6
|
|
@ -41,12 +41,12 @@ int main(int argc, char* argv[])
|
||||||
inp>>sm;
|
inp>>sm;
|
||||||
std::cout<<"File '"<<filename<<"' loaded. Finding edge-width of the mesh..."<<std::endl;
|
std::cout<<"File '"<<filename<<"' loaded. Finding edge-width of the mesh..."<<std::endl;
|
||||||
|
|
||||||
CGAL::Surface_mesh_topology::Curves_on_surface_topology<Mesh> cst(sm);
|
CGAL::Surface_mesh_topology::Curves_on_surface_topology<Mesh> cst(sm, true);
|
||||||
|
|
||||||
Path_on_surface cycle1=cst.compute_edgewidth();
|
Path_on_surface cycle1=cst.compute_edgewidth(true);
|
||||||
|
|
||||||
CGAL::Surface_mesh_topology::Euclidean_length_weight_functor<Mesh> wf(sm);
|
CGAL::Surface_mesh_topology::Euclidean_length_weight_functor<Mesh> wf(sm);
|
||||||
Path_on_surface cycle2=cst.compute_edgewidth(wf);
|
Path_on_surface cycle2=cst.compute_edgewidth(wf, true);
|
||||||
|
|
||||||
std::cout<<"Cycle 1 (pink): "; display_cycle_info(sm, cycle1);
|
std::cout<<"Cycle 1 (pink): "; display_cycle_info(sm, cycle1);
|
||||||
std::cout<<"Cycle 2 (green): "; display_cycle_info(sm, cycle2);
|
std::cout<<"Cycle 2 (green): "; display_cycle_info(sm, cycle2);
|
||||||
|
|
|
||||||
|
|
@ -40,9 +40,9 @@ struct Euclidean_length_weight_functor
|
||||||
|
|
||||||
Weight_t operator() (Dart_const_handle dh) const
|
Weight_t operator() (Dart_const_handle dh) const
|
||||||
{
|
{
|
||||||
CGAL::sqrt(CGAL::squared_distance
|
return CGAL::sqrt(CGAL::squared_distance
|
||||||
(Get_traits<Mesh>::get_point(m_mesh, dh),
|
(Get_traits<Mesh>::get_point(m_mesh, dh),
|
||||||
Get_traits<Mesh>::get_point(m_mesh, m_map.other_extremity(dh))));
|
Get_traits<Mesh>::get_point(m_mesh, m_map.other_extremity(dh))));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
||||||
|
|
@ -108,7 +108,7 @@ public:
|
||||||
// Here amesh is already closed, and have 0-attributes with int.
|
// Here amesh is already closed, and have 0-attributes with int.
|
||||||
// Thus the mesh is not copied.
|
// Thus the mesh is not copied.
|
||||||
Shortest_noncontractible_cycle(Mesh* amesh, size_type perforated_mark,
|
Shortest_noncontractible_cycle(Mesh* amesh, size_type perforated_mark,
|
||||||
bool display_time=false) :
|
bool /*display_time*/=false) :
|
||||||
m_local_map(amesh),
|
m_local_map(amesh),
|
||||||
m_is_perforated(perforated_mark),
|
m_is_perforated(perforated_mark),
|
||||||
m_cycle(*amesh)
|
m_cycle(*amesh)
|
||||||
|
|
@ -522,11 +522,11 @@ protected:
|
||||||
Original_dart_const_handle
|
Original_dart_const_handle
|
||||||
dh_original=Get_original_dart<Self, Copy>::run(this, dh);
|
dh_original=Get_original_dart<Self, Copy>::run(this, dh);
|
||||||
if (cycle.can_be_pushed(dh_original, flip))
|
if (cycle.can_be_pushed(dh_original, flip))
|
||||||
{ cycle.push_back(dh_original, flip); }
|
{ cycle.push_back(dh_original, flip, false); }
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CGAL_assertion(cycle.can_be_pushed(dh_original, !flip));
|
CGAL_assertion(cycle.can_be_pushed(dh_original, !flip));
|
||||||
cycle.push_back(dh_original, !flip);
|
cycle.push_back(dh_original, !flip, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -576,6 +576,7 @@ protected:
|
||||||
// Trace back the path from `b` to root
|
// Trace back the path from `b` to root
|
||||||
for (int ind=min_b-1; ind!=-1; ind=m_trace_index[ind])
|
for (int ind=min_b-1; ind!=-1; ind=m_trace_index[ind])
|
||||||
{ add_to_cycle(m_spanning_tree[ind], cycle, true); }
|
{ add_to_cycle(m_spanning_tree[ind], cycle, true); }
|
||||||
|
cycle.update_is_closed();
|
||||||
CGAL_assertion(cycle.is_closed());
|
CGAL_assertion(cycle.is_closed());
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue