close all; clear all; clc;
[node1,face1,elem1]=meshanellip([0 0 0],[1 1 1], 1/10,0.4);
[node2,face2,elem2]=meshanellip([3 0 0],[3 1 1], 1/10,0.4);
[node3,face3,elem3]=meshanellip([0 0 1],[1 3 1], 1/10,0.4);
[newnode,newface] = mergemesh(node1,face1,node2,face2);
[newnode,newface] = mergemesh(newnode,newface,node3,face3);
figure;
plotmesh(newnode,newface, 'facecolor', 'w');
[newnode,newface] = surfboolean(node2,face2,'union', node1,face1);
[newnode,newface] = surfboolean(node3,face3,'union', newnode,newface);
figure;
plotmesh(newnode,newface, 'facecolor', 'w');On the other hand, when I use surfboolean and take the union of all the surfaces, it gives me the following:
I suspect, it is taking the 3rd ellipsoid as an open surface. Could you please guide what is wrong with my code and why can't I get the closed outer surface of the three ellipsoids?
Thank you for the great toolbox.I'm trying to make three ellipsoids intersect each other and then take their union to get the outer surface. My code is as follows:
close all; clear all; clc;
[node1,face1,elem1]=meshanellip([0 0 0],[1 1 1], 1/10,0.4);
[node2,face2,elem2]=meshanellip([3 0 0],[3 1 1], 1/10,0.4);
[node3,face3,elem3]=meshanellip([0 0 1],[1 3 1], 1/10,0.4);
[newnode,newface] = mergemesh(node1,face1,node2,face2);
[newnode,newface] = mergemesh(newnode,newface,node3,face3);
figure;
plotmesh(newnode,newface, 'facecolor', 'w');
[newnode,newface] = surfboolean(node2,face2,'union', node1,face1);
[newnode,newface] = surfboolean(node3,face3,'union', newnode,newface);
figure;
plotmesh(newnode,newface, 'facecolor', 'w');
If you see the first figure, it shows the merged ellipsoids.
On the other hand, when I use surfboolean and take the union of all the surfaces, it gives me the following:
I suspect, it is taking the 3rd ellipsoid as an open surface. Could you please guide what is wrong with my code and why can't I get the closed outer surface of the three ellipsoids?
--
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.
[newnode,newface] = surfboolean(node3,face3,'union', newnode,newface(:,[1 3 2]));you only need to pay attention when one of your surface operands
contains multiple enclosed shells.