mkseg - make a basic picture composed of line segments


#include "mpict_p.h"

PICT mksegl (mode, nseg, xc1, yc1, xc2, yc2)
int mode, nseg, xc1[], yc1[], xc2[], yc2[];

PICT mksegv (mode, nseg, xyxy);
int mode, nseg, xyxy[][4];


mkseg builds a vector picture based on two pairs of (x,y) coordinates for each vector that specify starting and ending points of the vector.

nseg is the number of line segments to build.

for mksegl, xc1 and yc1 are the arrays of coordinate pairs for the starting points; xc2 and yc2 are the arrays of coordinate pairs for the ending points. For mksegv each x1/y1/x2/y2 quadruple is a vector element (i.e., a row) of the two-dimensional array xyxy e.g.:

xyxy[][4] = {{xa0,ya0,xb0,yb0,{xa1,ya1,xb1,yb1},...}

If the value of mode is RC (for relative chaining) mkseg interprets the first starting point coordinate as an offset from an arbitrary origin. The ending point coordinate pairs are interpreted as offsets from their starting points while starting point coordinates are interpretes as offsets from the previous ending point. If mode is RO (for relative origin) then all coordinate pairs are interpreted as an offsets from a common origin.

mksegl and mksegv return a PICT, a pointer to picture structure that can be used as an argument to mkpic(3U) , mkpar(3U) , or mktop(3U) to build complex pictures.


mkvec(3U) , mkpic(3U) , mkpar(3U) , mktop(3U)


mkseg prints an error message and returns EOP for the following reasons: