CGAL 3D mesher

165 views
Skip to first unread message

nathan jeffery

unread,
Oct 7, 2014, 10:40:46 AM10/7/14
to iso2mes...@googlegroups.com
Hi All,
Still struggling with the irregular, jagged, boundaries the cgal option creates with vol2mesh. Looking at the cgal site (http://cgal-discuss.949826.n4.nabble.com/Smooth-3D-mesh-from-segmented-labeled-CT-scans-td4656333.html), it doesn't look hopeful that they will implement a solution anytime soon. As an interim, I am thinking of generating my two parts separately with vol2mesh (cgal option) and then merging the two resulting meshes using mergemesh combined with meshcheckrepair. Any thoughts or experiences I could learn from?
cheers
nathan

Qianqian Fang

unread,
Oct 7, 2014, 1:44:10 PM10/7/14
to iso2mes...@googlegroups.com
On 10/07/2014 10:40 AM, nathan jeffery wrote:
Hi All,
Still struggling with the irregular, jagged, boundaries the cgal option creates with vol2mesh. Looking at the cgal site (http://cgal-discuss.949826.n4.nabble.com/Smooth-3D-mesh-from-segmented-labeled-CT-scans-td4656333.html), it doesn't look hopeful that they will implement a solution anytime soon. As an interim, I am thinking of generating my two parts separately with vol2mesh (cgal option) and then merging the two resulting meshes using mergemesh combined with meshcheckrepair. Any thoughts or experiences I could learn from?

hi Nathan

you can certainly tweak iso2mesh so that the
jaggedness on the boundaries can be reduced.
It is not an elegant solution, sometimes requires
some parameter tuning, but it works in many cases.

let me start from some background. Overall,
iso2mesh has two meshing workflows:

volume->surface mesh->tetrahedral mesh
or
volume->tetrahedral mesh

the second workflow was enabled by the cgal 3D
mesher (v2m/vol2mesh with 'cgalmesh' option). it
is fully automatic, but, due to the very reason you
mentioned, it has weaknesses.

the first workflow gives you the fine-grained tuning
ability to control the mesh quality. Given the access to
the individual surfaces, you can perform smoothing or
resampling to control the meshing details. However,
you may run into the risk of self-intersecting elements,
and failure in the surf2mesh step. So, it's weakness is
mostly robustness.

Regarding your question, my current hack is to go
along the first workflow and insert a mesh
smoothing step, outlined below (assuming you volume
is a multi-labeled domain):

1. use surf2mesh() to create a set of surfaces,
including both outer/inner boundaries.

2. use sms/smoothsurf to apply a mild smoothing
to the surface (if smooth too much, elements may
intersect)

3. call s2m/surf2mesh to mesh the smoothed surface.

Here is an example:
% use a sample volume from a demo script
cd iso2mesh/sample
demo_label_sizing
close all % all I need is the image volume from the above script

% create a tet/surface mesh first
maxvol='1=2:2=1:3=2:4=1';
[no,el,fc]=v2m(image,[],5,maxvol,'cgalmesh');

% cgalmesh returns two facts for each triangle, remove duplicates
newfc=unique(sort(fc(:,1:3),2),'rows');
% smoothing the surface group
newno=sms(no(:,1:3),newfc(:,1:3),20,0.5);
% create volumetric mesh from the smoothed surfaces
seeds=repmat([35 25 15 5]',1,3)/sqrt(3); % use to label the region
[node,elem,face]=surf2mesh(newno(:,1:3),newfc,[],[],1,2,seeds);

% making plots, compare the smoothness of all surfaces
subplot(221)
plotmesh(no(:,1:3),newfc,'x>y')
view([0 1 0])

subplot(222)
plotmesh(node(:,1:3),face(:,1:3),'x>y')    
view([0 1 0])

subplot(223)
plotmesh(no(:,1:3),el,'x>y')
view([-1 1 0])

subplot(224)
plotmesh(node(:,1:3),elem,'x>y')
view([-1 1 0])
the resulting plot is attached.

the roughness of the internal/external surfaces is
apparently reduced. The surface smoothing does
not do a good job at the surface junctions (1D manifold),
but interior cuts look quite smooth.

To make this better, I plan to add a surface junction
extraction function and apply smoothing along the
junction loops. This may likely generate a clear cut
both on the inside and the outside surfaces.

Qianqian

cheers
nathan
--
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.

surface_smoothing_cgalmesh.png

nathan jeffery

unread,
Oct 10, 2014, 4:07:13 AM10/10/14
to iso2mes...@googlegroups.com
Many thanks Qianqian,
Tried it out and looks much better, but as you note interfaces at the surface (e.g. where label x, label y and exterior meet) are still a little irregular. In my FE I have a surface junction between two materials with very different moduli so these jagged edges are causing problems. Will try tweaking. Looking forward to seeing the surface junction extraction. Thanks again for your great efforts.
nathan
Reply all
Reply to author
Forward
0 new messages