-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutils.py
More file actions
23 lines (19 loc) · 841 Bytes
/
utils.py
File metadata and controls
23 lines (19 loc) · 841 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import pandas as pd
import numpy as np
def build_node(color_array, size_array, save_path, length=160):
assert len(size_array) == len(color_array) == length
df_dress = pd.read_excel("data/destriux_160.xlsx")
with open(save_path, "w") as f:
for i in range(length):
f.write("{} {} {} {} {} {}\n".format(
str(df_dress["x"][i]),
str(df_dress["y"][i]),
str(df_dress["z"][i]),
str(color_array[i]),
str(size_array[i]),
str(df_dress["name"][i]),
))
if __name__ == "__main__":
example_color_array = np.asarray([0.0] * 30 + [1.0] * 50 + [2.0] * 80) # numpy.ndarray
example_size_array = [0.0 for i in range(160)] # list
build_node(example_color_array, example_size_array, "output/example.node")