Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Copying two different triangulation types.

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Copying two different triangulation types.


Chronological Thread 
  • From: "Laurent Rineau (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] Copying two different triangulation types.
  • Date: Thu, 28 Jan 2010 11:09:56 +0100
  • Organization: GeometryFactory

On Thursday 28 January 2010 08:50:40 Simon Perkins wrote:
> Dear All
>
> Is it possible to perform an exact copy of the vertices and cells between
> two different 3D Triangulation types? For example, I want to use the Mesh_3
> package to tetrahedralize a domain and then copy the Mesh_3 Triangulation
> into a customized Triangulation_3. It doesn't seem possible to do this via
> the constructor, copy() and swap() functions. I also attempted this with
> the output and input streams, by outputting a Mesh_3 Triangulation and
> trying to input the same into a Triangulation_3, but this did not work due
> to a failed assertion.

The problem with "outputing" a triangulation to a file and then reload it
form
that file, is that I/O operations in ascii mode usually rounds numbers. It
has
the consequence that the reloaded triangulation can be invalid, due to
geometric inversion of triangles.

To workaround that issue, you can use I/O operations in binary mode. You can
also set the decimal precision of the output stream to 23 (which is the
maximum precision for doubles, if I remember well).


--
Laurent Rineau, PhD
R&D Engineer at GeometryFactory http://www.geometryfactory.com/
Release Manager of the CGAL Project http://www.cgal.org/



Archive powered by MHonArc 2.6.16.

Top of Page