Skip to content

Instantly share code, notes, and snippets.

@zeffii
Created September 3, 2013 12:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zeffii/6422996 to your computer and use it in GitHub Desktop.
Save zeffii/6422996 to your computer and use it in GitHub Desktop.
coffee_sol_lewitt_rules2

[ Launch: coffee_sol_lewitt_rules ] 6422996 by zeffii
[ Launch: coffee_template ] 6420246 by zeffii
[ Launch: boomstick_motion_wcolor_coffee ] 6399870 by zeffii
[ Launch: boomstick_motion_wcolor_coffee ] 6382272 by zeffii
[ Launch: boomstick_motion_wcolor_coffee ] 6382237 by zeffii
[ Launch: boomstick_motion_wcolor_coffee ] 6379220 by zeffii
[ Launch: boomstick_motion_wcolor ] 6376715 by zeffii
[ Launch: boomstick_motion2 ] 6365156 by zeffii
[ Launch: boomstick_motion ] 6364686 by zeffii
[ Launch: boomstick ] 6364584 by zeffii
[ Launch: zeffii default ] 6364028 by zeffii
[ Launch: zeffii default ] 5033869 by zeffii

german version found, but I highly recommend not looking at the drawing until
after you have spent time trying to figure out how to interpret the instructions.
at:
" the placing of a quad "
full page (german)
http://www.walkerart.org/collections/artworks/die-plazierung-eines-vierecks-the-location-of-a-quadrangle
just text (german)
image: http://i.imgur.com/ZpOWUi2.png
© The LeWitt Estate / Artists Rights Society (ARS), New York
Translation is my own: (it was bugging me, but it is no improvement)
The first line starts **from** a point halfway between a point halfway between
the centre of the page (wall) and the bottom right corner and the middle of
the left edge and the top right corner **to** a point halfway between
the middle of the bottom edge and top right corner.
The second line starts **from** a point halfway between the starting-point of
the 1st line and a point halfway between the middle of the bottom edge and
the top left corner **to** a point halfway between a point halfway between
the center of the page (wall) and the bottom left corner and the middle of
the bottom edge.
The third line starts **from** a point halfway between a point halfway between
the starting-point of the 1st line and the end-point of the 2nd line and
a point halfway between the middle of the left edge and the bottom left corner
**to** a point 'auf einer Achse von der' bottom left corner to a point
halfway between the middle of the right edge and the top right corner,
where a line from the center of the page to a point halfway between
the middle of the right edge and the bottom right corner would intersect the axis.
The fourth line starts **from** a point the same distance between the end of
the 3rd line, the endpoint of the 2nd line, and from a point halfway between
a point halfway between the center of the page and the middle of
the bottom edge and a point halfway between the middle of the bottom edge and
the bottom right corner **to** a point halfway between the starting point of
the 2nd line and a point, where a line would intersect the 1st line, if it ran
from the middle of the right edge to a point halfway between the middle of
the top edge and the top left corner.
SL 1974.
My thoughts:
Though Written in a procedural way, these instructions are at times somewhat
obfuscated and definitely inefficient without symbols.
- The 1st line turns out to be unparsable without adding an extra 'halfway between'
statement.
- The 3rd line doesn't make sense to me introducing the term axis
{"description":"coffee_sol_lewitt_rules2","endpoint":"","display":"svg","public":true,"require":[],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"style.css":{"default":true,"vim":false,"emacs":false,"fontSize":12},"_.md":{"default":true,"vim":false,"emacs":false,"fontSize":12},"config.json":{"default":true,"vim":false,"emacs":false,"fontSize":12},"data2.csv":{"default":true,"vim":false,"emacs":false,"fontSize":12},"util.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"injet.coffee":{"default":true,"vim":false,"emacs":false,"fontSize":12},"inlet.coffee":{"default":true,"vim":false,"emacs":false,"fontSize":12},"readme.txt":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"fullscreen":false,"play":false,"loop":false,"restart":false,"autoinit":true,"pause":true,"loop_type":"period","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01,"thumbnail":"http://i.imgur.com/OqFYJQH.png"}
###
Info in the readme.txt tab (links to original german text)
this version is intentionally unfinished.
latest version
http://tributary.io/inlet/6440274
(with overlay)
###
between = (p1, p2) ->
x: (p1.x + p2.x) * 0.5
y: (p1.y + p2.y) * 0.5
equid = (points) ->
# this formula averages, this is wrong.
num = points.length
[ret_x, ret_y] = [0, 0]
for p in points
ret_x += p.x
ret_y += p.y
x: ret_x / num
y: ret_y / num
intersect = (line1, line2) ->
[x1,y1,x2,y2] = [line1.p1.x, line1.p1.y, line1.p2.x, line1.p2.y]
[x3,y3,x4,y4] = [line2.p1.x, line2.p1.y, line2.p2.x, line2.p2.y]
[bx, by_, dx, dy] = [x2 - x1, y2 - y1, x4 - x3, y4 - y3]
b_dot_d_perp = (bx * dy) - (by_ * dx)
if b_dot_d_perp is 0
console.log('doesnt intersect')
return None
[cx, cy] = [x3 - x1, y3 - y1]
t = (cx * dy - cy * dx) / b_dot_d_perp
p =
x: x1 + t * bx
y: y1 + t * by_
# constants and setup
d3.select("body").style "background-color", d3.rgb(25, 25, 25)
svg = d3.select("svg")
group1 = svg.append("g").classed("group1", true)
.attr("transform", "translate(" + [200, 100] + ")")
.style
fill: "none"
stroke: "#aeaeae"
thin = 0.3
thick = 1.2
X = width = 415
Y = height = 415
A = {x: 0, y: 0} # top left
B = {x: X, y: 0} # top right
C = {x: X, y: Y} # bottom right
D = {x: 0, y: Y} # bottom left
MID = between(A, C) # center
AB = between(A, B) # mid top
BC = between(B, C) # mid right
CD = between(C, D) # mid bottom
AD = between(A, D) # mid left
# PHWB = point halfway between
# A quadrangle which is formed and enclosed by four lines, (if you say so.)
# L1 = (seems to contain ambiguity due to missing PHWB)
# from -> PHWB PHWB(MID, A) and (AD) and (A), to -> PHWB(AB, B)
L1 =
p1: between( between( between(MID, A), AD), A)
p2: between(AB, B)
# L2 =
# from -> PHWB (L1.p1) and PHWB (AB) and (A)
# to -> PHWB PHWB (MID) and (D) and (CD),
L2 =
p1: between(L1.p1, between(AB, A))
p2: between( between(MID, D), CD)
# L_support_1 =
# from -> (X), to -> PHWB(BC, C)
L_support_1 = {p1: X, p2: between(BC, C)}
# L3 = ??
# from -> PHWB PHWB (L1.p1) and (L2.p2) and PHWB (AD) and (D)
# to point which is on an axis between (D) to PHWB(BC, B)
# where L_support_1 would cross that axis,
L3 =
p1: between( between(L1.p1, L2.p2), between(AD, D)),
p2: between( D, between(BC, B))
# L_support_2 =
# from -> (BC), to PHWB(AB, A)
L_support_2 = {p1: BC, p2: between(AB, A)}
# L4 =
# from -> point equidistant from (L3.p2), (L2.p2) and PHWB(MID, CD) and PHWB(CD, C)
# to -> PHWB (L2.p1) and a point where a L_support_2 crosses (L1)
L4 =
p1: equid([L3.p2, L2.p2, between(MID, CD), between(CD, C)])
p2: between(L2.p1, intersect(L_support_2, L1))
### populate svg ###
# lines only
line_data = [
{line: {p1: A, p2: B}, line_thickness: thin},
{line: {p1: B, p2: C}, line_thickness: thin},
{line: {p1: C, p2: D}, line_thickness: thin},
{line: {p1: A, p2: D}, line_thickness: thin},
{line: L1, line_thickness: thick},
{line: L2, line_thickness: thick},
{line: L_support_1, line_thickness: thin},
{line: L_support_2, line_thickness: thin},
{line: L3, line_thickness: thin},
{line: L4, line_thickness: thick},
]
lines = group1.selectAll('line').data(line_data).enter()
.append('line')
.attr
x1: (d) -> d.line.p1.x
y1: (d) -> d.line.p1.y
x2: (d) -> d.line.p2.x
y2: (d) -> d.line.p2.y
.style
'stroke-width': (d) -> d.line_thickness
# verts only
vert_data = [A, B, C, D, MID, AB, BC, CD, AD]
verts = group1.selectAll('circle').data(vert_data).enter()
.append('circle')
.attr
r: 3
cx: (d) -> d.x
cy: (d) -> d.y
.style
stroke: "none"
fill: "#789BA2"
.cm-s-elegant.CodeMirror { background: #1e2426; color: #696969; }
.cm-s-elegant div.CodeMirror-selected {background: #064968 !important;} /* 33322B*/
.cm-s-elegant span.cm-variable { color:#22EFFF; }
.cm-s-elegant span.cm-variable-2 { color: #FFCCB4; }
.cm-s-elegant span.cm-variable-3 { color: white; }
.cm-s-elegant span.cm-string { color: Chartreuse; }
.cm-s-elegant span.cm-string-2 {color: Chartreuse;}
.cm-s-elegant span.cm-def {color: #FFCCB4; opacity: 1.0}
.cm-s-elegant span.cm-bracket { color: #EBEFE7; }
.cm-s-elegant pre { color:#FFF; }
.cm-s-elegant span.cm-qualifier { color:#C0C0C0; }
.cm-s-elegant span.cm-comment { color: #AFB4B4;}
.cm-s-elegant span.cm-property {color: #FDA676;}
.cm-s-elegant span.cm-number { color: #FF92EE;}
.cm-s-elegant span.cm-keyword { color: #FFFF18; }
.cm-s-elegant .CodeMirror-cursor { border-left: 1px solid white !important; }
.cm-s-elegant .CodeMirror-gutters {background: #505050;}
.cm-s-elegant .CodeMirror-linenumber {color: #D3D3D3;}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment