Faces listed twice in output mesh files of example mesh_polyhedral_domain

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Faces listed twice in output mesh files of example mesh_polyhedral_domain

Dr01TSPC
This post was updated on .
I ran example  

mesh_polyhedral_domain.cpp

with the default input file elephant.off.

I note that the output mesh files list each face twice.  

(Most of them.)

Is there a setting/flag I am missing?

I am using 4.13.





--
Sent from: http://cgal-discuss.949826.n4.nabble.com/

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


Reply | Threaded
Open this post in threaded view
|

Re: Faces listed twice in output mesh files of example mesh_polyhedral_domain

Sebastien Loriot (GeometryFactory)
On 12/10/2018 05:03 PM, Dr01TSPC wrote:
> I ran example
>
> mesh_polyhedral_domain.cpp
>
> with the default input file elephant.off.
>
> I note that the output mesh files list each face twice.
>

The mesh generated is a tetrahedron mesh, so it might be that you
get each face twice (one per tetrahedron). How do you list
faces?

Sebastien.

> (Most of them.)
>
> Is there a setting/flag I am missing?
>
>
>
>
>
> --
> Sent from: http://cgal-discuss.949826.n4.nabble.com/
>

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


Reply | Threaded
Open this post in threaded view
|

Re: Faces listed twice in output mesh files of example mesh_polyhedral_domain

Dr01TSPC
Sebastien:

My goal is to generate tet meshes from input surface meshes (tris).
(Actually
my first goal is to use CGAL to clean up the surface meshes, before volume
meshing, but baby steps.)

~~~~~~~~~~~~~~~~
Review of the steps I took:

After installing 4.13, I went to examples/Mesh_3; then executed cmake .,
make.

I then executed ./mesh_polyhedral_domain[_sm], which use(s) elephant.off by
default.

I view the out files - out_1.mesh (say) using either gedit or just less.

The Triangles are all listed twice. In the same node order.

(I made no changes or selections.)

For elephant.off input:
out_1.mesh has 760 Vertices, 3032 Triangles, and 1948 Tetrahedra.
out_2.mesh has 1916 Vertices, 4816 Triangles, and 7507 Tetrahedra.

From those numbers, I would have thought the triangles are the surface
facets.
I have written code that removes the duplicate triangles, in order to view
the
elephant (say) after removing the tets.

I have run mesh_polyhedral_domain[_sm] on my own input surface meshes, and
obtained the same results - double listing of triangles.

Regards,
Tim




--
Sent from: http://cgal-discuss.949826.n4.nabble.com/

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


Reply | Threaded
Open this post in threaded view
|

Re: Faces listed twice in output mesh files of example mesh_polyhedral_domain

Sebastien Loriot (GeometryFactory)
OK after checking with the original author, it is expected for coloring
in medit.

If you do not want those duplicated triangles, you can do:

CGAL::Mesh_3::output_to_medit<C3T3, true, false>(ostream, c3t3);

Sebastien.

On 12/12/2018 05:17 PM, Dr01TSPC wrote:

> Sebastien:
>
> My goal is to generate tet meshes from input surface meshes (tris).
> (Actually
> my first goal is to use CGAL to clean up the surface meshes, before volume
> meshing, but baby steps.)
>
> ~~~~~~~~~~~~~~~~
> Review of the steps I took:
>
> After installing 4.13, I went to examples/Mesh_3; then executed cmake .,
> make.
>
> I then executed ./mesh_polyhedral_domain[_sm], which use(s) elephant.off by
> default.
>
> I view the out files - out_1.mesh (say) using either gedit or just less.
>
> The Triangles are all listed twice. In the same node order.
>
> (I made no changes or selections.)
>
> For elephant.off input:
> out_1.mesh has 760 Vertices, 3032 Triangles, and 1948 Tetrahedra.
> out_2.mesh has 1916 Vertices, 4816 Triangles, and 7507 Tetrahedra.
>
>  From those numbers, I would have thought the triangles are the surface
> facets.
> I have written code that removes the duplicate triangles, in order to view
> the
> elephant (say) after removing the tets.
>
> I have run mesh_polyhedral_domain[_sm] on my own input surface meshes, and
> obtained the same results - double listing of triangles.
>
> Regards,
> Tim
>
>
>
>
> --
> Sent from: http://cgal-discuss.949826.n4.nabble.com/
>

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


Reply | Threaded
Open this post in threaded view
|

Re: Faces listed twice in output mesh files of example mesh_polyhedral_domain

Dr01TSPC
This post was updated on .
Sebastien:

Thank you for the feedback:

JUST to be sure: I have seen color info in medit files - following the tri info
on each line.
The output files from mesh_polyhedral_domain I see have two lines duplicated -
no new info. A section of the Triangles section of an output mesh file is:

.
.
.

Triangles
3032
14 370 228 1
14 370 228 1
129 106 347 1
129 106 347 1
51 149 231 1
51 149 231 1
311 88 513 1
311 88 513 1
237 197 190 1
237 197 190 1
179 187 199 1
Guess what the next line is . . .

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

WRT the suggested line to insert (?):

Thank you for the hint. Is there a good place to put

CGAL::Mesh_3::output_to_medit<C3T3, true, false>(ostream, c3t3);

in mesh_polyhedra_domain? I am very new to CGAL and new to c++:

This is the response from make, after inserting the above line just before mesh
generation.

~~~~~~~~~~~Output to screen~~~~~~~~
Scanning dependencies of target mesh_polyhedral_domain
[100%] Building CXX object examples/Mesh_3/CMakeFiles/mesh_polyhedral_domain.dir/mesh_polyhedral_domain.cpp.o
/home/tscale/CGAL-4.13/examples/Mesh_3/mesh_polyhedral_domain.cpp: In function ‘int main(int, char**)’:
/home/tscale/CGAL-4.13/examples/Mesh_3/mesh_polyhedral_domain.cpp:52:31: error: ‘C3T3’ was not declared in this scope
 CGAL::Mesh_3::output_to_medit<C3T3, true, false>(ostream, c3t3);
                               ^~~~
/home/tscale/CGAL-4.13/examples/Mesh_3/mesh_polyhedral_domain.cpp:52:31: note: suggested alternative: ‘C3t3’
 CGAL::Mesh_3::output_to_medit<C3T3, true, false>(ostream, c3t3);
                               ^~~~
                               C3t3
/home/tscale/CGAL-4.13/examples/Mesh_3/mesh_polyhedral_domain.cpp:52:50: error: ‘ostream’ was not declared in this scope
 CGAL::Mesh_3::output_to_medit<C3T3, true, false>(ostream, c3t3);
                                                  ^~~~~~~
/home/tscale/CGAL-4.13/examples/Mesh_3/mesh_polyhedral_domain.cpp:52:50: note: suggested alternative:
In file included from /usr/include/c++/7/bits/localefwd.h:41:0,
                 from /usr/include/c++/7/string:43,
                 from /usr/include/c++/7/stdexcept:39,
                 from /usr/include/boost/container/throw_exception.hpp:26,
                 from /usr/include/boost/container/new_allocator.hpp:24,
                 from /usr/include/boost/container/flat_map.hpp:26,
                 from /home/tscale/CGAL-4.13/include/CGAL/config.h:136,
                 from /home/tscale/CGAL-4.13/include/CGAL/basic.h:30,
                 from /home/tscale/CGAL-4.13/include/CGAL/Cartesian/Cartesian_base.h:29,
                 from /home/tscale/CGAL-4.13/include/CGAL/Simple_cartesian.h:29,
                 from /home/tscale/CGAL-4.13/include/CGAL/Exact_predicates_inexact_constructions_kernel.h:29,
                 from /home/tscale/CGAL-4.13/examples/Mesh_3/mesh_polyhedral_domain.cpp:1:
/usr/include/c++/7/iosfwd:141:33: note:   ‘std::ostream’
   typedef basic_ostream<char>   ostream;
                                 ^~~~~~~
/home/tscale/CGAL-4.13/examples/Mesh_3/mesh_polyhedral_domain.cpp:52:59: error: ‘c3t3’ was not declared in this scope
 CGAL::Mesh_3::output_to_medit<C3T3, true, false>(ostream, c3t3);
                                                           ^~~~
/home/tscale/CGAL-4.13/examples/Mesh_3/mesh_polyhedral_domain.cpp:52:59: note: suggested alternative:
In file included from /home/tscale/CGAL-4.13/include/CGAL/boost/parameter.h:35:0,
                 from /home/tscale/CGAL-4.13/include/CGAL/Mesh_criteria_3.h:37,
                 from /home/tscale/CGAL-4.13/examples/Mesh_3/mesh_polyhedral_domain.cpp:5:
/home/tscale/CGAL-4.13/include/CGAL/boost/parameter.h:85:23: note:   ‘CGAL::parameters::tag::c3t3’
 BOOST_PARAMETER_NAME( c3t3 )
                       ^
examples/Mesh_3/CMakeFiles/mesh_polyhedral_domain.dir/build.make:62: recipe for target 'examples/Mesh_3/CMakeFiles/mesh_polyhedral_domain.dir/mesh_polyhedral_domain.cpp.o' failed
make[2]: *** [examples/Mesh_3/CMakeFiles/mesh_polyhedral_domain.dir/mesh_polyhedral_domain.cpp.o] Error 1
CMakeFiles/Makefile2:12324: recipe for target 'examples/Mesh_3/CMakeFiles/mesh_polyhedral_domain.dir/all' failed
make[1]: *** [examples/Mesh_3/CMakeFiles/mesh_polyhedral_domain.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

~~~~~~~~~~~~~~~~~~~~~~~~

Regards,
Tim

--
Sent from: http://cgal-discuss.949826.n4.nabble.com/

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


Reply | Threaded
Open this post in threaded view
|

Re: Faces listed twice in output mesh files of example mesh_polyhedral_domain

Sebastien Loriot (GeometryFactory)
In mesh_polyhedra_domain.cpp replace:

c3t3.output_to_medit(medit_file);

by CGAL::Mesh_3::output_to_medit<C3t3, true, false>(medit_file, c3t3);

Sebastien.

On 12/12/2018 06:13 PM, Dr01TSPC wrote:

> Sebastien:
>
> Thank you for the hint. Is there a good place to put
>
> CGAL::Mesh_3::output_to_medit<C3T3, true, false>(ostream, c3t3);
>
> in mesh_polyhedra_domain?
>
> I am very new to CGAL and new to c++.
>
> JUST to be sure. I have seen color info in medit files - following tri info
> on each line.
> The out put files from mesh_polyhedral_domain have two lines duplicated -
> no new info. A section of the Triangles section of an output mesh file is:
>
> .
> .
> .
>
> Triangles
> 3032
> 14 370 228 1
> 14 370 228 1
> 129 106 347 1
> 129 106 347 1
> 51 149 231 1
> 51 149 231 1
> 311 88 513 1
> 311 88 513 1
> 237 197 190 1
> 237 197 190 1
> 179 187 199 1
> .
> .
> .
>
> Regards,
> Tim
>
>
>
>
>
> --
> Sent from: http://cgal-discuss.949826.n4.nabble.com/
>

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


Reply | Threaded
Open this post in threaded view
|

Re: Faces listed twice in output mesh files of example mesh_polyhedral_domain

Dr01TSPC
Sebastien:

Thank you.
That replacement statement works, and is more satisfying than my patch -
hardwiring File_medit.h to
feed "false" as the last argument into output_to_medit.

Best,
Tim



--
Sent from: http://cgal-discuss.949826.n4.nabble.com/

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