crystalscad 0.3.9 → 0.3.10
Sign up to get free protection for your applications and to get access to all the features.
- data/examples/threads2.rb +0 -1
- data/lib/crystalscad/Hardware.rb +17 -4
- data/lib/crystalscad/ScrewThreads.rb +1 -1
- data/lib/crystalscad/version.rb +1 -1
- metadata +5 -7
data/examples/threads2.rb
CHANGED
@@ -79,7 +79,6 @@ pos = male.threads_bottom.first.position_on(female.threads_top.first,rotation)
|
|
79
79
|
res += female.show.rotate(rotation).mirror(z:1).translate(pos)
|
80
80
|
|
81
81
|
|
82
|
-
|
83
82
|
rotation = {y:-90}
|
84
83
|
pos = male.threads_left.first.position_on(female.threads_top.first,rotation)
|
85
84
|
res += female.show.rotate(rotation).translate(pos)
|
data/lib/crystalscad/Hardware.rb
CHANGED
@@ -21,12 +21,16 @@ module CrystalScad::Hardware
|
|
21
21
|
def initialize(size,length,args={})
|
22
22
|
@args = args
|
23
23
|
@args[:type] ||= "912"
|
24
|
-
@args[:material] ||= "8.8"
|
24
|
+
@args[:material] ||= "steel 8.8"
|
25
25
|
@args[:surface] ||= "zinc plated"
|
26
26
|
# options for output only:
|
27
27
|
@args[:additional_length] ||= 0
|
28
28
|
@args[:additional_diameter] ||= 0.3
|
29
29
|
|
30
|
+
if @args[:washer] == true
|
31
|
+
@washer = Washer.new(size,{:material => @args[:material], :surface => @args[:surface]})
|
32
|
+
end
|
33
|
+
|
30
34
|
@size = size
|
31
35
|
@length = length
|
32
36
|
@transformations ||= []
|
@@ -51,8 +55,17 @@ module CrystalScad::Hardware
|
|
51
55
|
|
52
56
|
def show
|
53
57
|
add_to_bom
|
54
|
-
|
55
|
-
|
58
|
+
res = bolt_912(0,0) if @args[:type] == "912"
|
59
|
+
res = bolt_7380(0,0) if @args[:type] == "7380"
|
60
|
+
raise "unkown type #{args[:type]} for Bolt!" if res == nil
|
61
|
+
|
62
|
+
if @washer
|
63
|
+
res += @washer.show
|
64
|
+
res = res.translate(z:-@washer.height)
|
65
|
+
end
|
66
|
+
|
67
|
+
|
68
|
+
transform(res)
|
56
69
|
end
|
57
70
|
|
58
71
|
def transform(obj)
|
@@ -126,7 +139,7 @@ module CrystalScad::Hardware
|
|
126
139
|
@args=args
|
127
140
|
@size = size
|
128
141
|
@args[:type] ||= "125"
|
129
|
-
@args[:material] ||= "steel"
|
142
|
+
@args[:material] ||= "steel 8.8"
|
130
143
|
@args[:surface] ||= "zinc plated"
|
131
144
|
|
132
145
|
@chart_din125 = { 3.2 => {outer_diameter:7, height:0.5},
|
@@ -143,7 +143,7 @@ module CrystalScad::ScrewThreads
|
|
143
143
|
|
144
144
|
ret = []
|
145
145
|
holes.each_with_index do |hole,i|
|
146
|
-
bolt = Bolt.new(hole.size,bolt_heights[i])
|
146
|
+
bolt = Bolt.new(hole.size,bolt_heights[i],washer:args[:washer])
|
147
147
|
case face
|
148
148
|
when "top"
|
149
149
|
bolt.transformations << Rotate.new(x:180)
|
data/lib/crystalscad/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: crystalscad
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 7
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 0.3.
|
9
|
+
- 10
|
10
|
+
version: 0.3.10
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Joachim Glauche
|
@@ -15,8 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2014-01-
|
19
|
-
default_executable:
|
18
|
+
date: 2014-01-19 00:00:00 Z
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
22
21
|
name: rubyscad
|
@@ -86,7 +85,6 @@ files:
|
|
86
85
|
- skeleton_project/assemblies/example.rb
|
87
86
|
- skeleton_project/observe.sh
|
88
87
|
- skeleton_project/skeleton.rb
|
89
|
-
has_rdoc: true
|
90
88
|
homepage: http://github.com/Joaz/CrystalScad
|
91
89
|
licenses:
|
92
90
|
- GPL-3
|
@@ -118,7 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
118
116
|
requirements: []
|
119
117
|
|
120
118
|
rubyforge_project:
|
121
|
-
rubygems_version: 1.
|
119
|
+
rubygems_version: 1.8.15
|
122
120
|
signing_key:
|
123
121
|
specification_version: 3
|
124
122
|
summary: CrystalScad is a framework for programming OpenScad models in Ruby
|