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: "Antonino Mistretta" <>
  • To:
  • Subject: Re: [cgal-discuss] Polygon skeleton
  • Date: Fri, 4 Apr 2008 17:42:07 +0200
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=d0+ysd3RJoJD6BcNNs6GWlyE5kZMV307DcaXCa9VruulLbmV4Jrwq9Td3XAqhJ0xVshtLkFanvUIV+AvdDh3H1RZp07LcgfaGRH4b+Pfjtgfbm5hhMx6rNJstXuzO8FF0lQ7nVbtFwU9+3e8BlC0iqFfh4LqSR2qz705Tpob8e4=

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
>


--
AM

Attachment: skeletonResult.jpg
Description: JPEG image




Archive powered by MHonArc 2.6.16.

Top of Page