Add code that shows the issue

This commit is contained in:
Andreas Fabri 2024-06-07 08:43:36 +01:00
parent d876fbab69
commit 7a984104fa
1 changed files with 43 additions and 0 deletions

View File

@ -0,0 +1,43 @@
#include <CGAL/Surface_mesh.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <CGAL/boost/graph/helpers.h>
#include <CGAL/boost/graph/IO/PLY.h>
#include <CGAL/boost/graph/IO/polygon_mesh_io.h>
#include <CGAL/Surface_mesh/IO/PLY.h>
typedef CGAL::Surface_mesh<CGAL::Epeck::Point_3> Surface_mesh;
typedef CGAL::Polyhedron_3<CGAL::Epeck> Polyhedron_3;
typedef CGAL::Epeck::Point_3 Point_3;
int main()
{
Point_3 p(0.3, 0.3454, 0), q(0.6694, 0,0), r(0,0,0);
Surface_mesh sm;
Polyhedron_3 po;
CGAL::make_triangle(p,q,r,sm);
CGAL::make_triangle(p,q,r,po);
// from <CGAL/boost/graph/IO/polygon_mesh_io.h>
// https://doc.cgal.org/latest/BGL/group__PkgBGLIoFuncsPLY.html#ga959dcd88ca979d3b6b0806d883a0247f
CGAL::IO::write_polygon_mesh("write_polygon_mesh_sm.ply", sm,
CGAL::parameters::stream_precision(17).use_binary_mode(true));
CGAL::IO::write_polygon_mesh("write_polygon_mesh_po.ply", po,
CGAL::parameters::stream_precision(17).use_binary_mode(true));
// from #include <CGAL/boost/graph/IO/PLY.h>
// https://doc.cgal.org/latest/BGL/group__PkgBGLIoFuncsPLY.html#ga959dcd88ca979d3b6b0806d883a0247f
CGAL::IO::write_PLY("generic_write_PLY.ply", sm, "generic write_PLY(Surface_mesh)",
CGAL::parameters::stream_precision(17).use_binary_mode(true));
CGAL::IO::write_PLY("generic_write_PLY_po.ply", sm, "generic write_PLY(Polyhedron)",
CGAL::parameters::stream_precision(17).use_binary_mode(true));
// from #include <CGAL/Surface_mesh/IO/PLY.h>
// https://doc.cgal.org/latest/Surface_mesh/group__PkgSurfaceMeshIOFuncPLY.html#ga50f0e9f2b293855d2c7f1a62939cbe8d
std::ofstream out("sm_write_PLY.ply", std::ios::binary);
CGAL::IO::write_PLY(out, sm, "sm_write_PLY");
return 0;
}