This blog is devoted to patterns made with polygons. I'll try to have something interesting posted regularly.
Tuesday, February 10, 2026
Fireball
Wednesday, May 28, 2025
Thursday, January 13, 2022
D3 playing with data
Here's my take on Gödel, Escher, Bach cover in an attempt to start my new class, DATA ANALYTICS: PRINCIPLES & TOOLS.
These were generated with DataToolit. I probably went overboard on using arrow functions in the coding. What I found interesting in writing the code was that interconnected three different projections has some subtlety. I do not understand the constraints on data set, but I was very constrained on my last choice of projection, the y. Perhaps I'll give it some thought later. Also, D3 is not the best choice for 3D but I've recently be playing around with D3 in my course WEB TECHNOLOGIES, so I figured why not.
You may enjoy playing with the javascript. The interface needs work but I doubt I'll get around to fixing it until I have another need for something similar.
Details
[1,1,1,1,1,1,0,0,0,0,0,1,0,0,1,1,1,1,1,1,0,0,1,0,0,0],
[0,1,1,0,0,1,1,0,0,0,1,1,1,0,0,0,1,1,0,0,0,1,1,1,0,0],
[0,1,1,0,0,0,1,1,0,0,1,0,1,0,0,0,1,1,0,0,0,1,0,1,0,0],
[0,1,1,0,0,0,1,1,0,1,1,0,1,1,0,0,1,1,0,0,1,1,0,1,1,0],
[0,1,1,0,0,0,1,1,0,1,1,1,1,1,0,0,1,1,0,0,1,1,1,1,1,0],
[0,1,1,0,0,0,1,1,0,1,1,1,1,1,0,0,1,1,0,0,1,1,1,1,1,0],
[0,1,1,0,0,1,1,0,1,1,0,0,0,1,1,0,1,1,0,1,1,0,0,0,1,1],
[1,1,1,1,1,1,0,0,1,1,0,0,0,1,1,0,1,1,0,1,1,0,0,0,1,1]
[1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,0,0,0,0],
[0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0],
[0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,1,1,1],
[0,0,0,1,1,0,0,1,1,1,1,0,0,1,1,1,1,0,0,1,1,0,1,0,0,0],
[0,0,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,1,0,1,1,1,0],
[0,0,1,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,1,0,0,0,0,1,1],
[0,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,1,0,0,0,0,1,1],
[0,1,1,1,0,1,1,1,1,0,0,1,1,1,1,0,0,1,1,0,0,1,1,1,1,0]
]
Friday, March 20, 2020
Content for now
I'm going to fiddle with this later. The code is not that ugly. Aside from JQuery and math.js, it's under 200 lines of source half of which is Javascript. It still needs commenting but I'm off to 3D land to start working of a tree version of FibBox which is already a bit mind warping. Here's the latest version of the Fibonnaci trees.Tuesday, March 17, 2020
Solved but still plugging
This has none of the unexpected lines. I'm still not loving some of the boundary colour meshing but these are just choices which I can now put some time to improve on.
This update has some hoving CSS that allows you to see the Fibonacci connections of the pieces. So you can take a look at what is going on before I complete the version that may work as a decent teaching example for coding. Here is an example of seeing that that div has a width of 144 and a height of 89 which are both Fibonacci numbers.
Wednesday, March 04, 2020
Still plugging...
![]() |
| A collection of Fibonacci Trees |
There seems to be no issues with the sizes and placements so the artifacts are related to the conic-gradient and perhaps a browser thing... There is a better way to colour but not one that will be easy least using CSS.
Perhaps the 3D version of this tree will be more interesting and will fall together better.
Sunday, February 23, 2020
Back to JQuery...
You can find this code on my dumping site (jimmorey.com) or in this CodePen. I'm cheating a bit with the image sizes--the Sierpinski carpet's holes aren't quite as big as these images but I wanted to show off the images more than accurately have a fractal. Generally, I've been thinking about using the fractal as more of an information display for images. Perhaps later.
I'll explore a few more parameter tweaks to see if I can have some more fun with graphics. I may explore some rectangular ones but these were my first two.
These used "cat,cute" to find the Flickr images. Make sure to take a look at the active code--in total, it's under 150 lines. It allows you to hover over images to brighten and in the case of this later triangular one reshape to square images to better see the images.
I will explore other libraries and photo sites like google photos to see if I can construct a better teaching example but probably I'll let it sit for a bit.
Monday, February 10, 2020
Sierpinski with divs and CSS
function iterate(el){
[[1,1],[1,-1],[-1,1]].forEach(x=> {
let newEl = el.cloneNode();
newEl.style["transform"]=
`scale(0.5)
translate(${x[0]*el.offsetWidth/2}px,
${x[1]*el.offsetHeight/2}px)`;
el.appendChild(newEl);
});
}
adds three shifted elements, a quarter of the original's size. Each shift is relative to the center of the original, corresponding to all the corners excluding the upper-left corner, which would be the [-1,-1] .After thee iterates, there are 27 equally small divs as seen below and to the left. To get the more attractive triangles on the right, a class, called half, transforms the appearance of the squares into triangles.
Essentially, the squares are 0x0 divs with a 100px border where as the triangles are divs with borders described in the CSS below
.half{ /* the bottom right half of a 0x0 div */
border-bottom:100px solid rgba(0,0,255,0.3);
border-right:100px solid rgba(0,0,255,0.3);
border-left:100px solid transparent;
border-top:100px solid transparent;
}
A further bit of CSS transforms the outer square into a rhombus which transforms the blue part into an equilateral triangle. The class rhomb below skews the shape putting the vertical lines into a 30 degree lines going to the right and squashes the vertical so that the length of the skewed vertical lines are the same as the horizontal lines. The shift (translate) puts bottom horizontal line approximately where the original was. .rhomb {
transform:skew(30deg) scale(1,0.866) translate(-58px,0);
}
To further show off this div construction of this pattern, a Button is used to highlight how each div sits in other divs. The Button
<button onclick="show()">show divs</button>
On button presses, the highlight class is either added or removed from special divs (div.done).
function show(){ // toggles whether the borders are shown in iterations
let toggle = document.getElementsByClassName("highlight").length > 0;
Array.from(document.getElementsByClassName("done")).forEach(x=>{
if (toggle) x.classList.remove("highlight");
else x.classList.add("highlight");
});
}
Style can be used to suggest its construction. Above, the stacked shaded backgrounds reveal how many divisions a particular regions is included in. Adding a border to each div can better show how the construction was achieved.
.highlight {
border:2px red solid;
background:rgba(220,220,100,0.2);
}
This code can be a simplified by a Javascript library or framework with complication of having to something else to learn and potentially having to later switch if something better or more popular comes along.
Thursday, February 01, 2018
Weeping willows
In the picture, all of the red numbers are even and are above their halves. The odd black odd numbers are above numbers that are one more than triple their value (if the number is x then they are above 3x + 1). All number sequences starting with a red number can be traced down to 1. For example, if you start at the red number 212 (located directly above the 1) you can trace the sequence: 212 106 53 160 80 40 20 10 5 16 8 4 2 1. Notice how the numbers half until they reach an odd number (53 and 5) when they become one more than their triple. This behaviour sums up the tree aspect of the "willow". The weeping aspect comes from green numbers. Each of the green numbers are multiples of 3 and 2; these numbers are below their halves. So number sequences starting with green numbers can be trace up until they hit black numbers at which point they turn downward and also end up at the number 1. For example, if you start at the green number 288 (located along the left side of the tree) you can trace the sequence: 288 144 72 36 18 9 28 14 7 22 11 34 17 52 26 13 40 20 10 5 16 8 4 2 1. After 9 in the sequence, the sequence of numbers descend in the tree eventually reaching the base of one. The ascending green part forms linear structures which is very unlike the branching structure of the rest of the tree.
Every sequence of numbers in the visualization is rigidly defined by iterating the hailstone function which is simply defined by f(x) = x/2 if it is even or 3x + 1 if it is odd. The question that many people ask is, does every sequence end in 1? In terms of this tree, is every number in this tree? It certainly is an interesting question to which I refer you to the link above.
I can't answer many questions about the sequences but I perhaps this visualization can shed some light on the problem. The picture comes from a Javascript tool that uses html's DOM with some added branch-lines provided by a dynamic SVG background. The program can generate any subtree of defined by its base number and a other parameters: start number, maximum number, and tree depth. The one below has 19 as its base (19,20000,200). It also has supplementary map at the bottom that helps show the numbers that are not in the tree: numbers like 27 which have has a particularly long sequence ending in 1 (27 .82 41 .124 62 31 94 47 .142 71 .214 107 .322 161 .484 242 121 364 182 91 274 137 412 206 103 310 155 466 233 .700 350 175 526 263 .790 395 .1186 593 .1780 890 445 1336 668 334 167 502 251 754 377 1132 566 283 850 425 1276 638 319 958 479 1438 719 .2158 1079 .3238 1619 .4858 2429 .7288 3644 1822 911 2734 1367 4102 2051 6154 3077 .9232 4616 2308 1154 577 1732 866 433 1300 650 325 976 488 244 122 61 184 92 46 23 70 35 106 53 160 80 40 20 10 5 16 8 4 2 1 — the "." here shows that the number is maximum value of the sequence so far). Try out the program. Hopefully, my program isn't to buggy to play with.
Monday, January 29, 2018
Back to Business
To help remind me later of my contortions, I'll jot down a few highlights. My first solution: I figured out a way to link google drive files to the page. Essentially, google allowed you to serve up drive files as web pages to the world. This was worked well until google decided to change their policy on google drive. Before their policy change, I had served up a lot of my class examples through drive files — I prefer to also keep my class examples accessible so that after a class ends, they still retain access to the examples that help them later. My class wiki's (wikispaces — coderesources is one of my public ones which isn't closed to a particular class like mmsun) were littered with links to my google drive. After some scrambling I was on to my second solution. I was able to switch to dropbox only to realize after one semester that they too would discontinue their ability to serve up personal files as web resources. For my third solution, I ended up using a freehostia.com site which I purchased the domain jimmorey.com. Unfortunately, the free version has a 250M limit and restricts individual files to 500k. Since most of my examples are code related, I have modest storage needs but some of my files exceed 500k: in particular, Brocolli.svg is a fractal images that is more than 1MB in size. So after attempting to use a gzip-ed version that failed. I was finally found svgomg , which was able to reduce the file size to 493K — luckily under 500K.
I was able to then fix my old entry Embedding my Broccolli — a play on the embed tag that I'm not even using anymore....
Wednesday, October 18, 2017
My web woes
I really like this small change. I wasn't expecting such a big difference. I was aiming to promote the octagram called the Star of Lakshmi or khatam sulayman, which is two overlapping squares following the recent descending pentagons had two overlapping pentagons. I switched back to emphasizing the square rather than the triangles and ended up with this above pattern. I quite like the details in this pattern. Probably, it doesn't actually benefit that much from the animation. Or perhaps I need to work on a different animation...
...Polyproblems for this blog relate to the shifting sands of the web. When I was happily posting rasterized images of my tilings, I ran into no big issues. Blogger stored all my photos (screen captures in png format) transparently in some google place like picasso but didn't bother me about storage and such. But then I ran across SVG files and became quite drawn to the vector way (also my previous postscript skills were somewhat resurrected--although SVG files aren't nearly as powerful: no variables, loops etc). Anyway, finding a place to dump the files has been an issue I was solving with drive then dropbox and now after the services changed I have ended up resorting to jimmorey.com--essentially free hosting in Germany with space limitations. But I now have to go back and fix this blog...
Friday, August 18, 2017
Back to Vagrancy
I guess since I can't fix the images yet, I'm stuck with writing about these less polygon things... Unless I can easily link it to polygoncraze.... More soon
Saturday, October 10, 2015
Opacity Changes
I really like this small change. I wasn't expecting such a big difference. I was aiming to promote the octagram called the Star of Lakshmi or khatam sulayman, which is two overlapping squares following the recent descending pentagons had two overlapping pentagons. I switched back to emphasizing the square rather than the triangles and ended up with this above pattern. I quite like the details in this pattern. Probably, it doesn't actually benefit that much from the animation. Or perhaps I need to work on a different animation...
Descending Squares
The first version is a simple analogue of the descending pentagons--actually it was the original doodle on my boogie board. I find the boogie board is a great exploratory tool because of it's impermanence. Somehow it helps me focus on process rather than product. The version of the boogie board I have doesn't save any of your work and there is no erase so you are stuck with any mistakes unless you erase the entire drawing. So I am tasked with focusing on the internalizing any thing that I do that I think is important. Perhaps this is a bit of a throw back to all the time I spent with chalk and blackboards. Regardless of the tools, the square doodle is a decorated version of drawing a square then using the midpoints of the square as a new square. The corners of the original square then get decorated with their own squares. The second version of this descending square alters the importance of the decorations by using them as a key functioning part. The decorative triangles determine the scale of another layer--it has to fit in the previous square.
I'll look at variations for the pentagon.
My intuition tells me that the hexagon won't be as interesting but I'll probably check it out anyway. If there is anything of note I'll post it.
Descending Pentagon
Saturday, March 07, 2015
Octagonal flowers
This pattern has a few cute things: a right and left handed version of the flower and some structures that seem a little out of place. The green flower is the left and the purple is the right. What I find more interesting is the way the 4 octagons behave between the flowers--there is a diagonal slit between them that alternates its direction. The pentagons are just decorative but they make the white space more interesting.
Sunday, March 01, 2015
Quilt and wallpaper
I was going to try to get this into last month but alas February only has 28 days this year. here is a toned down copy that works for wallpaper wall (colour), wall (blue), and wall (sepia). I was a bit lazy using a tool to crop it so it's in pdf rather than svg...but my MacBook pro accepts it as my desktop background so I didn't pursue it.
Sunday, February 01, 2015
from Pentagons to Heptagons
I needed to do a modification to go from pentagons to heptagons: add a square between the triangles. Without the square the heptagons would intersect. I wonder how close there pentagons are....
Monday, January 26, 2015
Elegant pairs
I was experimenting with the pervious post's pattern and the particular twist I was attempt wasn't fruitful but I did end up with this pattern. There two key pairs in this pattern: two purple rhombi (made with triangles) and the prominent pink/purple triangle-pentagons. I call this pattern elegant because of its fine lines: the slim dart gap between the rhombi, and the near touching pink polygons. Perhaps these fine features are also amplified by this type of symmetry.
I may have to augment my tool to help play with the colour choice and perhaps add in an easy centering tool. I guess these are less of a priority just a little of an annoyance...
Here are some png wallpapers
Sunday, January 25, 2015
Nice 6-fold symmetry
I like this one. Essentially, it's variations on a theme. Perhaps I add a twist and see if it will be as pretty.
On a side issue, tinyurl.com/p3c6mdh/newPentTri2.svg didn't work when I put https which redirects to https://c3b8f482385fc05f71d246e2e23a26cb99a3c770.googledrive.com/host/0BwD1YaggiIIAY1gxNEJEa2JKNlU/newPentTri2.svg which needs the https. Not surprising but there certainly is a lot of details to juggle--at least when you are doing posting content on the cheap... Of course, if Blogger simply let me upload my svg files I wouldn't have to do any gymnastics... I ended haven't to use my own host.
Popular Posts
-
Here's my take on Gödel, Escher, Bach cover in an attempt to start my new class, DATA ANALYTICS: PRINCIPLES & TOOLS. These were ...
-
This one was fun to make. I wanted a cool snowflake to be a backdrop for a presentation (http://prezi.com/jie04ey9bhjr/zulo/) that I wa...
-
Unlike normal, I was able to deliver the square version of the descending pentagons quickly. There was no math to figure out. although ...
















