Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Segment round incorrectly rejects hot pixel

Subject: CGAL users discussion list

List archive

[cgal-discuss] Segment round incorrectly rejects hot pixel


Chronological Thread 
  • From: Steven <>
  • To:
  • Subject: [cgal-discuss] Segment round incorrectly rejects hot pixel
  • Date: Thu, 29 Oct 2015 00:50:36 -0700 (PDT)
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=SoftFail ; spf=None
  • Ironport-phdr: 9a23:Q/6TTBXVFsJDiYkCaTa4Y/dOGnHV8LGtZVwlr6E/grcLSJyIuqrYZhGBt8tkgFKBZ4jH8fUM07OQ6PC9HzVQqs/e+Fk5M7VyFDY9wf0MmAIhBMPXQWbaF9XNKxIAIcJZSVV+9Gu6O0UGUOz3ZlnVv2HgpWVKQka3CwN5K6zPF5LIiIzvjqbpq8CVOlUD3WX1SIgxBSv1hD2ZjtMRj4pmJ/R54TryiVwMRd5rw3h1L0mYhRf265T41pdi9yNNp6BprJYYAu3MVv9mHPkBVHxmaDhtpZ6jiR6WRgSG4j4QU34djwFTKwnD9hDzGJnr4QXgse8o4zWXI8DwBeQvRTm84qEtVhLyjSoKLTM/2G7Sg810yqlcpUTy9FRE34fIbdTMZ7JFdaTHcIZBHTJM

Please find the sample code below.

The pixel size is set to 50, whereas the line is obviously much longer than
that, so the result of the snap rounding should simply contain two points.
However, it contains only one. From what I've been able to debug, it seems
that there is no intersection found between one of the hot pixels and the
segment. I don't know the root cause of this though.

Note that if you set the pixel size to for example 1 or 60, it does give the
correct output.

Can anyone confirm this is a bug?

--------------------------------------------


typedef CGAL::Exact_predicates_exact_constructions_kernel K;
typedef CGAL::Snap_rounding_traits_2<K>
Traits;
typedef K::Point_2
Point;
typedef CGAL::Arr_segment_traits_2<K>
SegmentTraits;
typedef SegmentTraits::X_monotone_curve_2
Segment;
typedef std::list<Point>
Polyline;
typedef std::list<Polyline>
Polyline_list;

int main(int argc, char* argv[])
{
std::list<Segment> seg_list;
seg_list.push_back(Segment(Point(-53700, 28899.999999999996),
Point(-54551.560900716613, 15250.102354145352)));

Polyline_list output_list;
CGAL::snap_rounding_2<Traits, std::list&lt;Segment>::const_iterator,
Polyline_list>
(seg_list.begin(), seg_list.end(), output_list, 50, false,
false, 1);

assert (output_list.size() == 1);
assert (output_list.front().size() == 2);
}



--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/Segment-round-incorrectly-rejects-hot-pixel-tp4661300.html
Sent from the cgal-discuss mailing list archive at Nabble.com.


  • [cgal-discuss] Segment round incorrectly rejects hot pixel, Steven, 10/29/2015

Archive powered by MHonArc 2.6.18.

Top of Page