OBJECTS CREATION
Standard objects in METAGRAF are created acording with a sequence of steps that almost always begins clicking the corresponding button for the object and then clicking and dragging the mouse on the screen. This is so for all geometric objects (exception: the Point object). Now we will see some peculiarities that must be known in relation with every object.
RECTANGLE.- This object is a typical example. As we dragg the pointer of the mouse IN ANY DIRECTION we can see the shape of the object as it is created. When we click the right mouse button we can see that the red color that had the object as it was created, changes to black. A black color means that the object "is there" and that it is not selected, We can also observe that the mouse cursor has changed from a little crosshair to a small hand one. This is the cursor for the RESET situation, so the first thing to do is to click the right mouse button. As soon as we do that, the cursor changes to its reset shape that lets us do any other activity.
The steps done for the rectangle are the usual ones for any other object in relation with the creation and the need to click the right mouse button, so we will not come back to this point. Once the object is created, it is possible that it has the dimensions and is located at the exact position that we wanted. Usually this is not so, so a small precission work must be done. To translate the object in any direction it is enough to select it (to click on its boundary or the inner part) and clicking and dragging the pointer mouse we will see that the original object moves at the same time and in the same direction. Alternatively, when one or more objects are selected, they can be translated with the arroweys on the keyboard. The selected object or its boundary must be always of red color. This system of translating objects is the same for all objects or groups of objects at any moment.
If we want to change its dimensions, we select it to have it of red color and small bullets on the corners. Then is the moment to select with precission one of this corners. Once this is acomplished, clicking and dragging the mouse pointer we will see that the object changes its dimensions. The rectangle object, and exactly the same the oval one (before any afine transformation) change their size maintaining its axis parallel to the coordinates axis.
One aspect to be mentioned is the fact that when we create an object with any grid on the screen, the coordinates of the object work in the socalled "snap-to-grid" mode. Depending on the grid used, this coordinates will be millimeters, double millimeters, and so on. All the corners of the object will be placed in intersection points of the grid.
This is so at the time of the creation, and if we translate the object with the mouse, it will be translated from the original intersection point of the grid to another intersection point. This can be very important if we want our final drawing with perfect joints. Nevertheless, it is very simple to change this behaviour as it changes accordind with the grid on the background. If we prefer continous positioning the simplest thing is to choose the "white paper" as the background or the "pixel grid". When changing the grid, the object will remain in the same place as it was, althought now it can be in a place where its corners are not situated on the intersection points of the new grid. Anyway, the possibles mouvements will follow the new grid.
What we have explained lately is the "simple" way of working and will remain like that for all objects as long as we don't transform them. (From now on, when the word "transformation" is writen it must be understood "affine transformation"). When we transform an object, its behaviour changes in some way. Technically, the transformation changes the original coordinates of the points that define the object from "integers" to "double" or "float". Apart from that, in some cases the effect of the transformations is deeper as in the case of the rectangle and the oval. For this two objects, when we transform any one of them it is changed into a totally different object defined in a totally different way. So, once one of those objects is transformed, if we select it we will not see anymore the points in the corners and we can not modify its shape with the mouse. We can do everything with it but in a different way and always trough transformations, with the sole exception of translations movements that can be done as always.
It can be convenient to say some words about the "right line". It is a very simple object but some properties must be mentioned. It is created as usual. Once done, for selecting it, it is convenient to know that it is enough to click in any part of the rectangle with sides parallel to the coordinate axis and which diagonal is our line. This seems very simple, but sometimes it can be a little bit tricky, most of all with vertical and horizontal lines. We know that another way of selecting an object is just by clicking and dragging the mouse pointer in such a way as to include our object in the red rectangle produced by this mouvement. Another one would be to click in the "one-up/one-down arrow button" that selects consecutively all the objects (the same is obtained pressing the "q" key). Also, if little movement is required, the best way to proceed is to select the line and move it with the key arrows on the keyboard. Each click moves the object one pixel in the direction of the arrow. If a finger is maintained over the key, the mouvement is not too slow. Finally, we will say that by selecting one of the extrems of the line, this one can be modified in length and position regarding rotation, and that this object is an exception to the general rule in the sense that it does not chage its behaviour when transformed. (A point must be mentioned. If an object is translated using the arrow-keys, and there is a mesh as background of the drawing panel, the object can be put in an "out-of-the-grid" state. Then, selecting one of its corners, for examaple, will be impossible. So care is recommended. The solution always is to change to the "white-paper" background.
BEZIER-CIRCLE.- This is the usual and recomended circle to use when no very small sizes are required. It has also the advantage of little change in behaviour after transformation, so, for example, the size can be increased or decreased with the mouse. When we create it in the same way as always (clicking and dragging) the red circle appears with a point in the center (just for reference) an another one at the righr extreme. This last one can be used lately to change the diameter of the circle clicking the mouse on it and dragging to the outside (increase the diameter) or to the inside (diminish the diameter). When transformed trough rotation around x or y axis, the circle changes to an oval or ellipse, but the point will remain and the size can be modified at any moment, always in the same controlling way.
SPIRAL-CIRCLE.- This object has been implemented specifically for creating spirals, but it is also recommended when very small circles are needed and the aproximation of Bezier curves is not very good. It is created in the standard way. At the time of creation we will see a red line where we dragg the mouse that correspond to the radius and a black circle around it. If the extrem of the radius is changed in position but not in lenght, the circle will be the same, but not the spiral created if we do it. First of all it must be said that at present this object as a circle does NOT accept transformations. The spiral created with it, admits SOME transformations. In what follows we will go into spirals.
SPIRAL.- Once created the circle-support for the spiral in the way just explained, to create the spiral there are a few very simple steps to do it. First, the big slider must be placed in some value that will be the number of spires that the final object will have. To make it easier, the scale is divided by ten, so a value of 80 means 8 spires. Once the slider is in place the button with the spiral over it must be clicked. And that's all. Our spiral has been created. After clicking the right mouse button, as ALWAYS MUST BE DONE AFTER THE CREATION OF AN OBJECT, the original circle will change to a series of concentric circles, usually the same in number as spires created. This is just to remind us that this object is an spiral but the final draw is quite diferent, obviously. Now, some precissions about the spiral created: it begins always in the center of the circle and runs, by default, in clockwise fashion. It finish in the last point where we have draw the original radius of the circle. That is the reason why this radius can be changed in position without afecting the circle but changing the position of the spiral. If after placing the slider in place we click the corresponding "minus" button of the slider, so the value choosen appear in the small window "SCALE" as a negative number, the spiral created will go from the center to the extrem of the radius in an anticlockwise way. We will continue explaining other caratheristics of this object in the chapter related with transformations.
BEZIER CURVES.- Bezier curves are piecewise, smooth curves. We have already writen quite a lot about this object. It is created in the same way as the poly-line, with the only difference that in this case when clicking the forth time a curve will appear from the first point to the last one in black color. This is our Bezier curve. If we want to finish here, we can click the right mouse button (AS ALWAYS) and the curve is saved. BUT, if we continue and before touching the right mouse button we click a fifth time, something happens. On the one side the red polygon circumscribed to the curve will increase in one more side, and the curve will move to the middle point of the one before the last segment of the polygon. Then, cliking a new time, the curve will continue from the last point where it ended to this last point clicked, and so on. The reason for this "peculiar" behaviour is simple (Here some maths). What usually is searched with this kind of curves is to obtain a smooth one. A good way to achieve this is with the method used by METAGRAF. Smooth Bezier curves can have two kinds of continuyty: in mathematical terms, it can have continuity of the type G1, and this is the case when a "piece" of the curve continues with the next one having the same tangent, or continuity of the type C1, and this correspond to the case when having the same tangent, the distance from the second control point to the last point of the first piece is the same as the distance from the first control point to the first point of the second piece. In METAGRAF it is assured that our Bezier curves have continuity C1.
If we continue clicking, we will observe the same behaviour: every odd click will modify the already existing curve making it shorter and every even click will finish the smooth curve to the point just clicked. Usually the curve will be an open one, but if our last point is the same as the first, the curve will transform to a closed curve. If not care is taken, the closed shape will have a clear discontinuity in this last point. The way to close the curve smoothly is to click the one before the last point in a virtual line that will be the prolongation of the first one drawn and at the same distance in the opossite direction, as the first control point is from the begining. Doing that, when clicking the last point above the first one, the curve will close in a totally smooth way. A last improvement has been the capability to close the curve when this one has been already drawn as an open one. The way of doing that is to select and dragg the first/final point to joint it with the last/first point. Then one of them will disappear and the curve will be closed. The point where the curve has been closed, can be moved in such a way as to make the curve smooth, or a big angle can be created. Angles can be created at any point of our Bezier curves just joining two nodes after the curve is drawn.
POLYGON.- The polygon is created in the same way as the curves just explained. It has the peculiaruty of "not having peculiarities", so little explanation, if any, is needed. It is enough to test it clicking a few times after the first segment is created and the behaviour of the object is immediatly understood. Exactly the same can be said about the poly-line.
ARC.-The arc of circle is an object quite simple to use. A few concepts must be well understood. The arc is created in the standard way: first a segment and then one more click. It is defined by three points: the center point (where we click for the first time), the length of the radius that is the second point of our first segment, and the third point clicked that represents the direction from the center point that limit the arc. Sometimes it can be a little bit tricky to construct the arc that we are looking for. For doing it in the right way, one point must be remembered: The arc begins always at the second point and goes in a counterclock way until the direction created with the third point. This is very important to remember not to have any trouble. One big advantage of METAGRAF's arc is the unlimited capability of graphical edition. Once created and clicked the right mouse button (AS ALWAYS), the arc can be modified in any way by moving any one of the three definition points. Just playing with it will show his unlimited capabilities. It is important also to mention that being the translation to MetaPost language a "full circle" limited by two lines, it is also possible to create perfect circles with this object. At the moment it has only limitations in the aspects related with transformations.
POINT.- And last (and also least) we have the point. Just clicking once in the screen, it is created. The interest of this object is related strongly with the capability of increasing its size increasing the value of the pen used, so with the "couple +-" button.