Skip to content

Commit e6b5f46

Browse files
committed
Various fixes tidy ups
1 parent da02332 commit e6b5f46

File tree

6 files changed

+11
-12
lines changed

6 files changed

+11
-12
lines changed

external_library/gem/toxiclibs/geometry/model_align.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def setup
2020
Processing::ArcBall.init(self)
2121
@gfx = Gfx::ToxiclibsSupport.new(self)
2222
# compute mesh positions on circle in XZ plane
23-
@positions = (Toxi::Circle.new(200).toPolygon2D(8)).map{ |p| p.to3DXZ }
23+
@positions = (Toxi::Circle.new(200).toPolygon2D(8)).map(&:to3DXZ)
2424
end
2525

2626
def draw
@@ -37,7 +37,9 @@ def draw
3737
# align the positive z-axis of mesh to point at focus
3838
# mesh needs to be located at world origin for it to work correctly
3939
# only once rotated, move it to actual position
40-
positions.map { |p| gfx.mesh(m.copy.pointTowards(focus.sub(p), TVec3D::Z_AXIS).translate(p)) }
40+
positions.map do |p|
41+
gfx.mesh(m.copy.pointTowards(focus.sub(p), TVec3D::Z_AXIS).translate(p))
42+
end
4143
# draw connections from mesh centers to focal point
4244
stroke(0, 255, 255)
4345
positions.map { |p| gfx.line(p, focus) }

external_library/gem/toxiclibs/mesh/voxtest.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
require 'toxiclibs'
22

33
RES = 64
4-
54
attr_reader :gfx, :mesh, :is_wireframe
6-
75
# A factory wrapper can be used to create a more literate
86
# constructor for a java class (keyword args)
97
module Vector

external_library/gem/toxiclibs/verlet_physics/crash_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ def init_physics
5252
@physics = Physics::VerletPhysics3D.new
5353
@mesh = WETriangleMesh.new.addMesh(
5454
STLReader.new.load_binary(
55-
create_input('audi.stl'),
56-
'car',
55+
create_input(data_path('audi.stl')),
56+
'car',
5757
STLReader::WEMESH
5858
)
5959
)

external_library/gem/toxiclibs/verlet_physics/physics_type.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def setup
1313
sketch_title 'Physics Type'
1414
@input = 'Hello!'
1515
RG.init(self)
16-
fnt = RG.loadFont('ReplicaBold.ttf') # file name
16+
fnt = RG.loadFont(data_path('ReplicaBold.ttf')) # file name
1717
RG.textFont(fnt, 330) # RFont object, size
1818
@font = RG.getText(input) # String to RShape
1919
RG.setPolygonizer(RCommand::UNIFORMLENGTH)
@@ -41,7 +41,7 @@ def init_physics
4141
# add gravity along positive Y axis
4242
physics.add_behavior(Physics::GravityBehavior2D.new(TVec2D.new(0, 0.1)))
4343
# multidimensional array of x and y coordinates
44-
paths = font.get_points_in_paths
44+
paths = font.get_points_in_paths
4545
offset = TVec2D.new(200, 250)
4646
return if (paths.nil?)
4747
paths.length.times do |ii|

external_library/gem/toxiclibs/verlet_physics/simple_cluster/simple_cluster.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def settings
1818

1919
def setup
2020
sketch_title 'Simple Cluster'
21-
@f = createFont('Georgia', 12, true)
21+
@f = create_font('Georgia', 12, true)
2222
@show_physics = true
2323
@show_particles = true
2424
@show_physics = true

external_library/gem/toxiclibs/volume_utils/implicit.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,8 @@ def get_voxel(x, y, z) # can't overload so we renamed
130130
function1 = lambda do |x, y, z, c|
131131
3 * x**2 + 3 * y**2 - (3 * x**2 - y**2) * y + z**3
132132
end
133-
val = function1.call(value.call(x, resX),value.call(y, resY), value.call(z, resZ), FREQ)
134-
# val = cos(xx * FREQ) * sin(yy * FREQ) + cos(yy * FREQ) * sin(zz * FREQ) + cos(zz * FREQ) * sin(xx * FREQ)
135-
# 3*pow(x,2) + 3*pow(y,2) - (3*pow(x,2) - pow(y,2))*y + pow(z,3)
133+
# val = function1.call(value.call(x, resX),value.call(y, resY), value.call(z, resZ), FREQ)
134+
val = function0.call(value.call(x, resX),value.call(y, resY), value.call(z, resZ), FREQ)
136135
return 0 if val > upper_bound
137136
val
138137
end

0 commit comments

Comments
 (0)