picrate 2.5.1-java → 2.5.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -1
- data/README.md +1 -1
- data/docs/_classes/vec2d/vec2d.md +2 -2
- data/docs/_posts/2018-05-06-install_jruby.md +2 -2
- data/docs/_posts/2020-05-11-getting_started_manjaro.md +1 -1
- data/lib/picrate/version.rb +1 -1
- data/lib/picrate-2.5.2.jar +0 -0
- data/pom.rb +2 -2
- data/pom.xml +2 -2
- data/src/main/java/monkstone/vecmath/vec2/Vec2.java +15 -6
- data/test/vecmath_spec_test.rb +3 -3
- data/vendors/Rakefile +1 -1
- metadata +3 -3
- data/lib/picrate-2.5.1.jar +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b4a2f73c549d8ee796280cc60c5f304c50adc474375e56a7f1c27517f4e04f90
|
4
|
+
data.tar.gz: f326bd382abcdf8bb8b6ae76124ccddbfff932a4aac2f0c22c176928575bdbeb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '088cbf53dfa5f0b149d5312a7c5a2e52d81cebb54f05370feb813fb9aaa59bfc56dc6659dc0090c6b6451fb730a269e1e536e88c7cd2ce22a25c263a547ebf17'
|
7
|
+
data.tar.gz: 82ad21a6e136b0206018dc8b8906884303e1daf36995568e774a8ce5a4894733df1d5c0486b4ad4c910cb4c29df938c613cdf621d85ae4c5af87d0d0cb31e605
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
-
v2.5.
|
1
|
+
v2.5.2 Update to JRuby-9.3.2.0.
|
2
|
+
|
3
|
+
v2.5.1 Update to JRuby-9.3.1.0, under the hood changes in how we access java fields, no using `field` in place of `declared_field`, possible since JRuby-9.3.0.0 required since JRuby-9.3.2.0.
|
2
4
|
|
3
5
|
v2.5.0 Update to JRuby-9.3.0.0.
|
4
6
|
|
data/README.md
CHANGED
@@ -19,7 +19,7 @@ Requires java to build (and [jogl-2.4.0-rc jars][jogl_jars]), but uses a maven w
|
|
19
19
|
```bash
|
20
20
|
cd PiCrate # or whatever you call it
|
21
21
|
rake # assumes an installed version of vanilla processing
|
22
|
-
jgem install picrate-2.5.
|
22
|
+
jgem install picrate-2.5.2-java.gem
|
23
23
|
|
24
24
|
```
|
25
25
|
To create a template sketch:-
|
@@ -4,7 +4,7 @@ title: "Vec2D"
|
|
4
4
|
permalink: /classes/vec2d/
|
5
5
|
---
|
6
6
|
|
7
|
-
The Vec2D class is a direct replacement for processings PVector class (when used for 2D work, see Vec3D for 3D version).
|
7
|
+
The Vec2D class is a direct replacement for processings PVector class (when used for 2D work, see Vec3D for 3D version). Recently cross product is deprecated in favor of the more correct wedge `^` product
|
8
8
|
|
9
9
|
### Methods:-
|
10
10
|
```ruby
|
@@ -15,7 +15,7 @@ a / b # where a is instance of Vec2D and b is a scalar
|
|
15
15
|
a == b # where both a and b are both instances of Vec2D
|
16
16
|
a.angle_between(b) # where both a and b are both instances of Vec2D
|
17
17
|
a.copy # where a is instance of Vec2D returns a deep copy
|
18
|
-
a
|
18
|
+
a ^ b # wedge product where both a and b are both instances of Vec2D
|
19
19
|
a.dist(b) # where both a and b are both instances of Vec2D
|
20
20
|
a.dot(b) # where both a and b are both instances of Vec2D
|
21
21
|
a.heading # where a is instance of Vec2D
|
@@ -14,7 +14,7 @@ Get the latest version from [http://jruby.org/download][download]
|
|
14
14
|
|
15
15
|
```bash
|
16
16
|
cd /opt
|
17
|
-
sudo tar xzvf /pathToDownload/jruby-bin-9.3.
|
17
|
+
sudo tar xzvf /pathToDownload/jruby-bin-9.3.2.0.tar.gz
|
18
18
|
```
|
19
19
|
|
20
20
|
Then use the excellent `update-alternatives` tool to provide symbolic links to `jruby`, `jgem`, `jirb` and `rake` especially if you haven't installed `mri` ruby.
|
@@ -42,5 +42,5 @@ The [picrate2_install.sh][bash] script currently installs jruby-9.3.0.0 and picr
|
|
42
42
|
|
43
43
|
If you know better please post on wiki
|
44
44
|
|
45
|
-
[download]:"https://repo1.maven.org/maven2/org/jruby/jruby-dist/9.3.
|
45
|
+
[download]:"https://repo1.maven.org/maven2/org/jruby/jruby-dist/9.3.2.0/jruby-dist-9.3.2.0-bin.tar.gz"
|
46
46
|
[bash]:https://gist.github.com/monkstone/6ae9840d7b7008c177b4a9f589d14ec6
|
@@ -8,7 +8,7 @@ permalink: /getting_manjaro/
|
|
8
8
|
If Manjaro does not come with a pre-installed java, then the first step is to install a `jdk` the distro version (jdk16) should work.
|
9
9
|
|
10
10
|
```bash
|
11
|
-
sudo pacman -S jre-openjdk # current distro version
|
11
|
+
sudo pacman -S jre-openjdk # current distro version jdk17
|
12
12
|
```
|
13
13
|
You can also use pacman to install jruby
|
14
14
|
```bash
|
data/lib/picrate/version.rb
CHANGED
Binary file
|
data/pom.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
project 'picrate', 'http://maven.apache.org' do
|
4
4
|
model_version '4.0.0'
|
5
|
-
id 'ruby-processing:picrate:2.5.
|
5
|
+
id 'ruby-processing:picrate:2.5.2'
|
6
6
|
packaging 'jar'
|
7
7
|
|
8
8
|
description 'An integrated processing-core (somewhat hacked), with additional java code for a jruby version of processing.'
|
@@ -24,7 +24,7 @@ project 'picrate', 'http://maven.apache.org' do
|
|
24
24
|
issue_management 'https://github.com/ruby-processing/PiCrate/issues', 'Github'
|
25
25
|
# Need to update to jogl 2.4.1 as soon as available, then make a dependency
|
26
26
|
properties('jogl.version' => '2.3.2',
|
27
|
-
'jruby.version' => '9.3.
|
27
|
+
'jruby.version' => '9.3.2.0',
|
28
28
|
'batik.version' => '1.14',
|
29
29
|
'itextpdf.version' => '5.5.13.2',
|
30
30
|
'jruby.api' => 'http://jruby.org/apidocs/',
|
data/pom.xml
CHANGED
@@ -11,7 +11,7 @@ DO NOT MODIFY - GENERATED CODE
|
|
11
11
|
<modelVersion>4.0.0</modelVersion>
|
12
12
|
<groupId>ruby-processing</groupId>
|
13
13
|
<artifactId>picrate</artifactId>
|
14
|
-
<version>2.5.
|
14
|
+
<version>2.5.2</version>
|
15
15
|
<name>picrate</name>
|
16
16
|
<description>An integrated processing-core (somewhat hacked), with additional java code for a jruby version of processing.</description>
|
17
17
|
<url>http://maven.apache.org</url>
|
@@ -68,7 +68,7 @@ DO NOT MODIFY - GENERATED CODE
|
|
68
68
|
<itextpdf.version>5.5.13.2</itextpdf.version>
|
69
69
|
<jogl.version>2.3.2</jogl.version>
|
70
70
|
<jruby.api>http://jruby.org/apidocs/</jruby.api>
|
71
|
-
<jruby.version>9.3.
|
71
|
+
<jruby.version>9.3.2.0</jruby.version>
|
72
72
|
<picrate.basedir>${project.basedir}</picrate.basedir>
|
73
73
|
<polyglot.dump.pom>pom.xml</polyglot.dump.pom>
|
74
74
|
<processing.api>http://processing.github.io/processing-javadocs/core/</processing.api>
|
@@ -21,6 +21,7 @@ package monkstone.vecmath.vec2;
|
|
21
21
|
*
|
22
22
|
* fastAtan2 algorithm from https://github.com/libgdx/libgdx (Apache 2.0 license)
|
23
23
|
*/
|
24
|
+
import java.util.logging.Logger;
|
24
25
|
import org.jruby.Ruby;
|
25
26
|
import org.jruby.RubyArray;
|
26
27
|
import org.jruby.RubyClass;
|
@@ -228,19 +229,27 @@ public final class Vec2 extends RubyObject {
|
|
228
229
|
return runtime.newFloat(result);
|
229
230
|
}
|
230
231
|
|
232
|
+
@Deprecated
|
233
|
+
@JRubyMethod(name = "cross", required = 1)
|
234
|
+
public IRubyObject cross(ThreadContext context, IRubyObject other) {
|
235
|
+
Logger log = Logger.getGlobal();
|
236
|
+
log.warning("prefer ^ operator");
|
237
|
+
return op_wedge(context, other);
|
238
|
+
}
|
239
|
+
|
231
240
|
/**
|
232
241
|
*
|
233
242
|
* @param context ThreadContext
|
234
243
|
* @param other IRubyObject
|
235
|
-
* @return
|
244
|
+
* @return wedge product IRubyObject
|
236
245
|
*/
|
237
|
-
@JRubyMethod(name = "
|
246
|
+
@JRubyMethod(name = "^", required = 1)
|
238
247
|
|
239
|
-
public IRubyObject
|
248
|
+
public IRubyObject op_wedge(ThreadContext context, IRubyObject other) {
|
240
249
|
Vec2 b = null;
|
241
250
|
Ruby runtime = context.runtime;
|
242
251
|
if (other instanceof Vec2) {
|
243
|
-
b =
|
252
|
+
b = other.toJava(Vec2.class);
|
244
253
|
} else {
|
245
254
|
throw runtime.newTypeError("argument should be Vec2D");
|
246
255
|
}
|
@@ -401,7 +410,7 @@ public final class Vec2 extends RubyObject {
|
|
401
410
|
public IRubyObject set_mag(ThreadContext context, IRubyObject scalar, Block block) {
|
402
411
|
double new_mag = scalar.toJava(Double.class);
|
403
412
|
if (block.isGiven() && !block.yield(context, scalar).toJava(Boolean.class)) {
|
404
|
-
return this;
|
413
|
+
return this;
|
405
414
|
}
|
406
415
|
double current = 0;
|
407
416
|
if (Math.abs(jx) > EPSILON && Math.abs(jy) > EPSILON) {
|
@@ -789,7 +798,7 @@ public final class Vec2 extends RubyObject {
|
|
789
798
|
double diff = jx - v.jx;
|
790
799
|
if ((diff < 0 ? -diff : diff) > Vec2.EPSILON) {
|
791
800
|
return runtime.newBoolean(false);
|
792
|
-
}
|
801
|
+
}
|
793
802
|
diff = jy - v.jy;
|
794
803
|
return runtime.newBoolean((diff < 0 ? -diff : diff) < Vec2.EPSILON);
|
795
804
|
}
|
data/test/vecmath_spec_test.rb
CHANGED
@@ -270,14 +270,14 @@ class VecmathTest < Minitest::Test
|
|
270
270
|
a = Vec2D.new(200, 0)
|
271
271
|
b = Vec2D.new(0, 200)
|
272
272
|
# Expected result is an area, twice that of the triangle created by the vectors
|
273
|
-
assert_equal(a
|
273
|
+
assert_equal((a ^ b).abs, 40_000.0, 'Failed area test using 2D vector cross product')
|
274
274
|
end
|
275
275
|
|
276
276
|
def test_cross_non_zero # Could be used to calculate area of triangle
|
277
277
|
a = Vec2D.new(40, 40)
|
278
278
|
b = Vec2D.new(40, 140)
|
279
279
|
c = Vec2D.new(140, 40)
|
280
|
-
assert_equal((a - b)
|
280
|
+
assert_equal(((a - b) ^ (b - c)).abs / 2, 5_000.0, 'Failed area calculation using 2D vector cross product')
|
281
281
|
end
|
282
282
|
|
283
283
|
def test_cross_zero # where a, b, c are collinear area == 0
|
@@ -285,7 +285,7 @@ class VecmathTest < Minitest::Test
|
|
285
285
|
b = Vec2D.new(100, 100)
|
286
286
|
c = Vec2D.new(200, 200)
|
287
287
|
# see http://mathworld.wolfram.com/Collinear.html for details
|
288
|
-
assert((a - b)
|
288
|
+
assert(((a - b) ^ (b - c)).zero?, 'Failed collinearity test using 2D vector cross product')
|
289
289
|
end
|
290
290
|
|
291
291
|
def test_equals3
|
data/vendors/Rakefile
CHANGED
@@ -8,7 +8,7 @@ SOUND = 'sound.zip'
|
|
8
8
|
PROCESSING_GITHUB = 'https://github.com/processing'
|
9
9
|
VIDEO = 'video.zip'
|
10
10
|
DOWNLOAD = 'releases/download/latest'
|
11
|
-
EXAMPLES = '0.5.
|
11
|
+
EXAMPLES = '0.5.9'
|
12
12
|
HOME_DIR = ENV['HOME']
|
13
13
|
LIBRARY = File.join(HOME_DIR, '.picrate', 'libraries')
|
14
14
|
PROJECT_DIR = File.join(HOME_DIR, 'projects')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: picrate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.5.
|
4
|
+
version: 2.5.2
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- monkstone
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -185,7 +185,7 @@ files:
|
|
185
185
|
- lib/jogl-all-natives-linux-amd64.jar
|
186
186
|
- lib/jogl-all-natives-linux-armv6hf.jar
|
187
187
|
- lib/jogl-all.jar
|
188
|
-
- lib/picrate-2.5.
|
188
|
+
- lib/picrate-2.5.2.jar
|
189
189
|
- lib/picrate.rb
|
190
190
|
- lib/picrate/app.rb
|
191
191
|
- lib/picrate/creators/parameters.rb
|
data/lib/picrate-2.5.1.jar
DELETED
Binary file
|