rubyscad 1.0.4 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. data/.gitignore +21 -0
  2. data/Gemfile +4 -0
  3. data/LICENSE.txt +22 -0
  4. data/Rakefile +1 -0
  5. data/examples/BasicCube.rb +50 -0
  6. data/examples/ChamferCube.rb +96 -0
  7. data/examples/FilletCube.rb +317 -0
  8. data/examples/example001.rb +33 -0
  9. data/examples/example001.scad +11 -0
  10. data/examples/example002.rb +23 -0
  11. data/examples/example002.scad +18 -0
  12. data/examples/example003.rb +19 -0
  13. data/examples/example003.scad +15 -0
  14. data/examples/example004.rb +11 -0
  15. data/examples/example004.scad +6 -0
  16. data/examples/example005.rb +22 -0
  17. data/examples/example005.scad +31 -0
  18. data/examples/example006.rb +46 -0
  19. data/examples/example006.scad +221 -0
  20. data/examples/example007.dxf +2410 -0
  21. data/examples/example007.rb +53 -0
  22. data/examples/example007.scad +30 -0
  23. data/examples/example008.dxf +3238 -0
  24. data/examples/example008.rb +34 -0
  25. data/examples/example008.scad +26 -0
  26. data/examples/example009.dxf +3894 -0
  27. data/examples/example009.rb +33 -0
  28. data/examples/example009.scad +15 -0
  29. data/examples/example010.dat +51 -0
  30. data/examples/example010.rb +12 -0
  31. data/examples/example010.scad +7 -0
  32. data/examples/example011.rb +22 -0
  33. data/examples/example011.scad +3 -0
  34. data/examples/example012.rb +16 -0
  35. data/examples/example012.scad +8 -0
  36. data/examples/example012.stl +450 -0
  37. data/examples/example013.dxf +2276 -0
  38. data/examples/example013.rb +16 -0
  39. data/examples/example013.scad +12 -0
  40. data/examples/example014.rb +14 -0
  41. data/examples/example014.scad +12 -0
  42. data/examples/example015.rb +33 -0
  43. data/examples/example015.scad +22 -0
  44. data/examples/example016.rb +43 -0
  45. data/examples/example016.scad +49 -0
  46. data/examples/example016.stl +0 -0
  47. data/examples/example017.rb +170 -0
  48. data/examples/example017.scad +124 -0
  49. data/examples/example018.rb +29 -0
  50. data/examples/example018.scad +74 -0
  51. data/examples/example019.rb +22 -0
  52. data/examples/example019.scad +84 -0
  53. data/examples/example020.rb +92 -0
  54. data/examples/example020.scad +62 -0
  55. data/examples/example021.rb +42 -0
  56. data/examples/example021.scad +159 -0
  57. data/examples/example022.rb +44 -0
  58. data/examples/example022.scad +103 -0
  59. data/lib/{RubyScad.rb → rubyscad/RubyScad.rb} +0 -0
  60. data/lib/rubyscad/version.rb +1 -1
  61. data/lib/rubyscad.rb +1 -1
  62. data/rubyscad.gemspec +20 -0
  63. metadata +66 -7
@@ -0,0 +1,53 @@
1
+ require "rubyscad"
2
+
3
+ module Example007
4
+ extend RubyScad
5
+
6
+ def self.cutout()
7
+ intersection() {
8
+ rotate(a: 90, v: [1, 0, 0])
9
+ translate(z: -50)
10
+ linear_extrude(height: 100, convexity: 1)
11
+ import(file:"example007.dxf", layer:"cutout1")
12
+ rotate(a: 90, v: [0, 0, 1])
13
+ rotate(a: 90, v: [1, 0, 0])
14
+ translate(z: -50)
15
+ linear_extrude(height: 100, convexity: 2)
16
+ import(file: "example007.dxf", layer: "cutout2")
17
+ }
18
+ end
19
+
20
+ def self.clip()
21
+ difference() {
22
+ rotate_extrude(convexity: 3, file: "example007.dxf", layer: "dorn")
23
+ [0, 90].each { |r| rotate(z: r); cutout() }
24
+ }
25
+ end
26
+
27
+ def self.cutview()
28
+ difference() {
29
+ difference() {
30
+ translate(z: -10); clip()
31
+ rotate(z: 20)
32
+ rotate(y: -20)
33
+ translate(x: 18)
34
+ cube(size: 30, center: true)
35
+ }
36
+
37
+ render(convexity: 5)
38
+ intersection() {
39
+ translate(z: -10)
40
+ clip
41
+ rotate(z: 20)
42
+ rotate(y: -20)
43
+ translate(x: 18)
44
+ cube(size: 30, center: true)
45
+ }
46
+ }
47
+ end
48
+
49
+ translate(z: -10); clip()
50
+ #cutview()
51
+ end
52
+
53
+
@@ -0,0 +1,30 @@
1
+ //created with rubyscad 1.0
2
+
3
+ translate(v = [0, 0, -10])
4
+ difference() {
5
+ rotate_extrude(convexity = 3, file = "example007.dxf", layer = "dorn");
6
+ rotate(a = [0, 0, 0])
7
+ intersection() {
8
+ rotate(a = 90, v = [1, 0, 0])
9
+ translate(v = [0, 0, -50])
10
+ linear_extrude(height = 100, convexity = 1)
11
+ import(file = "example007.dxf", layer = "cutout1");
12
+ rotate(a = 90, v = [0, 0, 1])
13
+ rotate(a = 90, v = [1, 0, 0])
14
+ translate(v = [0, 0, -50])
15
+ linear_extrude(height = 100, convexity = 2)
16
+ import(file = "example007.dxf", layer = "cutout2");
17
+ }
18
+ rotate(a = [0, 0, 90])
19
+ intersection() {
20
+ rotate(a = 90, v = [1, 0, 0])
21
+ translate(v = [0, 0, -50])
22
+ linear_extrude(height = 100, convexity = 1)
23
+ import(file = "example007.dxf", layer = "cutout1");
24
+ rotate(a = 90, v = [0, 0, 1])
25
+ rotate(a = 90, v = [1, 0, 0])
26
+ translate(v = [0, 0, -50])
27
+ linear_extrude(height = 100, convexity = 2)
28
+ import(file = "example007.dxf", layer = "cutout2");
29
+ }
30
+ }