Unexpected assertion with arrangement insert_at_vertices

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Unexpected assertion with arrangement insert_at_vertices

chgans
Hi there,

I am trying to insert segment whose end points correspond to existing vertices.
Here is the use case that trigger an assertion:
- insert 4 segment to form a 4 sided face 'F'
- insert a segment S1 to form the first diagonal of 'F' (causing F to
be split in 2)
- insert a segment S2 to form the second diagonal of 'F' (visually speaking)

The 2 diagonals are inserted using
"insert_at_vertices(Segment(v1->point(), v2->point()), v1, v2)"

When inserting the second diagonal i get an assertion:
------------------------------
terminate called after throwing an instance of 'CGAL::Precondition_exception'
what(): CGAL ERROR: precondition violation!
Expr: f == f2
File: /usr/local/include/CGAL/Arrangement_2/Arrangement_on_surface_2_impl.h
Line: 2667
Explanation: The two halfedges must share the same incident face
------------------------------

I get the same results, using CGAL-4.8.1-1build1 and CGAL from git.

Looking at the documentation i cannot see this precondition listed,
here is the list of preconditions:
1. The interior of c is disjoint from all existing arrangement
vertices and edges.
2. c must not be an unbounded curve.
3. v1 and v2 are associated with c's endpoints.
4. If v1 and v2 are already connected by an edge, this edge represents
an x-monotone curve that is interior-disjoint from c).

I'm clearly not violating 2, 3 and 4. Am I violating 1? If so, could
someone shed some light on the meaning of it and what it implies?
If not, then shouldn't the documentation be updated? I'm happy to make
the change and do a pull request for it.

Thanks,
Chris

--
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
|  
Report Content as Inappropriate

Re: Unexpected assertion with arrangement insert_at_vertices

Efi Fogel
Could you please attach a small program that reproduces the problem.

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



On 3 March 2017 at 04:53, Ch'Gans <[hidden email]> wrote:
Hi there,

I am trying to insert segment whose end points correspond to existing vertices.
Here is the use case that trigger an assertion:
- insert 4 segment to form a 4 sided face 'F'
- insert a segment S1 to form the first diagonal of 'F' (causing F to
be split in 2)
- insert a segment S2 to form the second diagonal of 'F' (visually speaking)

The 2 diagonals are inserted using
"insert_at_vertices(Segment(v1->point(), v2->point()), v1, v2)"

When inserting the second diagonal i get an assertion:
------------------------------
terminate called after throwing an instance of 'CGAL::Precondition_exception'
what(): CGAL ERROR: precondition violation!
Expr: f == f2
File: /usr/local/include/CGAL/Arrangement_2/Arrangement_on_surface_2_impl.h
Line: 2667
Explanation: The two halfedges must share the same incident face
------------------------------

I get the same results, using CGAL-4.8.1-1build1 and CGAL from git.

Looking at the documentation i cannot see this precondition listed,
here is the list of preconditions:
1. The interior of c is disjoint from all existing arrangement
vertices and edges.
2. c must not be an unbounded curve.
3. v1 and v2 are associated with c's endpoints.
4. If v1 and v2 are already connected by an edge, this edge represents
an x-monotone curve that is interior-disjoint from c).

I'm clearly not violating 2, 3 and 4. Am I violating 1? If so, could
someone shed some light on the meaning of it and what it implies?
If not, then shouldn't the documentation be updated? I'm happy to make
the change and do a pull request for it.

Thanks,
Chris

--
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
|  
Report Content as Inappropriate

Re: Unexpected assertion with arrangement insert_at_vertices

chgans
On 4 March 2017 at 00:28, Efi Fogel <[hidden email]> wrote:
> Could you please attach a small program that reproduces the problem.

I used that approach (reproduce the problem  with a small program),
and realised that it worked, always. So I dag deeper and pin-pointed
the problem, the root cause was a use-after-free in another part of my
application! On top of that i've switched to an exact construction
kernel, so now everything seems to work nicely.

Thanks,
Chris

>
>    ____  _        ____             _
>   /_____/_) o    /__________  __  //
>  (____ (   (    (    (_/ (_/-(-'_(/
>                          _/
>
>
>
> On 3 March 2017 at 04:53, Ch'Gans <[hidden email]> wrote:
>>
>> Hi there,
>>
>> I am trying to insert segment whose end points correspond to existing
>> vertices.
>> Here is the use case that trigger an assertion:
>> - insert 4 segment to form a 4 sided face 'F'
>> - insert a segment S1 to form the first diagonal of 'F' (causing F to
>> be split in 2)
>> - insert a segment S2 to form the second diagonal of 'F' (visually
>> speaking)
>>
>> The 2 diagonals are inserted using
>> "insert_at_vertices(Segment(v1->point(), v2->point()), v1, v2)"
>>
>> When inserting the second diagonal i get an assertion:
>> ------------------------------
>> terminate called after throwing an instance of
>> 'CGAL::Precondition_exception'
>> what(): CGAL ERROR: precondition violation!
>> Expr: f == f2
>> File:
>> /usr/local/include/CGAL/Arrangement_2/Arrangement_on_surface_2_impl.h
>> Line: 2667
>> Explanation: The two halfedges must share the same incident face
>> ------------------------------
>>
>> I get the same results, using CGAL-4.8.1-1build1 and CGAL from git.
>>
>> Looking at the documentation i cannot see this precondition listed,
>> here is the list of preconditions:
>> 1. The interior of c is disjoint from all existing arrangement
>> vertices and edges.
>> 2. c must not be an unbounded curve.
>> 3. v1 and v2 are associated with c's endpoints.
>> 4. If v1 and v2 are already connected by an edge, this edge represents
>> an x-monotone curve that is interior-disjoint from c).
>>
>> I'm clearly not violating 2, 3 and 4. Am I violating 1? If so, could
>> someone shed some light on the meaning of it and what it implies?
>> If not, then shouldn't the documentation be updated? I'm happy to make
>> the change and do a pull request for it.
>>
>> Thanks,
>> Chris
>>
>> --
>> You are currently subscribed to cgal-discuss.
>> To unsubscribe or access the archives, go to
>> https://sympa.inria.fr/sympa/info/cgal-discuss
>>
>>
>

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


Loading...