geomerative 0.2.0-java → 0.3.2-java

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/.mvn/extensions.xml +8 -0
  3. data/.mvn/wrapper/maven-wrapper.properties +1 -0
  4. data/.travis.yml +14 -0
  5. data/CHANGELOG.md +4 -0
  6. data/COPYING.md +17 -0
  7. data/Gemfile +8 -1
  8. data/README.md +5 -1
  9. data/examples/README.md +1 -7
  10. data/examples/Rakefile +30 -0
  11. data/examples/data/ruby.svg +16 -0
  12. data/examples/f_agent.rb +30 -0
  13. data/examples/font_agent.rb +24 -0
  14. data/examples/hello_polygonize.rb +1 -1
  15. data/examples/hello_svg_to_pdf.rb +2 -2
  16. data/examples/hello_world.rb +1 -1
  17. data/examples/jruby_merge.rb +94 -0
  18. data/examples/physics_type.rb +1 -1
  19. data/examples/rotate_first_letter.rb +3 -4
  20. data/examples/typo_deform.rb +68 -0
  21. data/examples/typo_extra_bright.rb +62 -0
  22. data/examples/typo_merge.rb +94 -0
  23. data/geomerative.gemspec +2 -3
  24. data/lib/geomerative/version.rb +1 -1
  25. data/pom.rb +47 -0
  26. data/pom.xml +35 -65
  27. data/src/geomerative/FastRClip.java +1 -1
  28. data/src/geomerative/RCommand.java +1877 -1741
  29. data/src/geomerative/RContour.java +8 -1
  30. data/src/geomerative/RFont.java +8 -5
  31. data/src/geomerative/RG.java +8 -3
  32. data/src/geomerative/RGeomElem.java +8 -9
  33. data/src/geomerative/RGroup.java +50 -28
  34. data/src/geomerative/RMatrix.java +53 -57
  35. data/src/geomerative/RMesh.java +8 -3
  36. data/src/geomerative/RPath.java +34 -29
  37. data/src/geomerative/RPoint.java +408 -408
  38. data/src/geomerative/RPolygon.java +7 -3
  39. data/src/geomerative/RSVG.java +13 -10
  40. data/src/geomerative/RShape.java +18 -11
  41. data/src/geomerative/RStrip.java +5 -1
  42. data/src/geomerative/RStyle.java +15 -11
  43. 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 = null;
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 = null;
545
+ RPoint[] newresult;
542
546
  for (int i = 0; i < numContours; i++) {
543
547
  RPoint[] newPoints = contours[i].getPoints();
544
548
  if (newPoints != null) {
@@ -19,8 +19,11 @@
19
19
 
20
20
  package geomerative;
21
21
 
22
- import processing.core.*;
23
- import processing.data.*;
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 = 0;
94
- float multiplier = 1.0f;
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 RG.PROJECT:
301
+ case PConstants.PROJECT:
299
302
  result += "butt";
300
303
  break;
301
- case RG.ROUND:
304
+ case PConstants.ROUND:
302
305
  result += "round";
303
306
  break;
304
- case RG.SQUARE:
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 RG.MITER:
322
+ case PConstants.MITER:
320
323
  result += "miter";
321
324
  break;
322
- case RG.ROUND:
325
+ case PConstants.ROUND:
323
326
  result += "round";
324
327
  break;
325
- case RG.BEVEL:
328
+ case PConstants.BEVEL:
326
329
  result += "bevel";
327
330
  break;
328
331
 
@@ -18,7 +18,12 @@
18
18
  */
19
19
  package geomerative;
20
20
 
21
- import processing.core.*;
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 = null;
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 = null;
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 = 0;
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 = null;
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 = null;
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 = null;
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 = null;
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 = null;
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 = null;
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 = null;
1394
+ RPoint[] newresult;
1388
1395
 
1389
1396
  for (int i = 0; i < numPaths; i++) {
1390
1397
  RPoint[] newPoints = other.polygonIntersectionPoints(paths[i]);
@@ -18,7 +18,11 @@
18
18
  */
19
19
  package geomerative;
20
20
 
21
- import processing.core.*;
21
+
22
+
23
+ import processing.core.PConstants;
24
+ import processing.core.PGraphics;
25
+
22
26
 
23
27
  /**
24
28
  * RStrip is a reduced interface for creating, holding and drawing triangle
@@ -18,7 +18,11 @@
18
18
  */
19
19
 
20
20
  package geomerative ;
21
- import processing.core.*;
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 = RG.PROJECT;
51
+ public int strokeCap = PConstants.PROJECT;
48
52
 
49
53
  public boolean strokeJoinDef = false;
50
- public int strokeJoin = RG.MITER;
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 = RG.PROJECT;
59
- private int oldStrokeJoin = RG.MITER;
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 = RG.PROJECT;
199
+ strokeCap = PConstants.PROJECT;
196
200
  break;
197
201
  case "round":
198
- strokeCap = RG.ROUND;
202
+ strokeCap = PConstants.ROUND;
199
203
  break;
200
204
  case "square":
201
- strokeCap = RG.SQUARE;
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 = RG.MITER;
216
+ strokeJoin = PConstants.MITER;
213
217
  break;
214
218
  case "round":
215
- strokeJoin = RG.ROUND;
219
+ strokeJoin = PConstants.ROUND;
216
220
  break;
217
221
  case "bevel":
218
- strokeJoin = RG.BEVEL;
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.0
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: 2015-11-24 00:00:00.000000000 Z
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.5.0
204
+ rubygems_version: 2.6.3
206
205
  signing_key:
207
206
  specification_version: 4
208
207
  summary: Updated geomerative library for JRubyArt