In the last post I suggested, at the time somewhat facetiously, “Perhaps I’ll try sixteenths.”

Well, you know, I decided to do just that. So, here’s a short post on using sixteenths in an attempt to generate some symmetry in the images. Once again mostly simulated cycling line width images.

And, for fun, I decided to look at removing any symmetry or asymmetry. And what the outcome might provide in the way of interest or the lack thereof.

So, another post, albeit, hopefully, a short one.

Sixteenths

I decided to stick to the two basic cases. Reverse the first and every second sixteenth after that. And, reverse the second and every second sixteenth after that.

The code for the function get_sym_curve() now looks like this:

def get_sym_curve(f_x, typ_s, rwr=[], rwu=[]):
  m_pt = t_pts // 2
  s4_pt = t_pts // 4
  e4_pt = t_pts * 3 // 4
  s8 = [t_pts // 8, s4_pt, t_pts * 3 // 8, m_pt, t_pts * 5 // 8, e4_pt, t_pts * 7 // 8]
  s16 = [t_pts // 16, s8[0], t_pts * 3 // 16, s4_pt, t_pts * 5 // 16, s8[2], t_pts * 7 // 16, m_pt,
    t_pts * 9 // 16, s8[4], t_pts * 11 // 16, e4_pt, t_pts * 13 // 16, s8[6], t_pts * 15 // 16]

  if typ_s == 1:
    m_pt = t_pts // 2
    r_x = [*f_x[m_pt:][::-1], *f_x[:m_pt]]
  elif typ_s == 2:
    m_pt = t_pts // 2
    r_x = [*f_x[:m_pt][::-1], *f_x[m_pt:]]
  elif typ_s == 3:
    r_x = [*f_x[s4_pt:e4_pt][::-1], *f_x[:s4_pt], *f_x[e4_pt:]]
  elif typ_s == 4:  
    r_x = [*f_x[e4_pt:][::-1], *f_x[s4_pt:m_pt][::-1], *f_x[:s4_pt], *f_x[m_pt:e4_pt]]
  elif typ_s == 5:
    r_x = [*f_x[m_pt:e4_pt][::-1], *f_x[:s4_pt][::-1], *f_x[s4_pt:m_pt], *f_x[e4_pt:]]
  elif typ_s == 6:
    r_x = [*f_x[e4_pt:][::-1], *f_x[:s4_pt][::-1], *f_x[s4_pt:m_pt], *f_x[m_pt:e4_pt]*f_x[e4_pt:][::-1]]
  elif typ_s == 7:
    r_x = [*f_x[s8[5]:s8[6]][::-1], *f_x[s8[3]:s8[4]][::-1], *f_x[s8[1]:s8[2]][::-1], *f_x[:s8[0]][::-1],
      *f_x[s8[0]:s8[1]], *f_x[s8[2]:s8[3]],*f_x[s8[4]:s8[5]], *f_x[s8[6]:]
    ]
  elif typ_s == 8:
    r_x = [*f_x[s8[6]:][::-1], *f_x[s8[4]:s8[5]][::-1], *f_x[s8[2]:s8[3]][::-1], *f_x[s8[0]:s8[1]][::-1],
      *f_x[:s8[0]], *f_x[s8[1]:s8[2]], *f_x[s8[3]:s8[4]], *f_x[s8[5]:s8[6]]
    ]
  elif typ_s == 9:
    r_x = [
      *f_x[s16[13]:s16[14]][::-1], *f_x[s16[13]:s16[14]][::-1], *f_x[s16[11]:s16[12]][::-1],
      *f_x[s16[9]:s16[10]][::-1], *f_x[s16[7]:s16[8]][::-1], *f_x[s16[5]:s16[6]][::-1],
      *f_x[s16[3]:s16[4]][::-1], *f_x[s16[1]:s16[2]][::-1], *f_x[:s16[0]][::-1],
      *f_x[s16[0]:s16[1]], *f_x[s16[2]:s16[3]], *f_x[s16[4]:s16[5]], *f_x[s16[6]:s16[7]],
      *f_x[s16[8]:s16[9]], *f_x[s16[10]:s16[11]], *f_x[s16[12]:s16[13]], *f_x[s16[14]:],
    ]
  elif typ_s == 10:
    r_x = [
      *f_x[s16[14]:][::-1], *f_x[s16[12]:s16[13]][::-1], *f_x[s16[10]:s16[11]][::-1],
      *f_x[s16[8]:s16[9]][::-1], *f_x[s16[6]:s16[7]][::-1], *f_x[s16[4]:s16[5]][::-1],
      *f_x[s16[2]:s16[3]][::-1], *f_x[s16[0]:s16[1]][::-1],
      *f_x[:s16[0]], *f_x[s16[1]:s16[2]], *f_x[s16[3]:s16[4]], *f_x[s16[5]:s16[6]],
      *f_x[s16[7]:s16[8]], *f_x[s16[9]:s16[10]], *f_x[s16[11]:s16[12]], *f_x[s16[13]:s16[14]]
    ]

  return r_x

Examples

As in the previous post, I will show the image without any attempt at symmetry. Then the image with an attempt to produce some symmetry. In this case twice, once for each of the two forms of attempt mentioned above. Note: the same caveats regarding colour, maximum marker size, etc. apply when comparing images.

  1. Simulated curve with cycling line width using scatter plot, single random shape. 11 wheels (Rhombus). 1000 data points.

Though that first image seems to display a bit of symmetry. Let’s see what happens with the alternating, reversed sixteenths.

cycling line width image with attempt to improve symmetry using 16ths
do sym: False, max marker size: 6448, cycles: 8
cycling line width image with attempt to improve symmetry using 16ths
do sym: True => reverse 1st, 3rd, 5th, 7th, 9th, 11th, 13th and 15th sixteenths,
max marker size: 10500, cycles: 20
cycling line width image with attempt to improve symmetry using 16ths
do sym: True => reverse 2nd, 4th, 6th, 8th, 10th, 12th, 14th and 16th sixteenths,
max marker size: 2480, cycles: 8
  1. Simulated curve with cycling line width using scatter plot, random shape for each wheel. 5 wheels (’s’, ’e’, ’e’, ‘c’, ’s’). 1000 data points. 4 colour/marker size cycles.
cycling line width image with attempt to improve symmetry using 16ths
do sym: False, max marker size: 2500
cycling line width image with attempt to improve symmetry using 16ths
do sym: True => reverse 1st, 3rd, 5th, 7th, 9th, 11th, 13th and 15th sixteenths,
max marker size: 1500
cycling line width image with attempt to improve symmetry using 16ths
do sym: True => reverse 2nd, 4th, 6th, 8th, 10th, 12th, 14th and 16th sixteenths,
max marker size: 1500

Integer Factors

I expect you noticed the slight irregularities in the symmetry of the above images. Each of the images has a few spots where the symmetry is broken.

After a bit of thinking, I thought that perhaps this is a result of the fact that 1000 (number of data points I was using) is not evenly divisible by 16. So I am going to try using 1024 data points and see what happens.

cycling line width image with attempt to improve symmetry using 16ths
do sym: True => reverse 2nd, 4th, 6th, 8th, 10th, 12th, 14th and 16th sixteenths,
max marker size: 2432
cycling line width image with attempt to improve symmetry using 16ths
do sym: True => reverse 1st, 3rd, 5th, 7th, 9th, 11th, 13th and 15th sixteenths,
max marker size: 3456

And that does appear to fix things. Will need to make sure I add some code to make sure that the number of data points is evenly divisible by my symmetry section size. Or, perhaps just print message let me know it isn’t. Will see how much work the former turns out to be.

Cycle Frequency

I wanted to give you an idea of how the cycle size (for colours and marker sizes) affects the resulting image. I have a lot of random factors in each image. Makes it extremely difficult to predict what I am going to get when I generate a new image. But, I have added a command to let me set the cycle frequency.

So, here’s examples of the same curve with cycle frequencies of 4, 8 and 16. By accident it also turned out the maximum marker size increased with each image. So, also perhaps some additional insight into how marker sizes affect the result.

They are all simulated curve with cycling line width using scatter plot, single random shape. 7 wheels (Equilateral Triangle). Do sym: True => reverse 1st, 3rd, 5th, 7th, 9th, 11th, 13th and 15th sixteenths.

cycling line width image with attempt to improve symmetry using 16ths
number of cycles: 4, max marker size: 1408
cycling line width image with attempt to improve symmetry using 16ths
number of cycles: 6, max marker size: 3456
cycling line width image with attempt to improve symmetry using 16ths
number of cycles: 16, max marker size: 8480

Fairly clearly, they appear to be the same curve. But very real changes in each as the number of cycles and marker sizes changed.

All those variables that go into generating a curve and the plot make for some lovely images. But, make it nigh impossible to predict what you are going to get.

Done for This One

As mentioned in the introduction, I had planned to do a little more in this post. But, once again, it has take me a bit more time than I expected. It is reasonably lengthy and also has a fair number of images. So, I will leave things for the next post in the series. Which seems to want to continue to grow in length. Makes me happy!

Until next time, have fun with your code.