Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Display selected faces of polyhedra

Subject: CGAL users discussion list

List archive

[cgal-discuss] Display selected faces of polyhedra


Chronological Thread 
  • From: Youssef ALJ <>
  • To: <>
  • Subject: [cgal-discuss] Display selected faces of polyhedra
  • Date: Mon, 21 Jun 2010 18:58:05 +0200
  • Importance: Normal



Hi,

I'd like to know if it is possible to display a face color and how using the example provided by CGAL:

#include <CGAL/Simple_cartesian.h>
#include <CGAL/IO/Color.h>
#include <CGAL/Polyhederon.h>

// A face type with a color member variable.
template <class Refs>

struct My_face : public CGAL::HalfedgeDS_face_base<Refs> {
CGAL::Color color;
};

// An items type using my face.

struct My_items : public CGAL::Polyhedron_items_3 {
template <class Refs, class Traits>
struct Face_wrapper {
typedef My_face<Refs> Face;
};
};

typedef CGAL::Simple_cartesian<double> Kernel;
typedef CGAL::Polyhedron_3<Kernel, My_items> Polyhedron;
typedef Polyhedron::Halfedge_handle Halfedge_handle;



int main() {
Polyhedron P;



Halfedge_handle h = P.make_tetrahedron( Point( 1, 0, 0),
Point( 0, 0, 1),
Point( 0, 0, 0),
Point( 0, 1, 0));
h->facet()->color = CGAL::RED; // How to display this face with red color
return 0;
}

Can we visualize this polyhedron using geomview, such as all faces are in the default color and one facet has red color for example?


Thanks,
Youssef ALJ


Hotmail: Trusted email with Microsoft’s powerful SPAM protection. Sign up now.



Archive powered by MHonArc 2.6.16.

Top of Page