Subject: CGAL users discussion list
List archive
Re: [cgal-discuss] Store a polygon into a half edge data structure using CGAL Polyhedron_3 class
Chronological Thread
- From: "Sebastien Loriot (GeometryFactory)" <>
- To:
- Subject: Re: [cgal-discuss] Store a polygon into a half edge data structure using CGAL Polyhedron_3 class
- Date: Wed, 22 Mar 2017 08:39:04 +0100
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=Pass ; spf=None
- Ironport-phdr: 9a23:yXPOnx/sQGuokP9uRHKM819IXTAuvvDOBiVQ1KB90+ocTK2v8tzYMVDF4r011RmSDNidtKoP0rCN++C4ACpbvsbH6ChDOLV3FDY7yuwu1zQ6B8CEDUCpZNXLVAcdWPp4aVl+4nugOlJUEsutL3fbo3m18CJAUk6nbVk9dazJHdvZgM2zkuyz4JbOeB5ghTynYLo0Ig/lgx/Ws5xcuoZoI70tyxbP6l9PYeVR2SsoCl+Umhvg/Nae9ZV/9D5B+rhpo9VEVr/7eLh+SLhwAzEvMmRz78ru40qQBTCT72cRBz1F2iFDBBLIuUn3
- Organization: GeometryFactory
If you want to stick to Polyhedron_3, the original mechanism was using
the incremental builder:
http://doc.cgal.org/latest/Polyhedron/classCGAL_1_1Polyhedron__incremental__builder__3.html
If you can switch to Surface_mesh, then you have function available doing exactly what you want:
http://doc.cgal.org/latest/Surface_mesh/classCGAL_1_1Surface__mesh.html#ad2e8dedad669cb3637d6a7f8207caed5
http://doc.cgal.org/latest/Surface_mesh/classCGAL_1_1Surface__mesh.html#a47c2561d1430def60b9e538482ea2adb
If you want to write code that does not depend on the data structure,
you can use the BGL API:
put(get(CGAL::vertex_point, sm), add_vertex(sm), point_coordinates);
and use the helper function for creating a face:
http://doc.cgal.org/latest/BGL/group__PkgBGLEulerOperations.html#gada1dd2320a083dbfe09ddacafdaf8b19
Sebastien.
On 03/18/2017 08:10 PM, hossan.nazmul wrote:
Dear CGAL mailing list,
I am a CGAL beginner and have few problems using Polyhedron_3 class.
Problem description:
I have a LoD2 3D CityGML building that has to be decomposed and stored in a
topological data structure such like Half edge data structure. I was
searching for an example CGAL program that takes the Polygon (Vertices) as
an input and is able to store it into Half edge data structure. The
LinearRing is consists of points which represent actually a polygon:
for an example: (my polygon looks like following)
<gml:Polygon gml:id="GEOM_629113">
<gml:exterior>
<gml:LinearRing gml:id="GEOM_629113_0_">
<gml:posList srsDimension="3">390839.695902067 5819139.47788488
33.8699989318848 390839.20858174 5819139.44457522 33.8699989318848
390838.722880716 5819139.49639365 33.8699989318848 390841.021950274
5819140.0657906 33.8699989318848 390840.616573399 5819139.79328419
33.8699989318848 </gml:posList>
</gml:LinearRing>
</gml:exterior>
</gml:Polygon>
Questions:
Q1: How do I store these 3D points/vertices into a CGAL half edge data
structure?
Q2: How do I know from the data that which is the next half edge, previous
half edge, incident vertex and etc
Q3: I can make a triangle with three points and create a CGAL Polyhedron
object. How can I combine all points and store into half edge data
structure?
I hope someone from this CGAL discussion group can help me to find the
possible solution to my problem. It would be a great help if you can share
some example code so that I can understand it easily.
Thanks and regards,
Nazmul
--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/Store-a-polygon-into-a-half-edge-data-structure-using-CGAL-Polyhedron-3-class-tp4662587.html
Sent from the cgal-discuss mailing list archive at Nabble.com.
- [cgal-discuss] Store a polygon into a half edge data structure using CGAL Polyhedron_3 class, hossan.nazmul, 03/18/2017
- Re: [cgal-discuss] Store a polygon into a half edge data structure using CGAL Polyhedron_3 class, Sebastien Loriot (GeometryFactory), 03/22/2017
Archive powered by MHonArc 2.6.18.