update code

This commit is contained in:
Iridoudou
2021-08-07 08:03:40 +08:00
parent 0152f1909f
commit 9f6274fc19
8 changed files with 160 additions and 65 deletions

View File

@ -1,12 +1,13 @@
import numpy as np
def transform(arr: np.ndarray):
def transform(arr: np.ndarray, rotate=[1.,-1.,-1.]):
for i in range(arr.shape[0]):
origin = arr[i][0].copy()
origin = arr[i][3].copy()
for j in range(arr.shape[1]):
arr[i][j] -= origin
arr[i][j][1] *= -1
arr[i][j][2] *= -1
arr[i][0] = [0.0, 0.0, 0.0]
for k in range(3):
arr[i][j][k] *= rotate[k]
arr[i][3] = [0.0, 0.0, 0.0]
print(arr[0])
return arr