Skip to content

Commit 5f4b8bc

Browse files
committed
dymo tape example
1 parent 5105ff6 commit 5f4b8bc

File tree

10 files changed

+113
-6
lines changed

10 files changed

+113
-6
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
*.swp
12
*.class
23
*.gem
34
# Mobile Tools for Java (J2ME)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Impact Label is (c) 2011 Tension Type
2+
3+
By downloading and/or installing a Tension Type Free Font you agree to this licence:
4+
5+
This Tension Type Free Font is free to use in any and all of your personal and commercial work.
6+
7+
A donation is much appreciated, but not necessary (donations may be done through PayPal to: [email protected]). No donation is too small.
8+
9+
You may install and use an unlimited number of copies of a Tension Type Free Font.
10+
11+
Reproduction and Distribution. You may reproduce and distribute an unlimited number of copies of a Tension Type Free Font; provided that each copy shall be a true and complete copy, including all copyright and trademark notices (if applicable), and shall be accompanied by a copy of this text file. Copies of the Font may not be distributed for profit either on a standalone basis or included as part of your own product unless by prior permission of Tension Type.
12+
13+
You may not rename, edit or create any derivative works from a Tension Type Free Font, other than subsetting when embedding them in documents unless you have permission from Tension Type.
14+
15+
Embedding a Tension Type Free Font in a PDF document and web pages is allowed.
16+
17+
Michael Tension and Tension Type are not responsible for any damage resulting from the use of this Tension Type Free Font.
18+
19+
Any questions, or if you wish to share your designs, please contact Michael Tension: [email protected]
20+
21+
Thanks a ton,
22+
Michael Tension
23+
128 KB
Binary file not shown.

examples/f_agent.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# encoding: utf-8
21
# frozen_literal: true
32
# FontAgent class handles motion and display
43
class FontAgent

examples/hello_polygonize.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Move image round screen with mouse
22
# top left to view least polygonized version
33
# NB: constrained_map is a JRubyArt method
4-
54
require 'geomerative'
65

76
attr_reader :shp
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# Louis Christodoulou (louis -at- louisc.co.uk)
2+
#
3+
# Very quickly thrown together code whilst learning how the
4+
# geomerative library ticks.
5+
#
6+
# Here we take out previous scripts drawing and placing points along an arc and
7+
# complete our initial idea of placing text along the arc.
8+
#
9+
# Full Writeup on the Blog here: http://louisc.co.uk/?p=2686
10+
require 'geomerative'
11+
12+
MESSAGE = 'hello bendy world >>>'.freeze
13+
SCALE = 3
14+
attr_reader :font, :points
15+
16+
def settings
17+
size(800, 450)
18+
end
19+
20+
def setup
21+
# Geomerative
22+
sketch_title 'Geomerative Text On A Path'
23+
# From the examples we must always initialise the library using this command
24+
RG.init(self)
25+
@points = []
26+
background(255)
27+
# We want a dymo labeller style look, replace this font with your choice
28+
# see data folder for licence
29+
@font = RFont.new(data_path('Impact Label Reversed.ttf'), 72, RIGHT)
30+
end
31+
32+
def draw
33+
# Blank Background each frame
34+
background(0)
35+
# Create a new RShape each frame
36+
wave = RShape.new
37+
# At the moment the wave object is empty, so lets add a curve:
38+
wave.add_move_to(0 * SCALE, 100 * SCALE)
39+
wave.add_bezier_to(
40+
0 * SCALE,
41+
100 * SCALE,
42+
50 * SCALE,
43+
25 * SCALE,
44+
100 * SCALE,
45+
100 * SCALE
46+
)
47+
wave.add_bezier_to(
48+
100 * SCALE,
49+
100 * SCALE,
50+
150 * SCALE,
51+
175 * SCALE,
52+
200 * SCALE,
53+
100 * SCALE
54+
)
55+
translate(100, -80)
56+
# draw our wave
57+
no_fill
58+
stroke(255, 0, 0)
59+
stroke_weight(60)
60+
stroke_cap(PROJECT)
61+
wave.draw
62+
stroke_cap(ROUND)
63+
# Collect some points along the curve
64+
RG.set_polygonizer(RCommand::UNIFORMLENGTH)
65+
RG.set_polygonizer_length(35)
66+
points = wave.get_points
67+
index = 0 # Letter index within the string message
68+
# 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
71+
fill(255)
72+
no_stroke
73+
push_matrix
74+
translate(center.x, center.y)
75+
rotate(get_angle(points[index], points[index + 1]))
76+
translate(5, 20)
77+
font.draw(letter)
78+
pop_matrix
79+
index += 1
80+
end
81+
end
82+
83+
# Simple function to calculate the angle between two points
84+
def get_angle(p1, p2)
85+
atan2(p2.y - p1.y, p2.x - p1.x)
86+
end

examples/typo_merge.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
require 'geomerative'
2828

2929
attr_reader :my_font, :stop, :xoff, :yoff, :x_inc, :y_inc
30-
3130
TEXT = %w(Merge Design).freeze
3231

3332
def settings

geomerative.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
2020
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
2121
spec.files << 'lib/geomerative.jar'
2222
spec.require_paths = ['lib']
23-
spec.add_dependency 'jruby_art', '~> 1.0'
23+
spec.add_dependency 'jruby_art', '~> 1.1'
2424
spec.add_development_dependency 'rake', '~> 10.0'
2525
# spec.add_development_dependency 'maven', '~> 3.3', '>= 3.3.3'
2626
spec.platform = 'java'

lib/geomerative/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module Geomerative
2-
VERSION = '0.3.2'
2+
VERSION = '0.3.3'
33
end

pom.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
project 'geomerative' do
22

33
model_version '4.0.0'
4-
id 'ruby-processing:geomerative:0.3.2'
4+
id 'ruby-processing:geomerative:0.3.3'
55
packaging 'jar'
66

77
description 'geomerative-library for JRubyArt'

0 commit comments

Comments
 (0)