function d6_visualize_shifts
	BB_6dir_box_spline.shifts(1,:,:) =...
		[0, 0, 0;	
		 0, 1, 1;
		 1, 0, 1;
		 1, 1, 0;
		-1, 0, 1;
		-1, 1, 0;
		 0,-1, 1;
		 0, 1,-1;
		 1,-1, 0;
		 1, 0,-1;
		 0,-1,-1;
		-1, 0,-1;
		-1,-1, 0;
		 2, 0, 0;
		 0, 2, 0;
		 0, 0, 2];
	BB_6dir_box_spline.shifts(2,:,:) =...
		[0, 0, 0;
		 0, 1, 1;
		 1, 0, 1;
		 1, 1, 0;
		 1, 1, 2;
		 1, 2, 1;
		 2, 1, 1;
		 0, 2, 0;
		-1, 1, 0;
		 0, 1,-1;
		 2, 0, 0;
		 1,-1, 0;
		 1, 0,-1;
		 0, 0, 2;
		-1, 0, 1;
		 0,-1, 1];
	BB_6dir_box_spline.coeffs(1,:,:) =...
	   [12,12, 8, 4,12,12, 8, 8, 8, 4,12,12, 8,12,12, 8, 8, 8, 8, 4;
		 1, 1, 0, 0, 2, 2, 0, 4, 4, 4, 2, 2, 0, 4, 4, 8, 4, 4, 8, 4;
		 1, 2, 4, 4, 1, 2, 4, 0, 0, 0, 2, 4, 8, 2, 4, 0, 4, 8, 4, 4;
		 1, 2, 4, 4, 2, 4, 8, 4, 8, 4, 1, 2, 4, 2, 4, 4, 0, 0, 0, 0;
		 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 2, 0, 0, 2, 0, 0, 4, 0, 4, 4;
		 1, 0, 0, 0, 2, 0, 0, 4, 0, 4, 1, 0, 0, 2, 0, 4, 0, 0, 0, 0;
		 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 4, 4, 0, 4;
		 1, 1, 0, 0, 2, 2, 0, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0;
		 1, 2, 4, 4, 0, 0, 0, 0, 0, 0, 1, 2, 4, 0, 0, 0, 0, 0, 0, 0;
		 1, 2, 4, 4, 1, 2, 4, 0, 0,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 0, 0, 0, 0, 0, 0, 0, 0, 0;
		 0, 0, 0, 0, 0, 0, 0, 4, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0;
		 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0;
		 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0;
		 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 4;
		 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 4;
		 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4];
	BB_6dir_box_spline.tets(1,:,:) =...
		[0,0,0;
		1,0,0;
		0,1,0;
		0,0,1];
	BB_6dir_box_spline.tets(2,:,:) =...
		[1,1,1;
		0,1,0;
		1,0,0;
		0,0,1];

	multi_index =...
	   [3,0,0,0;
		2,1,0,0;
		1,2,0,0;
		0,3,0,0;
		2,0,1,0;
		1,1,1,0;
		0,2,1,0;
		1,0,2,0;
		0,1,2,0;
		0,0,3,0;
		2,0,0,1;
		1,1,0,1;
		0,2,0,1;
		1,0,1,1;
		0,1,1,1;
		0,0,2,1;
		1,0,0,2;
		0,1,0,2;
		0,0,1,2;
		0,0,0,3];

	f = [1,2,3;1,2,4;1,3,4;2,3,4];

	fcolor = [1,.8,.5;.5,.8,1];
	ecolor = [1,0,0;0,0,1];

	figure(1);
	shift = [0,0,0];
	tet = zeros(4,3);
	for itype=1:2
		for i=1:16
			clf;
			daspect([1,1,1]);
			for j=1:16
				shift(:) = BB_6dir_box_spline.shifts(itype,j,:);
				hold on;
				plot3(shift(1),shift(2),shift(3),'o','MarkerFaceColor','none','MarkerEdgeColor','black','MarkerSize',5);
			end
			view([2,1,.5]);
			xlim([-3,4]);
			ylim([-3,4]);
			zlim([-3,4]);
			tet(:,:) = BB_6dir_box_spline.tets(itype,:,:);
			patch('Faces',f,'Vertices',tet,'FaceColor',fcolor(itype,:),'FaceAlpha',.5,'EdgeColor',ecolor(itype,:));
			for j=1:20
				coords = multi_index(j,:)*tet/3;
				hold on;
				text(coords(1),coords(2),coords(3),sprintf('%d',BB_6dir_box_spline.coeffs(itype,i,j)));
			end
			shift(:) = BB_6dir_box_spline.shifts(itype,i,:);
			hold on;
			plot3(shift(1),shift(2),shift(3),'o','MarkerFaceColor','black','MarkerEdgeColor','black','MarkerSize',5);
			hold on;
			text(shift(1),shift(2),shift(3),sprintf(' (%d,%d,%d)',shift));
			render_support(shift);
			pause
		end
	end

function render_support(offset)
	v = [ 2, 0,-1;
		  2,-1, 0;
		  2, 0, 1;
		  2, 1, 0;	%	4
		 -2, 0,-1;
		 -2,-1, 0;
		 -2, 0, 1;
		 -2, 1, 0;	%	8
		  0, 2,-1;
		 -1, 2, 0;
		  0, 2, 1;
		  1, 2, 0;	%	12
		  0,-2,-1;
		 -1,-2, 0;
		  0,-2, 1;
		  1,-2, 0;	%	16
		  0,-1, 2;
		 -1, 0, 2;
		  0, 1, 2;
		  1, 0, 2;	%	20
		  0,-1,-2;
		 -1, 0,-2;
		  0, 1,-2;
		  1, 0,-2];	%	24
	e = [1,2; 2,3; 3,4; 4,1;
		5,6; 6,7; 7,8; 8,5;
		9,10;10,11;11,12;12,9;
		13,14;14,15;15,16;16,13;
		17,18;18,19;19,20;20,17;
		21,22;22,23;23,24;24,21;
		1,24;2,16;3,20;4,12;
		5,22;6,14;7,18;8,10;
		11,19;9,23;17,15;13,21];

	for i=1:size(e,1)
		hold on;
		line([v(e(i,1),1);v(e(i,2),1)]+offset(1),...
			[v(e(i,1),2);v(e(i,2),2)]+offset(2),...
			[v(e(i,1),3);v(e(i,2),3)]+offset(3),'Color','black');
	end
