Go to file
nicolalandro e3630f8e4d new dist
2021-11-14 15:41:53 +01:00
imgs add image 2021-11-13 16:15:35 +01:00
obj2html add scale options 2021-11-14 15:06:51 +01:00
test add setup.py correct 2021-11-13 15:18:04 +01:00
.gitignore new dist 2021-11-14 15:41:53 +01:00
.gitlab-ci.yml setup.py and test 2021-11-13 15:33:54 +01:00
pipy_readme.rst new dist 2021-11-14 15:41:53 +01:00
README.md new dist 2021-11-14 15:41:53 +01:00
setup.py new dist 2021-11-14 15:41:53 +01:00

pipeline status coverage report

Obj2Html

This lib is able to transform an .obj file to HTML that use three.js. In this way it is possible to have an interactive 3D view that can be used on the browser or into a jupyter notebook.

Install with pip install obj2html and use with obj2html('model.obj', 'index.html')

  • run into jupyter notebook
! pip install obj2html
! wget https://gitlab.com/nicolalandro/obj2html/-/raw/main/test/assets/model.obj
from obj2html import obj2html
from IPython.display import display, HTML

obj2html('model.obj', 'index.html')

display(HTML('index.html'))

Features

  • .obj files support
  • pipy delivery
  • guide for notebook
  • pypi doc add image
  • edit html positions and other 3D params
  • dist wheel
  • load three.js as static file
  • .mat files support

Dev

  • run test
python3.8 -m unittest discover
  • run test with coverage
pip install coverage
python3.8 -m coverage run --source=src -m unittest discover
python3.8 -m coverage report -m
  • deploy pipy
pip install twine

rm -rf dist

python setup.py sdist
twine check dist/*

twine upload dist/*

# in one line

References

In this chapter I add at least a link for each of the knowledge needed for develop this project.

  • python
  • git
  • how to write a setup.py
  • python test
  • coverage
  • gitlab ci/cd
  • three.js
  • pymustache: for using html template, but in the end I use replace with similar sintax