18

I am struggling with drawing the following diagram in Inkscape.

Enter image description here

I can insert math symbols in it, but I don't know how to reproduce the above shown hexagons. Below I have shown a diagram I tried.

Enter image description here

In my figure, nodes of each line get connected to nodes of each circle. So it seems odd. How can I draw the first shown hexagonal lattice diagram?

26
  1. Draw a 6-sided polygon (a hexagon) with the Star and Polygon tool. Hold down Ctrl as you click and drag to constrain the angle.

enter image description here

  1. Do Path > Object to Path to convert to paths.

  2. Using the Select by Nodes tool, select all the nodes, then hit the Break Path at Selected Nodes button.

enter image description here

  1. Do Path > Break apart. This will release all the paths to individual objects. You can now select and recolour each stroke individually, and increase the stroke widths in the Fill and Stroke panel.

enter image description here

  1. Draw a small circle with the Ellipse tool, holding down Ctrl as you click and drag to constrain proportions. Set a black stroke, and white fill.

  2. In the Snap Controls bar, enable Snapping, Snapping to nodes, Snapping to cusp nodes, Snapping to miscellaneous points, and Snapping to object rotation centres. All the snapping options to enable are shown here

  3. Click and drag the circle so that it snaps the nodes to the centre of the circle. Press Ctrl+D to duplicate the circle, move and repeat until you have added all the circles

enter image description here

  1. Select and Group all these objects.

enter image description here

  1. Ctrl+D to duplicate, click and drag to snap, repeat.

enter image description here

6
  • Thanks for the answer. I followed up to the point 6. I enabled snapping controls bar. But i don't find any snapping to miscellaneous points there. I also unable to snap as you shown. When i place the circle in between two lines they don't separate out. Please can you comment on this issue ? Jul 18 at 12:52
  • See the location of all the snapping controls to enable here. I've also added this link to the answer if anybody else needs to see their location. I also left one out by accident. Appologies. I've now edited the answer to include all 5 settings.
    – Billy Kerr
    Jul 18 at 13:07
  • 7
    It's also worthwhile familiarising yourself with these snap controls generally, as they are a very powerful part of Inkscape's functionality. They're quite complex, and there's a bit of a learning curve.
    – Billy Kerr
    Jul 18 at 13:32
  • 5
    Note that this is creating duplicate geometry wherever the duplicated groups overlap. For simple cases such as the final image above this works absolutely fine. It may, however, cause problems later. If you apply a shadow, for example, the shadow under duplicated nodes may appear much darker (because there are actually multiple shadows). Even without anything as complicated as a shadow, the duplicated parts may appear darker or wider due to antialiasing. It's not a problem until it is; just something to be aware of in case you see "weird stuff" later.
    – A C
    Jul 19 at 0:48
  • 3
    @AC - I am well aware of that. The duplicates could be removed afterwards if they are problematic. One would simply need to delete them. The above tutorial is already long enough without going into further unnecessary detail. For a simple graphic as shown, the overlaps are inconsequential.
    – Billy Kerr
    Jul 19 at 8:56
9

Billy Kerr's answer is the canonical way to draw regular hexagons (and beautifully illustrated, I might add), but I would propose an alternative for your specific situation: a hexagonal grid.

  1. In Document Properties, select the Grids tab.
  2. Choose Axonometric Grid and press New. Change the grid spacing as desired, but leave the angles as they are (30°).
  3. Ensure Snap to grids, Snap nodes, paths and handles, and Snap an item's rotation centre are all enabled on the Snap Controls Bar.

Now you can draw lines that follow the grid, and you can move circles so that their centres align with the grid points (and thus the lines' ends).

2
  • I'm not so sure I'd call the method I posted "canonical". There are always plenty of different ways to skin a cat in Inkscape ;) Grid snapping is certainly another effective method to create such graphics. +1 from me!
    – Billy Kerr
    Jul 19 at 17:38
  • @BillyKerr: "Canonical" in the sense that "there's a specific tool for the exact purpose of drawing regular polygons". :-) Thanks though! Jul 20 at 12:48
2

Another method:

  • Draw a vertical line.
  • Set your angle snap to some divisor of 60° if it isn't already (Preferences → Behavior → Steps).
  • Duplicate it, rotate it 60° (hold ctrl to snap to steps).
  • Move it so its endpoint aligns with that of the previous line.
  • Continue as in Billy Kerr's answer.

This might be more generally useful, since it will also help if you need to make other angles.

1
  • Well I learned something new! I can't remember when or why I was wanting to make an angle that's not a multiple of 15° (the default on my install), but I do remember that I was… Jul 21 at 8:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.