celtic-knot
is a Ruby programme that creates simple rectangular
celtic knot drawings based upon a given set of parameters. The images are in a vector format.
The drawing is in SVG (Scaleable Vector Graphics) format, which is sent to standard output.
Usage: ./knot [options]
-h, --help Prints this help
-V, --vertical=VERTICAL Number of cells vertically.
-H, --horizontal=HORIZONTAL Number of cells horizontally.
-G, --cell-size=CELL_SIZE Dimensions of each cell in the grid.
-b, --background-color=BG_COLOR Background colour.
-k, --knot-color=KNOT_COLOR Knot colour.
-K, --knot-width=KNOT_WIDTH Knot width.
-s, --stroke-color=STROKE_COLOR Stroke colour.
-S, --stroke-width=STROKE_WIDTH Stroke width.
./knot \
--vertical=2 \
--horizontal=2 \
--cell-size=96 \
--knot-color='white' \
--knot-width=24 \
--stroke-color=black \
--stroke-width=8 \
> basic.svg
./knot \
--vertical=3 \
--horizontal=4 \
--cell-size=96 \
--background-color='#012169' \
--knot-color='#C8102E' \
--knot-width=32 \
--stroke-color=white \
--stroke-width=16 \
> ingwine.svg
./knot \
--vertical=5 \
--horizontal=6 \
--cell-size=64 \
--background-color='#169B62' \
--knot-color='#FF883E' \
--knot-width=32 \
--stroke-color=white \
--stroke-width=4 \
> bratach.svg
The SVG file can be viewed locally in your Web browser or converted into other formats such as PNG using utilities such as ImageMagick's convert
. For example:
convert -background none examples/basic.svg examples/basic.png
sudo dnf install ruby rubygem-nokogiri
mkdir ~/src
cd ~/src/
git clone git@github.com:bezborodow/celtic-knot.git
cd celtic-knot
bundle install --local
2023 Damien Bezborodov