Islamic Radial Geometric Design: SVG Templates for Inkscape

These SVG templates are modelled after Eric Broug‘s drawing templates for Islamic Geometric Design pattern elements. Although written for Inkscape, they should be usable with almost any graphics program.

By enabling snapping to nodes and object centres, your drawing program can act like an accurate straight edge and compass for constructing geometric figures.

File Nomenclature

The files are name N-LL-S.svg, where:

  • N — is the root symmetry: 4-fold, 5-fold, 6-fold, etc.
  • LL — the total number of lines arranged evenly around the circle. This will always be a multiple of N.
  • S — If the total number of lines has another symmetry that is a factor, this is S. If S = 0, then only the root symmetry is marked.

Examples:

  1. 4-12-6.svg — base symmetry 4-fold (square/diamond), with 12 lines or 30° spacing. Hexagonal (6-fold) guidelines are highlighted in a different colour.
  2. 5-10-0.svg — base symmetry 5-fold (pentagonal), with 10 lines or 36° spacing. No other guidelines are highlighted.

Features

In Inkscape 0.91:

  • units set to mm
  • snapping set to cusp nodes, intersections, and object rotation centres
  • construction lines on a separate layer (‘construction’) from the active layer (‘drawing’)
  • templates are initially sized at 100 x 100 mm
  • hair-line (0.1 mm) construction lines

Licence

WTFPL (srsly).

Files

All files, zipped: radial-templates-for-inkscape.zip

Individual files, with SVG linked behind image:

4-08-0
4-08-0
4-12-6
4-12-6
4-16-0
4-16-0
4-20-5
4-20-5
4-24-6
4-24-6
4-28-7
4-28-7
4-32-0
4-32-0
4-36-6
4-36-6
4-36-9
4-36-9
4-40-5
4-40-5
4-48-6
4-48-6
4-60-5
4-60-5
4-60-6
4-60-6
4-72-6
4-72-6
4-72-9
4-72-9
5-10-0
5-10-0
5-20-4
5-20-4
5-30-6
5-30-6
5-40-4
5-40-4
5-50-0
5-50-0
5-60-4
5-60-4
5-60-6
5-60-6
6-12-4
6-12-4
6-24-4
6-24-4
6-30-5
6-30-5
6-36-4
6-36-4
6-36-9
6-36-9
6-42-7
6-42-7
6-48-4
6-48-4
6-60-4
6-60-4
6-60-5
6-60-5
6-72-4
6-72-4
6-72-9
6-72-9
7-28-4
7-28-4
7-42-6
7-42-6
9-36-4
9-36-4
9-36-6
9-36-6
9-72-4
9-72-4
9-72-6
9-72-6

Arabic Geometrical Pattern and Design (Dover Pictorial Archive) [Kindle Edition] review

Product link: Arabic Geometrical Pattern and Design (Dover Pictorial Archive) eBook: J. Bourgoin: Amazon.ca: Kindle Store

Summary: Buy the paper edition; this book is illegible on Kindle.

The original book features very finely engraved line drawings, with construction lines showing how the patterns are built up. The Kindle edition has only low-resolution scans, so the lines break down into noise and are very hard to follow. You can’t zoom in, either. The figure numbering is entirely absent from the Kindle edition, so you can’t use this book for reference. Some of the page scans are squint and partially cut off, too.

Very disappointed in this purchase. You’re better off with the paper than trying to squint at these smudgy pixels.

kindlefail

(unedited text as simultaneously posted to Amazon)

Zeta: heart-in-mouth time …

flashing zeta romI’d been having no luck getting the SD card working on my Zeta. I got help on the mailing list, and uploaded a new 512KB Flash ROM image (via XMODEM and floppy; teh slow!). So now I have two multi-megabyte drives on my CP/M computer — whee!

Zeta: it lives!

zeta_firstboot-20150725wYou have no idea how good it was to see that message come through over the serial link. The Zeta worked first time!

Here’s the board, fully populated:

zeta-complete-20150725I still have to put it in a proper case. A visit to Above All Electronics did result in getting a floppy drive (and most importantly, 3½” 1.44 MB floppies …) and all the cables, so I’ll add that later. But for now, I’ll try to remember how CP/M works …

 

Zeta: all soldering done!

Please excuse horrible blurry photo, but I think all the soldering is done —

zeta-20150724This adds the crystal sockets, the 32.768 kHz RTC crystal, the status LED(s) and the reset button.

A whole new board I soldered up is the Mini-PPISD. It adds (slow) SD card storage to an SBC board:

ppisd-20150724Man, but those surface mount SD card pads are a pain. I had to get flux on the PCB pad and the bottom of the SD connector, load a little blob of solder on the iron, then warm up the pad and roll the solder into place. It made a satisfying little Zsht! noise as the flux burnt off, and the molten solder got drawn under the pad by capillary action.

Next up is checking the power and ground continuity, adding the chips, building a null modem (grr; I hate RS232, really) and finding a case. I may already have one, but I may forage at Above All to get a 3½” floppy drive and enclosure. I definitely have an old Turbo/reset button from an XT that would make a great reset breakout.

Zeta: looks more finished than it really is

zeta-20150712Just waiting for the full-can oscillator sockets (and most of the chips) to arrive from Mouser. I could have used 14-pin DIP machine pin sockets, as Sergey was thoughtful and had all of the holes drilled.

Most of the big sockets need to be fully soldered, as at the moment they’re just tack-soldered at the corners. Maybe I’ll put on some dronecore and have a meditative time with the Sn-Ag tonight. I’ll be glad to get the flux off the board, though: it’s not my usual stuff (which is Kester #951; no clean ftw), and what I’m using is smoky and a bit gummy. It does make nice bright joints, though, which is never 951’s strong point.

Thermal Printer driver for CUPS, Linux, and Raspberry Pi: zj-58

This might be my last post on mini-printers, as I’ve found a driver that just works with CUPS on Raspberry Pi. It also works on Ubuntu on my laptop, and should work (though untried) on Mac OS. You’ll have to build it from source, but it’s not too hard.

The hard part is working out if your thermal printer will work or not. There are many out there, and they’re all slightly different. If they support the ESC/POS bitmap command GS v 0 on 58 mm wide paper, they should work. The ones I’ve tested are:

  1. Catex POS5890U — USB, cheap, fast.
  2. “701” control board panel printer — fairly generic, decent quality printer with serial input. A bit slow for daily use at 9600 baud.
  3. Xiamen Embedded Printer DP-EH600 — as above.

The following should also work, but haven’t been tried:

  • Adafruit Mini Thermal Receipt Printer — again, serial, so not super fast.
  • Sparkfun thermal printer — which now appears to be identical to the Adafruit unit, and is referred to as the “A1 (or A2) micro panel printer” in the documentation.

Known not to work:

  • BTHT-V6 printer — which uses a completely different command set.

If you have a manual for your printer, check it to see if it prints bitmaps by sending a three byte header of 29 118 48 (or 1D 76 30 in hexadecimal). If you’re not sure, try it with a small test image, and be ready by the power switch …

Getting and building the driver

The driver is meant for a ZiJiang ZJ-58 printer, and lives here on Github: klirichek/zj-58.

Building it is fairly easy, though it has some package requirements you’ll need to meet. On Raspbian, do something like:

sudo apt-get install libcups2-dev libcupsimage2-dev git build-essential

Then you can download the code:

git clone https://github.com/klirichek/zj-58.git

Building it is straightforward:

cd zj-58/
make

and installing takes all of:

sudo ./install

You’ll still have to set up the printer to accept jobs, but now you have the driver installed.

Setting up the printer

This bit is much more graphical. Open up the printer settings window:

2015-07-11-220946_452x281_scrotSelect the Add icon, and the New Printer window opens:

2015-07-11-221141_602x592_scrotThe POS5890U shows up as “Unknown” on my USB port, as Linux doesn’t know the name of this device from its USB ID. Your printer might have an known ID, or show up as a serial port. Select the right one, and click Forward:

2015-07-11-221221_602x592_scrotHere, I’m really pleased that the driver is for a Zijiang unit, as it’s conveniently at the end of the list. Click Forward

2015-07-11-221240_602x592_scrotNo options here, so again, Forward

2015-07-11-221311_602x592_scrotI changed the name from the default ZJ-58 to the more unixly zj58. You don’t have to, but either way, Apply the changes.

2015-07-11-222030_452x281_scrotAnd there it is, registered as a printer!

Printer Options

Most printers expect paper wider than 58 mm, but mini-printers can’t do that. To tell the system about paper sizes, right click on the printer’s icon, and change the printer settings:

2015-07-11-222225_570x560_scrotA test page might print properly now, but you should probably go into Printer Options first:

2015-07-11-222239_570x560_scrotYou do want to set the media size to at least 58 × 210 mm. This is just the longest strip it will print in one ‘page’; if your print is shorter, it won’t waste extra paper. You can choose longer prints, but not wider. The default assume your local standard paper size which —be it A4, Letter, or whatever — will not be what you want here. Hit OK.

Printing something

You could print the self test page, but it’s long and boring. If you’re fairly sure your printer will be supported, try this scaled PDF version of the Raspberry Pi Logo: raspberry-pi-logo.  Printed and scanned, it came out like this:

raspberry-pi-logo-miniprinterNot the best rendition, but not bad for a $30 receipt printer. My test image came out like this (iffy scan, sorry):

zj58-driver-testI haven’t covered the intricacies of setting up serial port connections here; maybe another time. Also, there’s a short delay (maybe 10–20 s) between selecting Print and the printer coming to life. CUPS is pretty complex, and is doing things in the background while you wait.

(Seeing as I use their logo prominently up there, I should totes acknowledge that “Raspberry Pi is a trademark of the Raspberry Pi Foundation”. Also, I couldn’t have done all this without the support of Reed Zhao. Though Reed has moved on to bigger things and doesn’t sell printers any more, his help — not to mention the generous loan of a couple of printers — was very welcome.)

Oh no, he’s messing about with thermal printers again …

Instagram filter used: Lo-fi

View in Instagram ⇒

Scored this cheapo USB printer on eBay: “High-speed 58mm POS Dot Receipt Paper Thermal Printer USB”. It identifies itself as a CATEX Technolog [sic] POS5890U, with a USB vendor:product ID of b000:0410. After a bit of random fiddling, it shows up as /dev/usb/lp0 on a Raspberry Pi. After turning off CUPS (as it nabs the device, not even letting root near it), you can print images up to 384 dots (48 mm at 8 dots/mm) wide using the ESC-POS GS v 0 command. You can use my esc-pos-image.py script if you wish, and if you need a test image

(The photo is of Marie Doro; proto-goth 1902 style.)

Minimalist Computer Build: Zeta SBC

zeta sbc v2 boardI’m building a Zeta SBC V2, a basic Z80 computer in the spirit of the N8VEM. I’m trying to kit it out mostly locally, which means extensive trips to Creatron, Supremetronics/Honson Computer (aka the basement of College Home Hardware), Above All Electronic Surplus, and Active Surplus.

Fun discovery #1: not all CR-2032 battery holders are the same size. This board call for the one just a tiny bit larger than the coin cell itself. Most of the ones with the retainer clip that goes over the battery are too big, and will prevent other components being installed.

Just in case you were needing a thermal printer test image …

Thermal Test Image

Here you go, then. It should print perfectly on an 58 mm thermal printer. It features:

  • 12½% grey scales (clockwise, from right) — ordered, Hilbert (clump=5), Floyd-Steinberg, and halftone (4 pixel/cell).
  • Vertical and horizontal test lines.
  • Classy woven background.
  • Roughly 50% grey overall, so shouldn’t cause your printer too much grief.
  • Entirely free of licence restrictions.

 

GSView … not to be confused with GSview

Artifex’s GSView is rather good. It describes itself as ‘a user friendly viewer for Postscript, PDF, XPS, EPUB, CBZ, JPEG, and PNG’, and it sure does those things. It’s currently bundled as Mac, Windows and Linux Intel-only binaries, but maybe we’ll see ARM distribution or source soon enough.

The name confused me a bit. Russell Lang of Ghostgum Software Pty Ltd has maintained a nice Windows-only Ghostscript front end called GSview for years. Note the huge difference in names: Artifex‘s release is GSView 6, while Ghostgum’s is GSview 5. Hmm.

GSView on Linux

Naming aside, GSView does make it very easy to convert its input files to PDF/A, the ISO standard archival PDF definition that is immune to Adobe’s format meddling. (Adobe have, with Acrobat Reader DC, maintained an unbroken tradition that their latest PDF reader software is more bloated and craptastic than the last.)

PDF/A defines several archival settings such as font embedding and colour management. It’s possible to do this on the Ghostscript command line, but it’s fiddly.  GSView just needs you to point it at the colour standard files on your system. On Mac, these live in /System/Library/ColorSync/Profiles/, and in the image below, I’ve picked out the generic ones:

GSView Mac Colour Profiles

On Linux, these files will likely be somewhere predictable; for me, they are in /usr/share/ghostscript/9.15/iccprofiles/. I made copies in the GSView executable folder so they wouldn’t get lost if my system updates Ghostscript:

GSView Linux Colour Profiles

The PDF/A files you get can be considerably smaller than the originals. A 10 MB LibreOffice Impress slide deck from a presentation on OpenStreetMap that I gave last week shrunk down to 1.3 MB when saved by GSView, with only very minor JPEG gribblies visible in the slide background. The graphic above (modified from the Ghostscript example file ‘golfer.eps’; yay, Illustrator 1.0!) shrunk by ⅓. These are handy savings, plus you get a standalone archival format that will never change!

Gurney-7B

f7b-colour
A minimally-useful tracing of the standard numerals embossed
on credit cards. The geometry should be checked against ISO/IEC 7811—1:2002 should these data be used for official purposes. No claims of compliance are made here.

As there are only 10 digits in this font, encoding it as a digital
form (TTF, OTF, or otherwise) is left as an exercise for the reader.

Files

  1. f7b-colour.svg – an A4 sheet with all 10 digits presented as a
    poster. Each digit is approximately 1284% standard size.
  2. eps folder – PostScript source files. Each outline is approximately 5695% standard size, which is appropriate for a glyph in FontForge.

Workflow

The rough character outlines were created as short scripts in Python,
using the Shapely library to handle geometry. A confusing array of support tools (including, but not limited to: QCAD, wellknown
and OGR added the arcs and fillets. The more complex arc intersections were calculated using GeoGebra. Finally, the
outlines — at this point, mostly in the form of PostScript Level 2
arct commands — were hand-keyed into the EPS files included here.

Notes on the data

  1. There are some typos in the published coordinates, particularly in
    the “1” glyph. Whether these are genuine errors or
    trap streets‘, is hard to tell. The glyphs presented here are intended to be visually accurate
  2. The published coordinates of the “8” glyph indicate that it is
    only 97.6% as tall as the other digits. This has been carried
    through here.

Also on github: scruss/Gurney-7B

LibreOffice brings the old

Twenty-two years ago, I wrote a thesis. It wasn’t a very good thesis, but it did what it needed to do. For years, its model files have been unreadable, because the spreadsheets were written in a ~1992 version of Microsoft Works. These are old files:

1993-04-21 03:19 newmodel.wks
1993-04-21 03:19 newmodel.wk1
1993-04-08 06:29 pr_fa.wks

Quite recently, LibreOffice realized that there are old files out there that (unlike my thesis models) could still be useful. As they have no commercial requirement to only support the latest and greatest, LibreOffice added the ability to read these ancient works. So my old stuff lives again:

ms works files from 1993

I found a screen dump that I used back in ’93 to illustrate the layout. The display was colour, but here it is brought back to life with a little bit of antialiasing:

'93 print stylee

LibreOffice can also read old AppleWorks files. Although Works 6 still runs on Catherine‘s Mac, it looks a bit … dated:

appleworks

Thanks, LibreOffice! It’s sometimes easy to forget (like right after updated to Ubuntu 15.04, which decided that BlueTooth support was kinda optional unless you jumped through hoops …) that people do write software just to be more useful.

Running FreeBASIC on Raspberry Pi

FreeBASIC is a pretty nifty cross-platform BASIC compiler. It uses a Microsoft-like syntax, has an active user and developer base, and is quite fast. Building the latest version on a Raspberry Pi is a bit of a challenge, though.

FreeBASIC 1.01 demo running on a Raspberry Pi
FreeBASIC 1.01 demo running on a Raspberry Pi from Geany

Part of the problem is that FreeBASIC is mostly written in FreeBASIC, so you need a working compiler to bootstrap the latest version. The following steps worked for me:

  1. Install some necessary packages:
    sudo apt-get install build-essential libncurses5-dev libffi-dev libgl1-mesa-dev libx11-dev libxext-dev libxrender-dev libxrandr-dev libxpm-dev ncurses-doc libxcb-doc libxext-doc libgpm-dev git libcunit1 libcunit1-dev libcunit1-doc

    (You don’t really have to include the cunit packages; they’re only needed if you run tests before installation.)

  2. Download a nightly binary from Sebastian’s server: http://users.freebasic-portal.de/stw/builds/linux-armv6-rpi/  and install it:
    unzip fbc_linux_armv6_rpi_version.zip
    cd fbc_linux_armv6_rpi/
    chmod +x install.sh
    sudo ./install.sh -i

    Don’t delete the installation folder just yet.

  3. Grab the latest version of the source from github:
    cd
    git clone https://github.com/freebasic/fbc.git

    Change directory to the new FreeBASIC source folder (cd fbc), and type make. (or, on a Raspberry Pi 2, make -j4 to use all the cores …). After a while (in my tests, about 52 minutes on a 512 MB Raspberry Pi, or around 6½ minutes [!] on a Raspberry Pi 2), it should finish. If there’s a bin/fbc file, the compilation worked!

  4. Before you install the new compiler, uninstall the old one: change directory to the fbc_linux_armv6_rpi folder, and type:
    sudo ./install.sh -u
  5. Once that’s done, go back to the new fbc folder, and type:
    sudo make install

And you’re done! You can delete the fbc_linux_armv6_rpi folder now. If you don’t mind it taking up space, keep the fbc folder to allow you a quick rebuild of the latest version of the compiler with:

cd fbc
git pull
make
sudo make install

Note that this will build a native armv7l compiler on a Raspberry Pi 2, and an armv6l one on a Raspberry Pi. This means you can’t run binaries you built on a Raspberry Pi 2 on a Raspberry Pi (you’ll get an Illegal Instruction error), but you should be able to run ones built on a Raspberry Pi on a Raspberry Pi 2. Binary compatibility is overrated, anyway …

∞ Noise

(Quick reminder, before it becomes obvious from the text — I have more interest in hardware random number generation than I have understanding …)

Just got Bill “WaywardGeek” Cox’s Infinite Noise USB Random Number Generator. It uses very few components, and doesn’t even have a microcontroller on board. It relies on the controlled amplification of thermal noise as its entropy source.

Not great enhanced image of the Infinite Noise board. Yes, that's all there is to it
Not great enhanced image of the Infinite Noise board. Yes, that’s all there is to it

As it’s so very simple, it uses a driver to read from the device, and then hashes the data to reduce the data stream to very close to pure noise. Building the driver is easy, once you work it that the code lives in the infnoise/software folder on the author’s github repo.

Normal operation would look like this:

sudo ./infnoise | entropy_consuming_program …

as in

sudo ./infnoise | rngtest -t 10

which I left running for a work day to get

…
rngtest: bits received from input: 10327720032
rngtest: FIPS 140-2 successes: 515955
rngtest: FIPS 140-2 failures: 431
rngtest: FIPS 140-2(2001-10-10) Monobit: 63
rngtest: FIPS 140-2(2001-10-10) Poker: 61
rngtest: FIPS 140-2(2001-10-10) Runs: 162
rngtest: FIPS 140-2(2001-10-10) Long run: 151
rngtest: FIPS 140-2(2001-10-10) Continuous run: 0
rngtest: input channel speed: (min=29.022; avg=178.828; max=19531250.000)Kibits/s
rngtest: FIPS tests speed: (min=17.403; avg=30.153; max=85.917)Mibits/s
rngtest: Program run time: 56727702860 microseconds

So from its success to failure rate, it produces pretty decent (for my casual use) results. These bytes chug out at around 22¾ Kbytes/second; not screamingly fast, but decent, considering the very simple hardware.

You can run the hardware without hashing/whitening, and the results (from a much shorter run) are less solid:

sudo ./infnoise --raw | rngtest -t 10
…
rngtest: bits received from input: 15499264
rngtest: FIPS 140-2 successes: 0
rngtest: FIPS 140-2 failures: 774
rngtest: FIPS 140-2(2001-10-10) Monobit: 0
rngtest: FIPS 140-2(2001-10-10) Poker: 774
rngtest: FIPS 140-2(2001-10-10) Runs: 774
rngtest: FIPS 140-2(2001-10-10) Long run: 0
rngtest: FIPS 140-2(2001-10-10) Continuous run: 0
rngtest: input channel speed: (min=27.201; avg=355.760; max=9765625.000)Kibits/s
rngtest: FIPS tests speed: (min=24.868; avg=30.488; max=41.554)Mibits/s
rngtest: Program run time: 49831593 microseconds

Another naïve test is seeing how images made from the data stream look:

don't stare at this too long, or richard d james's grinning mug will appear
random bytes (PNG), file size 49435 bytes
nvrandom20150121074051
raw bytes (PNG), file size 45421 bytes

Each of these 128 pixel squares should be no less than 49152 (= 128 × 128 × 3) bytes — plus the size of any PNG header/metadata — in size. The fact that the raw output is smaller shows that PNG’s compressor found some patterns it could work with.

It’s a fun little device, and Bill is adding new code and features to the driver at waywardgeek/infnoise regularly.

Home-brew Jetstream Plotter Pens

After a relative lack of success in making cheap plotter pens, I managed to score a trove of old pens on eBay. Some of these were dry, and I tried to resuscitate them. A few came back to life, but I ended up with a handful of very dead pen shells.

mystery_pen-alvin_maybe
A dry plotter pen, possibly Alvin

I think the pens were made or sold by Alvin, as there were several empty Alvin trays in the batch I got on eBay. In taking one apart, I thought that a pen refill might just slide inside. Lo and behold, but didn’t the pen nerd’s fave gel pen du jour refill just slide in with enough of an interference fit that it wouldn’t easily slide back out.

Taking the dry pens apart isn’t too easy:

  1. Pull the black tip straight out with pliers; it has a long fibre plug which goes into the ink reservoir. Discard the tip.
  2. While it’s really hard to see, the other end of the pen body has a push-on plug. Gently working around it with a sharp knife can open it up a bit.
  3. Once you’re inside the pen, pull the dry fibre ink reservoir out with tweezers and discard it.

Converting the pen body to use a Jetstream refill needs some tools:

  1. Drill a hole in the plug at the end of the pen body just large enough to allow the end of the refill to pass through. It helps if this is mostly centred to keep the pen point centred; this is important for accurate plots.
  2. Cut a piece of tubing just wide enough to slip over the pen refill, but not quite narrow enough to fit through the hole you just drilled. I used some unshrunk heatshrink tubing for this. It needs to be just long enough to push against the plug when the pen tip is at the right length. This should help stop the refill getting hammered back into the body by your plotter.
  3. Before you assemble the pen, I find it useful to cut a couple of flats in the sides of the plug so you can more easily change the refill. You don’t have to do this, though.
  4. Assemble the pen:
    1. Push the Jetstream refill into the pen body, and adjust it so it sticks out about 6 mm clear of the plastic collar near the nib.
    2. Put the tubing over the other end of the refill, and push the plug over the top, clicking it into place.
img_1220
Three pens in place on my DXY-1300

To get best results, you’ll have to slow your plot speed down quite a bit. At standard speeds, you get a ¼ mm interrupted line which looks like this:

Jetstream at full speed
Jetstream at full speed

Close up, the lines are really faint

A hint that I should run them slower was at the start of each line, where the line would start very thick, then taper off as the ink supply ran low:

acceleration blobs
acceleration blobs

Run at 120 mm/s, the results where a bit darker, but still blobby at the start of lines:

120 mm/s
120 mm/s

Slowing down to 60 mm/s produced slightly better results:

60 mm/s
60 mm/s

But sharpest of all was at the crawling speed 30 mm/s:

30 mm/s
30 mm/s

Some pronounced blobs at the starts of lines still. Here’s the full page at 600 dpi, squished into a very lossy PDF: jetstream_plotter-slow

The blobs could be due to this, though:

grode on pen tip
grode on pen tip

It seems that a mix of paper fibres and coagulated ink builds up on the tip. Occasional cleaning seems to be a good idea. It also seems to help to draw a quick scratch line before anything important so the ink will be flowing properly.

Just to sign off, here’s one of the pens in action: