Subject: CGAL users discussion list
List archive
Re: [cgal-discuss] Re: Help: how to load 3D tet mesh from file into c3t3 (sorry if noob)
Chronological Thread
- From: "Laurent Rineau (GeometryFactory)" <>
- To:
- Subject: Re: [cgal-discuss] Re: Help: how to load 3D tet mesh from file into c3t3 (sorry if noob)
- Date: Tue, 16 Mar 2010 10:23:12 +0100
- Organization: GeometryFactory
On Thursday 11 March 2010 17:23:20 toddoe wrote:
> Thanks for the reply.
>
> Not the answer i expected... but I'm probably just not asking the right
> question.
>
> My meshes are all delaunay and convex. That's no problem. But, in fact all
> i want to do is just load meshes that were created in cgal and saved as
> mesh file.
In that case, you can use the operator<< of CGAL triangulations.
// [create c3t3], then:
std::cout << c3t3.triangulation();
// to load:
C3t3 new_c3t3;
std::cin >> new_c3t3.triangulation();
Of course, cout and cin might be replaced by objects of classes std::ofstream
and std::ifstream to use files as storage.
Be aware that the default mode of those operators is ASCII, with rounded
double coordinates. You may need to modify the output stream like that
std::cout.precision(17); // sets the decimal precision to something
// greater than 54*log(2)/log(10)
or you may want to use a binary mode:
CGAL::set_binary_mode(std::cout);
but in that case the saved triangulation can be loaded only on platforms of
the same indianness, and same size of integers, if I remember well.
See
http://www.cgal.org/Manual/last/doc_html/cgal_manual/IOstream_ref/Chapter_intro.html
> One of my purposes for doing this is to generate very large parametric
> meshes on a distributed system. I would like to generate an 'initial' mesh
> using cgal and save as a mesh file. Then i would like to load that mesh
> into 256 cpus running 256 refinement executables in parallel (with varying
> refinement parameters, obviously).
It would be nice that you publish the code of that. That seems interesting!
--
Laurent Rineau, PhD
R&D Engineer at GeometryFactory http://www.geometryfactory.com/
Release Manager of the CGAL Project http://www.cgal.org/
- [cgal-discuss] Help: how to load 3D tet mesh from file into c3t3 (sorry if noob), toddoe, 03/11/2010
- Re: [cgal-discuss] Help: how to load 3D tet mesh from file into c3t3 (sorry if noob), Laurent Rineau (GeometryFactory), 03/11/2010
- [cgal-discuss] Re: Help: how to load 3D tet mesh from file into c3t3 (sorry if noob), toddoe, 03/11/2010
- Re: [cgal-discuss] Re: Help: how to load 3D tet mesh from file into c3t3 (sorry if noob), Laurent Rineau (GeometryFactory), 03/16/2010
- Re: [cgal-discuss] Help: how to load 3D tet mesh from file into c3t3 (sorry if noob), t doehring, 03/11/2010
- [cgal-discuss] Re: Help: how to load 3D tet mesh from file into c3t3 (sorry if noob), toddoe, 03/11/2010
- Re: [cgal-discuss] Help: how to load 3D tet mesh from file into c3t3 (sorry if noob), Laurent Rineau (GeometryFactory), 03/11/2010
Archive powered by MHonArc 2.6.16.