Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Export 3d delaunay triangulation

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Export 3d delaunay triangulation


Chronological Thread 
  • From: Monique Teillaud <>
  • To:
  • Subject: Re: [cgal-discuss] Export 3d delaunay triangulation
  • Date: Sat, 13 May 2017 09:23:39 +0200

Hi 

You will find a description of the file in paragraph "I/O" of page http://doc.cgal.org/latest/Triangulation_3/classCGAL_1_1Triangulation__3.html

Best,

--
Monique Teillaud 
https://members.loria.fr/Monique.Teillaud/
INRIA Nancy - Grand Est, LORIA 
Institut National de Recherche en Informatique et Automatique 

On 13 May 2017, at 00:25, mozendi <> wrote:

Dear CGAL users,
I am a new CGAL user. My objective is to create 3d delaunay triangulation
from terrestrial LIDAR points clouds. So that, each point of the cloud will
be set as a vertex.
After some efforts on CGAL I came up with the code below:

// types
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
typedef Kernel::Point_3 Point;
typedef Kernel::Vector_3 Vector;
typedef CGAL::Triangulation_vertex_base_with_info_3<unsigned, Kernel> Vb;
typedef CGAL::Triangulation_data_structure_3<Vb> Tds;
typedef CGAL::Delaunay_triangulation_3<Kernel, Tds, CGAL::Fast_location>
Delaunay;
typedef Delaunay::Point Point;


int main(int argc, char*argv[])
{
// Reads a .xyz point set file in points[].
std::vector<Point> points;
std::vector<Vector> normals;
const char* fname = (argc>1) ? argv[1] :
"data/SIL_ARKA_1cm_POINTS_NORMALS.xyz";
std::ifstream stream(fname);
Point p;
Vector v;
while (stream >> p >> v) {
points.push_back(p);
normals.push_back(v);
}

std::vector<std::size_t> indices(points.size());
for (std::size_t i = 0; i < points.size(); ++i) {
indices[i] = i;
}
std::cout << "Point Cloud is Loaded" << std::endl;
std::cout << points.size() << " input points" << std::endl;
std::cout << " -------------------------------" << std::endl;
std::cout << " START BUILDING THE TRIANGULATION" << std::endl;
Delaunay T(points.begin(), points.end());
std::cout << " TRIANGULTION COMPLETED" << std::endl;
std::cout << " -------------------------------" << std::endl;
std::ofstream oFileT("testFile1", std::ios::out);
oFileT << T;

return EXIT_SUCCESS;
}

As a result of this program I get the txt file "testFile1". However, I could
not find any description for this file. Is it possible to convert this file
to well known file formats such as .ply, .stl or .obj. Moreover, do you
think is it the correct way of creating 3D delaunay triangulation from point
clouds that are stored in .xyz file?
I am looking forward to hearing from you
Regards






--
View this message in context: http://cgal-discuss.949826.n4.nabble.com/Export-3d-delaunay-triangulation-tp4662725.html
Sent from the cgal-discuss mailing list archive at Nabble.com.

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss






Archive powered by MHonArc 2.6.18.

Top of Page