{ "cells": [ { "cell_type": "markdown", "id": "02a2b9c4", "metadata": {}, "source": [ "# Mesh managment examples" ] }, { "cell_type": "markdown", "id": "4dad28c2", "metadata": {}, "source": [ "This notebook shows how to check the mesh status on the dataset\n", "\n" ] }, { "cell_type": "code", "execution_count": 1, "id": "aae19f8d", "metadata": {}, "outputs": [], "source": [ "import morphonet" ] }, { "cell_type": "code", "execution_count": null, "id": "e1c194d1", "metadata": {}, "outputs": [], "source": [ "mn_login=\"user\"\n", "mn_password=\"password\"\n", "mn=morphonet.Net(mn_login,mn_password)" ] }, { "cell_type": "markdown", "id": "3b05b046", "metadata": {}, "source": [ "Select your dataset\n" ] }, { "cell_type": "code", "execution_count": null, "id": "e477d116", "metadata": {}, "outputs": [], "source": [ "print(\"-------------------------------\")\n", "print(\"Select a dataset by id for test : 1452\")\n", "mn.select_dataset_by_id(1)" ] }, { "cell_type": "markdown", "id": "7a13a25c", "metadata": {}, "source": [ "Retrieve the number of mesh for time 1, for quality 1 at channel 0\n" ] }, { "cell_type": "code", "execution_count": null, "id": "2dd53ed2", "metadata": {}, "outputs": [], "source": [ "print(\"-------------------------------\")\n", "print(\"Get number mesh at t = 1 quality = 1 and channel = 0\")\n", "mn.get_number_of_mesh_at(1,1,0)\n", "input(\"Press Enter to continue...\")" ] }, { "cell_type": "markdown", "id": "edb186da", "metadata": {}, "source": [ "Retrieve 3d data for the same mesh\n", "\n" ] }, { "cell_type": "code", "execution_count": null, "id": "ca1a02f9", "metadata": {}, "outputs": [], "source": [ "print(\"-------------------------------\")\n", "print(\"Get mesh at t = 1 quality = 1 and channel = 0 (existing but none obj)\")\n", "print(mn.get_mesh_at(1,1,0))\n", "input(\"Press Enter to continue...\")\n" ] }, { "cell_type": "markdown", "id": "9aa17c29", "metadata": {}, "source": [ "If you need to add a mesh, you need first of all to read the data in a file\n", "\n" ] }, { "cell_type": "code", "execution_count": null, "id": "e1359a1b", "metadata": {}, "outputs": [], "source": [ "obj = mn.read_mesh(\"DATASET/Multiple_Objs/obj502.obj\")" ] }, { "cell_type": "markdown", "id": "83930511", "metadata": {}, "source": [ "Then you can upload it \n", "\n", "**Parameters**\n", "\n", "time : (int)\n", " time point that will receive the mesh\n", "\n", "obj : (bytes)\n", " 3d data of the mesh itself\n", " \n", "quality : (int)\n", " for a time point of the dataset, you can have multiple quality settings. Default value is 0\n" ] }, { "cell_type": "code", "execution_count": null, "id": "de7d0094", "metadata": {}, "outputs": [], "source": [ "time = 0\n", "mn.upload_mesh_at(time,obj,quality=0)" ] }, { "cell_type": "markdown", "id": "2fcf51a9", "metadata": {}, "source": [ "For a reason you may need to clear a mesh for a specific time point\n", "\n", "**Parameters**\n", "\n", "time : (int)\n", " time point o be cleared\n", "\n", "quality : (int)\n", " for a time point of the dataset, you can have multiple quality settings. Default value is 0\n", " \n" ] }, { "cell_type": "code", "execution_count": null, "id": "0a43f9d8", "metadata": {}, "outputs": [], "source": [ "mn.clear_mesh_at(time,quality=0)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.7" } }, "nbformat": 4, "nbformat_minor": 5 }