Using the Python numpy-stl package: reading the .stl files we can get the geometrical information from the triangular mesh, vertex data, normals, areas etc, but can we access the topological information, the connectivity information? I am a newcomer to Python and everything... but there was once this question was asked and did not get any response.
I need to read a triangular stl mesh and plot some of the elements using Pyvista such as the one in the sample!
# Vertices
vertices = np.array([[0, 0, 0],
[1, 0, 0],
[1, 1, 0],
[0, 1, 0],
[0.5, 0.5, -1]])
-> This I can
# mesh faces
faces = np.hstack([[4, 0, 1, 2, 3], # square
[3, 0, 1, 4], # triangle
[3, 1, 2, 4]]) # triangle
-> This I cannot.
Is it necessary to define the data structure to generate the connectivity information??
Thank you for reading!
This test gives me the expected result:
what error message do you get?