Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Fail in computing the corefinement of two simple triangulated surface meshes

Subject: CGAL users discussion list

List archive

[cgal-discuss] Fail in computing the corefinement of two simple triangulated surface meshes


Chronological Thread 
  • From: "coz.mars123" <>
  • To:
  • Subject: [cgal-discuss] Fail in computing the corefinement of two simple triangulated surface meshes
  • Date: Thu, 12 Sep 2019 09:32:29 -0500 (CDT)
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=SoftFail ; spf=Pass
  • Ironport-phdr: 9a23:PZD/DhZF20645kYULDoicYb/LSx+4OfEezUN459isYplN5qZoMu6bnLW6fgltlLVR4KTs6sC17ON9fi9EjNcqdbZ6TZeKcYKD0dEwewt3CUYSPafDkP6KPO4JwcbJ+9lEGFfwnegLEJOE9z/bVCB6le77DoVBwmtfVEtfre9FYHdldm42P6v8JPPfQpImCC9YbRvJxmqsAndrMYbjZZsJ6or1hfEonREduZZyGh1IV6fgwvw6t2/8ZJ+7Shcoe4t+9JFXa7nY6k2ULtUASg8PWso/sPrrx7DTQWO5nsYTGoblwdDDhbG4h/nQJr/qzP2ueVh1iaUO832Vq00Vi+576h3Uh/oiTwIOCA//WrKl8F/lqNboBampxxi347ZZZyeOfRicq/Be94RWGxMVdtTWSNcGIOxd4UBAeofM+hbsofyqEcBoxSlCAmwBu7j1iNEimPq0aEk1ekqDAHI3BYnH9ILqHnYosn6NKATUOyvyanH1y/Db+hL1Tvj5oXEfA0qrPaQUrJ3cMvd00wvGBnfjlWLtIDpIT2Y2/8Cs2ie9eVgVOavh3Q7pAF2pzii38EhgZTHiIISz1DL7yR5wIAtKN2+UkF0esWrEJ9OuC2AK4R2RcYiTmd1syg50r0LoYO3cSwOxZg9yRPSaOaLfouJ7x75VeucIDF1j29/dr2lnRa9602gx/X8Vsaq1FZKqTJIkt/Du3wX0Rzc8NOIReB5/ki/wzqAywfT6uRcLUA1k6rUNYIhz6YtmpcXtUnPBCH7lUbsgKKVd0go4Oml5uX/brXjvJCcNot0ig/kMqQpn8yyGfg3Mg8PXmSB/OSzzqfj/VbkTLlUgPA7iabZsJXAKsQaoq61GRNa0oEm6xqnFTepzMwYnWUbLFJCYB+Ik4fpNEvKIPzhEPi/gk+snyt2x/DdJb3sGY7NL3jGkLf5Z7lx8U9cyAwpzdBe/Z1YEL8BIOigEnP24dfXBxt8Pw2vyPv8E/180JkfUCSBGPy3KqTX5BWD4fBpJuCWf9ZP43y1f/Mi9bjrhGUiwAVGVaas1JoTLnu/G6I1cA2ifXPwj4JZQi8xtQ0kQbmy0QHQYXtof3+3GpkEyHQjEov/VNXMQ4mshPqK2yLpRsQLNFADMUiFFDLTT6vBW/oIb3vPcMk91DoNX7KlRskq0hT87VarmYoiFfLd/2gjjbym0dF04+PJkhRrrG57Cs2c1yeGSGQmxW4=

Hello.

I have a problem when computing the corefirement of two simple triangulated
surface meshes. The following code raised an exception when running. I think
the error came from the input 2 "ConeClosed.off" because when I replaced it
with "blobby.off", the corefirement was successfully computed.
But I don't know what is wrong here.
Please suggest me how to fix the problem. Thanks a lot.

#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Surface_mesh.h>
#include <CGAL/Polygon_mesh_processing/corefinement.h>
#include <fstream>
#include <CGAL/draw_surface_mesh.h>
#include <CGAL/Surface_mesh_simplification/edge_collapse.h>

typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Surface_mesh<K::Point_3> Mesh;
typedef K::Point_3 Point;
namespace PMP = CGAL::Polygon_mesh_processing;

int main(int argc, char* argv[])
{
const char* filename1 = (argc > 1) ? argv[1] : "data/cuboid.off";
const char* filename2 = (argc > 2) ? argv[2] : "data/ConeClosed.off";
//const char* filename2 = (argc > 2) ? argv[2] : "data/blobby.off";


std::ifstream input(filename1);
Mesh mesh1, mesh2;
if (!input || !(input >> mesh1))
{
std::cerr << "First mesh is not a valid off file." <<
std::endl;
return 1;
}
input.close();

input.open(filename2);

if (!input || !(input >> mesh2))
{
std::cerr << "Second mesh is not a valid off file." <<
std::endl;
return 1;
}
input.close();

Mesh out;
bool valid_union = PMP::corefine_and_compute_union(mesh1, mesh2, out);

if (valid_union)
{
std::cout << "Union was successfully computed\n";
std::ofstream output("union.off");
output << out;
CGAL::draw(out);
return 0;
}
std::cout << "Union could not be computed\n";
return 1;
}


Cuboid.off
<http://cgal-discuss.949826.n4.nabble.com/file/t376147/Cuboid.off>
ConeClosed.off
<http://cgal-discuss.949826.n4.nabble.com/file/t376147/ConeClosed.off>
blobby.off
<http://cgal-discuss.949826.n4.nabble.com/file/t376147/blobby.off>



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



Archive powered by MHonArc 2.6.18.

Top of Page