Skip to content

Instantly share code, notes, and snippets.

@ochoto

ochoto/Vertex.py Secret

Last active August 18, 2022 18:43
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ochoto/7f3b6f4baac08bfa57b0f0094e4a853a to your computer and use it in GitHub Desktop.
Save ochoto/7f3b6f4baac08bfa57b0f0094e4a853a to your computer and use it in GitHub Desktop.
Hackit 3 2022
#!/usr/bin/env python
import numpy as np
import matplotlib.pyplot as plt
dt = np.dtype([('x',np.float32),('y',np.float32),('z',np.float32)])
with open("obj_150138c000.bin", 'rb') as f:
data = np.fromfile(f,dtype=dt)
filter = (data['x'] != 0.) & (data['y'] != 0.) & (data['z'] != 0.)
filtered = data[filter]
xs = filtered['x']
ys = filtered['y']
#zs = filtered['z'] # las descartamos por estar todas en el mismo plano -> len(np.unique(zs)) == 1
plt.plot(xs,ys)
plt.show()
@acuartango
Copy link

Muy elegante!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment