mirror of https://github.com/CGAL/cgal
fixed score calculation and sorting of cylinders and circles
This commit is contained in:
parent
c7ae5ab054
commit
dd2774391b
|
|
@ -177,7 +177,7 @@ namespace Point_set {
|
|||
neighbors.push_back(i);
|
||||
m_scores[i] = internal::create_circle_2(
|
||||
m_input_range, m_point_map, neighbors, m_traits, true).second;
|
||||
CGAL_assertion(m_scores[i] >= FT(0));
|
||||
CGAL_assertion(m_scores[i] <= FT(0));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -190,7 +190,7 @@ namespace Point_set {
|
|||
neighbors.push_back(i);
|
||||
m_scores[i] = internal::create_cylinder(
|
||||
m_input_range, m_point_map, m_normal_map, neighbors, m_traits, true).second;
|
||||
CGAL_assertion(m_scores[i] >= FT(0));
|
||||
CGAL_assertion(m_scores[i] <= FT(0));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -435,7 +435,7 @@ namespace internal {
|
|||
if (eigenvectors[3] == IFT(0)) {
|
||||
return std::make_pair(
|
||||
std::make_pair(FT(-1), Point_2()),
|
||||
static_cast<FT>(((std::numeric_limits<double>::max))()));
|
||||
-static_cast<FT>(((std::numeric_limits<double>::max))()));
|
||||
}
|
||||
CGAL_assertion(eigenvectors[3] != IFT(0));
|
||||
|
||||
|
|
@ -463,7 +463,7 @@ namespace internal {
|
|||
CGAL_precondition(item_index < input_range.size());
|
||||
const auto& key = *(input_range.begin() + item_index);
|
||||
const auto& point = get(point_map, key);
|
||||
score += CGAL::abs(sqrt(squared_distance_2(point, fitted_center)) - fitted_radius);
|
||||
score -= CGAL::abs(sqrt(squared_distance_2(point, fitted_center)) - fitted_radius);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -671,7 +671,7 @@ namespace internal {
|
|||
if (nb == 0) {
|
||||
return std::make_pair(
|
||||
std::make_pair(FT(-1), Line_3()),
|
||||
static_cast<FT>((std::numeric_limits<double>::max)()));
|
||||
-static_cast<FT>((std::numeric_limits<double>::max)()));
|
||||
}
|
||||
|
||||
mean_axis = mean_axis / sqrt(mean_axis * mean_axis);
|
||||
|
|
@ -694,7 +694,7 @@ namespace internal {
|
|||
CGAL_precondition(item_index < input_range.size());
|
||||
const auto& key = *(input_range.begin() + item_index);
|
||||
const auto& point = get(point_map, key);
|
||||
score += CGAL::abs(sqrt(squared_distance_3(point, fitted_axis)) - fitted_radius);
|
||||
score -= CGAL::abs(sqrt(squared_distance_3(point, fitted_axis)) - fitted_radius);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue