Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Re: Rendering Polyhedron ?? (*Solution*)

Subject: CGAL users discussion list

List archive

[cgal-discuss] Re: Rendering Polyhedron ?? (*Solution*)


Chronological Thread 
  • From: Priyank Jain <>
  • To:
  • Subject: [cgal-discuss] Re: Rendering Polyhedron ?? (*Solution*)
  • Date: Wed, 04 Nov 2009 02:33:46 -0500
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=VZcby86/S4V+keDHoV4kS7VoE/WKPHZH7D8cuuTwtRmHB/fgDPno7Lc7RY/MQIhR8w S9h7zK80WnAxstivBVBOdsHDVMB0Ncs27JbtItZj+lVDPBg1MQw/toN4i2F4wZOPm+WA 7bxAtuN/6OAJ5Z9t6iHErBIMHREpIqerGld8U=

Hello,

I found a way to view to render a polyhedron in windows without using geomview/qt. Its not the best way to do it, but one can visually see them models.
I use the following code to write to a .off file (adapted from the example in the manual):

void WriteToFile(char* name, Polyhedron& P) {
using namespace std;
ofstream myFile;
myFile.open(name);

myFile << "OFF" << std::endl << P.size_of_vertices() << ' '
<< P.size_of_facets() << " 0" << std::endl;
std::copy( P.points_begin(), P.points_end(),
std::ostream_iterator<Point_3>( myFile, "\n"));
for ( Facet_iterator i = P.facets_begin(); i != P.facets_end(); ++i) {
Halfedge_facet_circulator j = i->facet_begin();
// Facets in polyhedral surfaces are at least triangles.
CGAL_assertion( CGAL::circulator_size(j) >= 3);
myFile << CGAL::circulator_size(j) << ' ';
do {
myFile << ' ' << std::distance(P.vertices_begin(), j->vertex());
} while ( ++j != i->facet_begin());
myFile << std::endl;
}


myFile.close();
}

This would yield a .off file with whatever name one specifies. I then use a renderer (GLC Player) to load and render this .off model file.

Hope it helps someone if they come across the same problem.

/Priyank

Priyank Jain wrote:
Hello,

I want to render a polyhedron model and I am not sure how to go about it. I am on a windows machine using Visual Studio 2008 as my choice of compiler. I looked at geomView, but it seems to only support unix / windows(+cygwin) flavor. The other option is Qt framework, but then in the manual, it mentioned only about 2D stuff, so I am not sure if I can use qt to render my polyhedron. On a side note, I have Qt installed on my machine, so if required I can use that.

Can someone please let me know how they have dealt with rendering polyhedron models on a windows/visual studio configuration ?

I'd really appreciate any help.

Thank you
/Priyank Jain



Archive powered by MHonArc 2.6.16.

Top of Page