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2,0.4,0.6,0.8,1.0,-1.0,-0.8,-0.6,-0.4,-0.2,0.0,0.2,0.4,0.6,0.8,1.0,-1.0,-0.8,-0.6,-0.4,-0.2,0.0,0.2,0.4,0.6,0.8,1.0,-1.0,-0.8,-0.6,-0.4,-0.2,0.0,0.2,0.4,0.6,0.8,1.0,-1.0,-0.8,-0.6,-0.4,-0.2,0.0,0.2,0.4,0.6,0.8,1.0,-1.0,-0.8,-0.6,-0.4,-0.2,0.0,0.2,0.4,0.6,0.8,1.0,-1.0,-0.8,-0.6,-0.4,-0.2,0.0,0.2,0.4,0.6,0.8,1.0,-1.0,-0.8,-0.6,-0.4,-0.2,0.0,0.2,0.4,0.6,0.8,1.0,-1.0,-0.8,-0.6,-0.4,-0.2,0.0,0.2,0.4,0.6,0.8,1.0]
                          ], dtype=np.float32)  # [3, n]
sample_points = np.transpose(sample_points)  # [n, 3]


def cube_inclusion(cube_param_1, cube_param_2):
  n_cube_1 = cube_param_1['z'].shape[0]  # child
  n_cube_2 = cube_param_2['z'].shape[0]  # parent
  assert(n_cube_1 > n_cube_2)
  assert(cube_param_1['q'].shape[0] == cube_param_1['t'].shape[0] == n_cube_1)
  assert(cube_param_2['q'].shape[0] == cube_param_2['t'].shape[0] == n_cube_2)
  n_point = sample_points.shape[0]
  cube_cube_distance = np.zeros([n_cube_1, n_cube_2])
  for i in range(n_cube_1):
    z1, q1, t1 = [cube_param_1[v][i] for v in ['z', 'q', 't']]
    for j in range(n_cube_2):
      z2, q2, t2 = [cube_param_2[v][j] for v in ['z', 'q', 't']]
      points = sample_points * z1
      rot1 = np.quaternion(q1[0], q1[1], q1[2], q1[3])
      rot1 = quaternion.as_rotation_matrix(rot1)
      points = np.transpose(np.matmul(rot1, np.transpose(points)))
      points += t1
      points -= t2
      rot2 = np.quaternion(q2[0], q2[1], q2[2], q2[3]).conjugate()
      rot2 = quaternion.as_rotation_matrix(rot2)
      points = np.transpose(np.matmul(rot2, np.transpose(points)))
      distance = np.mean(np.sum(np.maximum(abs(points) - z2, 0)**2, axis=1))
      cube_cube_distance[i, j] = distance
  index = np.argmin(cube_cube_distance, axis=1)
  return index


def generate_sample_cube_points(resulution=11):
  sample_points = np.zeros([resulution, resulution, resulution, 3], dtype=np.float32)
  location_template = np.linspace(-1.0, 1.0, num=11)
  for i in range(resulution):
    for j in range(resulution):
      for k in range(resulution):
        sample_points[i, j, k, 0] = location_template[i]
        sample_points[i, j, k, 1] = location_template[j]
        sample_points[i, j, k, 2] = location_template[k]
  np.savetxt('sample_points.txt', np.transpose(np.reshape(sample_points, [-1, 3])),
      fmt='%1.1f', delimiter=',')


if __name__ == '__main__':
  # generate_sample_cube_points()
  z1 = np.array([[0.1, 0.1, 0.1], [0.1, 0.1, 0.1], [0.1, 0.1, 0.1]])
  q1 = np.array([[1.0, 0.0, 0.0, 0.0], [1.0, 0.0, 0.0, 0.0], [1.0, 0.0, 0.0, 0.0]])
  t1 = np.array([[0.1, 0.1, 0.1], [0.1, 0.1, 0.1], [0.4, 0.4, 0.4]])
  cube_param_1 = {'z': z1, 'q': q1, 't': t1}
  z2 = np.array([[0.1, 0.1, 0.1], [0.2, 0.2, 0.2]])
  q2 = np.array([[1.0, 0.0, 0.0, 0.0], [1.0, 0.0, 0.0, 0.0]])
  t2 = np.array([[0.2, 0.2, 0.2], [0.3, 0.3, 0.3]])
  cube_param_2 = {'z': z2, 'q': q2, 't': t2}
  index = cube_inclusion(cube_param_1, cube_param_2)
  print(index)
  assert((index == np.array([0, 0, 1])).all())

[((5, 16, 8, 46), 'numpy.array', 'np.array', (), '', True, 'import numpy as np\n'), ((9, 16, 9, 43), 'numpy.transpose', 'np.transpose', ({(9, 29, 9, 42): 'sample_points'}, {}), '(sample_points)', True, 'import numpy as np\n'), ((19, 23, 19, 53), 'numpy.zeros', 'np.zeros', ({(19, 32, 19, 52): '[n_cube_1, n_cube_2]'}, {}), '([n_cube_1, n_cube_2])', True, 'import numpy as np\n'), ((35, 10, 35, 47), 'numpy.argmin', 'np.argmin', (), '', True, 'import numpy as np\n'), ((40, 18, 40, 85), 'numpy.zeros', 'np.zeros', (), '', True, 'import numpy as np\n'), ((41, 22, 41, 52), 'numpy.linspace', 'np.linspace', (), '', True, 'import numpy as np\n'), ((54, 7, 54, 68), 'numpy.array', 'np.array', ({(54, 16, 54, 67): '[[0.1, 0.1, 0.1], [0.1, 0.1, 0.1], [0.1, 0.1, 0.1]]'}, {}), '([[0.1, 0.1, 0.1], [0.1, 0.1, 0.1], [0.1, 0.1, 0.1]])', True, 'import numpy as np\n'), ((55, 7, 55, 83), 'numpy.array', 'np.array', ({(55, 16, 55, 82): '[[1.0, 0.0, 0.0, 0.0], [1.0, 0.0, 0.0, 0.0], [1.0, 0.0, 0.0, 0.0]]'}, {}), '([[1.0, 0.0, 0.0, 0.0], [1.0, 0.0, 0.0, 0.0], [1.0, 0.0, 0.0, 0.0]])', True, 'import numpy as np\n'), ((56, 7, 56, 68), 'numpy.array', 'np.array', ({(56, 16, 56, 67): '[[0.1, 0.1, 0.1], [0.1, 0.1, 0.1], [0.4, 0.4, 0.4]]'}, {}), '([[0.1, 0.1, 0.1], [0.1, 0.1, 0.1], [0.4, 0.4, 0.4]])', True, 'import numpy as np\n'), ((58, 7, 58, 51), 'numpy.array', 'np.array', ({(58, 16, 58, 50): '[[0.1, 0.1, 0.1], [0.2, 0.2, 0.2]]'}, {}), '([[0.1, 0.1, 0.1], [0.2, 0.2, 0.2]])', True, 'import numpy as np\n'), ((59, 7, 59, 61), 'numpy.array', 'np.array', ({(59, 16, 59, 60): '[[1.0, 0.0, 0.0, 0.0], [1.0, 0.0, 0.0, 0.0]]'}, {}), '([[1.0, 0.0, 0.0, 0.0], [1.0, 0.0, 0.0, 0.0]])', True, 'import numpy as np\n'), ((60, 7, 60, 51), 'numpy.array', 'np.array', ({(60, 16, 60, 50): '[[0.2, 0.2, 0.2], [0.3, 0.3, 0.3]]'}, {}), '([[0.2, 0.2, 0.2], [0.3, 0.3, 0.3]])', True, 'import numpy as np\n'), ((25, 13, 25, 54), 'numpy.quaternion', 'np.quaternion', ({(25, 27, 25, 32): 'q1[0]', (25, 34, 25, 39): 'q1[1]', (25, 41, 25, 46): 'q1[2]', (25, 48, 25, 53): 'q1[3]'}, {}), '(q1[0], q1[1], q1[2], q1[3])', True, 'import numpy as np\n'), ((26, 13, 26, 48), 'quaternion.as_rotation_matrix', 'quaternion.as_rotation_matrix', ({(26, 43, 26, 47): 'rot1'}, {}), '(rot1)', False, 'import quaternion\n'), ((31, 13, 31, 48), 'quaternion.as_rotation_matrix', 'quaternion.as_rotation_matrix', ({(31, 43, 31, 47): 'rot2'}, {}), '(rot2)', False, 'import quaternion\n'), ((48, 47, 48, 81), 'numpy.reshape', 'np.reshape', ({(48, 58, 48, 71): 'sample_points', (48, 73, 48, 80): '[-1, 3]'}, {}), '(sample_points, [-1, 3])', True, 'import numpy as np\n'), ((64, 19, 64, 38), 'numpy.array', 'np.array', ({(64, 28, 64, 37): '[0, 0, 1]'}, {}), '([0, 0, 1])', True, 'import numpy as np\n'), ((27, 44, 27, 64), 'numpy.transpose', 'np.transpose', ({(27, 57, 27, 63): 'points'}, {}), '(points)', True, 'import numpy as np\n'), ((30, 13, 30, 54), 'numpy.quaternion', 'np.quaternion', ({(30, 27, 30, 32): 'q2[0]', (30, 34, 30, 39): 'q2[1]', (30, 41, 30, 46): 'q2[2]', (30, 48, 30, 53): 'q2[3]'}, {}), '(q2[0], q2[1], q2[2], q2[3])', True, 'import numpy as np\n'), ((32, 44, 32, 64), 'numpy.transpose', 'np.transpose', ({(32, 57, 32, 63): 'points'}, {}), '(points)', True, 'import numpy as np\n')]