Problem meshing off files

70 views
Skip to first unread message

Konstantinos Mountris

unread,
Nov 24, 2015, 2:06:34 PM11/24/15
to iso2mesh-users
Dear Doctor Fang,
I am trying to generate a two domains mesh, where a cad valve model is located in the aorta. I am importing two off files in iso2mesh and i am trying to generate the volumetric mesh of their combination unsucessfully. Could you help me spot the issue? I am not sure that i am setting correctly the bounding box of the geometry and possibly this could be the issue. I hope to hear from you soon.

Above is the matlab scrypt and the files i use to help you reproduce the problem.

clc; clear all; clear figure; close all;

%Add the necessary paths..

%addpath('path to the mesh2abaqus file')
addpath('/home/mood/Softwares/MATLAB/toolkits/iso2mesh_1.7.9')

%Read surfaces / They must be in format .off
[nodesurf1,facesurf1]=readoff('aorta5.off');
[nodesurf2,facesurf2]=readoff('valve20.off');

%repair surfaces for intersections
[nodesurf1,facesurf1]=meshcheckrepair(nodesurf1,facesurf1);
[nodesurf2,facesurf2]=meshcheckrepair(nodesurf2,facesurf2);

[nodeJoin,faceJoin]=mergemesh(nodesurf1,facesurf1, nodesurf2,facesurf2);

figure;
plotmesh(nodesurf1,facesurf1);
figure;
plotmesh(nodesurf2,facesurf2);

%get seeds
s1=surfseeds(nodesurf1(:,1:3),facesurf1(:,1:3));
s2=surfseeds(nodesurf2(:,1:3),facesurf2(:,1:3));

%set seeds
seeds=[s1 20;s2 20];

%set bounding box??
p0=min(nodesurf1);
p1=max(nodesurf1);

%mesh whole geometry
[node,elem,face]=surf2mesh(nodeJoin,faceJoin,p0,p1,1,[],seeds,[],0);

figure;
plotmesh(node(:,1:3),elem(:,1:4));




Best regards,
Konstantinos.
aorta5.off
valve20.off

Qianqian Fang

unread,
Nov 30, 2015, 1:42:35 PM11/30/15
to iso2mes...@googlegroups.com
On 11/24/2015 02:06 PM, Konstantinos Mountris wrote:
Dear Doctor Fang,
I am trying to generate a two domains mesh, where a cad valve model is located in the aorta. I am importing two off files in iso2mesh and i am trying to generate the volumetric mesh of their combination unsucessfully. Could you help me spot the issue? I am not sure that i am setting correctly the bounding box of the geometry and possibly this could be the issue. I hope to hear from you soon.

Above is the matlab scrypt and the files i use to help you reproduce the problem.

clc; clear all; clear figure; close all;

%Add the necessary paths..

%addpath('path to the mesh2abaqus file')
addpath('/home/mood/Softwares/MATLAB/toolkits/iso2mesh_1.7.9')

%Read surfaces / They must be in format .off
[nodesurf1,facesurf1]=readoff('aorta5.off');
[nodesurf2,facesurf2]=readoff('valve20.off');

%repair surfaces for intersections
[nodesurf1,facesurf1]=meshcheckrepair(nodesurf1,facesurf1);
[nodesurf2,facesurf2]=meshcheckrepair(nodesurf2,facesurf2);

[nodeJoin,faceJoin]=mergemesh(nodesurf1,facesurf1, nodesurf2,facesurf2);

hi Konstantinos

if the two surfaces intersect each other, you can not simply merge
them using mergemesh - mergemesh only concatenate two meshes
without checking intersections.

if you want to combine the two meshes, you may use mergesurf(),
however, it depends on surfboolean() and the libGTS utilies (gtsset.*).
Because libGTS is quite buggy, mergesurf often fails with errors.

one robust workflow to deal with this case is to rasterize both
surfaces into volumetric images of the same grid uzing s2v().
Then, merge the two volumes using simple addition so that
the enclosed areas are properly labeled. Then call v2m with
cgalmesh option to generate a tetrahedral mesh. This process
is slower, but valid result is guaranteed.

Qianqian


figure;
plotmesh(nodesurf1,facesurf1);
figure;
plotmesh(nodesurf2,facesurf2);

%get seeds
s1=surfseeds(nodesurf1(:,1:3),facesurf1(:,1:3));
s2=surfseeds(nodesurf2(:,1:3),facesurf2(:,1:3));

%set seeds
seeds=[s1 20;s2 20];

%set bounding box??
p0=min(nodesurf1);
p1=max(nodesurf1);

%mesh whole geometry
[node,elem,face]=surf2mesh(nodeJoin,faceJoin,p0,p1,1,[],seeds,[],0);

figure;
plotmesh(node(:,1:3),elem(:,1:4));




Best regards,
Konstantinos.
--
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.

Reply all
Reply to author
Forward
0 new messages