Subject: CGAL users discussion list
List archive
- From: Juan Carlos Lopez Alfonso <>
- To:
- Subject: Re: [cgal-discuss] I still have problems with Alpha_Shape_3
- Date: Fri, 18 Nov 2011 12:54:27 +0100
Hi Sebastien and Laurent:
Thank you for your answers and for your help, I am very thankful.
Only one question more if is possible. In the answer of Laurent about the off file, I am not sure what He is saying. Please could you explain with more detail, give me some code or reference about it?
Best regards and thank you again
Juan Carlos
On Fri, Nov 18, 2011 at 10:32 AM, Laurent Rineau (GeometryFactory) <> wrote:
Le jeudi 17 novembre 2011 12:53:09 Juan Carlos Lopez Alfonso a écrit :
> Hi:Let me quote your code:
>
> Well, I am following in details the examples and the documentation, but
> without lucky. I have used the input data of the examples in order to find
> more simplicity. My input set of points is "bunny_5000" and when I use the
> Alpha_Shape_3 class I dont see any desired results. Please see the
> following images:
>
> http://dl.dropbox.com/u/2516160/bunny1.png
> http://dl.dropbox.com/u/2516160/bunny2.png
>
> I have followed the first example in the charapter of Alpha_Shape_3 and for
> this reason my code is very simple.
>
> http://dl.dropbox.com/u/2516160/code.txt
> void Export2OFF(char * filedir, const Alpha_shape_3 &T, const
> std::map<Vertex_handle, int> &Vertices, const std::list<Cell_handle>
> &cells) {
>
> ofstream myfile (filedir);
> if (myfile.is_open())
> {
>
> myfile << "OFF" << "\n";
> myfile << Vertices.size() << ' ' << cells.size() << ' ' << 0 << "\n";
>
> std::map<Vertex_handle, int>::const_iterator vit;
> for (vit = Vertices.begin(); vit != Vertices.end(); vit++)
> {
>
> myfile << vit->first->point().x() << ' ' << vit->first->point().y()
> << ' ' << vit->first->point().z() << "\n";>
> }
>
> std::list<Cell_handle>::const_iterator itr;
> for (itr = cells.begin(); itr != cells.end(); itr++)
> {
>
> Cell_handle cit = *itr;
> myfile << 4 << ' ' << Vertices.find(cit->vertex(0))->second-1 << ' '
> << Vertices.find(cit->vertex(1))->second-1 << ' ' <<
> Vertices.find(cit->vertex(2))->second-1 << ' ' <<
> Vertices.find(cit->vertex(3))->second-1 << "\n";
> }
The OFF format is for polygonal faces only. "4" does not mean that the lines is a tetrahedron. Here you put in the OFF file some non planar faces with 4 vertices. I am not surprised that you OFF viewer display non-sense.
--
Laurent Rineau, PhD
R&D Engineer at GeometryFactory http://www.geometryfactory.com/
Release Manager of the CGAL Project http://www.cgal.org/
--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss
- [cgal-discuss] I still have problems with Alpha_Shape_3, Juan Carlos Lopez Alfonso, 11/17/2011
- Re: [cgal-discuss] I still have problems with Alpha_Shape_3, Daniel Duque, 11/17/2011
- Re: [cgal-discuss] I still have problems with Alpha_Shape_3, Juan Carlos Lopez Alfonso, 11/18/2011
- Re: [cgal-discuss] I still have problems with Alpha_Shape_3, Sebastien Loriot (GeometryFactory), 11/18/2011
- Re: [cgal-discuss] I still have problems with Alpha_Shape_3, Juan Carlos Lopez Alfonso, 11/18/2011
- Re: [cgal-discuss] I still have problems with Alpha_Shape_3, Laurent Rineau (GeometryFactory), 11/18/2011
- Re: [cgal-discuss] I still have problems with Alpha_Shape_3, Juan Carlos Lopez Alfonso, 11/18/2011
- Re: [cgal-discuss] I still have problems with Alpha_Shape_3, Daniel Duque, 11/17/2011
Archive powered by MHonArc 2.6.16.