Skip to content

Commit edf25a4

Browse files
committed
weaire_phelan
1 parent b41d153 commit edf25a4

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
load_library :hemesh
2+
java_import 'wblut.processing.WB_Render'
3+
java_import 'wblut.hemesh.HEMC_WeairePhelan'
4+
java_import 'wblut.geom.WB_Point'
5+
java_import 'wblut.geom.WB_Vector'
6+
7+
attr_reader :meshes, :render
8+
9+
def setup
10+
sketch_title 'Weaire Phelan'
11+
ArcBall.init(self)
12+
wp = HEMC_WeairePhelan.new
13+
wp.set_origin(WB_Point.new(0, 0, -100))
14+
wp.set_extents(WB_Vector.new(400, 400, 400))
15+
wp.set_number_of_units(2, 2, 2)
16+
wp.set_scale(150, 150, 150)
17+
@meshes = wp.create
18+
@render = WB_Render.new(self)
19+
end
20+
21+
def draw
22+
background(55)
23+
scale 1, -1, 1
24+
directional_light(255, 255, 255, 1, 1, -1)
25+
directional_light(127, 127, 127, -1, -1, 1)
26+
noStroke
27+
render.draw_faces(meshes)
28+
stroke(0)
29+
render.draw_edges(meshes)
30+
end
31+
32+
def settings
33+
size(1000, 1000, P3D)
34+
smooth(8)
35+
end

0 commit comments

Comments
 (0)