{ "nbformat": 4, "nbformat_minor": 0, "metadata": { "colab": { "name": "Demo_obj2html.ipynb", "provenance": [], "collapsed_sections": [] }, "kernelspec": { "display_name": "Python 3", "name": "python3" }, "language_info": { "name": "python" } }, "cells": [ { "cell_type": "code", "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "yhAY5KFy1gi2", "outputId": "248d496f-421e-4b92-dc90-8e91cee03c01" }, "source": [ "! pip install obj2html\n", "! wget https://gitlab.com/nicolalandro/obj2html/-/raw/main/test/assets/model.obj" ], "execution_count": null, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Collecting obj2html==0.12\n", " Downloading obj2html-0.12.tar.gz (3.4 kB)\n", "Building wheels for collected packages: obj2html\n", " Building wheel for obj2html (setup.py) ... \u001b[?25l\u001b[?25hdone\n", " Created wheel for obj2html: filename=obj2html-0.12-py3-none-any.whl size=3801 sha256=b5b7db9f171c91da798ee6ddc805451863ecd34f39221935bdb68d7cab6ae352\n", " Stored in directory: /root/.cache/pip/wheels/8d/2e/a7/c7a4aa0a197f80a9cabb39e4da48905cf09b0f26244afb2841\n", "Successfully built obj2html\n", "Installing collected packages: obj2html\n", " Attempting uninstall: obj2html\n", " Found existing installation: obj2html 0.11\n", " Uninstalling obj2html-0.11:\n", " Successfully uninstalled obj2html-0.11\n", "Successfully installed obj2html-0.12\n", "--2021-11-14 16:05:58-- https://gitlab.com/nicolalandro/obj2html/-/raw/main/test/assets/model.obj\n", "Resolving gitlab.com (gitlab.com)... 172.65.251.78, 2606:4700:90:0:f22e:fbec:5bed:a9b9\n", "Connecting to gitlab.com (gitlab.com)|172.65.251.78|:443... connected.\n", "HTTP request sent, awaiting response... 200 OK\n", "Length: 9887179 (9.4M) [text/plain]\n", "Saving to: ‘model.obj.4’\n", "\n", "model.obj.4 100%[===================>] 9.43M --.-KB/s in 0.06s \n", "\n", "2021-11-14 16:05:58 (157 MB/s) - ‘model.obj.4’ saved [9887179/9887179]\n", "\n" ] } ] }, { "cell_type": "code", "metadata": { "colab": { "background_save": true, "base_uri": "https://localhost:8080/", "height": 171 }, "id": "jeTD6bmh2MX6", "outputId": "945bcf90-70e3-407b-ad54-79aae1246120" }, "source": [ "from obj2html import obj2html\n", "from IPython.display import display, HTML\n", "obj2html('model.obj', 'index.html')\n", "display(HTML('index.html'))" ], "execution_count": null, "outputs": [ { "data": { "text/html": [ "\n", "\n", "
\n", " \n", "