QR Code in solidworks

I was looking for easy way to get QR code in 3D model within solidworks. Here’s one recipe hot to do it.

test  qr3dqrfinal

First, get to some online QR code generators, which could export vector graphics, e.g. PNG, SVG, EPS, or similar format. I picked up the first link via google search: http://qrcode.littleidiot.be/

Let’s put some simple “test” into QR code via SVG file. It is obvious, the QR generator compose the QR code with small squares at their proper positions. The squares grid and size are equal, which may cause troubles when used in extrude feature within solidworks. To avoid that, squares should be scaled individually. Open the SVG file in inkscape and scale all squares:

  1. select the drawing
  2. ungroup
  3. select scale 95% for width and height
  4. check the option “Apply to each object separately” and press Apply

transform

 

The QR code should look something like this (with gaps between squares):

qrgaps

 

The preparation is finished by saving the drawing into DXF file.

Now start new part by extruding a square. Place DXF on top face and move the drawing to origin:

qr3d-1

 

Extrude cut to e.g. 1mm:

qrcut1

 

Repeat DXF insertion once again and align the drawing to the origin (or alternatively, convert the extrude edges into line entities):

qr3d-2

 

Use the drawing to cut extrude with the thin feature, which cut the walls away. Change the solid color to black and top surface to white:

qrfinal

 

3 Comments

  1. Matt says:

    I’ve been trying this for a few hours now. I saved my QR code as a DXF file and inserted to the face of my extruded square, I went through the insertion wizard but nothing seems to happen??

  2. Bill says:

    I tried this as well, inkscape generates a file that is 0kb, unusable.

    • Bill says:

      Inkscape has received additional data from the script executed. The script did not return an error, but this may indicate the results will not be as expected.

      Traceback (most recent call last):

      File “dxf_outlines.py”, line 295, in

      e.affect()

      File “C:\Program Files (x86)\Inkscape\share\extensions\inkex.py”, line 221, in affect

      self.effect()

      File “dxf_outlines.py”, line 286, in effect

      self.process_group(doc)

      File “dxf_outlines.py”, line 257, in process_group

      self.process_clone(node)

      File “dxf_outlines.py”, line 239, in process_clone

      self.process_shape(refnode, self.groupmat[-1])

      File “dxf_outlines.py”, line 186, in process_shape

      x = float(node.get(‘x’))

      TypeError: float() argument must be a string or a number

Leave a Reply