Live data from Hacker News

Celtic Code: Drawing knots with Python

2earth.github.io

1–10 of 23 posts

Re: Celtic Code: Drawing knots with Python

#3

A web app that uses Python to create Celtic knots and it's really fun!

Looks neat. Might be worth constraining the inputs. I got an error at 200x200:

  Uncaught PythonError: Traceback (most recent call last):
  File "", line 22, in resetKnot
  File "", line 473, in generateKnot
  File "/lib/python3.12/site-packages/PIL/Image.py", line 2941, in new
    return im._new(core.fill(mode, size, color))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
MemoryError

Re: Celtic Code: Drawing knots with Python

#4
I'm thinking this might have broader use than artistic appeal. From what I've heard, knot generation is a young but increasingly important topic in knot theory, since it can be used to generate data to train ML models on, and subsequently (hopefully) discover new algorithms for knot classification. See https://www.nature.com/articles/s41586-021-04086-x for example.

Re: Celtic Code: Drawing knots with Python

#5
The linked article references George Bain’s book on Celtic knotwork construction methods, but his son Ian Bain actually found a much, much better method, and argues convincingly that this, not his father’s, was the method used by medieval Celtic illustrators. Ian’s method more easily produces consistent rope widths (when done by hand), and addresses the issue of how to soften these angular turns which ruin the rope effect and produce a robotic grid.

The book is out of print now but it looks like you can borrow it on archive.org: https://archive.org/details/celticknotwork0000bain/mode/2up

Re: Celtic Code: Drawing knots with Python

#6

The linked article references George Bain’s book on Celtic knotwork construction methods, but his son Ian Bain actually found a much, much better method, and argues convincingly that this, not his father’s, was the method used by medieval Celtic illustrators. Ian’s method more easily produces consistent rope widths (when done by hand), and addresses the issue of how to soften these angular turns which ruin the rope e…

Thank you! I’ll have to take a look.

Re: Celtic Code: Drawing knots with Python

#7

The linked article references George Bain’s book on Celtic knotwork construction methods, but his son Ian Bain actually found a much, much better method, and argues convincingly that this, not his father’s, was the method used by medieval Celtic illustrators. Ian’s method more easily produces consistent rope widths (when done by hand), and addresses the issue of how to soften these angular turns which ruin the rope e…

Interested in what Iain's method might be, but the method I like is:

1) Draw the 'skeleton' as a connected (simple?) graph in the plane

2) Place crosses at the midpoint of each edge

3) Connect the crosses with shortest (non-crossing!) connections (bit vague this, but is more obvious by hand)

4) Erase the crosses, and run over the line, assigning under/over as appropriate - you can also thicken at this step

This gives good free-standing knots, although may be more work for the dense knotwork in the OP's examples.

Re: Celtic Code: Drawing knots with Python

#8
post #7

The linked article references George Bain’s book on Celtic knotwork construction methods, but his son Ian Bain actually found a much, much better method, and argues convincingly that this, not his father’s, was the method used by medieval Celtic illustrators. Ian’s method more easily produces consistent rope widths (when done by hand), and addresses the issue of how to soften these angular turns which ruin the rope e…

Interested in what Iain's method might be, but the method I like is: 1) Draw the 'skeleton' as a connected (simple?) graph in the plane 2) Place crosses at the midpoint of each edge 3) Connect the crosses with shortest (non-crossing!) connections (bit vague this, but is more obvious by hand) 4) Erase the crosses, and run over the line, assigning under/over as appropriate - you can also thicken at this step This gives…

Actually, this is described well in reverse here :

https://armory-rasa.tumblr.com/post/151872673763/drawing-wit...

Re: Celtic Code: Drawing knots with Python

#10
This post makes me wonder - does anyone else think there is a need for a term to more strongly differentiate between procedural generation (like this knot-drawing program) and genAI? I feel it really diminishes the impact of the work of programmer-artists nowadays to say they make “computer-generated” art. Or maybe we already have such a term?
Post reply on HN