geomerative 0.2.0-java → 0.3.2-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.mvn/extensions.xml +8 -0
- data/.mvn/wrapper/maven-wrapper.properties +1 -0
- data/.travis.yml +14 -0
- data/CHANGELOG.md +4 -0
- data/COPYING.md +17 -0
- data/Gemfile +8 -1
- data/README.md +5 -1
- data/examples/README.md +1 -7
- data/examples/Rakefile +30 -0
- data/examples/data/ruby.svg +16 -0
- data/examples/f_agent.rb +30 -0
- data/examples/font_agent.rb +24 -0
- data/examples/hello_polygonize.rb +1 -1
- data/examples/hello_svg_to_pdf.rb +2 -2
- data/examples/hello_world.rb +1 -1
- data/examples/jruby_merge.rb +94 -0
- data/examples/physics_type.rb +1 -1
- data/examples/rotate_first_letter.rb +3 -4
- data/examples/typo_deform.rb +68 -0
- data/examples/typo_extra_bright.rb +62 -0
- data/examples/typo_merge.rb +94 -0
- data/geomerative.gemspec +2 -3
- data/lib/geomerative/version.rb +1 -1
- data/pom.rb +47 -0
- data/pom.xml +35 -65
- data/src/geomerative/FastRClip.java +1 -1
- data/src/geomerative/RCommand.java +1877 -1741
- data/src/geomerative/RContour.java +8 -1
- data/src/geomerative/RFont.java +8 -5
- data/src/geomerative/RG.java +8 -3
- data/src/geomerative/RGeomElem.java +8 -9
- data/src/geomerative/RGroup.java +50 -28
- data/src/geomerative/RMatrix.java +53 -57
- data/src/geomerative/RMesh.java +8 -3
- data/src/geomerative/RPath.java +34 -29
- data/src/geomerative/RPoint.java +408 -408
- data/src/geomerative/RPolygon.java +7 -3
- data/src/geomerative/RSVG.java +13 -10
- data/src/geomerative/RShape.java +18 -11
- data/src/geomerative/RStrip.java +5 -1
- data/src/geomerative/RStyle.java +15 -11
- metadata +17 -18
@@ -18,7 +18,11 @@
|
|
18
18
|
*/
|
19
19
|
package geomerative;
|
20
20
|
|
21
|
-
import processing.core.*;
|
21
|
+
//import processing.core.*;
|
22
|
+
|
23
|
+
import processing.core.PApplet;
|
24
|
+
import processing.core.PGraphics;
|
25
|
+
|
22
26
|
|
23
27
|
/**
|
24
28
|
* RPolygon is a reduced interface for creating, holding and drawing complex
|
@@ -504,7 +508,7 @@ public class RPolygon extends RGeomElem {
|
|
504
508
|
}
|
505
509
|
|
506
510
|
RPoint[] result = null;
|
507
|
-
RPoint[] newresult
|
511
|
+
RPoint[] newresult;
|
508
512
|
for (int i = 0; i < numContours; i++) {
|
509
513
|
RPoint[] newPoints = contours[i].getHandles();
|
510
514
|
if (newPoints != null) {
|
@@ -538,7 +542,7 @@ public class RPolygon extends RGeomElem {
|
|
538
542
|
}
|
539
543
|
|
540
544
|
RPoint[] result = null;
|
541
|
-
RPoint[] newresult
|
545
|
+
RPoint[] newresult;
|
542
546
|
for (int i = 0; i < numContours; i++) {
|
543
547
|
RPoint[] newPoints = contours[i].getPoints();
|
544
548
|
if (newPoints != null) {
|
data/src/geomerative/RSVG.java
CHANGED
@@ -19,8 +19,11 @@
|
|
19
19
|
|
20
20
|
package geomerative;
|
21
21
|
|
22
|
-
|
23
|
-
import processing.
|
22
|
+
|
23
|
+
import processing.core.PApplet;
|
24
|
+
import processing.core.PConstants;
|
25
|
+
import processing.core.PGraphics;
|
26
|
+
import processing.data.XML;
|
24
27
|
|
25
28
|
/**
|
26
29
|
* @extended
|
@@ -90,8 +93,8 @@ public class RSVG
|
|
90
93
|
}
|
91
94
|
|
92
95
|
public float unitsToPixels(String units, float originalPxSize, float dpi) {
|
93
|
-
int chars
|
94
|
-
float multiplier
|
96
|
+
int chars;
|
97
|
+
float multiplier;
|
95
98
|
|
96
99
|
if (units.endsWith("em")) {
|
97
100
|
chars = 2;
|
@@ -295,13 +298,13 @@ public class RSVG
|
|
295
298
|
result += "stroke-linecap:";
|
296
299
|
|
297
300
|
switch (style.strokeCap) {
|
298
|
-
case
|
301
|
+
case PConstants.PROJECT:
|
299
302
|
result += "butt";
|
300
303
|
break;
|
301
|
-
case
|
304
|
+
case PConstants.ROUND:
|
302
305
|
result += "round";
|
303
306
|
break;
|
304
|
-
case
|
307
|
+
case PConstants.SQUARE:
|
305
308
|
result += "square";
|
306
309
|
break;
|
307
310
|
|
@@ -316,13 +319,13 @@ public class RSVG
|
|
316
319
|
result += "stroke-linejoin:";
|
317
320
|
|
318
321
|
switch (style.strokeJoin) {
|
319
|
-
case
|
322
|
+
case PConstants.MITER:
|
320
323
|
result += "miter";
|
321
324
|
break;
|
322
|
-
case
|
325
|
+
case PConstants.ROUND:
|
323
326
|
result += "round";
|
324
327
|
break;
|
325
|
-
case
|
328
|
+
case PConstants.BEVEL:
|
326
329
|
result += "bevel";
|
327
330
|
break;
|
328
331
|
|
data/src/geomerative/RShape.java
CHANGED
@@ -18,7 +18,12 @@
|
|
18
18
|
*/
|
19
19
|
package geomerative;
|
20
20
|
|
21
|
-
|
21
|
+
|
22
|
+
|
23
|
+
import processing.core.PApplet;
|
24
|
+
import processing.core.PConstants;
|
25
|
+
import processing.core.PGraphics;
|
26
|
+
|
22
27
|
|
23
28
|
/**
|
24
29
|
* RShape is a reduced interface for creating, holding and drawing complex
|
@@ -749,7 +754,7 @@ public class RShape extends RGeomElem {
|
|
749
754
|
int numPaths = countPaths();
|
750
755
|
|
751
756
|
RPoint[] result = null;
|
752
|
-
RPoint[] newresult
|
757
|
+
RPoint[] newresult;
|
753
758
|
for (int i = 0; i < numPaths; i++) {
|
754
759
|
RPoint[] newPoints = paths[i].getHandles();
|
755
760
|
if (newPoints != null) {
|
@@ -819,7 +824,7 @@ public class RShape extends RGeomElem {
|
|
819
824
|
|
820
825
|
RCommand.segmentAccOffset = RCommand.segmentOffset;
|
821
826
|
RPoint[] result = null;
|
822
|
-
RPoint[] newresult
|
827
|
+
RPoint[] newresult;
|
823
828
|
for (int i = 0; i < numPaths; i++) {
|
824
829
|
RPoint[] newPoints = paths[i].getPoints();
|
825
830
|
if (newPoints != null) {
|
@@ -931,7 +936,7 @@ public class RShape extends RGeomElem {
|
|
931
936
|
return false;
|
932
937
|
}
|
933
938
|
int nvert = verts.length;
|
934
|
-
int i, j
|
939
|
+
int i, j;
|
935
940
|
boolean c = false;
|
936
941
|
for (i = 0, j = nvert - 1; i < nvert; j = i++) {
|
937
942
|
if (((verts[i].y > testy) != (verts[j].y > testy))
|
@@ -950,11 +955,12 @@ public class RShape extends RGeomElem {
|
|
950
955
|
* @return RPoint[], the points returned in an array.
|
951
956
|
*
|
952
957
|
*/
|
958
|
+
@Override
|
953
959
|
public RPoint[] getTangents() {
|
954
960
|
int numPaths = countPaths();
|
955
961
|
|
956
962
|
RPoint[] result = null;
|
957
|
-
RPoint[] newresult
|
963
|
+
RPoint[] newresult;
|
958
964
|
for (int i = 0; i < numPaths; i++) {
|
959
965
|
RPoint[] newPoints = paths[i].getTangents();
|
960
966
|
if (newPoints != null) {
|
@@ -995,11 +1001,12 @@ public class RShape extends RGeomElem {
|
|
995
1001
|
* @return RPoint[], the points returned in an array.
|
996
1002
|
*
|
997
1003
|
*/
|
1004
|
+
@Override
|
998
1005
|
public RPoint[][] getPointsInPaths() {
|
999
1006
|
int numPaths = countPaths();
|
1000
1007
|
|
1001
1008
|
RPoint[][] result = null;
|
1002
|
-
RPoint[][] newresult
|
1009
|
+
RPoint[][] newresult;
|
1003
1010
|
for (int i = 0; i < numPaths; i++) {
|
1004
1011
|
RPoint[][] newPointPaths = paths[i].getPointsInPaths();
|
1005
1012
|
if (newPointPaths != null) {
|
@@ -1042,7 +1049,7 @@ public class RShape extends RGeomElem {
|
|
1042
1049
|
int numPaths = countPaths();
|
1043
1050
|
|
1044
1051
|
RPoint[][] result = null;
|
1045
|
-
RPoint[][] newresult
|
1052
|
+
RPoint[][] newresult;
|
1046
1053
|
for (int i = 0; i < numPaths; i++) {
|
1047
1054
|
RPoint[][] newHandlePaths = paths[i].getHandlesInPaths();
|
1048
1055
|
if (newHandlePaths != null) {
|
@@ -1084,7 +1091,7 @@ public class RShape extends RGeomElem {
|
|
1084
1091
|
}
|
1085
1092
|
|
1086
1093
|
RPoint[][] result = null;
|
1087
|
-
RPoint[][] newresult
|
1094
|
+
RPoint[][] newresult;
|
1088
1095
|
for (int i = 0; i < numPaths; i++) {
|
1089
1096
|
RPoint[][] newTangentPaths = paths[i].getTangentsInPaths();
|
1090
1097
|
if (newTangentPaths != null) {
|
@@ -1305,7 +1312,7 @@ public class RShape extends RGeomElem {
|
|
1305
1312
|
int numPaths = countPaths();
|
1306
1313
|
|
1307
1314
|
RPoint[] result = null;
|
1308
|
-
RPoint[] newresult
|
1315
|
+
RPoint[] newresult;
|
1309
1316
|
for (int i = 0; i < numPaths; i++) {
|
1310
1317
|
RPoint[] newPoints = paths[i].intersectionPoints(other);
|
1311
1318
|
if (newPoints != null) {
|
@@ -1344,7 +1351,7 @@ public class RShape extends RGeomElem {
|
|
1344
1351
|
int numPaths = countPaths();
|
1345
1352
|
|
1346
1353
|
RPoint[] result = null;
|
1347
|
-
RPoint[] newresult
|
1354
|
+
RPoint[] newresult;
|
1348
1355
|
|
1349
1356
|
for (int i = 0; i < numPaths; i++) {
|
1350
1357
|
RPoint[] newPoints = paths[i].intersectionPoints(other);
|
@@ -1384,7 +1391,7 @@ public class RShape extends RGeomElem {
|
|
1384
1391
|
int numPaths = countPaths();
|
1385
1392
|
|
1386
1393
|
RPoint[] result = null;
|
1387
|
-
RPoint[] newresult
|
1394
|
+
RPoint[] newresult;
|
1388
1395
|
|
1389
1396
|
for (int i = 0; i < numPaths; i++) {
|
1390
1397
|
RPoint[] newPoints = other.polygonIntersectionPoints(paths[i]);
|
data/src/geomerative/RStrip.java
CHANGED
data/src/geomerative/RStyle.java
CHANGED
@@ -18,7 +18,11 @@
|
|
18
18
|
*/
|
19
19
|
|
20
20
|
package geomerative ;
|
21
|
-
|
21
|
+
|
22
|
+
import processing.core.PApplet;
|
23
|
+
import processing.core.PConstants;
|
24
|
+
import processing.core.PGraphics;
|
25
|
+
import processing.core.PImage;
|
22
26
|
|
23
27
|
/**
|
24
28
|
* @extended
|
@@ -44,10 +48,10 @@ public class RStyle{
|
|
44
48
|
public float strokeWeight = 1F;
|
45
49
|
|
46
50
|
public boolean strokeCapDef = false;
|
47
|
-
public int strokeCap =
|
51
|
+
public int strokeCap = PConstants.PROJECT;
|
48
52
|
|
49
53
|
public boolean strokeJoinDef = false;
|
50
|
-
public int strokeJoin =
|
54
|
+
public int strokeJoin = PConstants.MITER;
|
51
55
|
|
52
56
|
private boolean oldFill = false;
|
53
57
|
private int oldFillColor = 0;
|
@@ -55,8 +59,8 @@ public class RStyle{
|
|
55
59
|
private boolean oldStroke = false;
|
56
60
|
private int oldStrokeColor = 0;
|
57
61
|
private float oldStrokeWeight = 1F;
|
58
|
-
private int oldStrokeCap =
|
59
|
-
private int oldStrokeJoin =
|
62
|
+
private int oldStrokeCap = PConstants.PROJECT;
|
63
|
+
private int oldStrokeJoin = PConstants.MITER;
|
60
64
|
|
61
65
|
public RStyle(){}
|
62
66
|
|
@@ -192,13 +196,13 @@ public class RStyle{
|
|
192
196
|
|
193
197
|
switch (str) {
|
194
198
|
case "butt":
|
195
|
-
strokeCap =
|
199
|
+
strokeCap = PConstants.PROJECT;
|
196
200
|
break;
|
197
201
|
case "round":
|
198
|
-
strokeCap =
|
202
|
+
strokeCap = PConstants.ROUND;
|
199
203
|
break;
|
200
204
|
case "square":
|
201
|
-
strokeCap =
|
205
|
+
strokeCap = PConstants.SQUARE;
|
202
206
|
break;
|
203
207
|
}
|
204
208
|
}
|
@@ -209,13 +213,13 @@ public class RStyle{
|
|
209
213
|
|
210
214
|
switch (str) {
|
211
215
|
case "miter":
|
212
|
-
strokeJoin =
|
216
|
+
strokeJoin = PConstants.MITER;
|
213
217
|
break;
|
214
218
|
case "round":
|
215
|
-
strokeJoin =
|
219
|
+
strokeJoin = PConstants.ROUND;
|
216
220
|
break;
|
217
221
|
case "bevel":
|
218
|
-
strokeJoin =
|
222
|
+
strokeJoin = PConstants.BEVEL;
|
219
223
|
break;
|
220
224
|
}
|
221
225
|
}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: geomerative
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2
|
4
|
+
version: 0.3.2
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Ricard Marxer
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2016-05-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: jruby_art
|
@@ -39,20 +39,6 @@ dependencies:
|
|
39
39
|
- - "~>"
|
40
40
|
- !ruby/object:Gem::Version
|
41
41
|
version: '10.0'
|
42
|
-
- !ruby/object:Gem::Dependency
|
43
|
-
name: minitest
|
44
|
-
requirement: !ruby/object:Gem::Requirement
|
45
|
-
requirements:
|
46
|
-
- - "~>"
|
47
|
-
- !ruby/object:Gem::Version
|
48
|
-
version: '5.8'
|
49
|
-
type: :development
|
50
|
-
prerelease: false
|
51
|
-
version_requirements: !ruby/object:Gem::Requirement
|
52
|
-
requirements:
|
53
|
-
- - "~>"
|
54
|
-
- !ruby/object:Gem::Version
|
55
|
-
version: '5.8'
|
56
42
|
description: |2
|
57
43
|
Geomerative java library wrapped in a rubygem. Updated to use String switch
|
58
44
|
etc available since jdk8.
|
@@ -64,25 +50,39 @@ extra_rdoc_files:
|
|
64
50
|
- LICENSE.md
|
65
51
|
files:
|
66
52
|
- ".gitignore"
|
53
|
+
- ".mvn/extensions.xml"
|
54
|
+
- ".mvn/wrapper/maven-wrapper.properties"
|
55
|
+
- ".travis.yml"
|
56
|
+
- CHANGELOG.md
|
57
|
+
- COPYING.md
|
67
58
|
- Gemfile
|
68
59
|
- LICENSE
|
69
60
|
- LICENSE.md
|
70
61
|
- README.md
|
71
62
|
- Rakefile
|
72
63
|
- examples/README.md
|
64
|
+
- examples/Rakefile
|
73
65
|
- examples/data/FreeSans.ttf
|
74
66
|
- examples/data/ReplicaBold.ttf
|
75
67
|
- examples/data/bot1.svg
|
76
68
|
- examples/data/lion.svg
|
69
|
+
- examples/data/ruby.svg
|
70
|
+
- examples/f_agent.rb
|
71
|
+
- examples/font_agent.rb
|
77
72
|
- examples/hello_polygonize.rb
|
78
73
|
- examples/hello_svg_to_pdf.rb
|
79
74
|
- examples/hello_world.rb
|
75
|
+
- examples/jruby_merge.rb
|
80
76
|
- examples/physics_type.rb
|
81
77
|
- examples/rotate_first_letter.rb
|
78
|
+
- examples/typo_deform.rb
|
79
|
+
- examples/typo_extra_bright.rb
|
80
|
+
- examples/typo_merge.rb
|
82
81
|
- geomerative.gemspec
|
83
82
|
- lib/geomerative.jar
|
84
83
|
- lib/geomerative.rb
|
85
84
|
- lib/geomerative/version.rb
|
85
|
+
- pom.rb
|
86
86
|
- pom.xml
|
87
87
|
- src/geomerative/FastRClip.java
|
88
88
|
- src/geomerative/RClip.java
|
@@ -199,10 +199,9 @@ requirements:
|
|
199
199
|
- A decent graphics card
|
200
200
|
- java runtime >= 1.8+
|
201
201
|
- processing = 3.0.1+
|
202
|
-
- maven = 3.3.3
|
203
202
|
- jruby_art = 1.0+
|
204
203
|
rubyforge_project:
|
205
|
-
rubygems_version: 2.
|
204
|
+
rubygems_version: 2.6.3
|
206
205
|
signing_key:
|
207
206
|
specification_version: 4
|
208
207
|
summary: Updated geomerative library for JRubyArt
|