Hi everybody,
Can I create a tetrahedral mesh of a larger cube minus a smaller cube similar to one in the picture below? The result is however not good for me since it contain hanging nodes.
I got this result by
[node2,face2,elem2]=meshabox([-1,-1 0],[1 0 1],0.1,1);[node3,face3,elem3]=meshabox([-1,0, 0],[0 1 1],0.1,1);[node4,face4,elem4]=meshabox([-1,-1, -1],[1 1 0],0.1,1);[newnode,newelem]=mergemesh(node2,elem2,node3,elem3,node4,elem4);
[no,fc,c0]=latticegrid(-1:1,-1:1,-1:1);% create a 3d lattice grid
newfc=cell2mat(fc) % all the faces of the lattice
[ix,jx]=find(newfc==size(no,1)); % find the 3 faces connected to the corner point
newfc(ix,:)=[]; % remove them
newfc=num2cell(newfc,2) % convert the face node list back to cell
[node,elem]=s2m(no,newfc,1,0.001); % mesh the lattice with a broken corner
% [node,elem]=s2m(no,newfc,1,0.001,'tetgen',c0); % call this if you want to distinguish the cubes
plotmesh(node,elem) % plot the mesh
mask=zeros(4,4,4);% create a 3d 0-1 binary mask of your shape
mask(2:3,2:3,2:3)=1;
mask(3,3,3)=0; % remove the corner voxel
[no,fc]=binsurface(mask); % create the triangular boundary of the shape
no=no-2;
[node,elem]=s2m(no,fc,1,0.001); % create the tet mesh of the shape
plotmesh(node,elem)
--
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.
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.