Skip to content

Multigrid generator

Wolthera van Hövell requested to merge wolthera/multigridgenerator into master

This adds a generator that applies de Bruijn's multigrid method for generating, amongst others, Penrose Tesselations. The tesselations this produces are unique in that (if the dimensions are not 3, 4 or 6) they only have rotational symmetry, and are otherwise a-periodic, despite being constructed of a limited amount of rhombs. In other words, these cannot be reproduced with a rectangular texture. Hence why I really wanted to get this going in Krita.

I tried my best to get it written in seexpr, but as that does not have for loops, I wasted several days on getting that to work with not much gain. So instead I wrote it as a cpp fill layer generator.

The generator has a number of features, among which line width, colouring of the tiles driven by a gradient, connector lines and tweaking of the colouring depending on a number of factors (shape ratio, and which lines/angles form the intersection that the rhomb in question belongs to).

multi-penrose multi-7d multigrid13d 6dimensional

This patch also hides the new stop gradient editor items when the editor is in compact mode, as we never access fore or background color options when using the compact mode. I haven't implemented predefined gradient selection here, because I didn't want to deal with the resource rewrite right now.

Test Plan

Make a fill layer, select the multigrid option. The default options give a penrose tesselation, at offset .4 there's another penrose tesselation, the others are not because as far as I know the connection lines don't always match at higher dimensions. Be sure to try out different combos of dimension, division and offset, offset in particular controls the final look of the tesselation.

I need some help with the huge amount of options though, maybe I should put it in an abstract scroll area???

Formalities Checklist

  • I confirmed this builds.
  • I confirmed Krita ran and the relevant functions work.
  • I tested the relevant unit tests and can confirm they are not broken. (If not possible, don't hesitate to ask for help!)
  • I made sure my commits build individually and have good descriptions as per KDE guidelines.
  • I made sure my code conforms to the standards set in the HACKING file.
  • I can confirm the code is licensed and attributed appropriately, and that unattributed code is mine, as per KDE Licensing Policy.

Merge request reports