Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Polygon_3

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Polygon_3


Chronological Thread 
  • From: "Sebastien Loriot (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] Polygon_3
  • Date: Fri, 08 Feb 2013 07:08:25 +0100
  • Organization: GeometryFactory

Thanks for the contribution.

If I was asked to design now the class Polygon_2, I'm not sure I would do it the way it is now. One thing that is missing in particular in my opinion is an adapter-type functionality that let you have the points stored outside of the class.

We will try to fix the problem reported for the 2D class for the next release, but we will need some time to look at the Polygon_3.

Thanks again,

Sebastien.

On 02/07/2013 08:10 PM, Jeffrey Bush wrote:
Hi,

I noticed that they is no Polygon_3 class currently. I needed one to
help represent the cross-section of a mesh with a plane. I modeled it
after Polygon_2 (in the idea that most properties are not cached). It
has many functions from Polygon_2 exception some of the orientation
functions which would be ambiguous for outside polygon on same plane or
off plane and removal of top/left/right/bottom since they are less
useful in 3D. I added plane() and to_2d() and which retrieve the plane
of the polygon and the 2D projection of the polygon onto that plane. The
plane and 2D projection are cached. Whenever points are added/changed
they are checked to make sure they are coplanar.

I would love to see this class integrated into CGAL. I have attached the
necessary source files. They would need to be checked by someone for
robustness, changed to your coding style (which I tried to follow for
main things), and have the #include "..." changed to #include <...>.

Additionally I found some fixes for the Polygon_2 code. The
Polygon_2_edge_circulator has no operator->. This operator can be copied
from Polygon_2_edge_iterator. Additionally there is a function at the
end of each of Polygon_2_edge_iterator and Polygon_2_edge_circulator
document that is commented out because someone didn't know how to
implement. The solution is to just uncomment it add the keyword
"typename" in the first parameter (e.g. "operator+(typename
_Container::difference_type n, ").

One last thing is that Polygon_2_edge_iterator contains
a Polygon_2__Segment_ptr class. This is not specific to either of those
except that it is only used for those. I suggest either making a global
pointer class that can be used for the operator-> functions or to
include the Segment_ptr as a nested class in the necessary classes.

Thanks for your time!

Jeff




Archive powered by MHonArc 2.6.18.

Top of Page