ich möchte gerne Faces die im Wavefront (*.obj) Format vorliegen, mit einen 3D Plot darstellen und mit definierten Farben versehen.
Es geht um Vierecke die wie folgt definiert werden.
4x Knoten Koordinaten pro Face: (v ,x, y, z)
v 0.031500 -0.015000 0.170910
v 0.029352 -0.015155 0.174785
v 0.031500 -0.015000 0.173228
v 0.029420 -0.015145 0.172856
1x Face das alle vier Knoten anspricht
f 1 2 3 4
Ich hatte probiert, das erst manuell über den Surface Plot darzustellen, jedoch ohne Erfolg.
Ein Scatter Plot also nur die Ausgabe der Knoten funktioniert.
Wie könnte ich am besten solche Flächen / Faces darstellen?
Hiermit hatte ich bisher erfolglos probiert:
Code: Alles auswählen
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
xs=np.array([1,1,5,5])
ys=np.array([1,5,5,1])
zs=np.array([0,0,0,0])
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
#ax.scatter(xs, ys, zs)
ax.plot_surface(xs, ys, zs)
ax.set_xlabel('X Label')
ax.set_ylabel('Y Label')
ax.set_zlabel('Z Label')
plt.show()Danke für eure Bemühungen.
Edit: Code Tags hinzugefügt
