crystalscad 0.5 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -17,6 +17,7 @@ res2+= cube([10,10,50]).center
17
17
 
18
18
  res = res1-res2
19
19
  res*=cylinder(r1:20,r2:5,h:50,center:true).translate(z:5)
20
+
20
21
  res.save("example002.scad")
21
22
 
22
23
 
data/examples/pipe.rb CHANGED
@@ -25,7 +25,7 @@ pipe.cw(30,60,"blue")
25
25
  pipe.ccw(30,45,"green")
26
26
  pipe.line(3)
27
27
  pipe.ccw(30,160,"blue")
28
- pipe.ccw(30,60,"green")
28
+ pipe.ccw(30,60,"pink")
29
29
 
30
30
 
31
31
  #pipe.cw(30,60,"blue")
@@ -4,11 +4,11 @@ require "crystalscad"
4
4
  include CrystalScad
5
5
 
6
6
 
7
- g1 = PrintedGear.new(module:2.0,teeth:40,bore:8,height:4)
7
+ g1 = PrintedGear.new(module:2.0,teeth:40,bore:5,height:4)
8
8
  g2 = PrintedGear.new(module:2.0,teeth:20,bore:5,height:4,rotation:0.5) # rotation in number of teeth
9
9
 
10
- res = g1.show.color("red")
11
- res += g2.show.translate(x:g1.distance_to(g2))
10
+ res = g1.show.color("red").rotate(z:"$t*360")
11
+ res += g2.show.rotate(z:"-$t*360*#{g1.ratio(g2)}").translate(x:g1.distance_to(g2))
12
12
 
13
- res.save("printed_gear.scad","$fn=64;")
13
+ res.save("printed_gear.scad")
14
14
 
data/lib/crystalscad.rb CHANGED
@@ -7,5 +7,7 @@ require 'crystalscad/Gears'
7
7
  require 'crystalscad/ScrewThreads'
8
8
  require 'crystalscad/PrintedThreads'
9
9
  require 'crystalscad/Pipe'
10
+ require 'crystalscad/Ruler'
11
+
10
12
  require 'crystalscad/CrystalScad'
11
13
 
@@ -19,6 +19,11 @@ module CrystalScad
19
19
 
20
20
  def initialize(args={})
21
21
  @args = args if @args == nil
22
+
23
+ @x = args[:x]
24
+ @y = args[:y]
25
+ @z = args[:z]
26
+
22
27
  add_to_bom
23
28
  end
24
29
 
@@ -104,9 +109,14 @@ module CrystalScad
104
109
  end
105
110
 
106
111
  class LasercutSheet < Assembly
112
+
107
113
  def description
108
114
  "Laser cut sheet #{self.class.to_s}"
109
115
  end
116
+
117
+ def part(show)
118
+ square([@x,@y])
119
+ end
110
120
  end
111
121
 
112
122
  end
@@ -0,0 +1,49 @@
1
+ # This file is part of CrystalScad.
2
+ #
3
+ # CrystalScad is free software: you can redistribute it and/or modify
4
+ # it under the terms of the GNU General Public License as published by
5
+ # the Free Software Foundation, either version 3 of the License, or
6
+ # (at your option) any later version.
7
+ #
8
+ # CrystalScad is distributed in the hope that it will be useful,
9
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
+ # GNU General Public License for more details.
12
+ #
13
+ # You should have received a copy of the GNU General Public License
14
+ # along with CrystalScad. If not, see <http://www.gnu.org/licenses/>.
15
+
16
+
17
+
18
+ module CrystalScad
19
+ class Ruler < CrystalScad::Assembly
20
+ def initialize(args={})
21
+ @x = args[:x] || 50
22
+ @y = args[:y] || 5
23
+ @height = args[:height] || 1
24
+ @mm_mark = args[:mm_mark] || 3
25
+ @five_mm_mark = args[:five_mm_mark] || 4
26
+ @ten_mm_mark = args[:ten_mm_mark] || 5
27
+ @rotation = args[:rotation] || 0
28
+ end
29
+
30
+ def part(show)
31
+ res = cube([@x,@y,@height]).color("Gainsboro")
32
+ (@x+1).times do |i|
33
+ res += cube([0.1,@mm_mark,@height+0.1]).translate(x:i).color("black")
34
+ if i % 10 == 0
35
+ res += cube([0.1,@ten_mm_mark,@height+0.1]).translate(x:i).color("black")
36
+ elsif i % 5 == 0
37
+ res += cube([0.1,@five_mm_mark,@height+0.1]).translate(x:i).color("black")
38
+ end
39
+ end
40
+ if @rotation > 0
41
+ res = res.rotate(z:@rotation)
42
+ end
43
+ res
44
+ end
45
+
46
+
47
+ end
48
+ end
49
+
@@ -1,4 +1,4 @@
1
1
  module CrystalScad
2
- VERSION = "0.5"
2
+ VERSION = "0.5.1"
3
3
  end
4
4
 
metadata CHANGED
@@ -1,79 +1,94 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: crystalscad
3
- version: !ruby/object:Gem::Version
4
- version: '0.5'
3
+ version: !ruby/object:Gem::Version
4
+ hash: 9
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 5
9
+ - 1
10
+ version: 0.5.1
5
11
  platform: ruby
6
- authors:
12
+ authors:
7
13
  - Joachim Glauche
8
14
  autorequire:
9
15
  bindir: bin
10
16
  cert_chain: []
11
- date: 2015-03-31 00:00:00.000000000 Z
12
- dependencies:
13
- - !ruby/object:Gem::Dependency
17
+
18
+ date: 2015-04-09 00:00:00 Z
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
14
21
  name: rubyscad
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ! '>='
18
- - !ruby/object:Gem::Version
19
- version: '1.0'
20
- type: :runtime
21
22
  prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ! '>='
25
- - !ruby/object:Gem::Version
26
- version: '1.0'
27
- - !ruby/object:Gem::Dependency
28
- name: require_all
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ! '>='
32
- - !ruby/object:Gem::Version
33
- version: '1.3'
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ hash: 15
29
+ segments:
30
+ - 1
31
+ - 0
32
+ version: "1.0"
34
33
  type: :runtime
34
+ version_requirements: *id001
35
+ - !ruby/object:Gem::Dependency
36
+ name: require_all
35
37
  prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ! '>='
39
- - !ruby/object:Gem::Version
40
- version: '1.3'
41
- - !ruby/object:Gem::Dependency
42
- name: wijet-thor
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ! '>='
46
- - !ruby/object:Gem::Version
47
- version: 0.14.10
38
+ requirement: &id002 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ hash: 9
44
+ segments:
45
+ - 1
46
+ - 3
47
+ version: "1.3"
48
48
  type: :runtime
49
+ version_requirements: *id002
50
+ - !ruby/object:Gem::Dependency
51
+ name: wijet-thor
49
52
  prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ! '>='
53
- - !ruby/object:Gem::Version
53
+ requirement: &id003 !ruby/object:Gem::Requirement
54
+ none: false
55
+ requirements:
56
+ - - ">="
57
+ - !ruby/object:Gem::Version
58
+ hash: 51
59
+ segments:
60
+ - 0
61
+ - 14
62
+ - 10
54
63
  version: 0.14.10
55
- - !ruby/object:Gem::Dependency
56
- name: observr
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ! '>='
60
- - !ruby/object:Gem::Version
61
- version: 1.0.5
62
64
  type: :runtime
65
+ version_requirements: *id003
66
+ - !ruby/object:Gem::Dependency
67
+ name: observr
63
68
  prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ! '>='
67
- - !ruby/object:Gem::Version
69
+ requirement: &id004 !ruby/object:Gem::Requirement
70
+ none: false
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ hash: 29
75
+ segments:
76
+ - 1
77
+ - 0
78
+ - 5
68
79
  version: 1.0.5
80
+ type: :runtime
81
+ version_requirements: *id004
69
82
  description: Inspired by SolidPython, based on RubyScad
70
- email:
83
+ email:
71
84
  - webmaster@joaz.de
72
- executables:
85
+ executables:
73
86
  - crystalgen
74
87
  extensions: []
88
+
75
89
  extra_rdoc_files: []
76
- files:
90
+
91
+ files:
77
92
  - COPYING
78
93
  - Gemfile
79
94
  - README.md
@@ -103,6 +118,7 @@ files:
103
118
  - lib/crystalscad/LinearBearing.rb
104
119
  - lib/crystalscad/Pipe.rb
105
120
  - lib/crystalscad/PrintedThreads.rb
121
+ - lib/crystalscad/Ruler.rb
106
122
  - lib/crystalscad/ScrewThreads.rb
107
123
  - lib/crystalscad/version.rb
108
124
  - skeleton_project/assemblies/example.rb
@@ -111,27 +127,39 @@ files:
111
127
  - static/logo.png
112
128
  - static/logo_small.png
113
129
  homepage: http://github.com/Joaz/CrystalScad
114
- licenses:
130
+ licenses:
115
131
  - GPL-3
116
- metadata: {}
117
132
  post_install_message:
118
133
  rdoc_options: []
119
- require_paths:
134
+
135
+ require_paths:
120
136
  - lib
121
- required_ruby_version: !ruby/object:Gem::Requirement
122
- requirements:
123
- - - ! '>='
124
- - !ruby/object:Gem::Version
137
+ required_ruby_version: !ruby/object:Gem::Requirement
138
+ none: false
139
+ requirements:
140
+ - - ">="
141
+ - !ruby/object:Gem::Version
142
+ hash: 53
143
+ segments:
144
+ - 1
145
+ - 9
146
+ - 3
125
147
  version: 1.9.3
126
- required_rubygems_version: !ruby/object:Gem::Requirement
127
- requirements:
128
- - - ! '>='
129
- - !ruby/object:Gem::Version
130
- version: '0'
148
+ required_rubygems_version: !ruby/object:Gem::Requirement
149
+ none: false
150
+ requirements:
151
+ - - ">="
152
+ - !ruby/object:Gem::Version
153
+ hash: 3
154
+ segments:
155
+ - 0
156
+ version: "0"
131
157
  requirements: []
158
+
132
159
  rubyforge_project:
133
- rubygems_version: 2.2.2
160
+ rubygems_version: 1.8.15
134
161
  signing_key:
135
- specification_version: 4
162
+ specification_version: 3
136
163
  summary: CrystalScad is a framework for programming OpenScad models in Ruby
137
164
  test_files: []
165
+
checksums.yaml DELETED
@@ -1,15 +0,0 @@
1
- ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- NjZhYjQ1ZDg1OTI4YzAyODE5ZDAxZWMwYmRjYTQ2NzYwMGQyMGMwOA==
5
- data.tar.gz: !binary |-
6
- MDk5ZWIzOTRhNTZlZDBhMmE4MzJmYTdlNTZjMDUwNDUxNTA0NWYwNA==
7
- SHA512:
8
- metadata.gz: !binary |-
9
- NzBmZGEyMmEwNmQzZThlMjZlM2E1MDU5YTJiODMyNjE2YzkwNWM2MjI5Y2Yz
10
- ODdiNDg3ZWJjODU2NTkxNjQ0MDg3ZDgyZWY5NTdlNjY3OGRhOGJkMGU1ODFi
11
- OGQ0NTZiYzQzMzQ1YTA4ZWZiOWMwYzFmNjdkN2Q1ZDgyNTAyMTY=
12
- data.tar.gz: !binary |-
13
- MDlkMTA2OTY3M2JhMzgwN2QzNDMwOTQyMDdmNDVjMWFiNjM2MWRkODg0OTZk
14
- ZWQzZmExMGE3M2YwYTdlOWZhNmQ4ZTc5N2Q2ZGUwN2U1MDNjNTYzZjRkNzll
15
- OTQ1ODA1MjYzMTdhMGU3YWU0NDhkYWMxMzNlYzU5N2ZiODU3NTI=