parameters: (self, file_path)
docstring: Reads *.obj file and creates Model object
          Model is represented by a dictionary of vertex objects
            with relations with other vertexes via edges.
          Faces not implemented as they are not needed.
docstring_summary: Reads *.obj file and creates Model object
          Model is represented by a dictionary of vertex objects
            with relations with other vertexes via edges.
          Faces not implemented as they are not needed.
docstring_tokens: Reads * . obj file and creates Model object Model is represented by a dictionary of vertex objects with relations with other vertexes via edges . Faces not implemented as they are not needed .
function: def __init__(self, file_path):
          """
          Reads *.obj file and creates Model object
          Model is represented by a dictionary of vertex objects
            with relations with other vertexes via edges.
          Faces not implemented as they are not needed.
          """
          self.vertexes = {}
          # as we read lines we number indexes
          # in *.obj file they are numbered starting at 1
          # so within this code same notation is used
          # onle when the user inputs node numbers they are adjusted to notation
          # from Meshlab
          v_index = 1
  
          with open(file_path, "r") as fin:
  
              for line in fin:
  
                  line_list = line.split()
                  if len(line_list) == 0:
                      continue
                  
                  if line_list[0] == "v": # begins with v if describes vertex
  
                      vertex = Vertex(
                          v_index, # "telling vertex its index"
                          # strings, vertex conderts to float
                          line_list[1], # x
                          line_list[2], # y
                          line_list[3]  # z
                          )
                      self.vertexes[v_index] = vertex # add vertex to dictionary
                      v_index += 1 # index increment
  
                  elif line_list[0] == "f": # begins with f it describes a face
                      a_i = int(line_list[1]) # vertex index 1
                      b_i = int(line_list[2]) # vertex index 2
                      c_i = int(line_list[3]) # vertex index 3
  
                      a = self.vertexes[a_i] # vertex objcet 1
                      b = self.vertexes[b_i] # vertex objcet 2
                      c = self.vertexes[c_i] # vertex objcet 3
  
                      # 6 neighbor relations in one triangular face
                      a.add_neighbors(b)
                      a.add_neighbors(c)
  
                      b.add_neighbors(a)
                      b.add_neighbors(c)
  
                      c.add_neighbors(a)
                      c.add_neighbors(b)
function_tokens: def __init__ ( self , file_path ) : self . vertexes = { } # as we read lines we number indexes # in *.obj file they are numbered starting at 1 # so within this code same notation is used # onle when the user inputs node numbers they are adjusted to notation # from Meshlab v_index = 1 with open ( file_path , "r" ) as fin : for line in fin : line_list = line . split ( ) if len ( line_list ) == 0 : continue if line_list [ 0 ] == "v" : # begins with v if describes vertex vertex = Vertex ( v_index , # "telling vertex its index" # strings, vertex conderts to float line_list [ 1 ] , # x line_list [ 2 ] , # y line_list [ 3 ] # z ) self . vertexes [ v_index ] = vertex # add vertex to dictionary v_index += 1 # index increment elif line_list [ 0 ] == "f" : # begins with f it describes a face a_i = int ( line_list [ 1 ] ) # vertex index 1 b_i = int ( line_list [ 2 ] ) # vertex index 2 c_i = int ( line_list [ 3 ] ) # vertex index 3 a = self . vertexes [ a_i ] # vertex objcet 1 b = self . vertexes [ b_i ] # vertex objcet 2 c = self . vertexes [ c_i ] # vertex objcet 3 # 6 neighbor relations in one triangular face a . add_neighbors ( b ) a . add_neighbors ( c ) b . add_neighbors ( a ) b . add_neighbors ( c ) c . add_neighbors ( a ) c . add_neighbors ( b )