neperfepx / neper

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

tesr to mesh #206

Closed ThomasChauve closed 3 years ago

ThomasChauve commented 3 years ago

Hello, Thanks for the tools you provide. I was trying to do transform a tesr to mesh and I got an error. My tesr is a custom one build for a VTK file. Therefore it can be no written correctly. Anyway I got this error :

neper -M CI02_539x495_micro.tesr
========================    N   e   p   e   r    =======================
Info   : A software package for polycrystal generation and meshing.
Info   : Version 4.1.2
Info   : Built with: gsl|muparser|opengjk|openmp|nlopt
Info   : Running on 16 threads.
Info   : <https://neper.info>
Info   : Copyright (C) 2003-2020, and GNU GPL'd, by Romain Quey.
Info   : No initialization file found (`/home/chauvet//.neperrc').
Info   : ---------------------------------------------------------------
Info   : MODULE  -M loaded with arguments:
Info   : [ini file] (none)
Info   : [com line] CI02_539x495_micro.tesr
Info   : ---------------------------------------------------------------
Info   : Reading input data...
Info   :   - Reading arguments...
Info   : Loading input data...
Info   :   - Loading raster tessellation...
Info   :     [i] Parsing file `CI02_539x495_micro.tesr'...
Info   :     [i] Parsed file `CI02_539x495_micro.tesr'.
Info   :   - Reconstructing topology...
Info   :     > Reconstructing 1D mesh... 100%      
Info   :     > Reconstructing 0D mesh... 100%      
Error  : You have discovered a bug in Neper!  Please file an issue at
         https://github.com/rquey/neper/issues.  Thank you.

Here is the input file. I just rename the '.tesr' ' to '.txt' as github was not ok to take 'tesr' CI02_539x495_micro.txt

Therefore I have a couple of question :

  1. Is it possible to give a VTK as input in neper ?
  2. Is it possible to build a mesh from a 3D raster file ? (from the doc it seems not possible)
  3. Overwise do you have over tools to recommand to mesh a 2D/3D microstructure for an experimental raster image ?

Thanks for the great work. Best Thomas Chauve

PS: I am using Ubuntu 20.04 and Neper 4.1.2

rquey commented 3 years ago

You just have to filter your tesr before meshing to solve topological issues, using -transform rmsat,grow:

$ neper -T -loadtesr CI02_539x495_micro.txt -transform "rmsat,grow" -o filtered
$ neper -M filtered.tesr -rcl 0.5 -mesh2dalgo fron,dela
$ neper -V filtered.tesr,filtered.msh -datavoxedgerad 0 -datacellcol id -dataelsetcol id -imagesize 600:600 -cameraangle 12 -showelt1d all -dataelt1drad 0.2 -showtesr 1 -showmesh 0 -print filtered-tesr -showtesr 0 -showmesh 1 -print filtered-mesh

(-transform changes only 3 pixels...)

image image

Neper does not take VTK files as input, and it can mesh a 3D tesr by approximating it as a tess (-morpho tesr:file()), see Quey and Renversade, 2018.