[surf2mesh] Intersections

110 views
Skip to first unread message

Nerea Mangado

unread,
Nov 14, 2014, 10:58:58 AM11/14/14
to iso2mes...@googlegroups.com
Dear all,

I'm trying to create a volumetric mesh from a surface mesh with intersection. For that, I started with a simple example,  with two  geometries created by iso2mesh. 

[nbox,fbox,ebox]=meshabox([-5 -5 -5],[5 5 5],1, 1);
[nsph,fsph,esph]=meshasphere([0 0 5],3,1,1);

In order to obtain the volume, I used surf2mesh. However, it doesn't work properly. I think that maybe the surfaces could be not closed or with some bad definition.

I used mergemesh, combinations of surfboolean parameters, meshcheckrepair, etc.. but at the end,  I am not able to find the way to obtain the right surfaces that surf2mesh is able to mesh, maintaining the three different volumes created by the intersection.

Has anyone dealt with this problem of intersections before? Does anyone have some hints on where the problem might lie?
Thank you for any help you can provide,

Best regards,

Nerea

Qianqian Fang

unread,
Nov 14, 2014, 1:51:07 PM11/14/14
to iso2mes...@googlegroups.com
hi Nerea

I think this is right now the weakest link in the whole
iso2mesh pipeline - removing self-intersecting elements
from a complex multi-component surface. unfortunately,
no tool I am aware of at this point that can achieve this.

If you have a single closed surface, meshcheckrepair('meshfix')
seems to work well (except occasionally failed on Windows),
however, when you have multiple surfaces meet at some
joints, the meshfix utility (the backend of meshcheckrepair)
fails.

the only robust workaround I am aware of is to rasterize the
surfaces into volumes using s2v and combine them into a
multi-label field. Then extract a new mesh using v2m. For
your example, you will have to do the following:


[nbox,fbox,ebox]=meshabox([-5 -5 -5],[5 5 5],1, 1);
[nsph,fsph,esph]=meshasphere([0 0 5],3,1,1);

% rasterize the surfaces over a common grid
dx=0.1;
xi=-5.2:dx:5.2;
yi=-5.2:dx:5.2;
zi=-5.2:dx:8.2;
imbox=surf2vol(nbox,fbox,xi,yi,zi);
imsph=surf2vol(nsph,fsph,xi,yi,zi);
% make a solid from the outline
imbox=fillholes3d(imbox,1);
imsph=fillholes3d(imsph,1);   
% merge the two labels into a new labeled field   
imboth=imsph+(imbox*2);        
% imagesc(squeeze(imboth(50,:,:)))

% extract a mesh from the combined volume
[node,elem,face]=v2m(uint8(imboth),[],3,5,'cgalmesh');
plotmesh(node(:,1:3),elem,'x>50')

I am showing you the resulting mesh in the attached figure.
You will notice that the exterior surface will not be perfectly
smooth. To improve the accuracy, you will have to reduce "dx"
and the v2m mesh size inputs.

In the future, a robust mesh repairing utility is going to be
critical for a fully automated meshing workflow.

Qianqian


Best regards,

Nerea
--
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 http://groups.google.com/group/iso2mesh-users.
For more options, visit https://groups.google.com/d/optout.

The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.

mesh_repair_via_rasterization.png

Nerea Mangado

unread,
Nov 27, 2014, 4:48:30 AM11/27/14
to iso2mes...@googlegroups.com
Dear Qianqian,

Thank you fast reply. Unfortunately, I am not able to process my original meshes by means of converting them into image (v2m). 
It's extremely (computationaly) expensive when I improve the accuracy.
I will keep trying it with others meshes.Thank you for you answer.

Best regards,
Nerea



El divendres 14 de novembre de 2014 19:51:07 UTC+1, Qianqian Fang va escriure:

Qianqian Fang

unread,
Nov 28, 2014, 6:35:38 PM11/28/14
to iso2mes...@googlegroups.com
On 11/27/2014 04:48 AM, Nerea Mangado wrote:
Dear Qianqian,

Thank you fast reply. Unfortunately, I am not able to process my original meshes by means of converting them into image (v2m). 
It's extremely (computationaly) expensive when I improve the accuracy.
I will keep trying it with others meshes.Thank you for you answer.

hi Nerea

please checkout the two new rasterization functions I just
mentioned in my response to Jeremiah's question:

https://groups.google.com/forum/?hl=en#!topic/iso2mesh-users/TzGn4dghksc

the mesh2vol function can be much faster than s2v when processing
large volumes.

please give it a try if you are interested.

Qianqian

Nerea Mangado

unread,
Dec 4, 2014, 5:03:24 AM12/4/14
to iso2mes...@googlegroups.com
Hi Qianqian, 

I'll check it, for sure. Thank you for mention it.

Best regards,



El dissabte 29 de novembre de 2014 0:35:38 UTC+1, Qianqian Fang va escriure:
Reply all
Reply to author
Forward
0 new messages