def test_set_position_of_vertices(self): expected_matrix = np.array([[0., 0., 0.], [1., 0., 0.], [0., 1., 0.], [0., 0., 1.]]) tops = np.array([1., 1., 1.]) params = FFD() params.box_origin = expected_matrix[0] params.box_length = tops - expected_matrix[0] np.testing.assert_almost_equal(params.position_vertices, expected_matrix, decimal=5)
# 制御点の変位を制御するために、`array_mu_x`, `array_mu_y`, `array_mu_z` の値を変えれば良い if (args.ffd_param_file == ""): x_min = torch.min( mesh.verts_packed().squeeze()[:, 0]).detach().cpu().numpy() x_max = torch.max( mesh.verts_packed().squeeze()[:, 0]).detach().cpu().numpy() y_min = torch.min( mesh.verts_packed().squeeze()[:, 1]).detach().cpu().numpy() y_max = torch.max( mesh.verts_packed().squeeze()[:, 1]).detach().cpu().numpy() z_min = torch.min( mesh.verts_packed().squeeze()[:, 2]).detach().cpu().numpy() z_max = torch.max( mesh.verts_packed().squeeze()[:, 2]).detach().cpu().numpy() ffd.box_length = [x_max - x_min, y_max - y_min, z_max - z_min] ffd.box_origin = [x_min, y_min, z_min] if (args.debug): # FFD オブジェクトの内容 # conversion_unit = 1.0 # n_control_points = [2 2 2] # box_length = [1. 1. 1.] # rot_angle = [0. 0. 0.] # array_mu_x = [ [ [0. 0.] [0. 0.] ] [ [0. 0.] [0. 0.] ] ] / shape = (2, 2, 2) # array_mu_y = [ [ [0. 0.] [0. 0.] ] [ [0. 0.] [0. 0.] ] ] / shape = (2, 2, 2) # array_mu_z = [ [ [0. 0.] [0. 0.] ] [ [0. 0.] [0. 0.] ] ] / shape = (2, 2, 2) # デフォルト設定 : 格子の長さ1、原点 $(0, 0, 0)$、回転なし print("ffd : \n", ffd) # conversion_unit = 1.0, n_control_points, box_length, ... print("ffd.array_mu_x.shape : \n", ffd.array_mu_x.shape) print("ffd.array_mu_y.shape : \n", ffd.array_mu_y.shape)