Subject: CGAL users discussion list
List archive
- From: Andreas Fabri <>
- To:
- Subject: Re: [cgal-discuss] Another Polyhedra question
- Date: Tue, 16 Mar 2010 12:08:21 +0100
Hello Martin,
If I understand it right, you would expect that the plane
equation gets recomputed when the off file is loaded.
I don't see that this is supported by the off file format: http://www.geomview.org/docs/oogltour.html
Also it would not make sense, that CGAL computes the plane
equation after loading, as you could not have computed
it when you wrote it, or have stored yet another plane.
One solution would be to have an eoff format
( I just come up with this name, with the 'e'
standing for extended), which writes/reads whatever
information added to vertices and faces to the stream.
best regards,
andreas
On 16/03/2010 11:43, 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
<>
- [cgal-discuss] Another Polyhedra question, Martin Baeker, 03/16/2010
- Re: [cgal-discuss] Another Polyhedra question, Sebastien Loriot (GeometryFactory), 03/16/2010
- Re: [cgal-discuss] Another Polyhedra question, Martin Baeker, 03/16/2010
- Re: [cgal-discuss] Another Polyhedra question, Andreas Fabri, 03/16/2010
- Re: [cgal-discuss] Another Polyhedra question, Martin Baeker, 03/16/2010
- Re: [cgal-discuss] Another Polyhedra question, Priyank Jain, 03/17/2010
- Re: [cgal-discuss] Another Polyhedra question, Martin Baeker, 03/17/2010
- Re: [cgal-discuss] Another Polyhedra question, Laurent Rineau (GeometryFactory), 03/17/2010
- Re: [cgal-discuss] Another Polyhedra question, Priyank Jain, 03/17/2010
- Re: [cgal-discuss] Another Polyhedra question, Martin Baeker, 03/16/2010
- Re: [cgal-discuss] Another Polyhedra question, Sebastien Loriot (GeometryFactory), 03/16/2010
Archive powered by MHonArc 2.6.16.