Reformat tuple into a struct.

This commit is contained in:
2025-08-22 17:13:38 -05:00
parent c961ccf7cd
commit 0551a0a16e
4 changed files with 43 additions and 42 deletions

View File

@@ -1,23 +1,22 @@
import time
import numpy as np
import subprocess
from pathlib import Path
import time
p = subprocess.Popen(Path("bin", "x64", "Debug", "LivePlotter.exe"), stdin=subprocess.PIPE)
x = 0
y = 0
z = 0
t = 0
period = 0.1
while True:
lines = None
with open("gpoints_rotate.obj", "r") as f:
lines = f.readlines()
period = 0.25
for i in range(len(lines)):
time.sleep(period)
x = 10*np.cos(t)
y = 10*np.sin(t)
z = 0
t += period
p.stdin.write(f"test {x} {y} {z}\n".encode("utf8"))
p.stdin.write(f"test2 {x} {-y} {z}\n".encode("utf8"))
p.stdin.write(f"test3 {-x} {y} {z}\n".encode("utf8"))
p.stdin.write(f"test4 {-x} {-y} {z}\n".encode("utf8"))
words = lines[i].split()
x = words[1]
y = words[2]
z = words[3]
name = "".join(words[4:])
p.stdin.write(f"{name} {x} {y} {z}\n".encode("utf8"))
p.stdin.flush()