Falk Joensson's
Eas (Easy Application Script)

Rendering 2D Drawings:04. Drawing Shapes

DRAW:(x1 y1) (x2 y2) ... describes a (zigzag) line to draw straight lines will connect the points given as (x y) vectors of which there must be at least two if the coordinate system is set to radial, x is the clockwise angle in degrees, and y is the magnitude in percent of the circle or ellipse described by the coordinates box in DRAW'HERE a little helper to remember the order of radial coordinates: x looks like a compass cross, y may stand for "yield" or "yards", or think of hiking: first you pick a direction (angle), then you walk a distance (magnitude) you can pass the shape also contained in a single vector variable example: s ((0 0) (50 100) (100 0)) DRAW:s -- draws the open triangle s DRAW:(x1 y1) (x2 y2) ... 0 a 0 after the last point will close the shape (otherwise it is only a line or curve and cannot be filled) think of it as "return to point 0" or "close the circle/ring/loop" (setting the last point to the coordinates of the first does not close the shape, so always use the 0 for closing!) DRAW:((x1 y1) (x2 y2) ...) the whole drawing can also be given as a single-parameter vector holding all the point definitions and optionally the closing 0 DRAW:(x1 y1 t1 0) (x2 y2 t2 0) ... for each drawing point you can set a type three types are supported: 0 = pull point (straight lines, default) 1 = blow point (natural curve) 2 = whip point (straight line that lashes out) you can also set in-between types of these: 0<t<1 = blow-pull points 1<t<2 = whip-blow points whip points draw a straight line to the neighboring point with the lower type and lash a curve out to the other point if both neighbors have the same type, the whip breaks and both legs behave like independent loose-end whips as a loose end of a curve, whip points are somewhere in between a pull and a blow point
DRAW:(n x y t 0) ... each point can have a name prefix string n of the format [a-zA-Z]\w* to create a hook for later shapes DRAW:(r x y t 0) ... each point of a shape can have a relativeness prefix string r its format is (\d*|[a-zA-Z]\w*)-?[+<] \d* sets the coordinate origin for this point to the n-th previous point, if such exists if no number is given or it is 0, 1 is used [a-zA-Z]\w* uses the hook of this name + sets Cartesian coordinates for this point < sets radial coordinates for this point - spins the relative coordinate system for this point in the direction of the n-th previous vector, if such exists examples: "+" = Cartesian on previous point "-+" = Cartesian on previous vector "<" = radial on previous point "-<" = radial on previous vector "2+" = Cartesian on second-previous point "11-<" = radial on 11-th previous vector "knee-+" = Cartesian on vector to "knee"
04. Drawing Shapes
D Download Eas 4B
O Donate
C Contact
Esc Search / Table of Contents