bug fix for the simplex traverser

This commit is contained in:
Laurent Rineau 2023-05-04 09:55:10 +02:00
parent 2434b2437b
commit dd738bf029
2 changed files with 11 additions and 3 deletions

View File

@ -241,6 +241,7 @@ walk_to_next() {
// The target is inside the cell. // The target is inside the cell.
_prev = Simplex( cell(), Tr::VERTEX, ti, -1 ); _prev = Simplex( cell(), Tr::VERTEX, ti, -1 );
cell() = Cell_handle(); cell() = Cell_handle();
lt() = Locate_type::VERTEX;
return; return;
} }

View File

@ -228,6 +228,8 @@ public:
*/ */
const Point& target() const { return _target; } const Point& target() const { return _target; }
Vertex_handle target_vertex() const { return _t_vertex; }
// gives a handle to the current cell. // gives a handle to the current cell.
/* By invariance, this cell is intersected by the segment /* By invariance, this cell is intersected by the segment
* between `source()` and `target()`. * between `source()` and `target()`.
@ -809,7 +811,7 @@ public:
else else
ch = _cell_iterator.previous(); ch = _cell_iterator.previous();
Cell_handle chnext = Cell_handle(_cell_iterator); const Cell_handle chnext = Cell_handle(_cell_iterator);
//_cell_iterator is one step forward _curr_simplex //_cell_iterator is one step forward _curr_simplex
CGAL_assertion(ch != chnext); CGAL_assertion(ch != chnext);
@ -834,8 +836,13 @@ public:
{ {
if (prev == ch && ltprev == Locate_type::VERTEX) if (prev == ch && ltprev == Locate_type::VERTEX)
{ {
CGAL_assertion(prev->vertex(liprev) == get_vertex()); const auto current_vertex = get_vertex();
_curr_simplex = ch; if(current_vertex == _cell_iterator.target_vertex()) {
_curr_simplex = Simplex_3();
} else {
CGAL_assertion(prev->vertex(liprev) == _cell_iterator.target_vertex());
_curr_simplex = ch;
}
} }
else else
{ {