# Thinning a polygon / inner polygon offsetting

12 messages
Open this post in threaded view
|

## Thinning a polygon / inner polygon offsetting

 Is there way to find the inner offset of a polygon?  The minkowski examples all "dilate" or "fatten" the polygon.  I am looking for a way to "thin " the polygon. -- You are currently subscribed to cgal-discuss. To unsubscribe or access the archives, go to https://lists-sop.inria.fr/wws/info/cgal-discuss
Open this post in threaded view
|

## Re: Thinning a polygon / inner polygon offsetting

 [hidden email] wrote: > Is there way to find the inner offset of a polygon?  The minkowski examples all > "dilate" or "fatten" the polygon.  I am looking for a way to "thin " the > polygon. Hello, Its implemented and will be distributed with the next release. andreas -- You are currently subscribed to cgal-discuss. To unsubscribe or access the archives, go to https://lists-sop.inria.fr/wws/info/cgal-discuss
Open this post in threaded view
|

## Re: Thinning a polygon / inner polygon offsetting

 On Tuesday 24 June 2008 09:17:18 Andreas Fabri wrote: > [hidden email] wrote: > > Is there way to find the inner offset of a polygon?  The minkowski > > examples all "dilate" or "fatten" the polygon.  I am looking for a way to > > "thin " the polygon. > > Hello, > > Its implemented and will be distributed with the next release. > > andreas In the meantime you can get the inner offset by dilating the "inverse" polygon. Draw a bounding box around your polygon, and connect it with your polygon by a narrow path. Redefine the outer part of your original polygon as the new polygon and compute its outer offset ----> a part of the received curve is the inner offset of the original polygon. lg, Wolfgang -- You are currently subscribed to cgal-discuss. To unsubscribe or access the archives, go to https://lists-sop.inria.fr/wws/info/cgal-discuss
Open this post in threaded view
|

## 3D surface mesh generation

 Hi,   Since I made my implicit function, I got an "Surface_mesh_default_triangulation_3" which I named it "tr". My question is: Is there anyway to return only the facets or vertices of the surface? Thanks a lot.     HuiConnect to the next generation of MSN Messenger  Get it now!
Open this post in threaded view
|

## Re: 3D surface mesh generation

 On Tuesday 24 June 2008 12:24:34 Hui Ding wrote: > Hi, > > Since I made my implicit function, I got an > "Surface_mesh_default_triangulation_3" which I named it "tr". My question > is: Is there anyway to return only the facets or vertices of the surface? > Thanks a lot. Use the 2D complex in 3D triangulation. The variable is probably named c2t3. The documentation is here: http://www.cgal.org/Manual/3.3/doc_html/cgal_manual/Surface_mesher_ref/Concept_SurfaceMeshComplex_2InTriangulation_3.htmlA facet f is on the surface iff c2t3.face_status(f)!=NOT_IN_COMPLEX. If you want to iterate of facets of the surface, you can use the sequence   c2t3.facets_begin(), c2t3.facets_end() The iterators have type Facet_iterator (defined in the C2T3). -- Laurent Rineau, PhD Engineer at GeometryFactory http://www.geometryfactory.com/-- You are currently subscribed to cgal-discuss. To unsubscribe or access the archives, go to https://lists-sop.inria.fr/wws/info/cgal-discuss
Open this post in threaded view
|

## RE: 3D surface mesh generation

 Thank you! and also in this case(all the facets are triangles), i need to know the every three vertices on the same facet which is on the surface, but I didnt find the direct way to do it, do you have an idea?     > > On Tuesday 24 June 2008 12:24:34 Hui Ding wrote:> > Hi,> >> > Since I made my implicit function, I got an> > "Surface_mesh_default_triangulation_3" which I named it "tr". My question> > is: Is there anyway to return only the facets or vertices of the surface?> > Thanks a lot.> > Use the 2D complex in 3D triangulation. The variable is probably named c2t3. > The documentation is here:> http://www.cgal.org/Manual/3.3/doc_html/cgal_manual/Surface_mesher_ref/Concept_SurfaceMeshComplex_2InTriangulation_3.html> > A facet f is on the surface iff c2t3.face_status(f)!=NOT_IN_COMPLEX. If you > want to iterate of facets of the surface, you can use the sequence> c2t3.facets_begin(), c2t3.facets_end()> The iterators have type Facet_iterator (defined in the C2T3).> > -- > Laurent Rineau, PhD> Engineer at GeometryFactory> http://www.geometryfactory.com/> -- > You are currently subscribed to cgal-discuss.> To unsubscribe or access the archives, go to> https://lists-sop.inria.fr/wws/info/cgal-discussGet news, entertainment and everything you care about at Live.com. Check it out!
Open this post in threaded view
|

## Re: 3D surface mesh generation

 On Tuesday 24 June 2008 15:02:56 Hui Ding wrote: > Thank you! and also in this case(all the facets are triangles), i need to > know the every three vertices on the same facet which is on the surface, > but I didnt find the direct way to do it, do you have an idea? If you have a Face f (from a 3D triangulation), the three corresponding Vertex_handle are:   f.first->vertex((f.second+1)&3)   f.first->vertex((f.second+2)&3)   f.first->vertex((f.second+3)&3) if you have a Vertex_handle vh, the corresponding point is:   vh->point() -- Laurent Rineau, PhD Engineer at GeometryFactory http://www.geometryfactory.com/-- You are currently subscribed to cgal-discuss. To unsubscribe or access the archives, go to https://lists-sop.inria.fr/wws/info/cgal-discuss
Open this post in threaded view
|

## RE: 3D surface mesh generation

 Thanx, but what do you mean about "first" "second" of Facet f?? you mean: f ->vertex(( (f+1)+1 )&3)f ->vertex(( (f+1)+2 )&3)f ->vertex(( (f+1)+3 )&3)??     > > On Tuesday 24 June 2008 15:02:56 Hui Ding wrote:> > Thank you! and also in this case(all the facets are triangles), i need to> > know the every three vertices on the same facet which is on the surface,> > but I didnt find the direct way to do it, do you have an idea?> > If you have a Face f (from a 3D triangulation), the three corresponding > Vertex_handle are:> f.first->vertex((f.second+1)&3)> f.first->vertex((f.second+2)&3)> f.first->vertex((f.second+3)&3)> > if you have a Vertex_handle vh, the corresponding point is:> vh->point()> > -- > Laurent Rineau, PhD> Engineer at GeometryFactory> http://www.geometryfactory.com/> -- > You are currently subscribed to cgal-discuss.> To unsubscribe or access the archives, go to> https://lists-sop.inria.fr/wws/info/cgal-discussDiscover the new Windows Vista Learn more!
Open this post in threaded view
|

## RE: 3D surface mesh generation

 Well, because when I try to do something like this:     std::ofstream oFile("output",std::ios::out);   for(Facet_iterator fit = c2t3.facets_begin();fit!=c2t3.facets_end();fit++){      oFile<< fit.first->vertex((fit.second+1)&3)->Point();      oFile<< fit.first->vertex((fit.second+2)&3)->Point();      oFile<< fit.first->vertex((fit.second+3)&3)->Point();   }   it comes the errors: error C2227: left of '->Point' must point to class/struct/union/generic type error C2039: 'first' : is not a member of 'CGAL::Filter_iterator' etc.   >Thanx, but what do you mean about "first" "second" of Facet f?? you mean:>f ->vertex(( (f+1)+1 )&3)>f ->vertex(( (f+1)+2 )&3)>f ->vertex(( (f+1)+3 )&3)>>??  > > On Tuesday 24 June 2008 15:02:56 Hui Ding wrote:> > Thank you! and also in this case(all the facets are triangles), i need to> > know the every three vertices on the same facet which is on the surface,> > but I didnt find the direct way to do it, do you have an idea?> > If you have a Face f (from a 3D triangulation), the three corresponding > Vertex_handle are:> f.first->vertex((f.second+1)&3)> f.first->vertex((f.second+2)&3)> f.first->vertex((f.second+3)&3)> > if you have a Vertex_handle vh, the corresponding point is:> vh->point()> > -- > Laurent Rineau, PhD> Engineer at GeometryFactory> http://www.geometryfactory.com/> -- > You are currently subscribed to cgal-discuss.> To unsubscribe or access the archives, go to> https://lists-sop.inria.fr/wws/info/cgal-discuss Discover the new Windows Vista Learn more! Discover the new Windows Vista Learn more!
Open this post in threaded view
|

## Re: 3D surface mesh generation

 On Tuesday 24 June 2008 16:48:08 Hui Ding wrote: > Thanx, but what do you mean about "first" "second" of Facet f?? you mean: > f ->vertex(( (f+1)+1 )&3)f ->vertex(( (f+1)+2 )&3)f ->vertex(( (f+1)+3 > )&3)?? Have you ever read parts of the documentation of CGAL 3D Triangulations?! If Tr is a 3D triangulation, "Tr::Facet" is the type "std::pair". On Tuesday 24 June 2008 17:15:08 Hui Ding wrote: > Well, because when I try to do something like this: > >   std::ofstream oFile("output",std::ios::out); >   for(Facet_iterator fit = > c2t3.facets_begin();fit!=c2t3.facets_end();fit++){ oFile<< > fit.first->vertex((fit.second+1)&3)->Point(); >      oFile<< fit.first->vertex((fit.second+2)&3)->Point(); >      oFile<< fit.first->vertex((fit.second+3)&3)->Point(); >   } > > it comes the errors: > error C2227: left of '->Point' must point to class/struct/union/generic > type error C2039: 'first' : is not a member of 'CGAL::Filter_iterator' > etc. Here you assume, incorrectly, that Face_iterator is the same type (or at least has the same API) as Facet. And you misspelled "point()" as "Point()"! Use the following:   for(Facet_iterator fit = c2t3.facets_begin();fit!=c2t3.facets_end();fit++){       oFile<< fit->first->vertex((fit->second+1)&3)->point();       oFile<< fit->first->vertex((fit->second+2)&3)->point();       oFile<< fit->first->vertex((fit->second+3)&3)->point();    } You can use a code a bit more clear:   typedef Tr::Cell_handle Cell_handle;   for(Facet_iterator fit = c2t3.facets_begin();fit!=c2t3.facets_end();++fit)   {       const Cell_handle& ch = fit->first;       const int facet_index = fit->second;       oFile<< ch->vertex((facet_index+1)&3)->point();       oFile<< ch->vertex((facet_index+2)&3)->point();       oFile<< ch->vertex((facet_index+3)&3)->point();    } I hope that will give you the will to read some parts of the documentation. -- Laurent Rineau, PhD Engineer at GeometryFactory http://www.geometryfactory.com/-- You are currently subscribed to cgal-discuss. To unsubscribe or access the archives, go to https://lists-sop.inria.fr/wws/info/cgal-discuss