Inkscape tutorial: Shapes


https://inkscape.org/en/doc/shapes/tutorial-shapes.html


This tutorial covers the four shape tools: Rectangle, Ellipse, Star, and Spiral.We will demonstrate the capabilities of Inkscape shapes and showexamples of how and when they could be used.

Use Ctrl+Arrows, mousewheel, or middle button drag to scroll the page down. For basics of object creation, selection, and transformation, see the Basic tutorial in Help > Tutorials.

Inkscape has four versatile shape tools, each tool capable ofcreating and editing its own type of shapes. A shape is an object which you can modifyin ways unique to this shape type, using draggable handles andnumeric parameters that determine the shape's appearance.

For example, with a star you can alter the number of tips, their length, angle,rounding, etc. — but a star remains a star. A shape is “less free” than a simplepath, but it's often more interesting and useful. You can always convert a shapeto a path (Shift+Ctrl+C), but the reverse conversion is not possible.

The shape tools are Rectangle, Ellipse,Star, and Spiral. First, let's look at howshape tools work in general; then we'll explore each shape type in detail.

General tips

A new shape is created by dragging on canvas with the corresponding tool. Once the shape is created (and so long as it is selected), it displays its handles as white diamond, square or roundmarks (depending on the tools), so you can immediately edit what youcreated by dragging these handles.

All four kinds of shapes display their handles in all four shape tools as well as in theNode tool (F2). When you hover your mouse over a handle, it tells youin the statusbar what this handle will do when dragged or clicked with different modifiers.

Also, each shape tool displays its parameters in the Tool Controlsbar (which runs horizontally above the canvas). Usually it has a few numericentry fields and a button to reset the values to defaults. When shape(s) of the currenttool's native type are selected, editing the values in the Controls bar changes theselected shape(s).

Any changes made to the Tool Controls are remembered and used for the next object youdraw with that tool. For example, after you change the number of tips of a star, newstars will have this number of tips as well when drawn. Moreover, even simply selectinga shape sends its parameters to the Tool Controls bar and thus sets the values for newlycreated shapes of this type.

When in a shape tool, selecting an object can be done by clickingon it. Ctrl+click (select in group) and Alt+click(select under) also work as they do in Selector tool. Esc deselects.

Rectangles

A rectangle is the simplest but perhaps the most common shape in design and illustration. Inkscape attempts to make creating andediting rectangles as easy and convenient as possible.

Switch to the Rectangle tool by F4 or by clicking its toolbar button.Draw a new rectangle alongside this blue one:

An example image

Then, without leaving the Rectangle tool, switch selection from onerectangle to the other by clicking on them.

Rectangle drawing shortcuts:

  • With Ctrl, draw a square or an integer-ratio (2:1, 3:1, etc) rectangle.

  • With Shift, draw around the starting point as center.

As you see, the selected rectangle (the just-drawn rectangle is always selected) showsthree handles in three of its corners. In fact, these are four handles, but two of them(in the top right corner) overlap if the rectangle is not rounded. These two are therounding handles; the other two (top left and bottom right) areresize handles.

Let's look at the rounding handles first. Grab one of them and drag down. All fourcorners of the rectangle become rounded, and you can now see the second rounding handle— it stays in the original position in the corner. If you want circular roundedcorners, that is all you need to do. If you want corners which are rounded farther alongone side than along the other, you can move that other handle leftwards.

Here, the first two rectangles have circular rounded corners, and the other two haveelliptic rounded corners:

An example image

Still in the Rectangle tool, click on these rectangles to select, and observe their rounding handles.

Often, the radius and shape of the rounded corners must be constant within the entirecomposition, even if the sizes of the rectangles are different (think diagrams withrounded boxes of various sizes). Inkscape makes this easy. Switch to the Selector tool;in its Tool Controls bar, there's a group of four toggle buttons, the second from theleft showing two concentric rounded corners. This is how you control whether therounded corners are scaled when the rectangle is scaled or not.

For example, here the original red rectangle is duplicated and scaled several times, upand down, to different proportions, with the “Scale rounded corners” buttonoff:

An example image

Note how the size and shape of the rounded corners is the samein all rectangles, so that the roundings align exactly in the top right corner where they all meet. All the dotted blue rectangles are obtained from the original red rectangle just by scaling in Selector, without any manual readjustment of the rounding handles.

For a comparison, here is the same composition but now created with the “Scale rounded corners” button on:

An example image

Now the rounded corners are as different as the rectangles they belong to, and thereisn't a slightest agreement in the top right corner (zoom in to see). This is the same(visible) result as you would get by converting the original rectangle to a path(Ctrl+Shift+C) and scaling it as path.

Here are the shortcuts for the rounding handles of a rectangle:

  • Drag with Ctrl to make the other radius the same (circular rounding).

  • Ctrl+click to make the other radius the same without dragging.

  • Shift+click to remove rounding.

You may have noticed that the Rectangle tool's Controls bar shows the horizontal(Rx) and vertical (Ry) rounding radii forthe selected rectangle and lets you set them precisely using any length units. TheNot rounded button does what is says — removes rounding fromthe selected rectangle(s).

An important advantage of these controls is that they can affect many rectanglesat once. For example, if you want to change all rectangles in the layer, just doCtrl+A (Select All) and set the parameters you needin the Controls bar. If any non-rectangles are selected, they will be ignored — onlyrectangles will be changed.

Now let's look at the resize handles of a rectangle. You might wonder,why do we need them at all, if we can just as well resize the rectanglewith Selector?

The problem with Selector is that its notion of horizontal and vertical is always thatof the document page. By contrast, a rectangle's resize handles scale it alongthat rectangle's sides, even if the rectangle is rotated or skewed. Forexample, try to resize this rectangle first with Selector and then with its resizehandles in Rectangle tool:

An example image

Since the resize handles are two, you can resize the rectangle into any direction or even move it along its sides. Resize handles always preserve the rounding radii.

Here are the shortcuts for the resize handles:

  • Drag with Ctrl to snap to the sides or the diagonal ofthe rectangle. In other words, Ctrl preserves either width, or height,or the width/height ratio of the rectangle (again, in its own coordinate system whichmay be rotated or skewed).

Here is the same rectangle, with the gray dotted lines showing the directions to which the resize handles stick when dragged with Ctrl (try it):

An example image

By slanting and rotating a rectangle, then duplicating it and resizing with its resizehandles, 3D compositions can be created easily:

An example image

Here are some more examples of rectangle compositions, includingrounding and gradient fills:

An example image

Ellipses

The Ellipse tool (F5) can create ellipses and circles, which you can turn into segments or arcs. The drawing shortcuts are the same as those of the rectangle tool:

  • With Ctrl, draw a circle or an integer-ratio (2:1, 3:1, etc.) ellipse.

  • With Shift, draw around the starting point as center.

Let's explore the handles of an ellipse. Select this one:

An example image

Once again, you see three handles initially, but in fact they are four. The rightmosthandle is two overlapping handles that let you “open” the ellipse. Drag that rightmosthandle, then drag the other handle which becomes visible under it, to get a varietyof pie-chart segments or arcs:

An example image

To get a segment (an arc plus two radii), dragoutside the ellipse; to get an arc, draginside it. Above, there are 4 segments on the left and 3 arcs onthe right. Note that arcs are unclosed shapes, i.e. the stroke only goes along theellipse but does not connect the ends of the arc. You can make this obvious if youremove the fill, leaving only stroke:

An example image

Note the fan-like group of narrow segments on the left. It was easyto create using angle snapping of the handle with Ctrl. Here are the arc/segment handle shortcuts:

  • With Ctrl, snap the handle every 15 degrees when dragging.

  • Shift+click to make the ellipse whole (not arc or segment).

The snap angle can be changed in Inkscape Preferences (in Behavior > Steps).

The other two handles of the ellipse are used for resizing it around its center. Theirshortcuts are similar to those of the rounding handles of a rectangle:

  • Drag with Ctrl to make a circle (make the other radius the same).

  • Ctrl+click to make a circle without dragging.

And, like the rectangle resize handles, these ellipse handles adjust the height andwidth of the ellipse in the ellipse's own coordinates. This meansthat a rotated or skewed ellipse can easily be stretched or squeezed along its originalaxes while remaining rotated or skewed. Try to resize any of these ellipses by theirresize handles:

An example image

Stars

Stars are the most complex and the most exciting Inkscape shape. If you want to wow yourfriends by Inkscape, let them play with the Star tool. It's endlessly entertaining— outright addictive!

The Star tool can create two similar but distinct kinds of objects: stars andpolygons. A star has two handles whose positions define the length and shape of itstips; a polygon has just one handle which simply rotates and resizes the polygon whendragged:

An example image

In the Controls bar of the Star tool, the first two buttons control how the shape is drawn (regular polygon or star). Next, a numeric field sets the number ofvertices of a star or polygon. This parameter is only editable via theControls bar. The allowed range is from 3 (obviously) to 1024, but you shouldn't trylarge numbers (say, over 200) if your computer is slow.

When drawing a new star or polygon,

  • Drag with Ctrl to snap the angle to 15 degree increments.

Naturally, a star is a much more interesting shape (though polygons are often moreuseful in practice). The two handles of a star have slightly different functions. Thefirst handle (initially it is on a vertex, i.e. on a convex cornerof the star) makes the star rays longer or shorter, but when you rotate it (relative tothe center of the shape), the other handle rotates accordingly. This means you cannotskew the star's rays with this handle.

The other handle (initially in a concave corner between twovertices) is, conversely, free to move both radially and tangentially, without affectingthe vertex handle. (In fact, this handle can itself become vertex by moving farther fromthe center than the other handle.) This is the handle that can skew the star's tips toget all sorts of crystals, mandalas, snowflakes, and porcupines:

An example image

If you want just a plain regular star without any such lacework, you can make the skewing handle behave as the non-skewing one:

  • Drag with Ctrl to keep the star rays strictly radial (no skew).

  • Ctrl+click to remove the skew without dragging.

As a useful complement for the on-canvas handle dragging, the Controls bar has theSpoke ratio field which defines the ratio of the two handles'distances to the center.

Inkscape stars have two more tricks in their bag. In geometry, a polygon is a shape withstraight line edges and sharp corners. In the real world, however, various degrees ofcurvilinearity and roundedness are normally present — and Inkscape can do thattoo. Rounding a star or polygon works a bit differently from rounding a rectangle,however. You don't use a dedicated handle for this, but

  • Shift+drag a handle tangentially to round the star or polygon.

  • Shift+click a handle to remove rounding.

“Tangentially” means in a direction perpendicular to the direction to the center. If you“rotate” a handle with Shift counterclockwise around the center, you get positiveroundedness; with clockwise rotation, you get negative roundedness. (See below forexamples of negative roundedness.)

Here's a comparison of a rounded square (Rectangle tool) with a rounded 4-sided polygon(Star tool):

An example image

As you can see, while a rounded rectangle has straight line segments in its sides andcircular (generally, elliptic) roundings, a rounded polygon or star has no straightlines at all; its curvature varies smoothly from the maximum (in the corners) to theminimum (mid-way between the corners). Inkscape does this simply by adding collinearBezier tangents to each node of the shape (you can see them if you convert the shape topath and examine it in Node tool).

The Rounded parameter which you can adjust in the Controls bar is theratio of the length of these tangents to the length of the polygon/star sides to whichthey are adjacent. This parameter can be negative, which reverses the direction oftangents. The values of about 0.2 to 0.4 give “normal” rounding of the kind you wouldexpect; other values tend to produce beautiful, intricate, and totally unpredictablepatterns. A star with a large roundedness value may reach far beyond the positions ofits handles. Here are a few examples, each indicating its roundedness value:

An example image

If you want the tips of a star to be sharp but the concaves smooth or vice versa, thisis easy to do by creating an offset (Ctrl+J)from the star:

An example image

Shift+dragging star handles in Inkscape is one of the finest pursuitsknown to man. But it can get better still.

To closer imitate real world shapes, Inkscape can randomize (i.e.randomly distort) its stars and polygons. Slight randomization makes a star lessregular, more humane, often funny; strong randomization is an exciting way to obtain avariety of crazily unpredictable shapes. A rounded star remains smoothly rounded whenrandomized. Here are the shortcuts:

  • Alt+drag a handle tangentially to randomize the star or polygon.

  • Alt+click a handle to remove randomization.

As you draw or handle-drag-edit a randomized star, it will “tremble” because each uniqueposition of its handles corresponds to its own unique randomization. So, moving a handlewithout Alt re-randomizes the shape at the same randomization level, while Alt-draggingit keeps the same randomization but adjusts its level. Here are stars whose parametersare exactly the same, but each one is re-randomized by very slightly moving its handle(randomization level is 0.1 throughout):

An example image

And here is the middle star from the previous row, with the randomization level varyingfrom -0.2 to 0.2:

An example image

Alt+drag a handle of the middle star in this row and observe as itmorphs into its neighbors on the right and left — and beyond.

You will probably find your own applications for randomized stars, but I am especiallyfond of rounded amoeba-like blotches and large roughened planets with fantasticlandscapes:

An example image

Spirals

Inkscape's spiral is a versatile shape, and though not as immersing as the star,it is sometimes very useful. A spiral, like a star, is drawn from the center; whiledrawing as well as while editing,

  • Ctrl+drag to snap angle to 15 degree increments.

Once drawn, a spiral has two handles at its inner and outer ends. Both handles, whensimply dragged, roll or unroll the spiral (i.e. “continue” it, changing the number ofturns). Other shortcuts:

Outer handle:

  • Shift+drag to scale/rotate around center (no rolling/unrolling).

  • Alt+drag to lock radius while rolling/unrolling.

Inner handle:

  • Alt+drag vertically to converge/diverge.

  • Alt+click to reset divergence.

  • Shift+click to move the inner handle to the center.

The divergence of a spiral is the measure of nonlinearity of itswinds. When it is equal to 1, the spiral is uniform; when it is less than 1(Alt+drag upwards), the spiral is denser on the periphery; when itis greater than 1 (Alt+drag downwards), the spiral is densertowards the center:

An example image

The maximum number of spiral turns is 1024.

Just as the Ellipse tool is good not only for ellipses but also for arcs (lines ofconstant curvature), the Spiral tool is useful for making curves of smoothlyvarying curvature. Compared to a plain Bezier curve, an arc or a spiral isoften more convenient because you can make it shorter or longer by dragging a handlealong the curve without affecting its shape. Also, while a spiral is normally drawnwithout fill, you can add fill and remove stroke for interesting effects.

An example image

Especially interesting are spirals with dotted stroke — they combine the smoothconcentration of the shape with regular equispaced marks (dots or dashes) for beautifulmoire effects:

An example image

Conclusion

Inkscape's shape tools are very powerful. Learn their tricks and play with them at yourleisure — this will pay off when you do your design work, because using shapesinstead of simple paths often makes vector art faster to create and easier to modify. Ifyou have any ideas for further shape improvements, please contact the developers.


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 5
    评论
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值