clc;clearall;closeall;%Outerboundary%Drawthecubecb=zeros(8,3);cb([5:8,11,12,15,16,18,20,22,24])=2;cb(9,:)=ones(1,3);cb=cb-ones(9,3);d=[1243156875624873];plot3(cb(d,1),cb(d,2),cb(d,3),'k-');axisequal%Seedings=4e3;x=2*rand(s,1)-1;y=2*rand(s,1)-1;z=2*rand(s,1)-1;%Addmirrorptsxx=[x;-2-x;2-x;x;x;x;x];yy=[y;y;y;-2-y;2-y;y;y];zz=[z;z;z;z;z;-2-z;2-z];%Voronoi[V,C]=voronoin([xx,yy,zz]);%Visualisationfork=1:length(C)ifall(C{k}~=1)%notinfinityVerts=V(C{k},:);CoordAbs=abs(Verts(:));ifall(CoordAbs=1+eps(single(1)))%withinboundaryVertHull=convhulln(Verts);patch('Vertices',Verts,'Faces',VertHull,'FaceColor',rand(3,1),'EdgeColor','None');endendendview(3)set(gcf,'color','w');axisoff