Skip to content

Commit 68ccd9d

Browse files
committed
refactoring
1 parent 398f311 commit 68ccd9d

File tree

17 files changed

+153
-150
lines changed

17 files changed

+153
-150
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# frozen_string_literal: true
2+
3+
require 'toxiclibs'
4+
java_import 'toxi.geom.Circle'
5+
attr_reader :gfx
6+
7+
def setup
8+
sketch_title 'Circle Resolution'
9+
@gfx = Gfx::ToxiclibsSupport.new(self)
10+
end
11+
12+
def draw
13+
background(0)
14+
no_stroke
15+
fill(255)
16+
res = map1d(mouse_x, 0..width, 3..72)
17+
poly = Circle.new(TVec2D.new(width / 2, height / 2), 200).toPolygon2D(res)
18+
gfx.polygon2D(poly)
19+
fill(255, 0, 0)
20+
poly.each { |vertex| gfx.circle(vertex, 5) }
21+
text(res, 20, 20)
22+
end
23+
24+
def settings
25+
size(600, 600)
26+
smooth 8
27+
end
Loading

external_library/gem/toxiclibs/geometry/model_align.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# (c) 2012 Karsten Schmidt / LGPL2 licensed
77
#
88
require 'toxiclibs'
9-
9+
java_import 'toxi.geom.Circle'
1010
# container for mesh positions
1111

1212
attr_reader :gfx, :positions
@@ -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(&:to3DXZ)
23+
@positions = Circle.new(200).toPolygon2D(8).map(&:to3DXZ)
2424
end
2525

2626
def draw

external_library/gem/toxiclibs/physics/soft_body/soft_body_square_adapted.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@
3131
#
3232
require 'forwardable'
3333
require 'toxiclibs'
34-
require_relative 'blanket'
35-
require_relative 'connection'
36-
require_relative 'particle'
34+
load_library :blanket
3735

3836
attr_reader :b, :physics
3937

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
require_relative 'blanket'
2+
require_relative 'connection'
3+
require_relative 'particle'

0 commit comments

Comments
 (0)