neperfepx / neper

Polycrystal generation and meshing
http://neper.info
GNU General Public License v3.0
199 stars 53 forks source link

Error in tessellation when cutting a complementary shape. #287

Open mauromuniz opened 2 years ago

mauromuniz commented 2 years ago

Error when trying to cut a "complementary" cylinder from a cube.

$ neper -T -n 5000 -domain "cube(0.1,0.1,0.2)" -regularization 1 -transform "cut(cylinderi(.05,.05,0.0,0,0,1,0.027))" -o 'bloque5k' -format '3dec'

========================    N   e   p   e   r    =======================
Info   : A software package for polycrystal generation and meshing.
Info   : Version 4.2.1-8
Info   : Built with: gsl|muparser|opengjk|nlopt|libscotch
Info   : <https://neper.info>
Info   : Copyright (C) 2003-2021, and GNU GPL'd, by Romain Quey.
Info   : No initialization file found (`/home/name/.neperrc').
Info   : ---------------------------------------------------------------
Info   : MODULE  -T loaded with arguments:
Info   : [ini file] (none)
Info   : [com line] -n 5000 -domain cube(0.1,0.1,0.2) -regularization 1
         -transform cut(cylinderi(.05,.05,0.0,0,0,1,0.027)) -o bloque5k
         -format 3dec
Info   : ---------------------------------------------------------------
Info   : Reading input data...
Info   : Creating domain...
Info   : Creating tessellation...
Info   :     > cylinderi(.05,.05,0.0,0,0,1,0.027)...
Info   :   - Setting seeds...
Info   :   - Generating crystal orientations...
Info   :   - Running tessellation...
Info   : Transforming tessellation...
Warning:   - Cutting (experimental)...
Info   :     > cylinderi(.05,.05,0.0,0,0,1,0.027)...
Info   :     [o] Writing file `tess.debug'...
face = 11369
edges = 20837 4775 4776 4879 4884 4885 9986 12389 12390 13652 13653 13654 13655 13838 15116 15117 16173 16174 16175 17339 17493 17494 17495 17959 17960 18914 18915 19267 19319 19320 19569 19570 19616 19617 19621 19742 19779 19780 19795 19796 19987 19988 19989 19990 4774 20843 21066 21070 22609 22939 22940 23041 23093 23328 23711 23724 23726 23808 24003 24042 24049 24051 24069 24078
Info   :     [o] Wrote file `tess.debug'.
Error  : You have discovered a bug in Neper!  Please file an issue at
         https://github.com/rquey/neper/issues.  Thank you.

Aborted
rquey commented 2 years ago

Thanks for the bug report.

Possible workaround in your case:

$ neper -T -n 5000 -domain "cube(0.1,0.1,0.2)" -o step1
$ neper -T -n 5000 -domain "cylinder(0.2,0.054,100):translate(0.023,0.023,0)" -morphooptiini "file(step1.tess)" -o 'bloque5k' -format '3dec'

(second command: diameter = 0.054, center = (0.05,0.05,0), we need to translate the original domain by 0.05-0.054/2=0.023)

mauromuniz commented 2 years ago

Yeah!! It seems to work! Thank you very much!!