def load_obj()

in common/utils/mesh.py [0:0]


    def load_obj(self, file_name):
        obj_file = open(file_name)
        for line in obj_file:
            words = line.split(' ')
            if words[0] == 'v':
                x,y,z = float(words[1]) * 10, float(words[2]) * 10, float(words[3]) * 10 # change cm to mm
                self.v = np.concatenate((self.v, np.array([x,y,z]).reshape(1,3)), axis=0)
            elif words[0] == 'vt':
                u,v = float(words[1]), float(words[2])
                self.vt = np.concatenate((self.vt, np.array([u,v]).reshape(1,2)), axis=0)
            elif words[0] == 'f':
                vi_1, vti_1 = words[1].split('/')[:2]
                vi_2, vti_2 = words[2].split('/')[:2]
                vi_3, vti_3 = words[3].split('/')[:2]
 
                # change 1-based index to 0-based index
                vi_1, vi_2, vi_3 = int(vi_1)-1, int(vi_2)-1, int(vi_3)-1 
                vti_1, vti_2, vti_3 = int(vti_1)-1, int(vti_2)-1, int(vti_3)-1

                self.vi = np.concatenate((self.vi, np.array([vi_1,vi_2,vi_3]).reshape(1,3)), axis=0)
                self.vti = np.concatenate((self.vti, np.array([vti_1,vti_2,vti_3]).reshape(1,3)), axis=0)
            else:
                pass