ladybug-tools / ladybug-geometry

🐞 📦 A library with geometry objects used throughout the Ladybug Tools core libraries
https://www.ladybug.tools/ladybug-geometry/docs/
GNU Affero General Public License v3.0
25 stars 23 forks source link

Consider adding Mesh3D.from_obj classmethod #305

Open alphonse-lin opened 3 years ago

alphonse-lin commented 3 years ago

I am wondering, is it any possible way for ladybug tools to read obj models from the local path?

Or I have to write it by myself via transferring obj file into ladybug_geometry.geometry3d.mesh

mostaphaRoudsari commented 3 years ago

Hi @alphonse-lin, we don't currently have support for importing obj files. I would do what you suggested above.

chriswmackey commented 2 years ago

I know that I am late here but I just wanted to add that this is a good idea. If anyone has documentation on the .obj format, this will help in writing the translator.

mostaphaRoudsari commented 2 years ago

@chriswmackey, I don't know how you feel about adding dependencies but this library might help. https://github.com/pywavefront/PyWavefront

I should also add that if we don't want to load the mtl files which I understand we don't then the structure is pretty straightforward. You just read the vertices (lines start with v) and then create the faces (lines start with f).