Thinning a polygon / inner polygon offsetting

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

Thinning a polygon / inner polygon offsetting

ajaenicke
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
Reply | Threaded
Open this post in threaded view
|

Re: Thinning a polygon / inner polygon offsetting

andreas.fabri
[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
Reply | Threaded
Open this post in threaded view
|

Re: Thinning a polygon / inner polygon offsetting

Wolfgang Aigner-4
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
Reply | Threaded
Open this post in threaded view
|

3D surface mesh generation

Hui Ding-3
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.
 
 
Hui


Connect to the next generation of MSN Messenger  Get it now!
Reply | Threaded
Open this post in threaded view
|

Re: 3D surface mesh generation

Laurent Rineau (GeometryFactory)
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-discuss
Reply | Threaded
Open this post in threaded view
|

RE: 3D surface mesh generation

Hui Ding-3

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-discuss



Get news, entertainment and everything you care about at Live.com. Check it out!
Reply | Threaded
Open this post in threaded view
|

Re: 3D surface mesh generation

Laurent Rineau (GeometryFactory)
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
Reply | Threaded
Open this post in threaded view
|

RE: 3D surface mesh generation

Hui Ding-3
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!
Reply | Threaded
Open this post in threaded view
|

RE: 3D surface mesh generation

Hui Ding-3
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<I,P>'
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!
Reply | Threaded
Open this post in threaded view
|

Re: 3D surface mesh generation

Laurent Rineau (GeometryFactory)
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<Cell_handle,int>".

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<I,P>'
> 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
Reply | Threaded
Open this post in threaded view
|

Re: 3D surface mesh generation

Hui DING-4
thank you very much, it's really clearer when I know that Tr::Facet is the
type "std::pair<Cell_handle, int>. and the ". and ->", it was a copycoller
mistake that i realised after i send the mail. And you are right, i will
read more carefully the documentation, thanks.


----- Original Message -----
From: "Laurent Rineau" <[hidden email]>
To: <[hidden email]>
Sent: Tuesday, June 24, 2008 5:58 PM
Subject: Re: [cgal-discuss] 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<Cell_handle,int>".

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<I,P>'
> 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 

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Thinning a polygon / inner polygon offsetting

ajaenicke
In reply to this post by andreas.fabri
When is the approximate date of the next release?


On 6/24/08 12:17 AM, "Andreas Fabri" <[hidden email]>
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



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

The contents of this message, together with any attachments, are intended only for the use of the individual or entity to which they are addressed and may contain information that is confidential and exempt from disclosure. If you are not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this message, or any attachment, is strictly prohibited. If you have received this message in error, please notify the original sender immediately by telephone or by return E-mail and delete this message, along with any attachments, from your computer. Thank you.
--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss