crystalscad 0.3.5 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -19,8 +19,15 @@ module CrystalScad
19
19
 
20
20
  def initialize(args={})
21
21
  @args = args if @args == nil
22
- @@bom.add(description) unless args[:no_bom] == true
22
+ add_to_bom
23
23
  end
24
+
25
+ def add_to_bom
26
+ if !@bom_added
27
+ @@bom.add(description) unless @args[:no_bom] == true
28
+ @bom_added = true
29
+ end
30
+ end
24
31
 
25
32
  def description
26
33
  "No description set for Class #{self.class.to_s}"
@@ -49,7 +49,7 @@ module CrystalScad::Gears
49
49
  def output
50
50
  res = cylinder(d:@module*@teeth+@output_margin_dia,h:@height+@output_margin_height)
51
51
  if @hub_height.to_f > 0 && @hub_dia.to_f > 0
52
- res += cylinder(d:@hub_dia+@output_margin_dia,h:@hub_height+@output_margin_height).translate(z:@height+@output_margin_height)
52
+ res += cylinder(d:@hub_dia+@output_margin_dia,h:@hub_height+@output_margin_height).translate(z:@height)
53
53
  end
54
54
 
55
55
  res
@@ -30,8 +30,6 @@ module CrystalScad::Hardware
30
30
  @size = size
31
31
  @length = length
32
32
  @transformations ||= []
33
-
34
- @@bom.add(description)
35
33
  end
36
34
 
37
35
  def description
@@ -46,11 +44,13 @@ module CrystalScad::Hardware
46
44
  end
47
45
 
48
46
  def output
47
+ add_to_bom
49
48
  return transform(bolt_912(@args[:additional_length],@args[:additional_diameter])) if @args[:type] == "912"
50
49
  return transform(bolt_7380(@args[:additional_length],@args[:additional_diameter])) if @args[:type] == "7380"
51
50
  end
52
51
 
53
52
  def show
53
+ add_to_bom
54
54
  return transform(bolt_912(0,0)) if @args[:type] == "912"
55
55
  return transform(bolt_7380(0,0)) if @args[:type] == "7380"
56
56
  end
@@ -135,7 +135,6 @@ module CrystalScad::Hardware
135
135
 
136
136
  }
137
137
  @height = @chart_din125[@size][:height]
138
- super(args)
139
138
  end
140
139
 
141
140
  def description
@@ -143,6 +142,7 @@ module CrystalScad::Hardware
143
142
  end
144
143
 
145
144
  def show
145
+ add_to_bom
146
146
  washer = cylinder(d:@chart_din125[@size][:outer_diameter].to_f,h:@chart_din125[@size][:height].to_f)
147
147
  washer-= cylinder(d:@size,h:@chart_din125[@size][:outer_diameter].to_f+0.2).translate(z:-0.1)
148
148
  washer.color("Gainsboro")
@@ -158,7 +158,7 @@ module CrystalScad::Hardware
158
158
  @material = args[:material] ||= "8.8"
159
159
  @surface = args[:surface] ||= "zinc plated"
160
160
 
161
- @@bom.add(description) unless args[:no_bom] == true
161
+ @args = args
162
162
  prepare_data
163
163
  end
164
164
 
@@ -194,11 +194,13 @@ module CrystalScad::Hardware
194
194
 
195
195
  end
196
196
 
197
- def output(margin=0.3)
197
+ def output(margin=0.3)
198
+ add_to_bom
198
199
  return nut_934(margin)
199
200
  end
200
201
 
201
202
  def show
203
+ add_to_bom
202
204
  return nut_934
203
205
  end
204
206
 
@@ -1,4 +1,4 @@
1
1
  module CrystalScad
2
- VERSION = "0.3.5"
2
+ VERSION = "0.3.6"
3
3
  end
4
4
 
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: 25
4
+ hash: 31
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 5
10
- version: 0.3.5
9
+ - 6
10
+ version: 0.3.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Joachim Glauche
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2013-12-24 00:00:00 Z
18
+ date: 2013-12-25 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: rubyscad