2D Voronoi Diagram Adaptor: Inserting Site Assertion Exception

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

2D Voronoi Diagram Adaptor: Inserting Site Assertion Exception

Kotaro Yasuda
This post was updated on .
Hello!

I am using *2D Voronoi Diagram Adaptor* to obtain the segment Voronoi
diagram from a set of segments (sites).
When I run the following minimal example, I get an assertion exception
*"at_res == AT2::DISJOINT || at_res == AT2::INTERIOR || at_res ==
AT2::IDENTICAL"* (assertions_impl.h line 169).
This exception is thrown because of
Arrangement_type at_res is *TOUCH_2 (2)*
(Segment_Delaunay_graph_hierarchy_2_impl.h line 133).
I do have some segments touching at the end point but I believe this is not
the problem.
Please help me fix this issue.
Thank you in advance!

*MINIMAL EXAMPLE:*

#include "stdafx.h"
#include <iostream>
#include <fstream>
#include <cassert>
#include <string>
#include <vector>

// define the kernel
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Boolean_set_operations_2.h>

// includes for defining the Voronoi diagram adaptor
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Segment_Delaunay_graph_Linf_filtered_traits_2.h>
#include <CGAL/Segment_Delaunay_graph_Linf_traits_2.h>
#include <CGAL/Segment_Delaunay_graph_Linf_hierarchy_2.h>
#include <CGAL/Segment_Delaunay_graph_Linf_2.h>
#include <CGAL/Voronoi_diagram_2.h>
#include <CGAL/Segment_Delaunay_graph_adaptation_traits_2.h>
#include <CGAL/Segment_Delaunay_graph_adaptation_policies_2.h>
#include <CGAL/Timer.h> 

using namespace std;

// typedefs for Kernel
//typedef CGAL::Simple_cartesian<double> K;
typedef CGAL::Exact_predicates_inexact_constructions_kernel                  K;

typedef CGAL::Tag_true         STag;
typedef CGAL::Segment_Delaunay_graph_Linf_filtered_traits_without_intersections_2<K>	Gt;
typedef CGAL::Segment_Delaunay_graph_storage_traits_2<Gt>								ST;
typedef CGAL::Segment_Delaunay_graph_Linf_hierarchy_2<Gt, ST, STag>						DT;
typedef CGAL::Segment_Delaunay_graph_adaptation_traits_2<DT>							AT;
//typedef CGAL::Segment_Delaunay_graph_degeneracy_removal_policy_2<DT>					AP;
typedef CGAL::Segment_Delaunay_graph_caching_degeneracy_removal_policy_2<DT>			AP;
typedef CGAL::Voronoi_diagram_2<DT, AT, AP>												VD;

typedef AT::Site_2                    				Site_2; 
typedef AT::Point_2									Point_2; 
typedef K::Segment_2                                Segment;

int main()
{


	vector<Site_2> sites;
	sites.push_back(Site_2::construct_site_2(Point_2(121951334.00000000,20925000.000000000),Point_2(14788824.000000000,20925000.000000000)));
	sites.push_back(Site_2::construct_site_2(Point_2(14788824.000000000,20925000.000000000),Point_2(14792686.000000000,22274957.000000000)));
	sites.push_back(Site_2::construct_site_2(Point_2(14792686.000000000,22274957.000000000),Point_2(14167845.000000000,22341733.000000000)));
	sites.push_back(Site_2::construct_site_2(Point_2(14167845.000000000,22341733.000000000),Point_2(14167417.000000000,22210944.000000000)));
	sites.push_back(Site_2::construct_site_2(Point_2(625035.00000000000,28293109.000000000),Point_2(629524.00000000000,27943110.000000000)));
	sites.push_back(Site_2::construct_site_2(Point_2(629524.00000000000,27943110.000000000),Point_2(16588604.000000000,27949735.000000000)));
	sites.push_back(Site_2::construct_site_2(Point_2(16588604.000000000,27949735.000000000),Point_2(16584120.000000000,28299735.000000000)));
	sites.push_back(Site_2::construct_site_2(Point_2(16598160.000000000,28299741.000000000),Point_2(16598160.000000000,27237500.000000000)));
	sites.push_back(Site_2::construct_site_2(Point_2(16598160.000000000,27237500.000000000),Point_2(16389815.000000000,27237500.000000000)));
	sites.push_back(Site_2::construct_site_2(Point_2(16389815.000000000,27237500.000000000),Point_2(16389815.000000000,27545281.000000000)));
	sites.push_back(Site_2::construct_site_2(Point_2(16389815.000000000,27545281.000000000),Point_2(15072824.000000000,27545291.000000000)));
	sites.push_back(Site_2::construct_site_2(Point_2(15072824.000000000,27545311.000000000),Point_2(16593776.000000000,27545942.000000000)));
	sites.push_back(Site_2::construct_site_2(Point_2(16593776.000000000,27545942.000000000),Point_2(16589293.000000000,27895941.000000000)));
	sites.push_back(Site_2::construct_site_2(Point_2(16589293.000000000,27895941.000000000),Point_2(625035.00000000000,27889314.000000000)));
	sites.push_back(Site_2::construct_site_2(Point_2(625035.00000000000,27889314.000000000),Point_2(629524.00000000000,27539315.000000000)));
	sites.push_back(Site_2::construct_site_2(Point_2(629524.00000000000,27539315.000000000),Point_2(15000847.000000000,27545281.000000000)));
	sites.push_back(Site_2::construct_site_2(Point_2(15000847.000000000,27545281.000000000),Point_2(15000847.000000000,27237500.000000000)));
	sites.push_back(Site_2::construct_site_2(Point_2(15000847.000000000,27237500.000000000),Point_2(14167467.000000000,27237500.000000000)));
	sites.push_back(Site_2::construct_site_2(Point_2(14167467.000000000,27237500.000000000),Point_2(14167467.000000000,26737500.000000000)));
	sites.push_back(Site_2::construct_site_2(Point_2(14167467.000000000,26737500.000000000),Point_2(15000847.000000000,26737500.000000000)));
	sites.push_back(Site_2::construct_site_2(Point_2(15000847.000000000,26575000.000000000),Point_2(625035.00000000000,26575000.000000000)));
	sites.push_back(Site_2::construct_site_2(Point_2(625035.00000000000,26575000.000000000),Point_2(625035.00000000000,26225000.000000000)));
	sites.push_back(Site_2::construct_site_2(Point_2(625035.00000000000,26225000.000000000),Point_2(15000847.000000000,26225000.000000000)));
	sites.push_back(Site_2::construct_site_2(Point_2(15000847.000000000,25775000.000000000),Point_2(625035.00000000000,25775000.000000000)));
	sites.push_back(Site_2::construct_site_2(Point_2(625035.00000000000,25775000.000000000),Point_2(625035.00000000000,25425000.000000000)));
	sites.push_back(Site_2::construct_site_2(Point_2(625035.00000000000,25425000.000000000),Point_2(15000847.000000000,25425000.000000000)));
	sites.push_back(Site_2::construct_site_2(Point_2(15000847.000000000,24175000.000000000),Point_2(625035.00000000000,24175000.000000000)));
	sites.push_back(Site_2::construct_site_2(Point_2(625035.00000000000,24175000.000000000),Point_2(625035.00000000000,23825000.000000000)));
	sites.push_back(Site_2::construct_site_2(Point_2(625035.00000000000,23825000.000000000),Point_2(15000847.000000000,23825000.000000000)));
	sites.push_back(Site_2::construct_site_2(Point_2(15000847.000000000,22525000.000000000),Point_2(14792686.000000000,22525000.000000000)));
	sites.push_back(Site_2::construct_site_2(Point_2(14792686.000000000,22525000.000000000),Point_2(14792686.000000000,22275000.000000000)));
	sites.push_back(Site_2::construct_site_2(Point_2(14792686.000000000,22275000.000000000),Point_2(122923611.00000000,22275000.000000000)));
	sites.push_back(Site_2::construct_site_2(Point_2(122923611.00000000,21950000.000000000),Point_2(122229127.00000000,21950000.000000000)));
	sites.push_back(Site_2::construct_site_2(Point_2(122229127.00000000,21950000.000000000),Point_2(122229127.00000000,21575000.000000000)));
	sites.push_back(Site_2::construct_site_2(Point_2(122229127.00000000,21575000.000000000),Point_2(121951334.00000000,21575000.000000000)));
	sites.push_back(Site_2::construct_site_2(Point_2(121951334.00000000,21575000.000000000),Point_2(121951334.00000000,20925000.000000000)));
	
	//insert the sites all at once using spatial sorting to speed the insertion
	VD vd = VD(sites.begin(), sites.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