47 lines
927 B
Python
47 lines
927 B
Python
import csv
|
|
import itertools
|
|
import numpy as np
|
|
from matplotlib import pyplot as plt
|
|
|
|
import cv2
|
|
|
|
coordinates = []
|
|
plt.ion()
|
|
with open('data.csv') as csv_file:
|
|
csv_reader = csv.DictReader(csv_file)
|
|
line_count = 0
|
|
for row in csv_reader:
|
|
coordinate = [float(row['X']), float(row['Y']), float(row['Z'])]
|
|
coordinates.append(coordinate)
|
|
|
|
# print(coordinates)
|
|
|
|
# res = np.concatenate(coordinates)
|
|
#
|
|
# fig = plt.figure()
|
|
# ax = fig.add_subplot(projection='3d')
|
|
#
|
|
# for x, y, z in coordinates:
|
|
# ax.scatter(xs=x, ys=y, zs=z, marker='o')
|
|
#
|
|
# plt.show()
|
|
|
|
|
|
coor = coordinates[7]
|
|
for i in range(7):
|
|
coor = np.cross(coor, coordinates[i])
|
|
#coordi = coordinates[i]
|
|
#coordi
|
|
#print(multi)
|
|
combinations = list(itertools.combinations(coordinates, 8))
|
|
|
|
for combi in combinations:
|
|
coor = combi[7]
|
|
for i in range(7):
|
|
coor = np.cross(coor, combi[i])
|
|
|
|
print(coor)
|
|
|
|
length = 3
|
|
target = 15
|