module Gdsii::Access::PathType

Access PathType attribute

Public Instance Methods

pathtype() click to toggle source

Get the path type number (returns Fixnum).

# File lib/gdsii/mixins.rb, line 103
def pathtype() @records.get_data(GRT_PATHTYPE); end
pathtype=(val) click to toggle source

Set the type number (as Fixnum). Valid range is 0-2,4 (not 3):

  • 0: Square ended paths (default)

  • 1: Round ended

  • 2: Square ended, extended 1/2 width

  • 4: Variable length extensions (see bgnextn and endextn)

# File lib/gdsii/mixins.rb, line 113
def pathtype=(val)
  record = @records.set(GRT_PATHTYPE, val)
  data_val = record.data_value
  if [0, 1, 2, 4].member?(data_val)
    if data_val != 4
      # Rip out begin/end extensions for pathtypes other than 4
      @records.delete_key(GRT_BGNEXTN)
      @records.delete_key(GRT_ENDEXTN)
    end
  else
    # If path type is not 0, 1, 2, or 4, then fail
    raise TypeError, "Path type #{data_val} is invalid; must be 0, 1, 2, or 4."
  end
end
pathtype_record() click to toggle source

Get the path type record (returns Record).

# File lib/gdsii/mixins.rb, line 98
def pathtype_record() @records.get(GRT_PATHTYPE); end