Module: MiniScad::Transform

Included in:
Color, Cons, Cube, Cylinder, Difference, Hull, Intersection, Mirror, None, Projection, Rotate, Scale, Sphere, Translate, Union
Defined in:
lib/mini_scad.rb

Instance Method Summary collapse

Instance Method Details

#&(val) ⇒ Object



91
92
93
# File 'lib/mini_scad.rb', line 91

def &(val)
  Intersection.new(self, val)
end

#+(val) ⇒ Object



95
96
97
# File 'lib/mini_scad.rb', line 95

def +(val)
  Cons.new(self, val)
end

#-(val) ⇒ Object



99
100
101
# File 'lib/mini_scad.rb', line 99

def -(val)
  Difference.new(self, val)
end

#color(r, g, b, a) ⇒ Object



75
76
77
78
79
# File 'lib/mini_scad.rb', line 75

def color(r, g, b, a)
  Color.new(r, g, b, a) do
    self
  end
end

#hullObject



81
82
83
84
85
# File 'lib/mini_scad.rb', line 81

def hull
  Hull.new do
    self
  end
end

#mirror(x, y, z) ⇒ Object



57
58
59
60
61
# File 'lib/mini_scad.rb', line 57

def mirror(x, y, z)
  Mirror.new(x, y, z) do
    self
  end
end

#projectionObject



45
46
47
48
49
# File 'lib/mini_scad.rb', line 45

def projection
  Projection.new do
    self
  end
end

#renderObject

Raises:

  • (NotImplementError)


103
104
105
106
107
# File 'lib/mini_scad.rb', line 103

def render
  raise NotImplementError unless @renderer

  @renderer.()
end

#rotate(x, y, z) ⇒ Object



63
64
65
66
67
# File 'lib/mini_scad.rb', line 63

def rotate(x, y, z)
  Rotate.new(x, y, z) do
    self
  end
end

#scale(x, y, z) ⇒ Object



69
70
71
72
73
# File 'lib/mini_scad.rb', line 69

def scale(x, y, z)
  Scale.new(x, y, z) do
    self
  end
end

#translate(x, y, z) ⇒ Object



51
52
53
54
55
# File 'lib/mini_scad.rb', line 51

def translate(x, y, z)
  Translate.new(x, y, z) do
    self
  end
end

#|(val) ⇒ Object



87
88
89
# File 'lib/mini_scad.rb', line 87

def |(val)
  Union.new(self, val)
end