Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Re: Help: how to load 3D tet mesh from file into c3t3 (sorry if noob)

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: Ramin H <>
  • To:
  • Subject: Re: [cgal-discuss] Re: Help: how to load 3D tet mesh from file into c3t3 (sorry if noob)
  • Date: Fri, 2 Apr 2010 04:27:36 -0400
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=tzya38ANrobEY1n0LE/WHazcPFlA7fMIsyFSBrbaqGQYPlRrqSZg8Lzdz58Awe7bWN Q8j1am6NWnOQ4dwUAUQSmZFom1RLbuENoSLln702PM/kTrSgwsOFOYX1OGzjU+/I3hx6 0jVch3AbKh7OhIy3vDQmJ24Q1odZKpt7paWnQ=

Hi,

I used this method to write/read C3T3 triangulations.
- First I write the triangulation to "out_1.c3t3" file, it looks fine.
- Then I read back the saved file into a C3T3 object and save back to "out_2.c3t3" file.

Comparing "out_1.c3t3" and "out_2.c3t3" (both files are attached to the message) shows that indexes at the end of the files are different. In the second one, all indexes are set to zero.

1. Any idea why this is happening?
2. What are these index numbers?

-Ramin


On Tue, Mar 16, 2010 at 5:23 AM, Laurent Rineau (GeometryFactory) <> wrote:
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/

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss


Attachment: out_1.c3t3
Description: Binary data

Attachment: out_2.c3t3
Description: Binary data




Archive powered by MHonArc 2.6.16.

Top of Page