Voronoi pencil holder in Inkscape

I posted about a Voronoi pencil holder I created, and thought it would be nice to explain a little bit about how I did it.

How to make a Voronoi pencil holder in Inkscape

Create the box

First, using the Tabbed Box Maker extension, create the outline of the box you want to cut:

The important things to note here:

  • Box dimensions are internal — this helps with setting a good border around the outside of the eventual design
  • Box type is “one side open (LxW)”, as we want to be able to put things into it :slightly_smiling_face:

Screenshot from 2017-09-21 08-36-22

Clean up the box design

Now we have a box, the next thing to do is clean up what the extension generated. Slightly annoyingly, it creates each edge as a single path, rather than each face. This can lead to the Glowforge doing odd things, like cutting different edges of the face at different times.

In order to fix this, we need to select the four paths that make up each face, and hit Ctrl-K to combine them into a single path (or use Path > Combine from the menus… but I love my keyboard shortcuts).

Unfortunately this still doesn’t give us a closed shape, so use the Node Editor tool (F2) and select the overlapping nodes in the corners using a rubber-band selection (click and drag from an empty area near the corner to draw a selection rectangle around the two nodes).

After releasing the mouse, the status bar at the bottom should say “2 of x nodes selected”. No more, no less. Then press Shift-J or click the “Join selected nodes” button in the toolbar (third from left, with two nodes combining into one). Repeat for each corner, and then repeat the whole “combine and join corners” pattern for each face.

Just to illustrate why this is important, I’ve combined and joined one face, and combined but not joined another, then given both a red fill:

Create a mask for the design

You won’t want your Voronoi design to reach the edges of each face, as the box won’t hold together, so you’ll want to create an area that the design is restricted to. This doesn’t have to be a rectangle; you can be as creative as you like! Make sure that if you use text, you convert it to a path once you’re happy (Ctrl-Shift-C).

Tip: centering won’t quite do what you want with the faces that have a non-finger edge. Instead, you’ll want to set a fill and remove the stroke on the face, align the mask design to the non-finger edge, and then add whatever distance in order to center it manually.

For example, the rectangle is 4mm smaller than the internal dimensions of the face. Centering it horizontally worked fine, but I had to align it to the top of the face and shift it down by 4mm in order to position it properly.

Prepare the Voronoi diagram’s centers

Now that you have your mask, the next stage is where we can be even more creative! First, draw a circle of reasonable size. The smaller the circle, the more cells you’ll get in your Voronoi diagram. Place this somewhere on the top left corner of your mask.

Now we’ll create some tiled clones of this, in order to cover the mask. Go to Edit > Clone > Create Tiled Clones, set the symmetry to P1: simple translation, and enter the width and height of your mask in the appropriate section.

And then configure the shift like this:

Screenshot from 2017-09-21 09-08-26

Make sure that the other options are set to defaults (no scale, no rotation, etc) and then click Create. If you’re not happy with the arrangement, just undo and hit Create again. It may also be helpful to Unclump the circles, as you don’t want too much overlap.

Tip: If you want smaller cells, you can also reduce the shift percentages. For the text faces in this design, I used 40% shift and 80% randomness. Play around until you get something you’re happy with.

Screenshot from 2017-09-21 09-16-09

Next, you want to select all of these circles. While you could do it by hand, there’s a quicker way! Simply Edit > Select Same > Fill Color and you’re done.

Generate the Voronoi diagram

Now for the most important section: generating the Voronoi diagram itself.

With the circles selected, go to Extensions > Generate from Path > Voronoi Diagram… and use the defaults:

Select the newly-generated diagram, ungroup it (Ctrl-U), and combine into a single path (Ctrl-K). Set the stroke width to something reasonably thick, like 2mm:

Then convert the stroke to a path (Ctrl-Alt-C, or Path > Stroke to Path) and we’re nearly done. You can delete the circles at this point.

Apply the design to the face

Select the Voronoi path and the mask, then subtract (Ctrl-minus, or Path > Difference).

And finally, select the mask and the face, and subtract again.

And there you have it! One face to be cut. Now rinse, lather, and repeat :smiley:

Screenshot from 2017-09-21 09-34-37

[Thanks for moving the post, @cynd11!]

60 Likes

Done, and thanks so much for your tutorial!

4 Likes

awesome sauce! seems like the basic steps I go through with Rhino and Grasshopper but WAY more approachable and with free software. Great job!

4 Likes

Thanks, us old guys need all the help we can get. :grin:
I will bookmark this one and get on it maybe this weekend.

6 Likes

Thank you for taking the time to document this. And it is awesome that you give both the commands and the shortcuts!

3 Likes

No problem :slight_smile: I may get around to writing some other tutorials and things in the future, especially as I start writing extensions and other tools to help.

Glad you found it helpful!

5 Likes

I’m all about the shortcuts! Anything that I can do just with the keyboard, I will. Much faster, and breaks my flow less, I think :slight_smile:

1 Like

I have to take the time to change the combine shortcut so it is all in the left hand. Can’t stand jumping from mouse to shortcut.

Nice tutorial. Funny, I have a video in the works demonstrating the Tabbed Box Maker extension. It really is super. I like it better than most of the onlines for regular boxes because it has so many parameters to work with, especially inside and outside and then allows for dividers and open sides. I have a Kleenex box cover all ready to post and demonstrate. You covered almost all the bases in this, plus clone and Voronoi patterning! And explaning the combining and node joining issues is great. These are important if you are going to do some engraving and fill. Thanks so much.

3 Likes

Yeah, it is pretty good. Having said that, I have a whole bunch of ideas for improvements. One of the first will be creating the box panels as closed paths from the very beginning. I also want to support various other options, and make some changes to the way that tabs are defined (i.e. being able to say “I want 5 tabs” rather than specifying lengths). And a whole load of other plans for options…

5 Likes

Great appreciation for your enthusiasm and your tutorial! So nice for those of us who are new to Inkscape! Thank you!

2 Likes

Another excellent tutorial. This sort of information is gold for CNC neophytes like myself, thank you.

3 Likes

Thanks for the great tutorial, I like the tabbed box plug in. Does anyone know how to use inkscape to create tabs in specific locations. I want to learn how to fit 2 rectangles together at 90 degree anlges but not at the edges, rather having one fit into the center of another like a “T”.

I’d liketo know this too. I guess you could use the plug in to get the basic spacing, and then edit the shape manually to move things. But it would be nice if there was some easier way.

I would be happy to know if there was a way to easily determine distance between paths and nodes and adjust said distance. This would held help the issue

There is a Measure tool for inkscape, but I’m afraid I can’t tell you where it is or how to use it. Someone knows, I’m sure.

based on a few old inkscapeforum.com posts, i’m guessing it might be found at extensions>visualize-path>measure-path.

2 Likes