Skip to content

Commit 82af846

Browse files
committed
update examples
1 parent 5da875c commit 82af846

File tree

5 files changed

+19
-160
lines changed

5 files changed

+19
-160
lines changed

external_library/gem/geomerative/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ In [german][german]
88

99
### Examples ###
1010

11-
The solid_type sketch is a variant of an Amon Owed sketch requires jruby_art-1.0.8 (or latest github version).
11+
The solid_type sketch is a variant of an Amon Owed sketch requires jruby_art-1.3.0+ (or latest github version).
1212
See also [geomerative.gem][gem] for more examples
1313

1414
### Other Examples ###

external_library/gem/geomerative/blobby_trail.rb

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# encoding: utf-8
21
require 'geomerative'
32
# After an original sketch by fjenett
43
# Declare the objects we are going to use, so that they are accesible
@@ -33,4 +32,4 @@ def move
3332
@xd *= -1 unless (0..width).cover?(x)
3433
@y += yd
3534
@yd *= -1 unless (0..height).cover?(y)
36-
end
35+
end

external_library/gem/geomerative/solid_type.rb

-137
This file was deleted.

external_library/gem/geomerative/text_on_geomerative_path.rb

+3-5
Original file line numberDiff line numberDiff line change
@@ -64,19 +64,17 @@ def draw
6464
RG.set_polygonizer(RCommand::UNIFORMLENGTH)
6565
RG.set_polygonizer_length(35)
6666
points = wave.get_points
67-
index = 0 # Letter index within the string message
6867
# loop through and place a letter at each point
69-
MESSAGE.each_char do |letter|
70-
center = RCommand.new(points[index], points[index + 1]).get_center
68+
MESSAGE.chars.each_with_index do |letter, index|
69+
center = RCommand.new(points[index], points[index.succ]).get_center
7170
fill(255)
7271
no_stroke
7372
push_matrix
7473
translate(center.x, center.y)
75-
rotate(get_angle(points[index], points[index + 1]))
74+
rotate(get_angle(points[index], points[index.succ]))
7675
translate(5, 20)
7776
font.draw(letter)
7877
pop_matrix
79-
index += 1
8078
end
8179
end
8280

external_library/java/hemesh/twin_iso.rb

+14-15
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
load_libraries :hemesh, :vbo
2-
3-
include MS # module MS imports necessary java classes and contains ruby MeshToVBO class
4-
2+
# module MS imports necessary java classes and contains ruby MeshToVBO class
3+
include MS
54
RES ||= 20
65

76
attr_reader :mesh_ret, :inv_mesh_ret, :render
87

98
def setup
109
sketch_title 'Twin Iso'
1110
ArcBall.init(self)
12-
values = [] # build a multi-dimensional array in ruby
13-
(0..RES).each do |i| # the inclusive range is intentional here
11+
values = [] # build a multi-dimensional array in ruby
12+
(0..RES).each do |i| # the inclusive range is intentional here
1413
valu = []
1514
(0..RES).each do |j|
1615
val = []
@@ -21,27 +20,27 @@ def setup
2120
end
2221
values << valu
2322
end
24-
23+
2524
creator = HEC_IsoSurface.new
2625
creator.set_resolution(RES, RES, RES) # number of cells in x,y,z direction
2726
creator.set_size(400.0 / RES, 400.0 / RES, 400.0 / RES) # cell size
28-
29-
# JRuby requires a bit of help to determine correct 'java args', particulary with
30-
# overloaded arrays args as seen below. Note we are saying we have an 'array' of
31-
# 'float array' here, where the values can also be double[][][].
27+
28+
# JRuby requires a bit of help to determine correct 'java args', particulary
29+
# with overloaded arrays args as seen below. Note we are saying we have an
30+
# 'array' of 'float array' here, where the values can also be double[][][].
3231
java_values = values.to_java(Java::float[][]) # pre-coerce values to java
33-
creator.set_values(java_values) # the grid points
34-
35-
creator.set_isolevel(1) # isolevel to mesh
32+
creator.set_values(java_values) # the grid points
33+
34+
creator.set_isolevel(1) # isolevel to mesh
3635
creator.set_invert(false) # invert mesh
3736
creator.set_boundary(100) # value of isoFunction outside grid
3837
# use creator.clear_boundary to set boundary values to "no value".
3938
# A boundary value of "no value" results in an open mesh
40-
39+
4140
mesh = HE_Mesh.new(creator)
4241
# mesh.modify(HEM_Smooth.new.set_iterations(10).setAutoRescale(true))
4342
creator.set_invert(true)
44-
43+
4544
inv_mesh = HE_Mesh.new(creator)
4645
inv_mesh.modify(HEM_Smooth.new.set_iterations(10).set_auto_rescale(true))
4746
@render = MeshToVBO.new(self)

0 commit comments

Comments
 (0)