11.93 Sample ‘pipe

Function pipe is similar to flow but draw pipes (tubes) which radius is proportional to the amplitude of vector field. The color scheme is used for coloring (see Цветовая схема). At this warm color corresponds to normal flow (like attractor), cold one corresponds to inverse flow (like source).

MGL code:

call 'prepare2v'
call 'prepare3v'
subplot 2 2 0 '':title 'Pipe plot (default)':light on:box:pipe a b
subplot 2 2 1 '':title '"i" style':box:pipe a b 'i'
subplot 2 2 2 '':title 'from edges only':box:pipe a b '#'
subplot 2 2 3:title '3d variant':rotate 50 60:box:pipe ex ey ez '' 0.1

C++ code:

void smgl_pipe(mglGraph *gr)
{
	mglData a,b;	mgls_prepare2v(&a,&b);
	if(big!=3)	{gr->SubPlot(2,2,0,"");	gr->Title("Pipe plot (default)");}
	gr->Light(true);	gr->Box();	gr->Pipe(a,b);
	if(big==3)	return;
	gr->SubPlot(2,2,1,"");	gr->Title("'i' style");	gr->Box();	gr->Pipe(a,b,"i");
	gr->SubPlot(2,2,2,"");	gr->Title("'\\#' style");	gr->Box();	gr->Pipe(a,b,"#");
	mglData ex,ey,ez;	mgls_prepare3v(&ex,&ey,&ez);
	gr->SubPlot(2,2,3);	gr->Title("3d variant");	gr->Rotate(50,60);
	gr->Box();	gr->Pipe(ex,ey,ez,"",0.1);
}

Sample pipe