Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Polygon skeleton

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Polygon skeleton


Chronological Thread 
  • From: Andreas Fabri <>
  • To:
  • Subject: Re: [cgal-discuss] Polygon skeleton
  • Date: Fri, 04 Apr 2008 18:12:03 +0200


Hi Antonino,

I still insist that you better first read the manual.
It is organized in a user manual coming with examples,
and a reference manual listing the classes and functions.

A function called is_bisector() sounds and is a function
returning a boolean value, not a vertex.

best regards,

andreas



Antonino Mistretta wrote:
Hi Andreas,

in attachment is a jpeg with original polygon and skeleton nodes(in red).
This is the code that make this result:

//! create cgal polygon by my polygon.
Base::PolygonPtr _poly;
_poly = Base::PolygonPtr( new Base::Polygon2D() );
int startVertex = currPolygon->nVertices-2;
int end = 0;
for(int i=startVertex; i>=end; i--)
(*_poly).push_back( Base::Point( currPolygon->padfX[i],
currPolygon->padfY[i]) );
cgalPoly.push_back(_poly);

//! make skeleton
//! Insert vertex in skeleton_builder
for( RegIt bit = cgalPoly.begin(), ebit = cgalPoly.end() ; bit !=
ebit ; ++ bit )
{
builder.enter_contour((*bit)->begin(),(*bit)->end());
}
//! build skeleton
if ( !( skeleton = builder.construct_skeleton() ) )//!// Proceed only
if the skeleton was correctly constructed.
throw string("Impossibile creare lo skeleton per questo
poligono.");


//!get skeleton points
for (Base::Halfedge_iterator i = (*skeleton).halfedges_begin(); i !=
(*skeleton).halfedges_end(); ++ i )
{
//il punto fa parte dello skeleton??
if (i->is_bisector())
{
outX.push_back(i->vertex()->point().x());
outY.push_back(i->vertex()->point().y());
}
}

Why is_bisector() method returns not skeleton node?
I don't understant how I must do to use StraightSkeletonVertex class.

Thanks and excuse me to my english...

2008/4/4, Andreas Fabri
<>:
Hi Antonino,

Did you read the manual already. I think this is covered.

andreas



Antonino Mistretta wrote:

Can you show me a little example?
How I obtain StraightSkeletonVertex_2 object by Skeleton_Builder?
Thanks

2008/4/4, Fernando Cacciola
<>:

wrote:


Hi All,

I am using Straight Skeleton concept to find the skeleton polygon
points.
I call a construct_skeleton() method on istance of skeleton builder to
compute this(It's correct?).



Yes.



My question is - how can I get the coordinates of the skeleton vertex?



Using the 'point()' function as stated in the manual:


http://www.cgal.org/Manual/3.3/doc_html/cgal_manual/Straight_skeleton_2_ref/Concept_StraightSkeletonVertex_2.html#Cross_link_anchor_783
HTH

Fernando Cacciola
GeometryFactory

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





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




------------------------------------------------------------------------





Archive powered by MHonArc 2.6.16.

Top of Page