Skip to content

Instantly share code, notes, and snippets.

@reinhrst
Created July 26, 2022 09:27
Show Gist options
  • Select an option

  • Save reinhrst/c48be7d792159ead5d9b42bfe6e5def2 to your computer and use it in GitHub Desktop.

Select an option

Save reinhrst/c48be7d792159ead5d9b42bfe6e5def2 to your computer and use it in GitHub Desktop.

Revisions

  1. reinhrst created this gist Jul 26, 2022.
    10 changes: 10 additions & 0 deletions 3d design.scad
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    scale([4, 4, 1]) {
    translate([20, 20, 0]) {linear_extrude (height=1) {circle(26);}};
    color([0, 0, 0]) {
    translate([0, 26, 0]) { linear_extrude (height=3){import("wifi.svg"); }; }
    translate([2, 15, 1]) { linear_extrude (height=1){rotate(90){text("wifi", size=5); }}; }
    translate([43, 12, 1]) { linear_extrude (height=1){rotate(90){text("hs3.pl", size=5); }}; }
    translate([16, -2, 1]) { linear_extrude (height=1){text("QR", size=5); }; }
    translate([28, 43, 1]) { linear_extrude (height=1){rotate(180)text("NFC", size=5);}; }
    }
    }
    8 changes: 8 additions & 0 deletions Readme.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    # Notes
    - Not sure Pillow is needed (since we're exporting to SVG)
    - The above almost works. For some weird reason, OpenSCAD doesn't think the resulting mesh is closed.
    The solution is to seperately render the extruded QR code, and the rest, as two STL files, and then combine them in the slicer.
    - In the slicer, you would have to fix the colours (not sure if colours would be fixed automatically if OpenSCAD exports to .3MF)
    - The NFC label is because I also stuck an NFC sticker on the back of the print.

    **Bounty: I buy you a beer if you can explain to me why the openSCAD file as advertised doesn't work, and how to fix it (note: I didn't check if it doesn't work for any QR codes, it doesn't for my wifi network)
    3 changes: 3 additions & 0 deletions get qr code in svg.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    #!/bin/bash
    pip install qrcode\[pil\] # or conda install qrcode pillow
    qr --factory=svg "WIFI:S:MySSID;T:WPA;P:MyPassword;;" > wifi.svg