Class: Gerber::Layer

Inherits:
Object
  • Object
show all
Defined in:
lib/gerber/layer.rb,
lib/gerber/layer/parser.rb

Defined Under Namespace

Classes: Parser

Instance Attribute Summary collapse

Accessors collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Layer

Returns a new instance of Layer.



11
12
13
14
15
16
17
18
19
# File 'lib/gerber/layer.rb', line 11

def initialize(*args)
    super

    self.geometry = []
    @polarity = :dark
    @repeat = Vector[1,1]
    @step = Vector[0,0]
    @units = nil
end

Instance Attribute Details

#geometryObject

Returns the value of attribute geometry.



9
10
11
# File 'lib/gerber/layer.rb', line 9

def geometry
  @geometry
end

#nameObject

Returns the value of attribute name.



9
10
11
# File 'lib/gerber/layer.rb', line 9

def name
  @name
end

#polarityObject

Returns the value of attribute polarity.



9
10
11
# File 'lib/gerber/layer.rb', line 9

def polarity
  @polarity
end

#repeatObject

Returns the value of attribute repeat.



9
10
11
# File 'lib/gerber/layer.rb', line 9

def repeat
  @repeat
end

#stepObject

Returns the value of attribute step.



9
10
11
# File 'lib/gerber/layer.rb', line 9

def step
  @step
end

Instance Method Details

#empty?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/gerber/layer.rb', line 22

def empty?
    self.geometry.empty?
end

#set_inchesObject



26
27
28
# File 'lib/gerber/layer.rb', line 26

def set_inches
    @units = 'inch'
end

#set_millimetersObject



30
31
32
# File 'lib/gerber/layer.rb', line 30

def set_millimeters
    @units = 'millimeters'
end