Subject: CGAL users discussion list
List archive
- From: jiatao83 <>
- To:
- Subject: [cgal-discuss] Why straight skeleton algorithm in CGAL is so time-consuming
- Date: Sun, 26 Oct 2008 19:03:21 +0800 (CST)
Dear All:
Hi, I am a new learner in CGAL. I have written a program with CGAL to caculate the Straight Skeleton of Polygons with holes. The input Polygon with holes have 27 boundaries(both outer boundary and inner boundaries), plz see the following table for details about the 27 boundaries:
Boundary Type Number of Points
outer boundary 167
inner boundary1 23
inner boundary2 29
inner boundary3 38
inner boundary4 52
inner boundary5 89
inner boundary6 93
inner boundary7 69
inner boundary8 38
inner boundary9 39
inner boundary10 32
inner boundary11 37
...... ..
The others(12-26) have about the number of 45 Points. And most of these boundaries have reflex vertex.
The code followed:
--------------------------------------------------------------------------------------------------------
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
typedef Kernel::Point_2 Point_2;
typedef CGAL::Straight_skeleton_2<Kernel> Ss;
typedef Ss::Halfedge_iterator Halfedge_iterator;
typedef Ss::Halfedge_handle Halfedge_handle;
typedef Ss::Vertex_handle Vertex_handle;
typedef Ss::Halfedge_handle Halfedge_handle;
typedef Ss::Vertex_handle Vertex_handle;
typedef CGAL::Straight_skeleton_builder_traits_2<Kernel> SsBuilderTraits;
typedef CGAL::Straight_skeleton_builder_2<SsBuilderTraits,Ss> SsBuilder;
typedef CGAL::Straight_skeleton_builder_2<SsBuilderTraits,Ss> SsBuilder;
SsBuilder ssb;
for(int i=0;i++;i<27)
{
{
/* According to the boundary to generate the pts */
Point_2* pts=new Point_2[numPointsInPart];
ssb.enter_contour(pts,pts+numPointsInPart-1);
}
ssb.enter_contour(pts,pts+numPointsInPart-1);
}
ss=ssb.construct_skeleton();
--------------------------------------------------------------------------------------------------------
The program so time-consuming that it needs about 27 hours to calculate the straight skeleton of this Polygon with holes.
Could anyone help me ,why this algorithm is so time-consuming? Any suggestion is appreciated! Thanks in advance!
Regards
TaoJia
[广告] 金秋最关注楼盘-房不胜房
- [cgal-discuss] Why straight skeleton algorithm in CGAL is so time-consuming, jiatao83, 10/26/2008
- Re: [cgal-discuss] Why straight skeleton algorithm in CGAL is so, Fernando Cacciola, 10/29/2008
Archive powered by MHonArc 2.6.16.