예제 #1
0
def rebuild(idx):
    # print("[**] processing %d"%idx)
    data = t_measure[:, idx].reshape(utils.M_NUM, 1)
    [vertex, n, f] = body.mapping(data, flag=flag)
    utils.save_obj(os.path.join(ANS_DIR, "%s_%d.obj" % (label, idx)), vertex,
                   f + 1)
    data = mean_measure + data * std_measure
    output = np.array(utils.calc_measure(cp, vertex, facet))
    error = output - data
    error[0, 0] = output[0] - (data[0, 0] / 1000.0)**3
    # error[0, 0] = (output[0, 0]**3) / (1000**3) - (data[0, 0]**3) / (1000**3)
    # print(error)
    return error
 def save(self):
     desktopPath = os.path.expanduser('~')
     try:
         utils.save_obj(desktopPath + "\\desktop\\result.obj",
                        self.vertices, self.facets + 1)
     except FileNotFoundError:
         utils.save_obj("result.obj", self.vertices, self.facets + 1)
     output = np.array(
         utils.calc_measure(self.body.cp, self.vertices, self.facets))
     for i in range(0, utils.M_NUM):
         print("%s: %f" % (utils.M_STR[i], output[i, 0]))
     sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
     sock.sendto("Done".encode(), ('localhost', 5577))
예제 #3
0
 def save(self):
     utils.save_obj("result.obj", self.vertices, self.facets + 1)
     output = np.array(
         utils.calc_measure(self.body.cp, self.vertices, self.facets))
     for i in range(0, utils.M_NUM):
         print("%s: %f" % (utils.M_STR[i], output[i, 0]))