Skip to content

Commit c08328e

Browse files
committed
Some fixes, some not resolved
1 parent b1dc56d commit c08328e

File tree

8 files changed

+26
-24
lines changed

8 files changed

+26
-24
lines changed

external_library/gem/cf3/alhambra.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99

1010
def setup_the_tiles
1111
@tiles = ContextFree.define do
12-
############ Begin defining custom terminal, an wavy_triangle triangle
12+
############ Begin defining custom terminal, an wavy_triangle triangle
1313
class << self
1414
SQRT3 = Math.sqrt(3)
1515
define_method(:wavy_triangle) do |some_options| # wavy_triangle triangle
16-
options = self.get_shape_values(some_options)
16+
options = get_shape_values(some_options)
1717
size = options[:size]
1818
rot = options[:rotation]
1919
disp = 0.32 # could introduce a rule option?
@@ -47,20 +47,20 @@ class << self
4747
bezier_vertex(pts[4].x, pts[4].y, pts[9].x, pts[9].y, pts[2].x, pts[2].y)
4848
bezier_vertex(pts[2].x, pts[2].y, pts[10].x, pts[10].y, pts[5].x, pts[5].y)
4949
bezier_vertex(pts[5].x, pts[5].y, pts[11].x, pts[11].y, pts[0].x, pts[0].y)
50-
end_shape(CLOSE)
50+
end_shape(CLOSE)
5151
rotate(-rot) if rot
5252
end
53-
53+
5454
private
5555
def adjust_bezier(theta, disp)
5656
Vec2D.new(Math.cos(theta) * disp, Math.sin(theta) * disp)
5757
end
58-
59-
def get_mid_point(a, b)
58+
59+
def get_mid_point(a, b)
6060
(a + b) / 2.0
6161
end
6262
end
63-
63+
6464
########### End definition of custom terminal 'wavy_triangle' shape
6565
shape :tiles do
6666
20.times do |i|

external_library/gem/cf3/hex_tube.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ class << self
2727
end
2828

2929
shape :hexa do |i = nil, j = 0.5|
30-
hexagon size: 1, brightness: 1.0
31-
hexa size: 0.9, rotation: 5 *j
30+
hexagon(size: 1, brightness: 1.0)
31+
hexa(size: 0.9, rotation: 5 * j)
3232
end
3333
end
3434
end

external_library/gem/cf3/isosceles.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ def setup_the_spiral
55
############ Begin defining custom terminal, an isoceles triangle
66
class << self
77
define_method(:isoceles) do |some_options| # isoceles triangle
8-
options = self.get_shape_values(some_options)
8+
options = get_shape_values(some_options)
99
size = options[:size]
1010
rot = options[:rotation]
1111
rotate(rot) if rot
12-
self.app.triangle(-0.5 * size, -0.5 * size, -0.5 * size, 0.5 * size, 0.5 * size, 0.5 * size)
12+
Processing.app.triangle(-0.5 * size, -0.5 * size, -0.5 * size, 0.5 * size, 0.5 * size, 0.5 * size)
1313
rotate(-rot) if rot
1414
end
1515
end
@@ -37,5 +37,5 @@ def draw
3737

3838
def draw_it
3939
background 255
40-
@spiral.render :spiral, size: height, start_x: width/3, start_y: height/2
40+
@spiral.render :spiral, size: height, start_x: width / 3, start_y: height / 2
4141
end

external_library/gem/cf3/levy.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ def setup_the_levy
88
end
99
shape :levy do
1010
square alpha: 0.1
11-
split do
11+
split do
1212
levy size: 1/Math.sqrt(2), rotation: -45, x: 0.5, brightness: 0.9
1313
rewind
1414
levy size: 1/Math.sqrt(2), rotation: 45, x: 0.5, brightness: 0.9
15-
end
15+
end
1616
end
1717
end
1818
end
@@ -28,12 +28,10 @@ def setup
2828
save_frame("levy.png")
2929
end
3030

31-
3231
def draw
3332
# Do nothing.
3433
end
3534

36-
3735
def draw_it
3836
background 255
3937
@levy.render :start, size: 250, stop_size: 2,

external_library/gem/cf3/pcr.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def setup_the_gel
1111
############ Begin defining custom terminal, a proportional horizontal bar
1212
class << self
1313
define_method(:hbar) do |some_options|
14-
options = self.get_shape_values(some_options)
14+
options = get_shape_values(some_options)
1515
size = options[:size]
1616
ht = some_options[:ht] || 0.1 # default hbar width is 0.1
1717
ratio = ht * size

external_library/gem/cf3/spiral.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ def settings
3535
end
3636

3737
def setup
38+
sketch_title 'Spiral'
3839
setup_the_spiral
3940
no_stroke
4041
color_mode HSB, 1.0

external_library/gem/cf3/star.rb

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,36 @@
55
# from primitive terminals (renders on mouse clicked)
66
###
77

8+
def settings
9+
size 400, 200
10+
end
11+
812
def setup
9-
size 400, 200
13+
sketch_title 'Stars'
1014
@stars = ContextFree.define do
11-
15+
1216
shape :stars do
1317
split do
1418
sqstar size: 0.8, x: -1
1519
rewind
1620
trstar x: 1
1721
end
1822
end
19-
23+
2024
shape :sqstar do
2125
square
2226
square rotation: 45
2327
end
24-
28+
2529
shape :trstar do
2630
triangle
2731
triangle rotation: 180
2832
end
29-
end
33+
end
3034
end
3135

3236
def draw_it
33-
background 0.2
37+
background 0.2
3438
@stars.render :stars, size: height/2, color: [220, 1, 1, 1]
3539
end
3640

external_library/gem/cf3/tree.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# tree.rb by jashkenas
22
# This sketch demonstrates a lil' Ruby DSL for defining
33
# context-free drawings. Each shape rule calls itself by chance.
4-
54
require 'cf3'
65
load_library :control_panel
76

0 commit comments

Comments
 (0)