geomerative 0.4.3-java → 2.1.0-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 (129) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +2 -0
  3. data/.mvn/extensions.xml +1 -1
  4. data/.mvn/wrapper/maven-wrapper.properties +1 -1
  5. data/CHANGELOG.md +19 -1
  6. data/COPYING.md +1 -1
  7. data/README.md +2 -2
  8. data/Rakefile +2 -15
  9. data/docs/_config.yml +8 -0
  10. data/docs/_includes/head.html +7 -6
  11. data/docs/_includes/header.html +6 -6
  12. data/docs/_includes/icon-github.svg +3 -1
  13. data/docs/_includes/icon-twitter.svg +3 -1
  14. data/docs/_includes/navigation.html +24 -0
  15. data/docs/_sass/_base.scss +79 -79
  16. data/docs/_sass/_layout.scss +137 -137
  17. data/docs/_sass/_syntax-highlighting.scss +64 -64
  18. data/docs/index.html +18 -18
  19. data/examples/README.md +1 -1
  20. data/examples/data/bot1.svg +1 -1
  21. data/examples/data/lion.svg +156 -156
  22. data/examples/data/ruby.svg +1 -1
  23. data/examples/jruby_merge.rb +1 -1
  24. data/examples/{f_agent.rb → library/f_agent/f_agent.rb} +0 -0
  25. data/examples/{font_agent.rb → library/font_agent/font_agent.rb} +2 -1
  26. data/examples/text_on_geomerative_path.rb +3 -2
  27. data/examples/typo_deform.rb +2 -2
  28. data/examples/typo_extra_bright.rb +1 -1
  29. data/geomerative.gemspec +3 -6
  30. data/lib/geomerative/version.rb +1 -1
  31. data/lib/geomerative.jar +0 -0
  32. data/lib/geomerative.rb +10 -10
  33. data/mvnw +234 -0
  34. data/mvnw.cmd +145 -0
  35. data/pom.rb +14 -16
  36. data/pom.xml +13 -19
  37. data/src/geomerative/FastRClip.java +2050 -2334
  38. data/src/geomerative/RClip.java +2237 -2539
  39. data/src/geomerative/RClosest.java +33 -31
  40. data/src/geomerative/RCommand.java +1750 -1758
  41. data/src/geomerative/RContour.java +290 -292
  42. data/src/geomerative/RFont.java +277 -246
  43. data/src/geomerative/RG.java +722 -727
  44. data/src/geomerative/RGeomElem.java +967 -962
  45. data/src/geomerative/RGroup.java +508 -467
  46. data/src/geomerative/RMatrix.java +304 -289
  47. data/src/geomerative/RMesh.java +241 -229
  48. data/src/geomerative/RPath.java +924 -926
  49. data/src/geomerative/RPoint.java +391 -391
  50. data/src/geomerative/RPolygon.java +1017 -1013
  51. data/src/geomerative/RRectangle.java +43 -52
  52. data/src/geomerative/RSVG.java +480 -516
  53. data/src/geomerative/RShape.java +1767 -1777
  54. data/src/geomerative/RStrip.java +173 -176
  55. data/src/geomerative/RStyle.java +197 -194
  56. data/src/module-info.java +4 -0
  57. data/src/org/apache/batik/svggen/font/Font.java +141 -142
  58. data/src/org/apache/batik/svggen/font/Glyph.java +102 -71
  59. data/src/org/apache/batik/svggen/font/Point.java +12 -12
  60. data/src/org/apache/batik/svggen/font/RandomAccessFileEmulator.java +14 -12
  61. data/src/org/apache/batik/svggen/font/table/ClassDef.java +12 -12
  62. data/src/org/apache/batik/svggen/font/table/ClassDefFormat1.java +27 -24
  63. data/src/org/apache/batik/svggen/font/table/ClassDefFormat2.java +20 -17
  64. data/src/org/apache/batik/svggen/font/table/CmapFormat.java +43 -43
  65. data/src/org/apache/batik/svggen/font/table/CmapFormat0.java +33 -26
  66. data/src/org/apache/batik/svggen/font/table/CmapFormat2.java +25 -20
  67. data/src/org/apache/batik/svggen/font/table/CmapFormat4.java +106 -96
  68. data/src/org/apache/batik/svggen/font/table/CmapFormat6.java +36 -32
  69. data/src/org/apache/batik/svggen/font/table/CmapIndexEntry.java +69 -49
  70. data/src/org/apache/batik/svggen/font/table/CmapTable.java +50 -50
  71. data/src/org/apache/batik/svggen/font/table/Coverage.java +19 -19
  72. data/src/org/apache/batik/svggen/font/table/CoverageFormat1.java +30 -27
  73. data/src/org/apache/batik/svggen/font/table/CoverageFormat2.java +26 -24
  74. data/src/org/apache/batik/svggen/font/table/CvtTable.java +16 -16
  75. data/src/org/apache/batik/svggen/font/table/Device.java +32 -32
  76. data/src/org/apache/batik/svggen/font/table/DirectoryEntry.java +39 -39
  77. data/src/org/apache/batik/svggen/font/table/Feature.java +26 -23
  78. data/src/org/apache/batik/svggen/font/table/FeatureList.java +37 -35
  79. data/src/org/apache/batik/svggen/font/table/FeatureRecord.java +22 -22
  80. data/src/org/apache/batik/svggen/font/table/FeatureTags.java +4 -3
  81. data/src/org/apache/batik/svggen/font/table/FpgmTable.java +9 -9
  82. data/src/org/apache/batik/svggen/font/table/GlyfCompositeComp.java +134 -132
  83. data/src/org/apache/batik/svggen/font/table/GlyfCompositeDescript.java +123 -122
  84. data/src/org/apache/batik/svggen/font/table/GlyfDescript.java +44 -44
  85. data/src/org/apache/batik/svggen/font/table/GlyfSimpleDescript.java +110 -109
  86. data/src/org/apache/batik/svggen/font/table/GlyfTable.java +46 -46
  87. data/src/org/apache/batik/svggen/font/table/GlyphDescription.java +25 -13
  88. data/src/org/apache/batik/svggen/font/table/GposTable.java +26 -23
  89. data/src/org/apache/batik/svggen/font/table/GsubTable.java +85 -82
  90. data/src/org/apache/batik/svggen/font/table/HeadTable.java +131 -131
  91. data/src/org/apache/batik/svggen/font/table/HheaTable.java +80 -80
  92. data/src/org/apache/batik/svggen/font/table/HmtxTable.java +50 -49
  93. data/src/org/apache/batik/svggen/font/table/KernSubtable.java +29 -27
  94. data/src/org/apache/batik/svggen/font/table/KernSubtableFormat0.java +35 -32
  95. data/src/org/apache/batik/svggen/font/table/KernSubtableFormat2.java +28 -26
  96. data/src/org/apache/batik/svggen/font/table/KernTable.java +36 -31
  97. data/src/org/apache/batik/svggen/font/table/KerningPair.java +27 -23
  98. data/src/org/apache/batik/svggen/font/table/LangSys.java +28 -26
  99. data/src/org/apache/batik/svggen/font/table/LangSysRecord.java +22 -22
  100. data/src/org/apache/batik/svggen/font/table/Ligature.java +24 -24
  101. data/src/org/apache/batik/svggen/font/table/LigatureSet.java +24 -24
  102. data/src/org/apache/batik/svggen/font/table/LigatureSubst.java +9 -9
  103. data/src/org/apache/batik/svggen/font/table/LigatureSubstFormat1.java +30 -30
  104. data/src/org/apache/batik/svggen/font/table/LocaTable.java +37 -37
  105. data/src/org/apache/batik/svggen/font/table/Lookup.java +41 -40
  106. data/src/org/apache/batik/svggen/font/table/LookupList.java +34 -34
  107. data/src/org/apache/batik/svggen/font/table/LookupSubtableFactory.java +7 -5
  108. data/src/org/apache/batik/svggen/font/table/MaxpTable.java +96 -96
  109. data/src/org/apache/batik/svggen/font/table/NameRecord.java +64 -65
  110. data/src/org/apache/batik/svggen/font/table/NameTable.java +33 -33
  111. data/src/org/apache/batik/svggen/font/table/Os2Table.java +196 -196
  112. data/src/org/apache/batik/svggen/font/table/Panose.java +14 -12
  113. data/src/org/apache/batik/svggen/font/table/PostTable.java +338 -338
  114. data/src/org/apache/batik/svggen/font/table/PrepTable.java +9 -9
  115. data/src/org/apache/batik/svggen/font/table/Program.java +15 -15
  116. data/src/org/apache/batik/svggen/font/table/RangeRecord.java +26 -25
  117. data/src/org/apache/batik/svggen/font/table/Script.java +38 -38
  118. data/src/org/apache/batik/svggen/font/table/ScriptList.java +42 -42
  119. data/src/org/apache/batik/svggen/font/table/ScriptRecord.java +22 -22
  120. data/src/org/apache/batik/svggen/font/table/ScriptTags.java +2 -1
  121. data/src/org/apache/batik/svggen/font/table/SingleSubst.java +15 -16
  122. data/src/org/apache/batik/svggen/font/table/SingleSubstFormat1.java +33 -33
  123. data/src/org/apache/batik/svggen/font/table/SingleSubstFormat2.java +32 -32
  124. data/src/org/apache/batik/svggen/font/table/Table.java +171 -170
  125. data/src/org/apache/batik/svggen/font/table/TableDirectory.java +55 -55
  126. data/src/org/apache/batik/svggen/font/table/TableFactory.java +92 -93
  127. metadata +18 -19
  128. data/.travis.yml +0 -10
  129. data/calculate_torsional_angle.rb +0 -17
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Copyright 2004-2008 Ricard Marxer <email@ricardmarxer.com>
3
3
  *
4
- This file is part of Geomerative.
4
+ * This file is part of Geomerative.
5
5
  *
6
6
  * Geomerative is free software: you can redistribute it and/or modify it under
7
7
  * the terms of the GNU General Public License as published by the Free Software
@@ -18,208 +18,205 @@
18
18
  */
19
19
  package geomerative;
20
20
 
21
-
22
-
23
21
  import processing.core.PConstants;
24
22
  import processing.core.PGraphics;
25
23
 
26
-
27
24
  /**
28
25
  * RStrip is a reduced interface for creating, holding and drawing triangle
29
26
  * strips. Triangle strips are ordered lists of points (RPoint) which define the
30
27
  * vertices of a mesh.
31
28
  *
32
- * @eexample RStrip
33
- * @usage Geometry
34
- * @related RPoint
35
- * @related RMesh
36
- * @extended
29
+ RStrip
30
+ * Geometry
31
+ * RPoint
32
+ * RMesh
33
+
37
34
  */
38
35
  public class RStrip {
39
36
 
40
- /**
41
- * @invisible
42
- */
43
- public int type = RGeomElem.TRISTRIP;
44
-
45
- /**
46
- * Array of RPoint objects holding the vertices of the strip.
47
- *
48
- * @eexample vertices
49
- * @related RPoint
50
- * @related countVertices ( )
51
- * @related addVertex ( )
52
- */
53
- public RPoint vertices[];
54
-
55
- // ----------------------
56
- // --- Public Methods ---
57
- // ----------------------
58
- /**
59
- * Use this method to create a new strip.
60
- *
61
- * @eexample RStrip ( )
62
- * @related addVertex ( )
63
- * @param s the object of which to make a copy
64
- */
65
- public RStrip(RStrip s) {
66
- for (int i = 0; i < s.countVertices(); i++) {
67
- this.append(new RPoint(s.vertices[i]));
68
- }
69
- }
70
-
71
- public RStrip() {
72
- vertices = null;
73
- }
37
+ /**
38
+ *
39
+ */
40
+ public int type = RGeomElem.TRISTRIP;
74
41
 
75
- /**
76
- * Use this method to count the number of vertices in the strip.
77
- *
78
- * @eexample countVertices
79
- * @return int, the number vertices in the strip
80
- */
81
- public int countVertices() {
82
- if (this.vertices == null) {
83
- return 0;
84
- }
85
-
86
- return this.vertices.length;
87
- }
42
+ /**
43
+ * Array of RPoint objects holding the vertices of the strip.
44
+ *
45
+ vertices
46
+ * RPoint
47
+ * countVertices ( )
48
+ * addVertex ( )
49
+ */
50
+ public RPoint vertices[];
88
51
 
89
- /**
90
- * Use this method to draw the strip.
91
- *
92
- * @eexample drawStrip
93
- * @param g PGraphics, the graphics object on which to draw the strip
94
- */
95
- public void draw(PGraphics g) {
96
- int numVertices = countVertices();
97
- g.beginShape(PConstants.TRIANGLE_STRIP);
98
- for (int i = 0; i < numVertices; i++) {
99
- g.vertex(vertices[i].x, vertices[i].y);
100
- }
101
- g.endShape();
52
+ // ----------------------
53
+ // --- Public Methods ---
54
+ // ----------------------
55
+ /**
56
+ * Use this method to create a new strip.
57
+ *
58
+ RStrip ( )
59
+ * addVertex ( )
60
+ * @param s the object of which to make a copy
61
+ */
62
+ public RStrip(RStrip s) {
63
+ for (int i = 0; i < s.countVertices(); i++) {
64
+ this.append(new RPoint(s.vertices[i]));
102
65
  }
66
+ }
103
67
 
104
- /**
105
- * Use this method to add new vertices to the strip.
106
- *
107
- * @param p
108
- * @eexample addVertex ( )
109
- */
110
- public void addVertex(RPoint p) {
111
- this.append(p);
112
- }
68
+ public RStrip() {
69
+ vertices = null;
70
+ }
113
71
 
114
- public void addVertex(float x, float y) {
115
- this.append(new RPoint(x, y));
72
+ /**
73
+ * Use this method to count the number of vertices in the strip.
74
+ *
75
+ countVertices
76
+ * @return int, the number vertices in the strip
77
+ */
78
+ public int countVertices() {
79
+ if (this.vertices == null) {
80
+ return 0;
116
81
  }
117
82
 
118
- /**
119
- * Use this method to get the bounding box of the strip.
120
- *
121
- * @eexample getBounds
122
- * @return RContour, the bounding box of the strip in the form of a
123
- * four-point contour
124
- * @related draw ( )
125
- */
126
- public RContour getBounds() {
127
- float xmin = Float.MAX_VALUE;
128
- float ymin = Float.MAX_VALUE;
129
- float xmax = -Float.MAX_VALUE;
130
- float ymax = -Float.MAX_VALUE;
131
-
132
- for (int i = 0; i < this.countVertices(); i++) {
133
- float x = this.vertices[i].x;
134
- float y = this.vertices[i].y;
135
- if (x < xmin) {
136
- xmin = x;
137
- }
138
- if (x > xmax) {
139
- xmax = x;
140
- }
141
- if (y < ymin) {
142
- ymin = y;
143
- }
144
- if (y > ymax) {
145
- ymax = y;
146
- }
147
- }
148
-
149
- RContour c = new RContour();
150
- c.addPoint(xmin, ymin);
151
- c.addPoint(xmin, ymax);
152
- c.addPoint(xmax, ymax);
153
- c.addPoint(xmax, ymin);
154
- return c;
155
- }
83
+ return this.vertices.length;
84
+ }
156
85
 
157
- /**
158
- * Use this to get the vertices of the strip. It returns the points as an
159
- * array of RPoint.
160
- *
161
- * @eexample RStrip_getHandles
162
- * @return RPoint[], the vertices returned in an array.
86
+ /**
87
+ * Use this method to draw the strip.
163
88
  *
164
- */
165
- public RPoint[] getHandles() {
166
- return vertices;
89
+ drawStrip
90
+ * @param g PGraphics, the graphics object on which to draw the strip
91
+ */
92
+ public void draw(PGraphics g) {
93
+ int numVertices = countVertices();
94
+ g.beginShape(PConstants.TRIANGLE_STRIP);
95
+ for (int i = 0; i < numVertices; i++) {
96
+ g.vertex(vertices[i].x, vertices[i].y);
167
97
  }
98
+ g.endShape();
99
+ }
168
100
 
169
- /**
170
- * Use this to get the vertices of the strip. It returns the points as an
171
- * array of RPoint.
172
- *
173
- * @eexample RStrip_getPoints
174
- * @return RPoint[], the vertices returned in an array.
101
+ /**
102
+ * Use this method to add new vertices to the strip.
175
103
  *
176
- */
177
- public RPoint[] getPoints() {
178
- return vertices;
179
- }
180
-
181
- /**
182
- * Use this method to transform the strip.
183
- *
184
- * @eexample transformStrip
185
- * @param m RMatrix, the matrix of the affine transformation to apply to the
186
- * strip
187
- */
188
- public void transform(RMatrix m) {
189
- int numVertices = countVertices();
190
- if (numVertices != 0) {
191
- for (int i = 0; i < numVertices; i++) {
192
- vertices[i].transform(m);
193
- }
194
- }
195
- }
196
-
197
- void add(RPoint p) {
198
- this.append(p);
104
+ * @param p
105
+ addVertex ( )
106
+ */
107
+ public void addVertex(RPoint p) {
108
+ this.append(p);
109
+ }
110
+
111
+ public void addVertex(float x, float y) {
112
+ this.append(new RPoint(x, y));
113
+ }
114
+
115
+ /**
116
+ * Use this method to get the bounding box of the strip.
117
+ *
118
+ getBounds
119
+ * @return RContour, the bounding box of the strip in the form of a four-point
120
+ * contour
121
+ * draw ( )
122
+ */
123
+ public RContour getBounds() {
124
+ float xmin = Float.MAX_VALUE;
125
+ float ymin = Float.MAX_VALUE;
126
+ float xmax = -Float.MAX_VALUE;
127
+ float ymax = -Float.MAX_VALUE;
128
+
129
+ for (int i = 0; i < this.countVertices(); i++) {
130
+ float x = this.vertices[i].x;
131
+ float y = this.vertices[i].y;
132
+ if (x < xmin) {
133
+ xmin = x;
134
+ }
135
+ if (x > xmax) {
136
+ xmax = x;
137
+ }
138
+ if (y < ymin) {
139
+ ymin = y;
140
+ }
141
+ if (y > ymax) {
142
+ ymax = y;
143
+ }
199
144
  }
200
145
 
201
- void add(float x, float y) {
202
- this.append(new RPoint(x, y));
203
- }
146
+ RContour c = new RContour();
147
+ c.addPoint(xmin, ymin);
148
+ c.addPoint(xmin, ymax);
149
+ c.addPoint(xmax, ymax);
150
+ c.addPoint(xmax, ymin);
151
+ return c;
152
+ }
153
+
154
+ /**
155
+ * Use this to get the vertices of the strip. It returns the points as an
156
+ * array of RPoint.
157
+ *
158
+ RStrip_getHandles
159
+ * @return RPoint[], the vertices returned in an array.
160
+ *
161
+ */
162
+ public RPoint[] getHandles() {
163
+ return vertices;
164
+ }
165
+
166
+ /**
167
+ * Use this to get the vertices of the strip. It returns the points as an
168
+ * array of RPoint.
169
+ *
170
+ RStrip_getPoints
171
+ * @return RPoint[], the vertices returned in an array.
172
+ *
173
+ */
174
+ public RPoint[] getPoints() {
175
+ return vertices;
176
+ }
204
177
 
205
- /**
206
- * Remove all of the points. Creates an empty polygon.
207
- */
208
- void clear() {
209
- this.vertices = null;
178
+ /**
179
+ * Use this method to transform the strip.
180
+ *
181
+ transformStrip
182
+ * @param m RMatrix, the matrix of the affine transformation to apply to the
183
+ * strip
184
+ */
185
+ public void transform(RMatrix m) {
186
+ int numVertices = countVertices();
187
+ if (numVertices != 0) {
188
+ for (int i = 0; i < numVertices; i++) {
189
+ vertices[i].transform(m);
190
+ }
210
191
  }
211
-
212
- final void append(RPoint nextvertex) {
213
- RPoint[] newvertices;
214
- if (vertices == null) {
215
- newvertices = new RPoint[1];
216
- newvertices[0] = nextvertex;
217
- } else {
218
- newvertices = new RPoint[this.vertices.length + 1];
219
- System.arraycopy(this.vertices, 0, newvertices, 0, this.vertices.length);
220
- newvertices[this.vertices.length] = nextvertex;
221
- }
222
- this.vertices = newvertices;
192
+ }
193
+
194
+ void add(RPoint p) {
195
+ this.append(p);
196
+ }
197
+
198
+ void add(float x, float y) {
199
+ this.append(new RPoint(x, y));
200
+ }
201
+
202
+ /**
203
+ * Remove all of the points. Creates an empty polygon.
204
+ */
205
+ void clear() {
206
+ this.vertices = null;
207
+ }
208
+
209
+ final void append(RPoint nextvertex) {
210
+ RPoint[] newvertices;
211
+ if (vertices == null) {
212
+ newvertices = new RPoint[1];
213
+ newvertices[0] = nextvertex;
214
+ } else {
215
+ newvertices = new RPoint[this.vertices.length + 1];
216
+ System.arraycopy(this.vertices, 0, newvertices, 0, this.vertices.length);
217
+ newvertices[this.vertices.length] = nextvertex;
223
218
  }
219
+ this.vertices = newvertices;
220
+ }
224
221
 
225
222
  }