Subject: CGAL users discussion list
List archive
- From: Chris Marsh <>
- To: <>
- Subject: Re: [cgal-discuss] Load a mesh in Gmsh format
- Date: Thu, 8 Nov 2018 18:47:44 -0600
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=Pass ; spf=Pass
- Ironport-phdr: 9a23:7rYLlR9YC5iHEP9uRHKM819IXTAuvvDOBiVQ1KB32+scTK2v8tzYMVDF4r011RmVBdqds6oMotGVmpioYXYH75eFvSJKW713fDhBt/8rmRc9CtWOE0zxIa2iRSU7GMNfSA0tpCnjYgBaF8nkelLdvGC54yIMFRXjLwp1Ifn+FpLPg8it2O2+55/ebx9UiDahfLh/MAi4oQLNu8cMnIBsMLwxyhzHontJf+RZ22ZlLk+Nkhj/+8m94odt/zxftPw9+cFAV776f7kjQrxDEDsmKWE169b1uhTFUACC+2ETUmQSkhpPHgjF8BT3VYr/vyfmquZw3jSRMMvrRr42RDui9b9mRxDmiCgFNzA3/mLZhNFugq1Hux+uvQBzzpTObY2JKPZzfKXQds4aS2pbWcZRUjRMD528b4sVDuoBJvtToY7nqFsUthu+BRSnCeTzxT9InH/23LY63/4kEQ7cxgwgBNIOvW/JrNXuLqgSSuO1wLPUwjrZdv5b3yr25obPchAku/6MXLRwfNLQyUkpDQPFj0+fpZbrPzOPzugNt3aU4/N7Wu21kW4nsBt9oj6xyccwkoXJiYMVykzE9SVk24k5P8G3SEl+YdK8DJRQtzuaN4ptQsMnWW5ooj06yr0ctZGnZicHzoksyR3Ha/GfboSE/BHuWPyPLTp2in9pYqyziwuy/ES61OHxWdW43E5UoiZZltTArHMA2hzJ5sSaS/Zw/12t1DaB2g3V9+pKO1o7lbDBJJ4k2rMwloQcsUDEHiLunUX5lq6WdkE+9ui18OToeK7mppyGO4BokA7yKqUumsqhDuQkKgUCQnaX9Oem2LH980D0Tq9GguMrnqTZqpzWO8sWqrKhDw9QyIkj6hK/Dzm80NQfmHkKNE5KeBKdj4joIFHCOvX4Au2lg1S3kDdm3O3GPqb7DZXWLXjPiqvucqxl505G1AUz1cxf545TCrwZPP3zVVX+tNjBAhAkMgy02ProCMhm1oMFQm+PGa+YMKbKsVCS/O4vIu+MZJUUuDnnMfQl6eTu3jcEn0QAd/ypwYcPcyL/We93Jl2QJ3vqmNYIV2kQ+REvSfTjz1yEXzkUbHm7W+cw5yowFZm9XrvEE9Smj7WFmSu6BZZLfXtuC1aWEH6ueZ/SCNkWbyfHCc97kydMcLG7UI9pgRqurg7hjb9uNPHU0jADvIngktN8sb6A3Sou/CB5WpzOm1qGSHt5yztRFm0GmZtnqEk48W+tlK1xgvhWD9tWvqsbTxwzLp2axOUoUomuCDKERc+ATROdevvjGSs4F4pj3sQHeEU7ENzw1kmejRrvOKcckvmwPLJx8q/Y2CGsdcN0ynKAybIolFpgScIdbGA=
Oh, no auto is too bad. In this case, it's triangulation::Vertex_handle and triangulation::Face_handle. You have to use the template derived class.
I've updated the SO to make this more clear. Does this let you compile now?
So far, I am using purely 2D points (no “z” coordinate) for a 2D
triangulation. I may be using 3D meshes later, but not now.
Ok, with my example just set z to be 0 then. You can use a different geometry trait instead, but I'll be honest, I don't know which one that is. At the moment having a z=0 won't impact you at all.
I fear it won't really help you, but on off chance it does, this is a section of code where I build the CGAL data structure from a file
The file that is being read in has 3 components: a vertex list, a face (elem) list, and a neighbour list.
The vertex list is a tuple holding the x,y,z coordinates (this is an earth surface model).
The face list is a tuple where each item is an index into the vertex list -- so [567,1,299] would mean that this i-th face is made up of the 567-th, 1-th, and 299-th vertexes
The neigh list is a tuple but is an index into the face list, for which faces are neighbours.
e.g.,
vertexes = [ [x1,y1,z1], [x2,y2,z2], [x3,y3,z3] ]
# a single triangle made up of vertexes 0,1, and 2 triangles = [ [0,1,2] ]
This is a pretty common format, and I suspect the gmsh format uses something like this.
Now, as there are thousands of vertices and thousands of faces in the
meshes I am using, I cannot create a new variable for each.
The general approach with millions of faces is to, while reading in the gmsh/whatever file, you create the 3 vertexes, insert the face, and move on.
Cheers
Chris
Hello everybody out there!
On 2018/11/08 at 11:31 pm, Chris Marsh wrote:
> I've updated the SO post with a full working example w/ all header
> includes & a cmake script to build it. It adds 3 vertices and inserts 1
> face.
Far more than I could have expected, thank you. I have used it to check
my own CMake script, it turned out there was several mistakes.
Now, as there are thousands of vertices and thousands of faces in the
meshes I am using, I cannot create a new variable for each. I need to
stock them in vectors, and cannot use “auto”. Therefore, I am looking
for the appropriate type. It turned out
“CGAL::Triangulation_data_structure_2::Vertex_handle” is not
appropriate, as it does not provide “set_point”:
/home/yoann/program/UWWatch-test/src/gmsh.cpp:131:27: error:
‘__gnu_cxx::__alloc_traits<std::allocator<CGAL::internal::CC_iterator<CGAL::Compact_container<CGAL::Triangulation_vertex_base_2<CGAL::Projection_traits_xy_3<CGAL::Epick>,
CGAL::Triangulation_ds_vertex_base_2<CGAL::Triangulation_data_structure_2<CGAL::Triangulation_vertex_base_2<CGAL::Projection_traits_xy_3<CGAL::Epick>
>,
CGAL::Constrained_triangulation_face_base_2<CGAL::Projection_traits_xy_3<CGAL::Epick>
> > > >, CGAL::Default, CGAL::Default, CGAL::Default>, false> >,
CGAL::internal::CC_iterator<CGAL::Compact_container<CGAL::Triangulation_vertex_base_2<CGAL::Projection_traits_xy_3<CGAL::Epick>,
CGAL::Triangulation_ds_vertex_base_2<CGAL::Triangulation_data_structure_2<CGAL::Triangulation_vertex_base_2<CGAL::Projection_traits_xy_3<CGAL::Epick>
>,
CGAL::Constrained_triangulation_face_base_2<CGAL::Projection_traits_xy_3<CGAL::Epick>
> > > >, CGAL::Default, CGAL::Default, CGAL::Default>, false>
>::value_type’ {aka ‘class
CGAL::internal::CC_iterator<CGAL::Compact_container<CGAL::Triangulation_vertex_base_2<CGAL::Projection_traits_xy_3<CGAL::Epick>,
CGAL::Triangulation_ds_vertex_base_2<CGAL::Triangulation_data_structure_2<CGAL::Triangulation_vertex_base_2<CGAL::Projection_traits_xy_3<CGAL::Epick>
>,
CGAL::Constrained_triangulation_face_base_2<CGAL::Projection_traits_xy_3<CGAL::Epick>
> > > >, CGAL::Default, CGAL::Default, CGAL::Default>, false>’} has no
member named ‘set_point’
> Because I am using this for terrain, I use x,y,z points and use the
> projection trait to allow for using this 3D point in a 2D triangulation.
> I've kept it this way as it may be of use to you.
So far, I am using purely 2D points (no “z” coordinate) for a 2D
triangulation. I may be using 3D meshes later, but not now.
> I hope this helps,
Well, I have spent a couple of days trying to sort this out by myself
and failed. Now, I am making some progress, so it clearly helps.
Best regards.
--
Yoann LE BARS
http://le-bars.net/yoann/
Diaspora* :
--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss
- [cgal-discuss] Load a mesh in Gmsh format, Yoann LE BARS, 11/08/2018
- Re: [cgal-discuss] Load a mesh in Gmsh format, Chris Marsh, 11/08/2018
- Re: [cgal-discuss] Load a mesh in Gmsh format, Yoann LE BARS, 11/08/2018
- Re: [cgal-discuss] Load a mesh in Gmsh format, Chris Marsh, 11/08/2018
- Re: [cgal-discuss] Load a mesh in Gmsh format, Yoann LE BARS, 11/09/2018
- Re: [cgal-discuss] Load a mesh in Gmsh format, Chris Marsh, 11/09/2018
- Re: [cgal-discuss] Load a mesh in Gmsh format, Yoann LE BARS, 11/09/2018
- Re: [cgal-discuss] Load a mesh in Gmsh format, Chris Marsh, 11/09/2018
- Re: [cgal-discuss] Load a mesh in Gmsh format, Yoann LE BARS, 11/09/2018
- Re: [cgal-discuss] Load a mesh in Gmsh format, Yoann LE BARS, 11/09/2018
- Re: [cgal-discuss] Load a mesh in Gmsh format, Chris Marsh, 11/09/2018
- Re: [cgal-discuss] Load a mesh in Gmsh format, Yoann LE BARS, 11/09/2018
- Re: [cgal-discuss] Load a mesh in Gmsh format, Chris Marsh, 11/09/2018
- Re: [cgal-discuss] Load a mesh in Gmsh format, Yoann LE BARS, 11/09/2018
- Re: [cgal-discuss] Load a mesh in Gmsh format, Chris Marsh, 11/08/2018
- Re: [cgal-discuss] Load a mesh in Gmsh format, Yoann LE BARS, 11/08/2018
- Re: [cgal-discuss] Load a mesh in Gmsh format, Chris Marsh, 11/08/2018
Archive powered by MHonArc 2.6.18.