Skip to Content.
Sympa Menu

cgal-discuss - Re: Follow-up: [cgal-discuss] Segment missing in planar map?

Subject: CGAL users discussion list

List archive

Re: Follow-up: [cgal-discuss] Segment missing in planar map?


Chronological Thread 
  • From: Efraim Fogel <>
  • To:
  • Subject: Re: Follow-up: [cgal-discuss] Segment missing in planar map?
  • Date: Mon, 28 May 2007 17:02:41 +0300

I can tell you that the Arrangement_2 package went through a major
change in version 3.2. I strongly encourage you to move on to the latest
version. You will notice a small change in the interface, and you will
have to fix your code accordingly. Let us know whether the problem
remains after the switch.

Martin Baeker wrote:
> Dear experts,
>
> I still have not solved the problem described below. I tried to insert
> the segments one by one as follows:
>
> Pmwx pm;
> for (unsigned int i=0; i< seglist.size(); i++)
> pm.insert(seglist[i]);
>
> but still one of the segments is missing from the planar map in some cases.
>
> I would really appreciate any insight on why this can happen and what
> to do about it. Is there any kind of assertion I can use to check
> whether the segment was actually inserted?
>
> Thanks,
>
> Martin.
>
> PS: I still use CGAL 3.1 - is there a chance that upgrading to a later
> version will help?
>
>
>
>
>> Dear all,
>>
>> I just encountered a puzzling behaviour in a Planar map.
>>
>> I use the following code fragment to create the planar map:
>>
>>
>> std::vector<Segment> seglist //This is the standard template library
>> vector class
>> ... seglist filled with values
>> Pmwx pm;
>> pm.insert(seglist.begin(), seglist.end());
>> std::cout << "\n\nWriting pm's halfedges" << std::endl;
>> Pmwx::Halfedge_const_iterator eit;
>> for (eit = pm.halfedges_begin(); eit != pm.halfedges_end(); ++eit,
>> ++eit) {
>> std::cout << eit->source()->point()
>> << " --- " << eit->target()->point() << std::endl;
>> }
>>
>> In most cases, this works fine, but
>> I just encountered a case where one of the elements of a
>> seglist is missing in the Pmwx pm (and it is neither the first nor the
>> last element, so it seems not to be a problem with the
>> seglist.begin() or end()).
>>
>> Here's the bunch of defintions I use:
>> typedef CGAL::Quotient<CGAL::MP_Float> NT;
>> typedef CGAL::Cartesian<NT> TutorialR;
>> typedef CGAL::Segment_2<TutorialR> Segment;
>> typedef CGAL::Arr_segment_traits_2<TutorialR> Traits;
>> typedef CGAL::Pm_default_dcel<Traits> Dcel;
>> typedef CGAL::Planar_map_2<Dcel,Traits> Planar_map;
>> typedef CGAL::Planar_map_with_intersections_2<Planar_map> Pmwx;
>>
>> I don't know if looking at the actual values can help in understanding
>> this problem, but just in case, I'll show them here:
>>
>> This is the contents of seglist:
>>
>> i: 0 0.10000008344650269/1 0.012000012211501598/1 - 0.24999982118606567/1
>> 0.012000012211501598/1
>> i: 1 0.10000009089708328/1 5.8278321573111952e-38/1 -
>> 0.10000008344650269/1 0.012000012211501598/1
>> i: 2 0.10000009089708328/1 5.8278321573111952e-38/1 -
>> 0.26000073552131653/1 4.9593527711929177e-38/1
>> i: 3 0.26000073552131653/1 4.9593527711929177e-38/1 -
>> 0.25993925333023071/1 0.00057996663963422179/1
>> i: 4 0.25993925333023071/1 0.00057996663963422179/1 -
>> 0.25975009799003601/1 0.0011668455554172397/1
>> i: 5 0.25975009799003601/1 0.0011668455554172397/1 -
>> 0.25943571329116821/1 0.0017639140132814646/1
>> i: 6 0.25943571329116821/1 0.0017639140132814646/1 -
>> 0.25900107622146606/1 0.0023707395885139704/1
>> i: 7 0.25900107622146606/1 0.0023707395885139704/1 -
>> 0.25845640897750854/1 0.0029852592851966619/1
>> i: 8 0.25845640897750854/1 0.0029852592851966619/1 -
>> 0.25781622529029846/1 0.0036053736694157124/1
>> i: 9 0.25781622529029846/1 0.0036053736694157124/1 -
>> 0.25709828734397888/1 0.0042295018211007118/1
>> i: 10 0.25709828734397888/1 0.0042295018211007118/1 -
>> 0.25632262229919434/1 0.004856607411056757/1
>> i: 11 0.25632262229919434/1 0.004856607411056757/1 -
>> 0.25551068782806396/1 0.0054860818199813366/1
>> i: 12 0.25551068782806396/1 0.0054860818199813366/1 -
>> 0.25468483567237854/1 0.0061176484450697899/1
>> i: 13 0.25468483567237854/1 0.0061176484450697899/1 -
>> 0.25386759638786316/1 0.0067513072863221169/1
>> i: 14 0.25386759638786316/1 0.0067513072863221169/1 -
>> 0.2530810534954071/1 0.0073873363435268402/1
>> i: 15 0.2530810534954071/1 0.0073873363435268402/1 -
>> 0.25234633684158325/1 0.0080263437703251839/1
>> i: 16 0.25234633684158325/1 0.0080263437703251839/1 -
>> 0.25168305635452271/1 0.0086693689227104187/1
>> i: 17 0.25168305635452271/1 0.0086693689227104187/1 -
>> 0.25110900402069092/1 0.0093179969117045403/1
>> i: 18 0.25110900402069092/1 0.0093179969117045403/1 -
>> 0.25064021348953247/1 0.0099743315950036049/1
>> i: 19 0.25064021348953247/1 0.0099743315950036049/1 -
>> 0.25029110908508301/1 0.010640442371368408/1
>> i: 20 0.25029110908508301/1 0.010640442371368408/1 -
>> 0.25007474422454834/1 0.011316764168441296/1
>> i: 21 0.25007474422454834/1 0.011316764168441296/1 -
>> 0.24999982118606567/1 0.012000012211501598/1
>>
>> And this is the output from the above code fragment when given this
>> seglist:
>> Writing pm's halfedges
>> 0.10000008344650269/1 0.012000012211501598/1 --- 0.24999982118606567/1
>> 0.012000012211501598/1
>> 0.25007474422454834/1 0.011316764168441296/1 --- 0.24999982118606567/1
>> 0.012000012211501598/1
>> 0.25029110908508301/1 0.010640442371368408/1 --- 0.25007474422454834/1
>> 0.011316764168441296/1
>> 0.25064021348953247/1 0.0099743315950036049/1 --- 0.25029110908508301/1
>> 0.010640442371368408/1
>> 0.25110900402069092/1 0.0093179969117045403/1 --- 0.25064021348953247/1
>> 0.0099743315950036049/1
>> 0.25168305635452271/1 0.0086693689227104187/1 --- 0.25110900402069092/1
>> 0.0093179969117045403/1
>> 0.25234633684158325/1 0.0080263437703251839/1 --- 0.25168305635452271/1
>> 0.0086693689227104187/1
>> 0.2530810534954071/1 0.0073873363435268402/1 --- 0.25234633684158325/1
>> 0.0080263437703251839/1
>> 0.25386759638786316/1 0.0067513072863221169/1 --- 0.2530810534954071/1
>> 0.0073873363435268402/1
>> 0.25468483567237854/1 0.0061176484450697899/1 --- 0.25386759638786316/1
>> 0.0067513072863221169/1
>> 0.25551068782806396/1 0.0054860818199813366/1 --- 0.25468483567237854/1
>> 0.0061176484450697899/1
>> 0.25632262229919434/1 0.004856607411056757/1 --- 0.25551068782806396/1
>> 0.0054860818199813366/1
>> 0.25709828734397888/1 0.0042295018211007118/1 --- 0.25632262229919434/1
>> 0.004856607411056757/1
>> 0.25781622529029846/1 0.0036053736694157124/1 --- 0.25709828734397888/1
>> 0.0042295018211007118/1
>> 0.25845640897750854/1 0.0029852592851966619/1 --- 0.25781622529029846/1
>> 0.0036053736694157124/1
>> 0.25900107622146606/1 0.0023707395885139704/1 --- 0.25845640897750854/1
>> 0.0029852592851966619/1
>> 0.25943571329116821/1 0.0017639140132814646/1 --- 0.25900107622146606/1
>> 0.0023707395885139704/1
>> 0.25975009799003601/1 0.0011668455554172397/1 --- 0.25943571329116821/1
>> 0.0017639140132814646/1
>> 0.25993925333023071/1 0.00057996663963422179/1 --- 0.25975009799003601/1
>> 0.0011668455554172397/1
>> 0.10000009089708328/1 5.8278321573111952e-38/1 --- 0.26000073552131653/1
>> 4.9593527711929177e-38/1
>> 0.26000073552131653/1 4.9593527711929177e-38/1 --- 0.25993925333023071/1
>> 0.00057996663963422179/1
>>
>> As you can see, the second entry (i:1) of the seglist is missing.
>>
>> If anybody can give me a hint on what the error might be, I'd be very
>> grateful, for I'm completely stymied.
>>
>> Thanks a lot,
>>
>> Martin.
>>
>> Priv.-Doz. Dr. Martin Bäker
>> Institut für Werkstoffe
>> Technische Universität Braunschweig
>> Langer Kamp 8
>> 38106 Braunschweig
>> Germany
>> Tel.: 00-49-531-391-3073
>> Fax 00-49-531-391-3058
>> e-mail
>> <>
>>
>>
>> --
>> You are currently subscribed to cgal-discuss.
>> To unsubscribe or access the archives, go to
>> https://lists-sop.inria.fr/wws/info/cgal-discuss
>>
>>
>
> Priv.-Doz. Dr. Martin Bäker
> Institut für Werkstoffe
> Technische Universität Braunschweig
> Langer Kamp 8
> 38106 Braunschweig
> Germany
> Tel.: 00-49-531-391-3073
> Fax 00-49-531-391-3058
> e-mail
> <>
>
--
____ _ ____ _
/_____/_) o /__________ __ //
(____ ( ( ( (_/ (_/-(-'_(/
_/





Archive powered by MHonArc 2.6.16.

Top of Page