Class: JennCad::Primitives::UnionObject

Inherits:
BooleanObject show all
Defined in:
lib/jenncad/primitives/union_object.rb

Instance Attribute Summary

Attributes inherited from Primitive

#dimensions

Attributes inherited from Thing

#anchors, #angle, #calc_h, #calc_x, #calc_y, #calc_z, #csize, #diameter, #fn, #name, #opts, #parent, #parts, #pos, #shape, #sits_on, #transformations, #x, #y

Instance Method Summary collapse

Methods inherited from BooleanObject

#add, #add_or_new, #after_add, #get_primitives, #inherit_debug, #inherit_z, #inherit_zref, #only_additives_of

Methods inherited from Primitive

#feed_opts, #handle_diameter, #handle_margins

Methods inherited from Thing

#anchor, #at, #auto_color, #auto_color!, #auto_extrude, #calculate_center_rotation, #calculated_h, #children_list, #color, #color_or_fallback, #color_parse, #copy_anchor, #copy_anchors, #cut_to, #dbg, #debug?, #find_calculated_h, #fixate, #flip, #flipc, #get_children, #get_contents, #ghost, #has_explicit_color?, #hide, #hl, #inherit_color, #init, #is_2d?, #is_3d?, #mhx, #mhy, #mhz, #mirror, #mix, #miy, #miz, #modify_values, #modify_values!, #move, #movea, #moveai, #moveh, #movei, #multmatrix, #mx, #my, #mz, #on_top_of, #only, #only_color?, #openscad, #openscad_modifier, #option, #parse_xyz_shortcuts, #radians, #referenced_z, #reset, #reset_last_move, #rotate, #rotate_around, #rx, #ry, #rz, #scale, #set_anchor, #set_anchor_from, #set_auto_color, #set_auto_color_for_children, #set_flag, #set_heights_for_auto_extrude, #set_option, #set_parent, #skew, #to_mod, #top_of, #transform, #unset_flag, #z, #z=, #z_margin

Constructor Details

#initialize(*parts) ⇒ UnionObject

Returns a new instance of UnionObject.



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/jenncad/primitives/union_object.rb', line 3

def initialize(*parts)
  super(*parts)

  blacklist = [SubtractObject, IntersectionObject]

  @parts[1..-1].each do |part|
    blacklist.each do |b|
      if part.kind_of? b
        next
      end
    end
    @csize = part.csize
#        @csize.union(part.csize.clone) if part.csize
  end

end