Subject: CGAL users discussion list
List archive
- From: "Tobias Prousa" <>
- To:
- Subject: Re: [cgal-discuss] Grey_level_image triangulation to STL file
- Date: Sun, 23 Sep 2007 17:11:39 +0200
Hi Laurent,
thanks to your reply I achieved compiling some code which gives me a STL file
with the correct surface. The only problem is that the face-normals are still
pointing to random directions, some point out of object, others point into it.
I used output_surface_facets_to_off as inspiration, but the part when the
macro CGAL_C2T3_USE_POLYHEDRON is disabled. The other portion of the function
didn't work for me at all.
Is there any (simple) way to determine if the normal vector calculated as
cross product of the vectors p1-p0 and p2-p0 (p0,p1,p2 are the points of a
surface-facet) points to the inside or the outside of the surface-meshed
body? Or is there some cgal built in function to get an oriented normal
vector for each facet.
I want to use this for creating 3d meshes (using netgen) of easily modifyable
bodies. The meshes then will be used for studying flow behaviour using
OpenFOAM, an open source CFD software suite.
-------- Original-Nachricht --------
> Datum: Sun, 23 Sep 2007 13:12:11 +0200
> Von: Laurent Rineau
> <>
> An:
>
> Betreff: Re: [cgal-discuss] Grey_level_image triangulation to STL file
> On Sunday 23 September 2007 12:30:29
>
> wrote:
> > Hi,
> >
> > I'm trying to do a grey_level_image triangulation (like described in the
> > on-line manual Chapter X) and output the result into a STL file.
> [...]
> > Here is how I tried to extract the surface triangles:
> >
> > for ( CGAL::Surface_mesh_default_triangulation_3::Finite_facets_iterator
> i
> > = tr.finite_facets_begin(); i != tr.finite_facets_end(); ++i)
>
> Dead Tobi,
>
> You should read the documentation of the class template
> CGAL::Complex_2_in_trianglation_3.
>
> Your loop above could be:
> typedef CGAL::Surface_mesh_default_triangulation_3 Tr;
> typedef CGAL::Complexe_2_in_triangulation_3<Tr> C2t3;
>
> for (C2t3::Facets_iterator it = c2t3.facets_begin();
> it!=c2t3.facets_end(); ++it)
>
> and then "it" will iterate over all facets of the surface. The examples of
> the
> user manual of Surface_mesher do not show that. It is our fault. We will
> try
> to improve the manual in next releases. The only explanation o the user
> manual, about c2t3 is here:
> "The template parameter SurfaceMeshC2T3 stands for a data structure type
> that is used to store the surface mesh."
> It should make you read the reference pages.
>
> > The 3d image triangulation seems to work fine but I just don't get it
> how
> > to extract the mesh faces (with their correct normal vector) to create
> the
> > STL output. I do get something similar to what I expect but a lot of
> faces
> > have inverted normal-vectors. Some faces are completely deteriorated.
>
> Tobi, can you even have a look at an undocumented file, that I personally
> use
> in my applications: <CGAL/IO/Complex_2_in_triangulation_3_file_writer.h>,
> and
> especially the function named "output_surface_facets_to_off", when the
> macro
> CGAL_C2T3_USE_POLYHEDRON is defined. I have not yet documented that
> function, because it is not generic enough to be officially part of the
> CGAL
> library, but it outputs a set of *oriented* facets.
>
>
> Can you please give use feedback, when you reach other problems about
> Surface_mesher, or even if it works for your needs? I am writing my Ph.D
> dissertation, and I would enjoy positive feedback about that package, that
> is
> part of my thesis. For what sort of software do you need Surface_mesher?
> Do
> you have "attractive" pictures of your application, that I could use in my
> thesis? And so on. Thanks in advance.
>
> --
> Laurent Rineau (co-author of Surface_mesher, with Mariette Yvinec)
> INRIA - Sophia Antipolis
> BP 93, 2004 Route des Lucioles
> 06902 Sophia Antipolis Cedex FRANCE
> Tel: +33 4 92 38 78 62 (Fax: +33.4.97.15.53.95)
> --
> You are currently subscribed to cgal-discuss.
> To unsubscribe or access the archives, go to
> https://lists-sop.inria.fr/wws/info/cgal-discuss
--
Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kanns mit allen: http://www.gmx.net/de/go/multimessenger
- Grey_level_image triangulation to STL file, topro, 09/23/2007
- Re: [cgal-discuss] Grey_level_image triangulation to STL file, Laurent Rineau, 09/23/2007
- Re: [cgal-discuss] Grey_level_image triangulation to STL file, Tobias Prousa, 09/23/2007
- Re: [cgal-discuss] Grey_level_image triangulation to STL file, Laurent Rineau, 09/23/2007
- Re: [cgal-discuss] Grey_level_image triangulation to STL file, topro, 09/23/2007
- Re: [cgal-discuss] Grey_level_image triangulation to STL file, Laurent Rineau, 09/23/2007
- Re: [cgal-discuss] Grey_level_image triangulation to STL file, Tobias Prousa, 09/23/2007
- Re: [cgal-discuss] Grey_level_image triangulation to STL file, Laurent Rineau, 09/23/2007
Archive powered by MHonArc 2.6.16.