Hello,
I have a multilayer-sphere mesh, is there a way to plot the layers similar to the below image using plotmesh ?
% plot exploded mesh components without surface-boolean [no1,fc1]=meshasphere([0 0 0],10,1); [no2,fc2]=meshasphere([0 0 0],20,1); [no3,fc3]=meshasphere([0 0 0],30,1.5); [no,fc]=mergemesh(no1,fc1,no2,fc2,no3,fc3); [node,elem]=s2m(no,fc,1,5,'tetgen',[0 0 0; 11 0 0; 21 0 0]); figure; hold on plotmesh([node(:,1)-10 ,node(:,2:3)],elem(elem(:,end)==3,:),'x<-10') plotmesh([node(:,1) ,node(:,2:3)],elem(elem(:,end)==2,:),'x<0') plotmesh([node(:,1)+10 ,node(:,2:3)],elem(elem(:,end)==1,:)) camlight; lighting phong % plot exploded mesh components with surface-boolean (cut by a bounding box) [nbbx,fbbx]=meshabox([-40 -40 -40],[0 40 40],20); [no,fc]=mergemesh(no1,fc1,no2,fc2(:,[1 3 2]),no3,fc3); %need to revert direction of the middle layer [nosph,fcsph]=surfboolean(no,fc(:,[1 3 2]),'resolve',nbbx,fbbx); % cut the 3-sphere by a box [node,elem]=s2m(nosph,fcsph,1,5,'tetgen',[-1 0 0; -11 0 0; -21 0 0; 1 0 0; 11 0 0; 21 0 0]); % create tet mesh figure; hold on plotmesh([node(:,1)-10 ,node(:,2:3)],elem(elem(:,end)==3,:)) plotmesh([node(:,1) ,node(:,2:3)], elem(elem(:,end)==2,:)) plotmesh([node(:,1)+10 ,node(:,2:3)],elem(elem(:,end)==1,:),'facecolor','r','linestyle',':') plotmesh([node(:,1)+10 ,node(:,2:3)],elem(elem(:,end)==4,:),'facecolor','r','linestyle',':') camlight; lighting phong
Thanks
--
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.