Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Another Polyhedra question

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Another Polyhedra question


Chronological Thread 
  • From: "Sebastien Loriot (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] Another Polyhedra question
  • Date: Tue, 16 Mar 2010 11:59:38 +0100

Martin Baeker wrote:
Dear all,

I'm getting a bit desperate while trying to work with Polyhedra-stuff.

The manual says that I can access the plane that belongs to a facet with
Plane_3& f.plane () if Supports_facet_plane == CGAL::Tag_true

However, I do not understand how this really works.

When I create a Polyhedron, e.g., with the make_cube_3-routine that is
provided in the examples, I can access the plane corresponding to each
facet without problems.
However, when I write this Polyhedron to an off-file and read it in
again, I cannot access its planes anymore.

Here is a simple test program to show this:

void do_stuff(Polyhedron & pcube)
{
for (Halfedge_iterator h=pcube.halfedges_begin(); h != pcube.halfedges_end(); ++h)
{
Facet face=*(h->facet());
std::cout << face.plane().orthogonal_vector() << std::endl;
}
}

int main() {
Polyhedron pcube;
make_cube_3(pcube);
std::ofstream os1("poly2.off" ) ;
os1 << pcube ;
os1.close();
do_stuff(pcube);
std::cout << "\n";
Polyhedron pcube2;
std::ifstream is1("poly2.off" ) ;
is1 >> pcube2;
do_stuff(pcube2);
}

The output for pcube is correct; for pcube2, all orthogonal vectors are output as 0/1 0/1 0/1.


Is there a way to make sure that I can always access the plane
belonging to a facet? If not, why not? Could I do it by just taking
three points from the facet and create a plane with them?


Any help will be greatly appreciated,

Martin.





Priv.-Doz. Dr. Martin Bäker
Institut für Werkstoffe
Technische Universität Braunschweig
Langer Kamp 8
38106 Braunschweig
Germany
Tel.: 00-49-531-391-3073
Fax 00-49-531-391-3058
e-mail
<>

Can you please post the typedefs as well, so as to make your example compilable.


S.





Archive powered by MHonArc 2.6.16.

Top of Page