Class: SolidRuby::Primitives::Surface

Inherits:
Primitive show all
Defined in:
lib/solidruby/primitives/surface.rb

Instance Attribute Summary

Attributes inherited from SolidRubyObject

#attributes, #children, #siblings, #transformations

Instance Method Summary collapse

Methods inherited from SolidRubyObject

#&, alias_attr, #debug, #debug?, #mirror, #place, #rotate, #rotate_around, #save, #scale, #translate, #union, #walk_tree, #walk_tree_classes

Constructor Details

#initialize(attributes) ⇒ Surface

Returns a new instance of Surface.



23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/solidruby/primitives/surface.rb', line 23

def initialize(attributes)
  @transformations = []
  @children = []

  if attributes.is_a? String
    attributes = {file: attributes}
  end
  abs_path = attributes.delete(:absolue_path) || false

  super(attributes)
  @attributes[:file] = File.expand_path(@attributes[:file]) if abs_path
end

Instance Method Details

#to_rubyscadObject



36
37
38
# File 'lib/solidruby/primitives/surface.rb', line 36

def to_rubyscad
  RubyScadBridge.new.surface(@attributes)
end