Merge two contacted (or touched) surface with different id

88 views
Skip to first unread message

illya

unread,
Feb 7, 2022, 2:46:37 PM2/7/22
to iso2mesh-users
Dear Professor,

I have two two contacted objects and their surfaces. And I need to obtain mesh with different id (last column in elem). Also i plan to use this mesh in mmc. Is it possible in iso2mesh (see code example) or need BlenderPhotonics software?

The example of code (objects are simple boxes) :

ISO2MESH_TETGENOPT='-Y -A';
[node1,face1,elem1]=meshabox([5 5 5],[10 10 10],1,1);
[node2,face2,elem2]=meshabox([-5 -5 10],[15 15 15],1,1);
ISO2MESH_TETGENOPT='';
[node,face]=surfboolean(node1,face1,'union',node2,face2);
% fprintf('\nRepair...\n');
% [node, face] = meshcheckrepair(node, face, 'intersect');
% fprintf('End of repair\n\n');
seeds = [7.5, 7.5, 7.5, 0.1; 5, 5, 12.5, 0.1];
[newnode, newelem, newface] = surf2mesh(node, face, [], [], 1, 0.01, seeds);

But there is an error

creating volumetric mesh from a surface mesh ...
error: Tetgen command failed:
Opening /tmp/iso2mesh-illya/post_vmesh.poly.
Constructing Delaunay tetrahedralization.
Warning:  Point 16 is identical with point 17.
Delaunay seconds:  0.000267
Creating surface mesh.
Warning:  Polygon 1 has two identical verts in facet 16.
Warning:  Polygon 1 has two identical verts in facet 28.
Perturbing vertices.
Delaunizing segments.
Constraining facets.
Error:  Invalid PLC.
  Two subfaces (55, 59, 72) and (47, 4, 51)
  are found intersecting each other.
  Hint:  Use -d switch to find all intersecting facets.

Best regards.

illya

unread,
Feb 10, 2022, 3:38:05 AM2/10/22
to iso2mesh-users
Dear Mr. Qianqian Fang.
Can you help me with this problem?

Franz Steiermark

unread,
Jun 30, 2022, 4:06:04 AM6/30/22
to iso2mesh-users

Hi Illya,

Both meshes need to intersect in order to be combine. I moved the second box upwards by one and now your code works.

ISO2MESH_TETGENOPT='-Y -A';
[node1,face1,elem1]=meshabox([5 5 5],[10 10 10],1,1);
[node2,face2,elem2]=meshabox([-5 -5 9],[15 15 15],1,1);
ISO2MESH_TETGENOPT='';
plotmesh(node2,face2);
[node,face]=surfboolean(node1,face1,'all',node2,face2);
plotmesh(node,face);
% fprintf('\nRepair...\n');
% [node, face] = meshcheckrepair(node, face, 'intersect');
% fprintf('End of repair\n\n');
seeds = [7.5, 7.5, 7.5, 0.1; 5, 5, 12.5, 0.1];
[newnode, newelem, newface] = surf2mesh(node, face, [], [], 1, 0.01, seeds);
plotmesh(newnode,newelem);

Best,
Franz
Reply all
Reply to author
Forward
0 new messages