surface smoothing problem

104 views
Skip to first unread message

Hasan CELIK

unread,
Feb 23, 2016, 10:24:30 PM2/23/16
to iso2mesh-users
Hello all developers and users of iso2mesh,

I need your suggestions on surface smoothing for jagged edges. I followed v2m-->sms--->surf2mesh to obtain mesh on my stack image taken from imageJ.
But as you may see in the attached file, the edges between two zones are still not very smooth. I need smooth surface between those zones therefore, I can apply boundary conditions there. Is there any other way to obtain smooth surfaces at the interface of two different zones?  latticegrid may be a solution; I have checked "help latticegrid" but I couldn't find a way to apply it to my problem.

I am looking forward to hearing your suggestions.

Thank you!
edge.png

Qianqian Fang

unread,
Feb 27, 2016, 5:34:25 PM2/27/16
to iso2mes...@googlegroups.com
for simple geometries, generating meshes from primitives gives
you the best mesh quality.

how does the following script work for your two-cube domain?

[no1,fc1]=meshabox([0 0 0], [60 60 60], 4);
[no1,fc1]=removeisolatednode(no1,fc1);
[no2,fc2]=meshabox([20 20 20], [40 40 40], 1);
[no2,fc2]=removeisolatednode(no2,fc2);
[no,fc]=mergemesh(no1,fc1,no2,fc2);
seeds=[1 1 1; 30 30 30];
[node,elem]=surf2mesh(no,fc,[],[],1,6,seeds,[]);
plotmesh(node,elem,'x>30')

Qianqian


I am looking forward to hearing your suggestions.

Thank you!
--
You received this message because you are subscribed to the Google Groups "iso2mesh-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to iso2mesh-user...@googlegroups.com.
To post to this group, send email to iso2mes...@googlegroups.com.
Visit this group at https://groups.google.com/group/iso2mesh-users.
For more options, visit https://groups.google.com/d/optout.

Hasan CELIK

unread,
Mar 2, 2016, 11:18:58 PM3/2/16
to iso2mesh-users
Dear Qianqian,

Thank you so much for your suggestion and help. It helped me a lot. Actually, I was trying to simulate porous media domain by creating rectangles from images because I am not able to mesh my real porous images taken from micro CT. So, I have used very simple images to understand the meshing procedure.

It may be easier maybe to request your help and suggestions on the procedure for meshing my micro CT images, I guess because I do not have any idea why I can’t mesh it. I have attached a stack which contains 5 images. I have used only 5 images just for simplicity. I read this stack file into MATLAB and used the commands in the firsttry.m file.However, I got self-intersecting elements error. I think I need to smooth my surfaces somehow; but I have no idea. To solve this intersecting issue, I followed the steps that you suggested in FAQ file and some other posts in the group but no hope; I could not solve the error. So, I have changed my script file (secondttry.m) and it start running and then fails on Windows but it works on Mac OSX. On Windows, it gives out of memory error so I guess, I need 64bit version of iso2mesh binaries for Windows OS. Also, this script file takes too long time so I should simplify my procedure somehow.

So I need your help on 2 points. One of them is, may you compile 64-bit version of cgalmesh any other binaries that I need for me? And secondly, can you help me simplifying my mesher file? I think it should work and I should get a result soon or later because it works for simpler geometries. However, it fails.
I don’t need extra fine mesh, coarser mesh is okay for me as I found a way to create my geometry using iso2mesh mesh file in the commercial solver that we have (Comsol) so I just need a mesh to create a geometry.

I am very thankful for your help.
realporous.tif
secondtry.m
firsttry.m

Qianqian Fang

unread,
Mar 2, 2016, 11:59:19 PM3/2/16
to iso2mes...@googlegroups.com
On 03/02/2016 11:18 PM, Hasan CELIK wrote:
Dear Qianqian,

Thank you so much for your suggestion and help. It helped me a lot. Actually, I was trying to simulate porous media domain by creating rectangles from images because I am not able to mesh my real porous images taken from micro CT. So, I have used very simple images to understand the meshing procedure.

hi Hasan

I could not run your test script, it failed when loading
the realporous.tif file - matlab only loaded the first 6
slides and failed to load the 7th slice. Here is the error

Error using rtifc
Invalid TIFF image index 7.

Error in readtif (line 49)
[X, map, details] = rtifc(args);

Error in imread (line 416)
    [X, map] = feval(fmt_s.read, filename, extraArgs{:});

It may be easier maybe to request your help and suggestions on the procedure for meshing my micro CT images, I guess because I do not have any idea why I can’t mesh it. I have attached a stack which contains 5 images. I have used only 5 images just for simplicity. I read this stack file into MATLAB and used the commands in the firsttry.m file.However, I got self-intersecting elements error. I think I need to smooth my surfaces somehow; but I have no idea. To solve this intersecting issue, I followed the steps that you suggested in FAQ file and some other posts in the group but no hope; I could not solve the error. So, I have changed my script file (secondttry.m) and it start running and then fails on Windows but it works on Mac OSX. On Windows, it gives out of memory error so I guess, I need 64bit version of iso2mesh binaries for Windows OS. Also, this script file takes too long time so I should simplify my procedure somehow.

you want to start with a coarse surface model. Try to
change the opt.distbound and opt.radbound to get
the desired surface density.

So I need your help on 2 points. One of them is, may you compile 64-bit version of cgalmesh any other binaries that I need for me? And secondly, can you help me simplifying my mesher file?

let's get your sample script work first. Your tif file
is pretty big to be shared in the mailing list. You can
check your file, and upload it somewhere? or email it
to me directly.

Qianqian

Hasan CELIK

unread,
Mar 3, 2016, 1:06:31 AM3/3/16
to iso2mesh-users
Dear Qianqian,

Thank you very much. I am sending an e-mail to you now over this e-mail list.

Thank you
Reply all
Reply to author
Forward
0 new messages