gotcha

 


How to Draw a "Line" with Inkscape

Submitted By: brynn Date: August 16, 2013, 05:30:46 PM Views: 18217
Summary: An Introduction to Paths


How to Draw a "Line" with Inkscape -- An Introduction to Paths


New Inkscape users are sometimes frustrated when they search the manual (or forum) for how to draw a line, and can't find instructions.  That's because "line" is a bit of a nebulous term, at least in Inkscape....although in some ways it can be confusing in any vector graphics program.  What we generally think of as a line, is called a path, in Inkscape.  But it's not just a matter of terminology.

There are 3 types of paths -- open, closed, and compound.  An open path is probably what beginners would think of as a line; it has 2 ends.  A closed path has no ends (like a circle, for example).  And a compound path is made up of 2 or more, open or closed paths; it could have any even number of ends.  Sometimes a closed path with a fill (color) can look like a line.  And even a long and very skinny rectangle shape could be called a line, without being a path at all.

Before you read on, I should say that this is a very long tutorial.  Unfortunately, it's mostly text, because I don't seem to have a screen capture tool that will capture the mouse pointer, which is a very important part of drawing paths with Inkscape.  But don't worry.  This is one of those cases where it takes MUCH longer to write about and read about, than it takes to actually do the work. All the steps in this tutorial could be done in less than 2 minutes, by a complete Inkscape novice, if they didn't have to read the info in between the steps.  Also, it's not necessary to read through from start to finish.  You can read just the section(s) for the tool you need to learn about.  For the record, this is being written with version 48.4.  But these are very basic tools and steps, and aren't likely to change much, if at all, from previous versions through future versions.  I'll try to keep this up to date.  But if you have questions, please feel free to post in the forum.   :)

So now, we're talking about paths.  Several Inkscape tools can draw paths (starting from top of toolbar):  3D Box  :3db: , Pencil / Freehand  :pfh: , Pen / Bezier  :pen: , Calligraphy  :ct: , "Bucket" (Fill bounded area)  :fba: , Connector  :con: , and even the Eraser  :era: , in a way.  And all the shapes can be converted to paths, using Path menu > Object to Path:  Rectangle  :rect: , Ellipse  :et: , Star  :star: , and Spiral  :spir: .  But only 4 tools can draw what we usually think of as a line.


Pencil / Freehand Tool      :pfh:      (manual info)          The Pencil / Freehand tool is used to draw freehand paths, typically with many nodes which are automatically placed by the tool; or single, straight path segments, consisting of 2 nodes.

To draw straight path segments:

1 -- Click once to start the path.
2 -- Move the mouse around.
Notice how there's now a red line that is fixed to the canvas on the spot where you clicked, and the other end follows the mouse pointer.
3 -- Place the mouse pointer where you want the path to end.
4 -- 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 path is still selected and the Pencil tool is still engaged.  The tiny boxes are used to extend and/or close the path.  If you switch to any other tool (except the Pen/Bezier tool) the tiny boxes will disappear (because you don't need them anymore).

To extend a path with a straight segment:

1 -- Select the path and switch to the Pencil tool, to reveal the tiny boxes (if they're not already showing).
2 -- Position the mouse pointer over a tiny box.
You may notice that the box turns red, which indicates that the mouse in the proper position.1
3 -- Click once in the tiny box, to continue the path (with a straight segment).

To close a path with a straight segment:

1 -- Select the path and switch to the Pencil tool, to reveal the tiny boxes (if they're not already showing).
2 -- Place the mouse pointer over 1 tiny box.
You may notice that the box turns red, which indicates that the mouse in the proper position.1
3 -- Click once in the tiny box, to continue the path (with a straight segment).
4 -- Position the mouse over the other tiny box, as before.
5 -- Click once to close the path.

To draw a freehand path:

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 -- If this is to be an open path, just stop dragging and release the mouse button, to end the path.
Notice how the green line turns black, when you release the mouse.  And like with the straight path, it has a tiny box at each end.  They are used for extending the path and/or closing the path.  When you switch to most other tools, the tiny boxes disappear.

To extend a path with a freehand segment:

1 -- Select the path and switch to the Pencil tool, to reveal the tiny boxes (if they're not already showing).
2 -- Position the mouse pointer over a tiny box.
You may notice that the box turns red, which indicates that the mouse in the proper position to continue the path.1
3 -- Click, hold the mouse button down, and drag.

To close a path with a freehand segment:

1 -- Select the path and switch to the Pencil tool, to reveal the tiny boxes (if they're not already showing).
2 -- Position the mouse pointer over a tiny box.
You may notice that the box turns red, which indicates that the mouse in the proper position to continue the path.1
3 -- Click, hold the mouse button down, and drag.
4 -- Drag until your mouse is positioned over the other tiny box.
You may notice that the box turns red, which indicates that the mouse in the proper position to continue the path.2
5 -- After the mouse is positioned, just release the mouse button.

There are a few options available for the Pencil tool, that you can see on the tool control bar.  I would recommend putting the Smoothing slider around 30 to 50, to help keep a smooth path.  The tool is so sensitive, if smoothing is at 1, it picks up even the tiniest little twitch as you drag the mouse.  A higher smoothing value will help compensate.  The other options on the Pencil control bar are a little more advanced, and beyond the scope of this introductory tutorial.


Pen / Bezier Tool      :pen:      (manual info)          The Pen / Bezier tool is used to make paths with multiple nodes, which are placed by the user; and to make curved paths (sometimes called Bezier curves).

To draw a path with multiple nodes, made of straight segments:

1 -- Click once at the place where you want to start a new path.
Notice how there's now a tiny box on the spot where you clicked, with a red line that is fixed on the canvas inside the box; and how the other end follows the mouse pointer.
2 -- Move the mouse pointer to the place where you want to place a node.
3 -- 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.
4 -- When you're ready to end an open path, double-click.
Notice how the red line turns to black, and the new black path has a tiny box at each end.  That's because the path is still selected and the Pen tool is still engaged.  The tiny boxes are used to extend and/or close the path.  If you switch to any other tool (except the Pencil/Freehand tool) the tiny boxes will disappear (because you don't need them anymore).

To extend a path with multiple nodes and straight segments:

1 -- Select the path and switch to the Pen tool, to reveal the tiny boxes (if they're not already showing).
2 -- Position the mouse pointer over a tiny box.
You may notice that the box turns red, which indicates that the mouse in the proper position.3
3 -- Click once.
Now you can continue on with drawing the path.

To close a path with a staight segment:

1 -- Select the path and switch to the Pen tool, to reveal the tiny boxes (if they're not already showing).
2 -- Position the mouse pointer over 1 tiny box.
You may notice that the box turns red, which indicates that the mouse in the proper position.3
3 -- Click once in the tiny box, to continue the path (with a straight segment).
4 -- Position the mouse over the other tiny box.
You may notice that the box turns red, which indicates that the mouse in the proper position4
5 -- Click once to close the path.

To draw a path with multiple nodes, made of curved segments:

1 -- Click once at the place where you want to start a new path.
Notice how there's now a tiny box on the spot where you clicked, with a red line that is fixed on the canvas inside the box; and how the other end follows the mouse pointer. 
2 -- Move the mouse around.
See how the red line curves as you move the mouse?  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 curve handle, 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 set another node, that handle disappears, and the handles of the next node appear (assuming it's a smooth node).  And you can't, to my knowledge, adjust the handle with the Pen tool anyway.  But more on node handles later.

3 -- Move the mouse pointer to the place where you want to place a node.
4 -- Click, hold the mouse button down, drag the mouse a short distance, then release the mouse button.
This places a smooth node at the place where you click-drag.
5 -- Move the mouse around.
Notice how the red line curves as you move the mouse?  And also notice the blue node handles, like with the 1st node, except you may see 2 handles here.  You can continue along, clicking once wherever you want to place a cusp/corner node, and click and drag when you want to place a smooth node.  Don't worry about getting the curve perfect here, because you can come back later with the Node tool, and adjust it to perfection.
6 -- When you're ready to end an open path, double-click.
Notice how the red line turns to black, and the new black path has a tiny box at each end.  That's because the path is still selected and the Pencil tool is still engaged.  The tiny boxes are used to extend and/or close the path.  If you switch to most other tools, the tiny boxes will disappear (because you don't need them anymore).

To extend a path with a curved segment:

1 -- Select the path and switch to the Pen tool, to reveal the tiny boxes (if they're not already showing).
2 -- Position the mouse pointer over a tiny box.
You may notice that the box turns red, which indicates that the mouse in the proper position.3
3 -- Click, hold the mouse button down, drag the mouse a short distance, then release the mouse button.
Now you can continue on with drawing the path.

To close a path with a curved segment:

1 -- Select the path and switch to the Pen tool, to reveal the tiny boxes (if they're not already showing).
2 -- Position the mouse pointer over 1 tiny box.
You may notice that the box turns red, which indicates that the mouse in the proper position.3
3 -- Click, hold the mouse button down, drag the mouse a short distance, then release the mouse button.
4 -- Position the mouse over the other tiny box.
You may notice that the box turns red, which indicates that the mouse in the proper position4
5 -- Click, hold the mouse button down, drag the mouse a short distance, then release the mouse button.

Personally I haven't managed to coordinate the click and drag motion well enough to draw quickly 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 (this button on the Pen/Bezier tool control bar  :slm: ), setting cusp/corner nodes as I go.  Then after the path is finished, I go back and select the nodes that need to be smooth, and switch them to smooth using the Node tool control bar.  More about the Node tool later.  But the point is that there are many options available, and as you gain more experience, you'll find a configuration of settings that works for you and you drawing or artistic style.

There are a few more options available for the Pen tool, on the control bar.  But they're really beyond the scope of this introductory tutorial.  (Please see the manual for those details.)


Calligraphy tool       :ct:      (manual info)          The Calligraphy tool draws a long and very skinny closed path, typically with a color fill and no stroke.

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 with a regular mouse, 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.


So you can see that the Pencil and Pen tools both draw open paths, with a stroke and no fill by default.  They can be closed "manually", in a couple of different ways.  (More later about that.)  But the Calligraphy tool draws a closed path automatically, filled with no stroke, by default.

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, which you can see on the control bar.  It's probably not the best tool for a beginner to use, 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.  "No Preset" is the default mode.  You can experiment with the different modes, to see how they work, but it's beyond the scope of this tutorial, to explain them all.  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
       :con:       (manual info)        The Connector tool is used for drawing the line between steps in a flow chart.

The Connector tool 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)        The Node tool is used to edit paths after they are drawn.

And now, finally, we need to talk about the Node tool.  It cannot draw a path, but it's the only way to adjust a path after it's drawn, which is generally referred to as "node editing".  If the path has been deselected, since you drew it, you'll need to select it again.  You can select directly with the Node tool, or in certain situations, it's necessary to Select with Selection tool, then switch to the Node tool.  Once you select a path with the Node tool, 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  .  You can change the type of a node by selecting it, and clicking on one of the Node tool control bar icon/buttons (in yellow highlight):


Or if you prefer to use key shortcuts, Help menu > Keys and mouse reference, will tell you what they are.

Nodes appear in different colors, depending on their position, their state of selection, and the color behind or underneath them.  Here's how they look on a default white background.  When you mouseover them they turn red (which I can't show because my screenshot tools aren't capable).  When selected they're blue and .  Also, the nodes have a thin black outline or border.  The only time they lack that border, is if there are an even number of nodes stacked directly on top of each other (sharing the same coordinates), which looks like this  .  If there are an odd number of nodes occupying the same coordinates, it looks just like a single node (has the black border)  .  (I'm not sure if that's intended or if it might be a bug.)  Stacked nodes still change to red when moused over.  If the top 1 is selected, it's still blue, but there's a white margin between the blue center and black border  .  If any node below the top one in a stack is selected, it looks gray with a black border, and a thin white margin between the gray and border  .  If an even number of stacked up nodes are all selected, they seem to disappear, as if there are no nodes at all (except of course you still see the path)  .  If an odd number of stacked up nodes are all selected, they look just like a single selected node (blue with black border) 

To select a node:
1 -- Position 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 -- Position 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.

Nodes may have either one or both handles showing, or none.  Node handles are used to adjust curves (or remove curves).  Smooth node handles always move together, if both hands 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.  (I'm not sure why.)  Cusp/corner nodes are typically moved independently, 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.  If you retract both handles from a smooth node, it becomes a cusp/corner node.

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

To move a node handle:
1 -- Position 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 -- Position 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 -- Hold the 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, and which you can learn by reading the manual, following various tutorials, and experimenting on the canvas.  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 post a message in the forum, if you have questions.  Please don't use the Comments section below for support.  Although 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, please do feel free to post a comment about it.

All best :D

Brynn


1 For me, it's hard to notice that the tiny box turns red, because the mouse pointer icon usually covers it up.  So I often keep my eye on the status bar, which gives a text indication about the position of the mouse.  If you're continuing a path, it will say "Drag to continue the path from this point", when the mouse is properly positioned.  Actually, this may be a small bug, since it says the same thing whether you are extending the path, or closing the path.  In neither case should you actually drag, if you want a straight segment (with the Pencil); you should just click once.  If you are extending a freehand segment (with Pencil), you should click and drag.

2 For me, it's hard to notice that the tiny box turns red, because the mouse pointer icon usually covers it up.  So I often keep my eye on the status bar, which gives a text indication about the position of the mouse.  If you're closing a path with a freehand segment (with the Pencil), it will say "Release here to close and finish the path", when the mouse is properly positioned.

3 For me, it's hard to notice that the tiny box turns red, because the mouse pointer icon usually covers it up.  So I often keep my eye on the status bar, which gives a text indication about the position of the mouse.  If you're continuing a path with a straight segment (with the Pen), it will say "Click or click and drag to continue the path from this point".

4 For me, it's hard to notice that the tiny box turns red, because the mouse pointer icon usually covers it up.  So I often keep my eye on the status bar, which gives a text indication about the position of the mouse.  If you're closing a path with a curved segment (with the Pen), it will say "Click or click and drag to close or finish the path".


Brynn
August 2013


Rating: ***** by 1 members.

Comments

Rachid
Sr. Newbie
**
Offline Offline

Posts: 8


View Profile Email
May 24, 2017, 04:58:26 AM
Nice tutorial. I will add my two cent regarding the pen tool. If you want to pass from straight line to curved one, hold shift and drag. To pass from curved line into straight line, hold  shift + d.