Context Free Art Gallery

Using a free software program called Context Free, it is possible to generate a complex image from a brief declarative image description (which can be called the “source code”, or “cfdg” file).

This page is intended to be a (hopefully growing) repository for the author’s Context Free artwork. The images and the source code are licensed distinctly: please read my License page. For the text of the Gnu General Public License version 3, please visit https://www.gnu.org/licenses/gpl-3.0.en.html.

PointFlake CFDG Image

PointyFlake

// pointyflake.cfdg - CFDG description of the PointyFlake image
// Copyright (C) 2016  Christopher Howard
// 
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
// 
// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.

startshape seed[b 0.8 sat 0.7 h 60]
CF::Background = [hue 0 sat 0 b -1]

shape seed
{
  loop 4 [r 45] {
    wing[y 1]
    wing[f 180 y -1]
  }
  seed [z -0.1 s 0.5 r 22.5]
}

shape wing
{
  loop i = 10 [] {
    t = 2 + i * 0.1 * 2
    curve(t)[]
    curve(t)[f 90]
  }
}

shape curve(number pwr)
{
  cf = 0.01
  loop i = 200 [x cf h 10] {
    t = i * cf
    CIRCLE [s 0.1 y (t^pwr)]
    }
}
CFDG image entitled

Triforce Snowflake

// triforcesnowflake.cfdg - CFDG description of the Triforce Snowflake image
// Copyright (C) 2016  Christopher Howard
// 
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
// 
// You should have received a copy of the GNU General Public License
// along with this program.  If not, see .

startshape branchedtriforce[b 0.5 sat 0.7 h 60]
CF::Background = [hue 0 sat 0 b -1]
CF::MinimumSize = 0.1

pi=3.1415
rad=1/sqrt(3)
hueshift=30

y0 = sin(90)*rad
x1 = cos(210)*rad
y1 = sin(210)*rad
x2 = cos(330)*rad
y2 = sin(330)*rad

shape triforce
{
  TRIANGLE[x 0 y y0]
  TRIANGLE[x x1 y y1]
  TRIANGLE[x x2 y y2]
}

shape filledtriforce
{
  triforce[]
  filledtriforce[s 0.25]
}

shape triforcebranch
{
  triforce[]
  filledtriforce[s 0.25]
  triforcebranch[h hueshift s 0.5 r 60 x -.5 y .865 z -0.1]
  transform [r 240] {
    triforcebranch[h hueshift s 0.5 r 60 x -.5 y .865 z -0.1]
  } 
}

shape branchedtriforce
{
  triforce[]
  filledtriforce[s 0.25]
  triforcebranch[h hueshift s 0.5 r 60 x -.5 y .865 z -0.1]
  transform [r 120] {
    triforcebranch[h hueshift s 0.5 r 60 x -.5 y .865 z -0.1]
  } 
  transform [r 240] {
    triforcebranch[h hueshift s 0.5 r 60 x -.5 y .865 z -0.1]
  } 
}
Context free image entitled

Logarithmic Springs

// logsprings.cfdg - CFDG description of the Logarithmic Springs image
// Copyright (C) 2016  Christopher Howard
// 
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
// 
// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.

startshape LOGSPRINGS[b 0.8 sat 0.7 h 60]
CF::Background = [hue 0 sat 0 b -1]

eul = 2.71828

vector2 pol2euc(number deg, number rad) = rad*cos(deg), rad*sin(deg)

shape LOGSPRINGS
{
  rshift = 6
  hshift = 30
  UPSPRING[h (1*hshift) x  100  y  100 r        rshift ]
  UPSPRING[h (2*hshift) x -100  y -100 r (180 + rshift)]
  UPSPRING[h (3*hshift) x -100  y  100 r ( 90 + rshift)]
  UPSPRING[h (4*hshift) x  100  y -100 r (-90 + rshift)]
}

shape UPSPRING
{
  resolution = 10
  loop i = (300*resolution) [] {
    coords = pol2euc(10*i/resolution, eul^(0.02*i/resolution))
    transform[b (1.2*i/(300*resolution) - 1.5)] {
      sA = 2^(0.0013*i)
      zA = 0.1*i
      hA = i/30
      CIRCLE[x coords[0] y coords[1] s      sA  z zA h hA       ]
      CIRCLE[x coords[0] y coords[1] s (0.8*sA) z zA h hA b -0.5]
    }
  }
}