Bezier Arrangement_2 assertion violation: just two line segs

classic Classic list List threaded Threaded
4 messages Options
gp
Reply | Threaded
Open this post in threaded view
|

Bezier Arrangement_2 assertion violation: just two line segs

gp
I've noticed that CGAL::insert on an Arrangement_2< Arr_Bezier_curve_traits_2
> will occasionally violate an assertion. I can't tell exactly what the
erroneous scenarios have in common, but I have a rough idea that they
involve one curve terminating on top of another. I've put together a minimal
example. For me (Windows 8.1, MSVC2015 running in QtCreator, CGAL-4.14),
this fails in debug mode on the assertion of line 234 of
No_intersection_surface_sweep_2_impl.h (in release mode, my system just
crashes):

         CGAL_assertion((m_statusLine.size() == 0));

Can anyone reproduce this?


main.cpp:

#include <CGAL/Cartesian.h>
#include <CGAL/CORE_algebraic_number_traits.h>
#include <CGAL/Arr_Bezier_curve_traits_2.h>
#include <CGAL/Arrangement_2.h>

#include <sstream>

using NtTraits = CGAL::CORE_algebraic_number_traits;
using Rational = NtTraits::Rational;
using Algebraic = NtTraits::Algebraic;
using RationalKernel = CGAL::Cartesian< Rational >;
using AlgebraicKernel = CGAL::Cartesian< Algebraic >;
using ArrTraits = CGAL::Arr_Bezier_curve_traits_2< RationalKernel,
AlgebraicKernel, NtTraits >;
using BezierCurve2 = ArrTraits::Curve_2;
using Arrangement = CGAL::Arrangement_2< ArrTraits >;

int main()
{
    // Change the 10.1 to a 10 and there is no longer an assertion
violation.
    const std::string curvesData =
                "2            \
                2 -10 0 10.1 0 \
                2 10 10 10 0 ";

    std::istringstream stream( curvesData );
    std::vector< BezierCurve2 > curvesToInsert;
    size_t numCurves = 0;
    stream >> numCurves;
    for( size_t i = 0; i < numCurves; i++ ) {
        BezierCurve2 curve;
        stream >> curve;
        curvesToInsert.push_back( curve );
    }

    Arrangement arr;
    // Assertion violation here.
    CGAL::insert( arr, curvesToInsert.begin(), curvesToInsert.end() );
    return 0;
}



--
Sent from: http://cgal-discuss.949826.n4.nabble.com/

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss


Reply | Threaded
Open this post in threaded view
|

Re: Bezier Arrangement_2 assertion violation: just two line segs

Efi Fogel
Hi gp,

Yes, I can reproduce it.
I saw that you have listed it also in stackoverflow.
It's probably the same bug that has already been reported, but not the one you referred to. (That one got fixed.)
We are working on it...

Efi
   ____  _        ____             _
  /_____/_) o    /__________  __  //
 (____ (   (    (    (_/ (_/-(-'_(/
                         _/




On Sat, 11 May 2019 at 02:30, gp <[hidden email]> wrote:
I've noticed that CGAL::insert on an Arrangement_2< Arr_Bezier_curve_traits_2
> will occasionally violate an assertion. I can't tell exactly what the
erroneous scenarios have in common, but I have a rough idea that they
involve one curve terminating on top of another. I've put together a minimal
example. For me (Windows 8.1, MSVC2015 running in QtCreator, CGAL-4.14),
this fails in debug mode on the assertion of line 234 of
No_intersection_surface_sweep_2_impl.h (in release mode, my system just
crashes):

         CGAL_assertion((m_statusLine.size() == 0));

Can anyone reproduce this?


main.cpp:

#include <CGAL/Cartesian.h>
#include <CGAL/CORE_algebraic_number_traits.h>
#include <CGAL/Arr_Bezier_curve_traits_2.h>
#include <CGAL/Arrangement_2.h>

#include <sstream>

using NtTraits = CGAL::CORE_algebraic_number_traits;
using Rational = NtTraits::Rational;
using Algebraic = NtTraits::Algebraic;
using RationalKernel = CGAL::Cartesian< Rational >;
using AlgebraicKernel = CGAL::Cartesian< Algebraic >;
using ArrTraits = CGAL::Arr_Bezier_curve_traits_2< RationalKernel,
AlgebraicKernel, NtTraits >;
using BezierCurve2 = ArrTraits::Curve_2;
using Arrangement = CGAL::Arrangement_2< ArrTraits >;

int main()
{
    // Change the 10.1 to a 10 and there is no longer an assertion
violation.
    const std::string curvesData =
                "2            \
                2 -10 0 10.1 0 \
                2 10 10 10 0 ";

    std::istringstream stream( curvesData );
    std::vector< BezierCurve2 > curvesToInsert;
    size_t numCurves = 0;
    stream >> numCurves;
    for( size_t i = 0; i < numCurves; i++ ) {
        BezierCurve2 curve;
        stream >> curve;
        curvesToInsert.push_back( curve );
    }

    Arrangement arr;
    // Assertion violation here.
    CGAL::insert( arr, curvesToInsert.begin(), curvesToInsert.end() );
    return 0;
}



--
Sent from: http://cgal-discuss.949826.n4.nabble.com/

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss


gp
Reply | Threaded
Open this post in threaded view
|

Re: Bezier Arrangement_2 assertion violation: just two line segs

gp
It would be good to know if the status changes—is the relevant GitHub issue
3158 <https://github.com/CGAL/cgal/issues/3158>  ?



--
Sent from: http://cgal-discuss.949826.n4.nabble.com/

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss


Reply | Threaded
Open this post in threaded view
|

Re: Bezier Arrangement_2 assertion violation: just two line segs

Efi Fogel
Still working on it.
   ____  _        ____             _
  /_____/_) o    /__________  __  //
 (____ (   (    (    (_/ (_/-(-'_(/
                         _/




On Tue, 18 Jun 2019 at 19:33, gp <[hidden email]> wrote:
It would be good to know if the status changes—is the relevant GitHub issue
3158 <https://github.com/CGAL/cgal/issues/3158>  ?



--
Sent from: http://cgal-discuss.949826.n4.nabble.com/

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss