2016-11-21 11:01:22 +00:00
|
|
|
# model-converter
|
2016-11-22 14:15:34 +00:00
|
|
|
|
2016-11-22 14:23:53 +00:00
|
|
|
This project aims to be a simple, lightweight, and useful 3D model editor.
|
2016-12-21 11:16:49 +00:00
|
|
|
For the moment, only `obj`, `off`, `ply` ascii and `stl` models are supported.
|
2016-11-22 14:15:34 +00:00
|
|
|
|
2016-11-30 10:56:54 +00:00
|
|
|
Feel free to open an issue if you find anything wrong in this.
|
|
|
|
|
2016-12-02 15:01:42 +00:00
|
|
|
- [Scripts](#scripts)
|
|
|
|
- [Install](#install)
|
|
|
|
- [Contributing](#contributing)
|
|
|
|
- [List of all supported formats](#formats)
|
|
|
|
|
2016-11-22 14:15:34 +00:00
|
|
|
# Scripts
|
|
|
|
|
|
|
|
A few utilities to manage 3D models :
|
2016-11-22 14:23:53 +00:00
|
|
|
- `convert.py` that converts any type of model to any other
|
2016-11-25 13:18:57 +00:00
|
|
|
- `viewer.py` which is a simple script that renders a 3d model
|
2016-11-22 14:15:34 +00:00
|
|
|
|
2016-12-02 15:01:42 +00:00
|
|
|
# Install
|
2016-12-01 12:50:04 +00:00
|
|
|
|
|
|
|
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
|
2016-12-02 20:37:20 +00:00
|
|
|
- PIL `sudo pip install pillow`
|
2016-12-01 12:50:04 +00:00
|
|
|
- numpy `sudo pip install numpy`
|
|
|
|
- pygame `sudo pip install pygame`
|
|
|
|
- PyOpenGL `sudo pip install pyopengl`
|
|
|
|
|
2016-12-02 15:01:42 +00:00
|
|
|
## 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
|
2016-11-22 14:15:34 +00:00
|
|
|
- Wavefront `.obj`
|
|
|
|
- Stanford `.ply`
|
2016-12-21 11:16:49 +00:00
|
|
|
- Object File Format `.off`
|
2016-11-30 14:01:41 +00:00
|
|
|
- STL files `.stl`
|
2016-11-22 14:15:34 +00:00
|
|
|
|