Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Triangulation Question

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Triangulation Question


Chronological Thread 
  • From: Manuel Caroli <>
  • To:
  • Subject: Re: [cgal-discuss] Triangulation Question
  • Date: Fri, 13 Feb 2009 12:56:24 +0100

Hi Naresh,

you can use something like the function below.

Warning: I have not tested the function, neither can I give any guaratees for it. Also it is not really space efficient as it writes each vertex once for each of its incident tetrahedra as well as each triangle twice.

best

Manuel

==========================================================
template <class Stream, class Triangulation>
Stream &write_triangulation_to_off(Stream &out, Triangulation &t) {
typedef typename Triangulation::Point Point;
int number_of_cells = t.number_of_finite_cells();
out << "OFF "
<< "\n" << 4*number_of_cells
<< " " << 4*number_of_cells
<< " " << 0
<< std::endl;

for (typename Triangulation::Finite_cells_iterator it = t.finite_cells_begin();
it != t.finite_cells_end(); it++) {
for (int i=0; i<4; i++) {
Point p = it->vertex(i)->point();
out << p.x() << " "
<< p.y() << " "
<< p.z() << std::endl;
}
}
for (int i=0; i<number_of_cells; i++) {
out << "3 " << i*4 << " " << i*4+1 << " " << i*4+2 << std::endl;
out << "3 " << i*4 << " " << i*4+1 << " " << i*4+3 << std::endl;
out << "3 " << i*4 << " " << i*4+2 << " " << i*4+3 << std::endl;
out << "3 " << i*4+1 << " " << i*4+2 << " " << i*4+3 << std::endl;
}

return out;
}
===========================================================

naresh wrote:
Hi

I donot want geomview because i am using Windows XP and i need to do lot of stuff for CygnWin.. How can i save .OFF format ? because i have Deep Exploration wich support .OFF format


----- Original Message ----- From: "Monique Teillaud" <>
To:
<>
Sent: Friday, February 13, 2009 2:12 PM
Subject: Re: [cgal-discuss] Triangulation Question



wrote:

I looked at Tringulation_3 example but it saves some format as output text i
donot know how to view this format in any type of 3D viewers ?

Hi,

Look at the reference manual of Triangulation_3<>, section I/O (bottom), you will see how to output 3D triangulations into Geomview.
Also, there are demos in demo/Triangulation_3

best
Monique Teillaud
--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss






Archive powered by MHonArc 2.6.16.

Top of Page