One-liner challenge

Roses.

gmic 512,1,1,1 '(37,17)' eval. 'i(#0,i(x))=1' k.. ifft. a[-2,-1] c n. 0,{2*w#0-16} +. 8 {2*w#0},{2*w#0},1,1 permute.. cyzx  eval. ">begin(PV=crop(#0);polygon(#-1,-s#0,PV,1,0xffffffff,255))" k. expand_xy. 4 dilate_circ 4 r2dx 50%,5 

rose_37-17
rose_37-17.png

rose_19-13-5
rose_19-13-7.png

rose_11-7-3
rose_11-7-3.png

rose_11-7-5
rose_11-7-5.png

  1. The width of the first image sets the sides of the painting canvas. Leave remaining image dimensions at one.
  2. The 2, 3, 4… numbers comprising the second image shape the rose. The first pattern arises from (37,3). Suggest that these numbers should be no larger than 10% of the width and should not have common factors. (16,8,4) is (4,2,1) in disguise. Order does not matter: (7,5,3) paints the same rose as (5,3,7)
  3. The example images embed their shaping numbers.

Here’s a command file version:

roses.gmic
roses :
   $=a
   {$a1/2},1,1,1
   repeat $#-1,j
      =. 1,${a{$j+2}},0,0,0
   done
   s. c
   -ifft.
   a[-2,-1] c
   n. 0,{2*w#0-16}
   +. 8
   {2*w#0},{2*w#0},1,1
   permute.. cyzx
   eval. ">begin(PV=crop(#0);polygon(#-1,-s#0,PV,1,0xffffffff,255))"
   k.

Try:

gmic roses.gmic roses 4096,37,3 expand_xy. 4 dilate_circ 4 r2dx 50%,5 o. rose_37-7.png

For the first example drawn large. With the command version, the first argument sets the image size, an arbitrary number of shaping numbers follow. Same guidelines apply.

I have a vague notion that something like this was written a long time ago. I can’t find it. @David_Tschumperle’s Hypotrochoid has some resemblance of what is going on here, but what’s going on here is not circles rolling within/without circles. The shaping numbers are spectral coefficients. Temporally Fourier transformed and circular plotted: real provide the x coordinate and imaginary provides the y. Might trace one by happenstance.

2 Likes