From a1a29ee05e93d0a61eab8a7f76f78894680ff3f9 Mon Sep 17 00:00:00 2001 From: Efi Fogel Date: Tue, 8 Oct 2024 10:59:17 +0300 Subject: [PATCH] Added a comment --- .../include/CGAL/Arr_polycurve_traits_2.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_polycurve_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_polycurve_traits_2.h index 37052dbbc2b..97c5433e509 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_polycurve_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_polycurve_traits_2.h @@ -741,6 +741,12 @@ public: // Add a subcurve to the saved x-monotone curve auto update_saved_xcv = [&](const X_monotone_subcurve_2& sxcv) { xcv_saved = true; + // We maintain the invariant that if the input curves have opposite + // directions (! consistent), the overalpping curves are directed + // left=>right. This, however, is not guaranteed by all traits for the + // subcurves. (It is guaranteed by some traits, but this is + // insufficient.) Therefore, we need to enforce it. That is, we make + // sure the subcurves are also directed left=>right in this case. if (! consistent && (cmp_endpts(sxcv) == LARGER)) { if (invert_ocv) { saved_xcv.push_front(ctr_opposite(sxcv));