Skip to content

Commit 5af94bd

Browse files
committed
contributing
1 parent 5076121 commit 5af94bd

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

contributed/README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
## Contributing JRubyArt examples
2+
3+
Share your enthusiasm for coding by submitting an example for inclusion here, provisional versions are acceptable if they demonstrate something interesting (and work), but we would prefer that you followed the style guide. But naturally we expect that you to aspire to the principal of code as art eventually (not many original examples survive without amendment).
4+
5+
### Style guide
6+
7+
* Prefer [bare sketches][bare] over [class wrapped][class].
8+
* Prefer `Vec2D` and `Vec3D` to `PVector` (it is confusing and sometimes plain wrong).
9+
* Prefer `Struct` over `Vec2D` and `Vec3D` if you don't need their methods.
10+
* No trailing whitespace.
11+
* Use spaces not tabs.
12+
* Avoid explicit return statements.
13+
* Avoid using semicolons.
14+
* Don't use `self` explicitly anywhere except class methods (`def self.method`)
15+
and assignments (`self.attribute =`).
16+
* Prefer `&:method_name` to `{ |item| item.method_name }` for simple method
17+
calls.
18+
* Use `CamelCase` for classes and modules, `snake_case` for variables and
19+
methods, `SCREAMING_SNAKE_CASE` for constants.
20+
* Use `def self.method`, not `def Class.method` or `class << self`.
21+
* Use `def` with parentheses when there are arguments.
22+
* Don't use spaces after required keyword arguments.
23+
* Use `each`, not `for`, for iteration.
24+
25+
When translating a sketch from vanilla processing (or some other codebase), you should credit the original author, unless the rubified version is unrecognizable from the original. It is often worth running `rubocop` on sketch code to avoid the most egregious errors.
26+
27+
[bare]:http://ruby-processing.github.io/projects/jruby_art/
28+
[class]:http://ruby-processing.github.io/projects/jruby_art/

external_library/gem/geomerative/solid_type.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ def setup
3131
RCommand.setSegmentator(RCommand::UNIFORMSTEP) # settings for the generated shape density
3232
RCommand.setSegmentStep(2) # settings for the generated shape density
3333
# create the font used by Geomerative using absolute path on ArchLinux
34-
font = RFont.new('/usr/share/fonts/TTF/FreeSans.ttf', 350, CENTER)
34+
# font = RFont.new('/usr/share/fonts/TTF/FreeSans.ttf', 350, CENTER)
35+
font = RFont.new('/usr/share/fonts/truetype/freefont/FreeSans.ttf', 350, CENTER)
3536
rmesh = font.toGroup(INPUT).toMesh # create a 2D mesh from a text
3637
# call the methods (see below) that do the actual work in this sketch
3738
mesh = rmesh_to_hemesh(rmesh) # create a 3D mesh from an INPUT string (using Geomerative & Hemesh)

0 commit comments

Comments
 (0)