How to Draw a Line -- Tutorial

Share your Inkscape tricks and tutorials here.
User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

How to Draw a Line -- Tutorial

Postby brynn » Tue Nov 13, 2012 12:15 pm

Hi Friends,
It seems that some new users have been frustrated because they can't find instructions for drawing a line. So here is all the most basic info I can think of, that a new Inkscape user might need, to start drawing simple lines with Inkscape. Note that I'm using version 0.48.1 as I write this. If you have any questions, or find a mistake, please feel free to reply.

Also note that this is a long read, especially for a tutorial. This is a case where it takes much longer to write about, as well as to read, than it takes to actually do the work. All the steps in this tutorial could be done in less than 2 minutes, by an Inkscape user with below average skills, if they didn't have to read the info in between the steps. (You may decide to read the manual after all :P )

In Inkscape, a line is usually referred to as a path. Several tools can make paths (Tweak :tool_tweak: ; 3D Box :tool_3dbox: ; Pencil :tool_pencil: ; Pen :tool_pen: ; Calligraphy :tool_calligraphic: ; Spray :tool_spray ; Paint Bucket :tool_paintbucket: ; and Connector :tool_connector: ; even the Eraser, in a way :tool_eraser: ). And all the shapes can be converted to paths, using Path menu > Object to Path (shapes -- Rectangle :tool_rectangle: ; Circle :tool_ellipse: ; Star :tool_star: ; Spiral :tool_spiral: ). But only 3 or 4 tools can draw what could be called a line.

PENCIL :tool_pencil: also called Freehand tool -- manual info: http://tavmjong.free.fr/INKSCAPE/MANUAL ... ths-Pencil

To draw a straight line:
1 -- Click once to start the line. Notice how there's now a red line that is fixed on the canvas on the spot where you clicked, on one end, and the other end follows the mouse pointer.
2 -- Place the mouse pointer where you want the line to end.
3 -- Click once. Notice how the red line turns to black, and the black line has a tiny box at each end. That's because the line is still selected and the Pencil tool is still engaged. If you switch to most other tools, the tiny boxes will disappear (because you don't need the tiny boxes anymore). But if you ever need to extend that line, select it and engage the Pencil tool to reveal those tiny boxes. Then place the mouse pointer in the tiny box. You may notice that the box turns red. That indicates that you're in the proper position to continue the line. Click once in the tiny box, to continue the line (assuming you want another straight segment).

To draw a freehand line:
1 -- Click, hold the mouse button down, and drag the mouse. Notice how there's a tiny box at the point where you clicked and started dragging the mouse, with one end of a green line in it. The other end of the green line is at the mouse pointer. The green line shows you where you have drawn.
2 -- Stop dragging and release the mouse, to end the line. Notice how the line turns black, and like with the straight line, has a tiny box at each end. They are used for extending the line, as long as the line is selected and the Pencil tool is engaged. When you switch to most other tools, the boxes disappear. To extend the line, select it, switch to Pencil tool, place the mouse pointer in the tiny box, then click and drag.

There are a few options available for the Pencil tool, that you can see on the control bar. I would recommend putting the Smoothing slider around 30 to 50, to help keep a smooth line. The tool is so sensitive, it picks up even the tiniest little twitch as you drag the mouse, if smoothing is at 0. A higher smoothing value will help compensate.

The other options on the Pencil control bar are a little more advanced, and you should probably not try to use them until you either have a tutorial to follow, or have learned more about it. It's not that the world will explode if you use them, but it might insert a big dose of confusion, at this point.


PEN :tool_pen: also called Bezier tool -- manual info: http://tavmjong.free.fr/INKSCAPE/MANUAL ... ths-Bezier

To draw straight segments:
1 -- Click once at the place where you want to start a new line. Notice how there's now a red line that is fixed on the canvas on the spot where you clicked, on one end, and the other end follows the mouse pointer.
2 -- Move the mouse pointer to the place where you want to place another node.
3 -- If this is to be the end of the line, double-click.
4 -- If this is not the end of the line, click once. This places a cusp/corner node at the place where you click. You can continue along, clicking once wherever you want to place a node, then double-click at the place where you want the line to end.

Notice how the red line turns to black, after you double-click, and the black line has a tiny box at each end. That's because the line is still selected and the Pen tool is still engaged. If you switch to most other tools, the tiny boxes will disappear (because you don't need the tiny boxes anymore). But if you ever need to extend that line, select it and engage the Pen tool to reveal those tiny boxes. Then place the mouse pointer in the tiny box. You may notice that the box turns red. That indicates that you're in the proper position to continue the line. Click once in the tiny box, to continue the line.

To draw curved lines:
1 -- Click, hold the mouse button down, drag the mouse a short distance, then release the mouse button. Notice how there's a red line that is fixed, on one end, at the place where you clicked, and the other end follows the mouse. See how that line is curved? Also notice a straight blue line with a tiny circle on one end, with the other end fixed where the red line is fixed, which is the place where you first clicked. That is the Bezier or node handle. It's used to adjust the curve, although you can't adjust the curve with this tool. To be honest, I'm not sure why it's shown here, because as soon as you either click, or click + drag to set another node, that handle disappears, and the handles of the next node appears (assuming it's a smooth node). And you can't, to my knowledge, adjust the handle with the Pen tool anyway.
2 - Move the mouse pointer to the place where you want to set another node. Click once to set a cusp/corner node. Or click and drag to set another smooth node. If the last node you set was a smooth node, and the next node you set is a smooth node, you'll see 2 node handles when you drag the mouse.
3 -- Move the mouse pointer to the place where you want to end the line, and then double-click.

Notice how the red line turns to black, after you double-click, and the black line has a tiny box at each end. That's because the line is still selected and the Pen tool is still engaged. If you switch to most other tools, the tiny boxes will disappear (because you don't need the tiny boxes anymore). But if you ever need to extend that line, select it and engage the Pen tool to reveal those tiny boxes. Then place the mouse pointer in the tiny box. You may notice that the box turns red. That indicates that you're in the proper position to continue the line. Click once in the tiny box, to continue the line.

Personally I haven't managed to coordinate the click and drag motion well enough to draw with it. I guess some people are pretty good at it, but I just can't make it work. So instead of setting smooth nodes as I draw, I work in straight line mode. Then after the line is finished, I go back and select the nodes that need to be smooth, and switch them using the control bar.

There are a few options available for the Pen tool, on the control bar. But I would suggest sticking with Bezier mode ("regular mode") or straight line mode, until you learn more about Inkscape, or have a tutorial to follow.

CALLIGRAPHY :tool_calligraphic: -- manual info: http://tavmjong.free.fr/INKSCAPE/MANUAL ... alligraphy

The Calligraphy tool draws a special kind of line. Like a real calligraphy pen, it can draw lines that are thicker or thinner, depending on the angle of the nib (tip of pen) and the direction of the pen stroke. This tool is a favorite among those Inkscape artists who use a graphics tablet, because it can be set for pressure sensitivity on the tablet. It can be used without a tablet, but has no pressure sensitivity without a tablet.

It will be easier to show you the difference between Calligraphy and Pen and Pencil with an illustration, than to try and describe it.
Image
So you can see that the Pencil and Pen tools both draw open paths, with a stroke and no fill. They can be closed, if you click in the tiny boxes at both ends of the open path, which "manually" closes the path. (Or you can join the nodes using the Node tool, to close the path.) The Calligraphy tool draws a closed path automatically, with a black fill and no stroke. I added a stroke to the bottom example, just for clarity.

To use the Calligraphy tool, just click, hold the mouse button down, drag until the line is finished, then release the mouse button.

There are several options available for this tool. It's probably not the best tool for a beginner to use, so I'm not gonna go into a whole lot of detail here. You can find it in the manual when you feel ready to learn. But there are a couple of settings which will help get you started. First is the dropdown menu at the far left side of the control bar, which first item says "No preset". That's the default mode. You can experiment with the different modes, to see how they work. Next is the Width, which controls the width of the line. My biggest frustration when I was learning to use this tool, was like with the Pencil -- it picks up every little twitch. The Mass slider setting, at the far right on the control bar, will help with that. I find 10 is a good compromise between twitchy and too slow.

CONNECTOR :tool_connector: -- manual info: http://tavmjong.free.fr/INKSCAPE/MANUAL ... ctors.html

The Connector tool is used for drawing the line between steps in a flow chart. It really isn't suitable for drawing in the traditional sense. It does have some unique features that are helpful for making a flow chart. For a quick start, use it like the Pencil for drawing straight lines. For other features, please read the manual.

NODE :tool_node: -- manual info: http://tavmjong.free.fr/INKSCAPE/MANUAL ... iting.html

And now, finally, we need to talk about the Node tool. It cannot draw a line, but it's the only way to adjust a line after it's drawn. I mentioned about setting nodes already, with the Pen tool. With the Pencil tool, when drawing a straight line, there will always be 1 node at each end of the line. Same for Connector tool. If you're drawing a freehand line with the Pencil, Inkscape automatically sets the nodes for you. The higher you set the Smoothing option, the fewer nodes will be set (and smoother the line). The lower the Smoothing, the more nodes, and the jerkier the line you draw. Nodes are also set automatically with the Calligraphy tool.

After you either click (Pen and Connector tools), double-click (Pen tool), or release the mouse (Calligraphy tool) to finish drawing a line, you might want to adjust the line. That's done in a process usually referred to as node editing. If the line has been deselected, since you drew it, you'll need to select it again. You can select directly with the Node tool, or sometimes you'll need to Select with Selection tool, then switch to the Node tool.

Once you do that, you will see the nodes. There are 4 types of nodes, but most of the time, you'll be using either cusp/corner nodes, or smooth nodes. Cusp/corner nodes are diamond shaped, and may have either one or both handles showing, or none. Smooth nodes are square shaped, and will have either one handle showing, or both. You can change the node type on the Node tool control bar. If a node has either one or no handles showing, you can extract them, if you need to. Or if you need to get rid of the handles, you can retract (hide) them.

To select a node:
1 -- Place the mouse pointer over a node. Notice how it changes color. That indicates that your mouse pointer is in the proper position.
2 -- Click once. Notice how the node changes color again. Nodes must be selected before you can do pretty much anything, including adjust their handles.

To move a node:
1 -- Place the mouse pointer over a node. Notice how it changes color. That indicates that your mouse pointer is in the proper position.
2 -- Click, hold the mouse button, and drag. When the node is where you want it, release the mouse.

Node handles are used to adjust the curve. Smooth node handles always move together, if both handes are showing (this keeps the curve smooth). If one handle of a smooth node is retracted, you can't move the handle that's still showing. The handles of cusp/corner nodes are moved independantly, and can be moved no matter how many are showing (this allows for a sharp, defined corner/curve). Note that if you retract one handle, the path will become straight on the side of the node where the handle was. Retracting both handle makes a sharp corner with straight segments on both sides of the node.

To extract node handles:
1 -- Place the mouse pointer over a node. Notice how it changes color. That indicates that your mouse pointer is in the proper position.
2 -- Press Shift key, click, hold the mouse button, and drag. You'll see the hanlde as it comes out of the node.

To move a node handle:
1 -- Place the mouse pointer over the tiny circle at the end of the handle. Notice how it turns red, to indicate you're in the proper position.
2 -- Click, hold the mouse button down, and drag. You'll see the handle move, and you'll see the curve change as you drag the handle.

To retract node handles:
1 -- Place the mouse pointer over the tiny circle at the end of the handle. Notice how it turns red, to indicate you're in the proper position.
2 -- Press Ctrl key and click once. You'll see the handle disappear. It can be extracted again later, if you should need it again.

SUMMARY

So those are the basics to get you started drawing simple lines with Inkscape. There are many more features of all these tools, including some very sophisticated features, which can be accessed with various key shorcuts and menu items, which you can learn by reading the manual, and experimenting on the canvas; and which I can't possibly cover all of, in this forum topic. But I hope this will fill a need for what some Inkscape users see is missing in Inkscape, i.e. instructions on drawing a line. If you've actually read through the entire tutorial, you probabaly realize by now, that it's not as simple as perhaps you might have wanted it to be. But I hope it helps, in any case.

Please feel free to reply to this topic, if you have questions. Or if anyone finds a mistake in the tutorial, or feels I left out something which new Inkscape users might need to know, to start drawing with Inkscape.

All best :D

Brynn

User avatar
Inkspots
Posts: 232
Joined: Sat Dec 03, 2011 3:16 am

Re: How to Draw a Line -- Tutorial

Postby Inkspots » Tue Jan 01, 2013 9:10 am

This seems like an extremely thorough explanation of how to draw a line in Inkscape.
Maybe a little confusing for a new user, but very detailed.
Nice thought brynn, thanks.

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: How to Draw a Line -- Tutorial

Postby brynn » Wed Jan 02, 2013 10:39 am

Thanks Inkspots. I was extremely frustrated with a topic (of the same title, without "...a..." and "-- Tutorial") when I wrote this, and I wanted to cover every possible aspect of drawing a line, so that it could no longer be said that there are no instructions for drawing a line.

If there are specific areas which seem confusing, please feel free to let me know. Despite my frustration, I do want the tutorial to be helpful.

Perhaps I should make a "quick start" version....I was actually thinking about it when I made this one. But I can't think of any way to cover everything that a new user might need in a quick way. I could cover what seem to me to be the basics, but then someone will complain about something I didn't cover, and can't believe whatever feature thay need was left out.

I should learn how to make videos one of these days, because this would be an excellent subject for a video tutorial ;)

chriswww
Posts: 383
Joined: Fri Nov 19, 2010 3:04 pm

Re: How to Draw a Line -- Tutorial

Postby chriswww » Wed Jan 02, 2013 3:18 pm

it's a somewhat difficult topic, since a line really is a path (with or without closing and stroke or fill colors) and inkscape has some tools that cover svg and some tools extend that spec to produce line like graphic shapes. In the past I've even used rectangles to handily represent lines. On the other hand - thinking in terms of paths instead of "lines" - helps to more easily understand path operations. But then paths are a little more difficult to grasp in the first place; an invisible (closed or unclosed) set of ordered nodes. On a side note, I hope that some graphic tablet code magic will make it into inkscape. Some notable graphics programs make good use of this type of input, which goes beyond mousing but remains compatible with mousing.

User avatar
Inkspots
Posts: 232
Joined: Sat Dec 03, 2011 3:16 am

Re: How to Draw a Line -- Tutorial

Postby Inkspots » Sun Jan 06, 2013 12:49 am

When Your just starting out with Vector drawing, and Inkscape..drawing a line is one of the first things you want to do,
and I remember how frustrating it was before I realized...you can't really draw just a line.
It takes some time to discover that what you really want is a path, of some kind.

brynn, just leave your tutorial as it is, people are going to want the info...and when they're looking for it, they'll probably have what they tried, and failed to do firmly in mind.
I don't think it will be confusing for people as I was concerned it might be at first, because you do have things well organized, and headings are clear. You explained things very well.
p.s. I hate video tutorials for most things, I want it all written out so I can quickly scan a page to find the information I need.

chriswww,
Rectangles really are handy for drawing straight lines.


Return to “Tricks & Tutorials”