wolph / numpy-stl

Simple library to make working with STL files (and 3D objects in general) fast and easy.
http://numpy-stl.readthedocs.org/
BSD 3-Clause "New" or "Revised" License
624 stars 105 forks source link

Vertices and faces from numpy-stl instance #164

Closed toqduj closed 3 years ago

toqduj commented 3 years ago

After getting disappointing results from mplot3d in terms of occlusion and interactivity, I'm trying to use ipyvolume (or failing that, pythreejs) for visualizing a bunch of STL objects in a single space. However, both these require a definition of the stl in terms of vertices and faces.

I've seen the example in the numpy-stl docs how to go from vertices and faces to vectors, but it wasn't clear to me if this process could be reversed somehow? Could you give me a hint towards this, perhaps? Would be a great help, thanks!

wolph commented 3 years ago

The problem is that a vector doesn't contain all the information you need. A face has a front and a back side, while a vector (in this library and the STL standard) is a collection of the X, Y and Z coordinates of 3 points to make up a triangle.

So effectively a vector is a face, but you don't know the orientation.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.