Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Polygon_3

Subject: CGAL users discussion list

List archive

[cgal-discuss] Polygon_3


Chronological Thread 
  • From: Jeffrey Bush <>
  • To: "" <>
  • Subject: [cgal-discuss] Polygon_3
  • Date: Thu, 7 Feb 2013 11:10:46 -0800

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

Attachment: CGAL-Polygon_3.zip
Description: Zip archive




Archive powered by MHonArc 2.6.18.

Top of Page