Saturday 25 October 2014

LibreCAD: "A picture is worth a thousand words"

While I'm not sure about the official exchange rate, it certainly helps to use both sketches and formal drawings to help understand concepts, and also to plan & execute projects.


Open source applications such as LibreOffice Draw and LibreCAD can be valuable tools when working on DIY projects.


I normally begin the planning process of a new home project with some kind of a sketch.
While this can be scribbled on a scrap of paper, its frustrating when, possibly weeks later, I can't lay my hands on it, and have to start again.

So now I generally do a simple sketch on my laptop, often using the drawing application in LibreOffice.


I know its only a sketch, but I just can't resist "colouring-in" the shapes

This also means I can add detail to the sketch as the plan unfolds.

For block diagrams this is a pretty quick method, although I guess this will probably be replaced by free-hand sketches on a tablet+stylus at some point in the near future.

For more complicated circuit diagrams, and for physical component layouts, a 2D CAD application such as LibreCAD (formally QCAD) is generally more appropriate.

LibreCAD Survival Guide


Although I first used 2D CAD back in the mid 1980s, I've only ever tinkered, and never read a CAD user manual. But here are 10 tips for the occasional user like me.

Escape!

Pressing the <esc> key a couple of times will de-select any drawing object and get you back to an arrow mouse pointer. So if you are not sure where you are, hit <esc> twice.

When you draw a line, the drawing tool remains active so you can add an additional connecting line. Again, you dismiss the line tool by hitting <esc> twice when you have drawn the line you need.

Undo

Use <ctrl><z> to undo last edit (and previous edits if you <ctrl><z> again & again). This is a common "undo" key sequence for many different applications.

Zoom

Zoom in using <ctrl><+> and out using <ctrl><->

Again, this also works on other applications, such as web browsers.

Snap to grid

Always use "Snap on Grid" until/unless you really know what you are doing.

The grid is enabled from the View menu. Snap on Grid is controlled from the Snap menu.

The grid is shown by faint dots and lines on the work area.

If I'm not going to use dimensioning when I start a new drawing, I usually begin by zooming in until I have a fairly dense grid.


This approach is OK for wiring or circuit diagrams. I usually start by drawing some of the smallest objects first, like terminals and test points.

Dimensioning

If you want to add dimensions to your drawing, make sure you start with the required scaling. The easy check is to draw a dimension line:-

Menu Dimension > Horizontal

...then left-click a grid point, left-click a second grid point and then drag down to stretch out the dimension object.



You may also need to go to menu Edit > Current Drawing Preferences to set Units.

Copy and/or Move

Select the item by either left-click over the item or left-drag the mouse across an area to create a selection of objects.
Use menu Modify > Move/Copy



Click the "Continue Action" icon that appears on the left of screen.
Use the cross-hair cursor to left-click on a reference point (probably the centre of the circle in this example).
Move the mouse and then left-click on your target location.


If your intention was to Move the object, just select Delete Original.
For a single copy select Keep Original.
If you select Multiple Copies and then enter a number, LibreCAD will create the required number of copies spaced out from the original. This is great for producing repeating patterns, like the holes in stripboard.

Change Attributes (e.g. line colour)

Select objects by left click-drag over objects.
Select menu Modify > Attributes
Select Continue Action (>>) from left-hand action buttons.
Then change colour (or line width/style).

Grouping Items

If your have made a shape (e.g. a 14 pin dil chip) you can group the individual elements to form a new Block:-

Select your object(s) by left click-drag over objects.
Menu Blocks > Create Block
Use cross-hair pointer to pick a reference point within the object.
Enter a unique name for this Block and click OK.



Now, if you want to insert a copy of this block, select Block name from the Block list.
Select Insert the Active Block using Block list icon, or use menu Block > Insert Block
The block should appear and allow you to position it.

Layers

Layers are an essential feature for both image editors and CAD. It makes life much easier when working with assembly drawings.

Here is the drawing for a simple RaspberryPi add-on board constructed on standard stripboard.


There are 6 visible layers denoted by the eye icon alongside each layer in the list. Hidding layers via the eye icon is useful to minimise clutter. For example; when cutting the tracks on the stripboard I just enable the 2 layers: Cut Board & CutTrack.

The padlock indicates which layers are locked, so in the illustration all layers are protected from accidental changes, except the Components layer which can be edited.

The layer name and drawing colour used can be set by highlighting the layer and selecting the small icon at the top right of the Layer List.

I suggest you keep each printer icon enabled, because when disabled it produces a HelpLayer. No idea what this is for, but it extends all horizontal & vertical lines to infinity...and beyond!


Exporting an Image

To create an image file, like the one I've pasted below, simply select menu File > Export...  and enter a file name/location.

In the Image Export Options dialog, the Bitmap Resolution is quite important, as it influences drawing detail and file size. In my example I've set Resolution: 5 but please experiment with this setting.

The drawing extents are determined by what you have drawn on the work area. So the exported image will include everything plus a margin. I suggest you set the margin to about 10% of the image size.


I also set:-
Background: white
Colouring: coloured

Note a great image, still room for improvement.


...and finally

 

As with most modern GUI apps, there are several ways of achieving the same thing (e.g. menu, icon, short-cut keys). So choose the method that suits you, not necessarily the one presented here.

No comments:

Post a Comment