Ir para arquivo
Thomas Forgione ecb8c35ecc Fix parser 2022-09-12 14:18:36 +02:00
assets Export ply supports texture 2017-01-19 11:23:48 +01:00
d3 Fix parser 2022-09-12 14:18:36 +02:00
.gitignore Support multiple models 2018-02-23 11:31:58 +01:00
LICENSE Updated license 2016-11-29 15:56:05 +01:00
README.md Merge branch 'master' of github.com:tforgione/model-converter 2016-12-21 12:17:17 +01:00
convert.py Added up vector management 2016-11-30 15:37:58 +01:00
viewer.py Support multiple models 2018-02-23 11:31:58 +01:00

README.md

model-converter

This project aims to be a simple, lightweight, and useful 3D model editor. For the moment, only obj, off, ply ascii and stl models are supported.

Feel free to open an issue if you find anything wrong in this.

Scripts

A few utilities to manage 3D models :

  • convert.py that converts any type of model to any other
  • viewer.py which is a simple script that renders a 3d model

Install

This project is written in python 3. The convert.py script is made for needing nothing else than python. However, the viewer.py script has a few dependencies, you'll need :

  • pip (to install the other dependencies) sudo apt-get install python3-pip for example
  • PIL sudo pip install pillow
  • numpy sudo pip install numpy
  • pygame sudo pip install pygame
  • PyOpenGL sudo pip install pyopengl

Contributing

If you want to add a new format to this converter, it should be easy enough, you just have to create a python file in d3/model/formats that should :

  • be named after the format you want to add (e.g. obj.py)
  • contain a function that tests if a filename is in the specified format (e.g. is_obj)
  • contain a parser class (e.g. OBJParser)
  • contain an exporter class (e.g. OBJExporter)

About the parser

The parser should inherit the ModelParser class in the basemodel.py module. The ModelParser class has everything needed to create a 3D model and render it.

About the exporter

The exporter should inherit the Exporter class in the basemodel.py module. It should have a constructor that takes a ModelParser has parameter and a __str__ method that should compute the export.

Formats

Here is the list of all the supported formats

  • Wavefront .obj
  • Stanford .ply
  • Object File Format .off
  • STL files .stl