crystalscad 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -12,12 +12,16 @@ module CrystalScad
12
12
  end
13
13
 
14
14
  def show
15
- ScadObject.new
15
+ part(true)
16
16
  end
17
17
 
18
18
  def output
19
- show
19
+ part(false)
20
20
  end
21
+
22
+ def part(show=false)
23
+ CrystalScadObject.new
24
+ end
21
25
 
22
26
  def walk_tree
23
27
  return output.walk_tree
@@ -51,7 +55,12 @@ module CrystalScad
51
55
  return self.output.scad_output
52
56
  end
53
57
 
58
+ end
54
59
 
60
+ class Printed < Assembly
61
+ def description
62
+ "Printed part #{self.class.to_s}"
63
+ end
55
64
  end
56
65
  end
57
66
 
@@ -33,7 +33,6 @@ module CrystalScad
33
33
  end
34
34
  end
35
35
 
36
-
37
36
  def walk_tree
38
37
  res = ""
39
38
 
@@ -55,6 +54,9 @@ module CrystalScad
55
54
  file.puts scad_output
56
55
  file.close
57
56
  end
57
+
58
+ def method_missing(meth, *args, &block)
59
+ end
58
60
 
59
61
  end
60
62
 
@@ -262,7 +264,6 @@ module CrystalScad
262
264
  end
263
265
  end
264
266
 
265
-
266
267
  def +(args)
267
268
  return args if self == nil
268
269
  Union.new(self,args)
@@ -282,6 +283,22 @@ module CrystalScad
282
283
  Hull.new(*parts)
283
284
  end
284
285
 
286
+
287
+ class Import < Primitive
288
+ def initialize(filename)
289
+ @transformations = []
290
+ @filename = filename
291
+ end
292
+
293
+ def to_rubyscad
294
+ return RubyScadBridge.new.import("\""+@filename.to_s+"\"") # apparently the quotes get lost otherwise
295
+ end
296
+ end
297
+
298
+ def import(filename)
299
+ Import.new(filename)
300
+ end
301
+
285
302
  class CSGModifier < Primitive
286
303
  def initialize(object, attributes)
287
304
  @transformations = []
@@ -225,8 +225,8 @@ module CrystalScad::Hardware
225
225
  end
226
226
  @@bom.add(description) unless args[:no_bom] == true
227
227
 
228
- return single_profile if @args[:configuration] == 1
229
- return multi_profile
228
+ return single_profile.color("Silver") if @args[:configuration] == 1
229
+ return multi_profile.color("Silver")
230
230
  end
231
231
 
232
232
  alias :show :output
@@ -73,4 +73,22 @@ module CrystalScad::LinearBearing
73
73
 
74
74
  end
75
75
 
76
+ class Lm_luu < Lm_uu
77
+
78
+ def initialize(args={inner_diameter:10})
79
+ @args = args
80
+ @lm_uu = {
81
+ 12 => {diameter:21, length:57},
82
+
83
+ }
84
+ @shell_thickness = 1.1
85
+ @@bom.add(description) unless args[:no_bom] == true
86
+ end
87
+
88
+ def description
89
+ "LM#{@args[:inner_diameter]}LUU (long) Linear bearing"
90
+ end
91
+
92
+ end
93
+
76
94
  end
@@ -1,4 +1,4 @@
1
1
  module CrystalScad
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
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: 17
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 1
10
- version: 0.3.1
9
+ - 2
10
+ version: 0.3.2
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-18 00:00:00 Z
18
+ date: 2013-12-22 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: rubyscad