glitch3d 0.1.0

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 (57) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +15 -0
  3. data/.rspec +2 -0
  4. data/.travis.yml +5 -0
  5. data/CODE_OF_CONDUCT.md +49 -0
  6. data/Gemfile +4 -0
  7. data/LICENSE.txt +21 -0
  8. data/README.md +55 -0
  9. data/Rakefile +6 -0
  10. data/bin/console +10 -0
  11. data/bin/glitch3d +6 -0
  12. data/bin/setup +8 -0
  13. data/fixtures/cube.obj +18 -0
  14. data/fixtures/demo.png +0 -0
  15. data/fixtures/m4a1.obj +128741 -0
  16. data/fixtures/male_head.obj +22543 -0
  17. data/fixtures/skull.obj +34962 -0
  18. data/fixtures/textures/00.jpg +0 -0
  19. data/fixtures/textures/01.jpg +0 -0
  20. data/fixtures/textures/02.jpg +0 -0
  21. data/fixtures/textures/03.jpg +0 -0
  22. data/fixtures/textures/04.jpg +0 -0
  23. data/fixtures/textures/05.jpg +0 -0
  24. data/fixtures/textures/06.jpg +0 -0
  25. data/fixtures/textures/07.jpg +0 -0
  26. data/fixtures/textures/08.jpg +0 -0
  27. data/fixtures/textures/09.jpg +0 -0
  28. data/fixtures/textures/10.jpg +0 -0
  29. data/fixtures/textures/11.jpg +0 -0
  30. data/fixtures/textures/12.jpg +0 -0
  31. data/fixtures/textures/13.jpg +0 -0
  32. data/fixtures/textures/14.jpg +0 -0
  33. data/fixtures/textures/15.jpg +0 -0
  34. data/fixtures/textures/16.jpg +0 -0
  35. data/fixtures/textures/17.jpg +0 -0
  36. data/fixtures/textures/18.jpg +0 -0
  37. data/fixtures/textures/19.jpg +0 -0
  38. data/fixtures/textures/20.jpg +0 -0
  39. data/fixtures/textures/21.jpg +0 -0
  40. data/fixtures/textures/22.jpg +0 -0
  41. data/fixtures/textures/23.jpg +0 -0
  42. data/fixtures/textures/24.jpg +0 -0
  43. data/fixtures/textures/25.jpg +0 -0
  44. data/fixtures/textures/27.jpg +0 -0
  45. data/fixtures/textures/28.jpg +0 -0
  46. data/fixtures/textures/29.jpg +0 -0
  47. data/fixtures/textures/30.jpg +0 -0
  48. data/glitch3d.gemspec +34 -0
  49. data/lib/glitch3d/bpy/helpers.py +97 -0
  50. data/lib/glitch3d/bpy/rendering.py +159 -0
  51. data/lib/glitch3d/objects/face.rb +22 -0
  52. data/lib/glitch3d/objects/vertex.rb +55 -0
  53. data/lib/glitch3d/strategies/default.rb +17 -0
  54. data/lib/glitch3d/strategies/localized.rb +25 -0
  55. data/lib/glitch3d/version.rb +3 -0
  56. data/lib/glitch3d.rb +137 -0
  57. metadata +157 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 3ab2d06c3a8af4e43f252d1aa2342209c4e8b921
4
+ data.tar.gz: 25ee7f24892d01b73f2bd82d6a978656c15fd87c
5
+ SHA512:
6
+ metadata.gz: 266c53f8b005835192605ac3c2238f088ed61102d0efbb0c040c7f081e35c4734ab4e6bcbfd451ace3a772e131eab6a3b7ecae083f6d503dcaf9e3666c6dee72
7
+ data.tar.gz: 1d4618d047a7306437c05443423df5eab85ae9eedae7bf434c28eab9db50b8ef1647577aca463a1321eddced851ebbf2a5dab905c0c36012e13988b8699d64fc
data/.gitignore ADDED
@@ -0,0 +1,15 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ /fixtures/models/*
11
+ /renders/*
12
+ /fixtures/*
13
+ !/fixtures/skull.obj
14
+ !/fixtures/textures/25.jpg
15
+ .DS_Store
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/.travis.yml ADDED
@@ -0,0 +1,5 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.0.0
5
+ before_install: gem install bundler -v 1.12.5
@@ -0,0 +1,49 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, and in the interest of
4
+ fostering an open and welcoming community, we pledge to respect all people who
5
+ contribute through reporting issues, posting feature requests, updating
6
+ documentation, submitting pull requests or patches, and other activities.
7
+
8
+ We are committed to making participation in this project a harassment-free
9
+ experience for everyone, regardless of level of experience, gender, gender
10
+ identity and expression, sexual orientation, disability, personal appearance,
11
+ body size, race, ethnicity, age, religion, or nationality.
12
+
13
+ Examples of unacceptable behavior by participants include:
14
+
15
+ * The use of sexualized language or imagery
16
+ * Personal attacks
17
+ * Trolling or insulting/derogatory comments
18
+ * Public or private harassment
19
+ * Publishing other's private information, such as physical or electronic
20
+ addresses, without explicit permission
21
+ * Other unethical or unprofessional conduct
22
+
23
+ Project maintainers have the right and responsibility to remove, edit, or
24
+ reject comments, commits, code, wiki edits, issues, and other contributions
25
+ that are not aligned to this Code of Conduct, or to ban temporarily or
26
+ permanently any contributor for other behaviors that they deem inappropriate,
27
+ threatening, offensive, or harmful.
28
+
29
+ By adopting this Code of Conduct, project maintainers commit themselves to
30
+ fairly and consistently applying these principles to every aspect of managing
31
+ this project. Project maintainers who do not follow or enforce the Code of
32
+ Conduct may be permanently removed from the project team.
33
+
34
+ This code of conduct applies both within project spaces and in public spaces
35
+ when an individual is representing the project or its community.
36
+
37
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
38
+ reported by contacting a project maintainer at pascal.lamouric@gmail.com. All
39
+ complaints will be reviewed and investigated and will result in a response that
40
+ is deemed necessary and appropriate to the circumstances. Maintainers are
41
+ obligated to maintain confidentiality with regard to the reporter of an
42
+ incident.
43
+
44
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
45
+ version 1.3.0, available at
46
+ [http://contributor-covenant.org/version/1/3/0/][version]
47
+
48
+ [homepage]: http://contributor-covenant.org
49
+ [version]: http://contributor-covenant.org/version/1/3/0/
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in glitch3d.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 Pascal Lamouric
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,55 @@
1
+ # Glitch3d
2
+
3
+ By altering .obj file data you can get something like this :
4
+
5
+ <img style="width:70%;height:70%;display:block;margin: 0 auto;" src="https://raw.githubusercontent.com/pskl/glitch3d/master/fixtures/demo.png">
6
+
7
+ ## Disclaimer
8
+
9
+ Work in progress. The gem is not usable at the moment.
10
+ Rationale: Model data manipulation is done in ruby, while anything related to the rendering process is done in Python using the Blender API.
11
+ Usage
12
+ ---
13
+ - `3dglitch source_file_name` (a .obj file)
14
+
15
+ ## A quick note on the .obj file format
16
+
17
+ - v -> represents a vertice position
18
+ - f -> represents a face (contains references to vertices, can be triangle, quad...)
19
+ - vt -> texture UV map
20
+ - vn -> vertex normal
21
+
22
+ ## Installation
23
+
24
+ Add this line to your application's Gemfile:
25
+
26
+ ```ruby
27
+ gem 'glitch3d'
28
+ ```
29
+
30
+ And then execute:
31
+
32
+ $ bundle
33
+
34
+ Or install it yourself as:
35
+
36
+ $ gem install glitch3d
37
+
38
+ ## Usage
39
+
40
+ TODO: Write usage instructions here
41
+
42
+ ## Development
43
+
44
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
45
+
46
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
47
+
48
+ ## Contributing
49
+
50
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/glitch3d. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
51
+
52
+
53
+ ## License
54
+
55
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "glitch3d"
5
+
6
+ require "pry"
7
+ Pry.start
8
+
9
+ require "irb"
10
+ IRB.start
data/bin/glitch3d ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'glitch3d'
4
+
5
+ include Glitch3d
6
+ process_model(ARGV[0])
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
data/fixtures/cube.obj ADDED
@@ -0,0 +1,18 @@
1
+ # Blender v2.71 (sub 0) OBJ File:
2
+ # www.blender.org
3
+
4
+ v -1.000000 -1.000000 1.000000
5
+ v -1.000000 -1.000000 -1.000000
6
+ v 1.000000 -1.000000 -1.000000
7
+ v 1.000000 -1.000000 1.000000
8
+ v -1.000000 1.000000 1.000000
9
+ v -1.000000 1.000000 -1.000000
10
+ v 1.000000 1.000000 -1.000000
11
+ v 1.000000 1.000000 1.000000
12
+
13
+ f 5 6 2 1
14
+ f 6 7 3 2
15
+ f 7 8 4 3
16
+ f 8 5 1 4
17
+ f 1 2 3 4
18
+ f 8 7 6 5
data/fixtures/demo.png ADDED
Binary file