Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CGAL Mesh_3 generates undeterministic node ordering and occasionally non-repeatable tesselation #4

Closed
fangq opened this issue Jun 12, 2015 · 3 comments

Comments

@fangq
Copy link
Owner Author

fangq commented Jun 12, 2015

Temporary workaround was committed in

https://sourceforge.net/p/iso2mesh/code/493/

still, the tet number may change because of the node ordering

@fangq
Copy link
Owner Author

fangq commented Jun 12, 2015

Issue appears to be un-fixed in the latest CGAL release (4.6). Steps to reproduce this issue:

  • download and compile CGAL 4.6
  • cd example/Mesh_3, run "make mesh_3D_image"
  • when complete, run
./mesh_3D_image
mv out.mesh out.mesh_1
./mesh_3D_image
diff out.mesh out.mesh_1

the files are different, both the node list, and element list.

  • apply the following patch to set the RNG seed
--- mesh_3D_image.cpp_old   2015-06-12 16:34:46.000000000 -0400
+++ mesh_3D_image.cpp   2015-06-12 16:34:29.000000000 -0400
@@ -36,6 +36,11 @@
   CGAL::Image_3 image;
   image.read("data/liver.inr.gz");

+  CGAL::Random rd(1234567);
+  CGAL::Random::State st;
+  rd.save_state(st);
+  CGAL::default_random.restore_state(st);
+
   // Domain
   Mesh_domain domain(image);
  • rerun the above test, the output files remain different - the mesh could not be reproduced.

@fangq
Copy link
Owner Author

fangq commented Jun 15, 2016

issue closed. with the above patch for RNG seeding, I was able to produce deterministic meshes when using the latest CGAL release v4.8.1. looks like some recent upstream updates fixed the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant