{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "%matplotlib inline" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Mesh\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "import numpy as np\nfrom itom import pointCloud\nfrom itom import algorithms\nfrom itom import dataObject\nfrom itom import polygonMesh\n\n\n[X, Y] = np.meshgrid(range(0, 2), range(0, 2))\nZ = np.array([[0, 0], [1, 1]])\n\ncloud = pointCloud.fromXYZ(\n dataObject(X.astype(\"float32\")),\n dataObject(Y.astype(\"float32\")),\n dataObject(Z.astype(\"float32\")),\n)\nindices = np.array([[0, 1, 3, 2]])\n\nmesh = polygonMesh.fromCloudAndPolygons(cloud, indices)\nmeshOut = polygonMesh()\nalgorithms.pclMeshTriangulation(mesh, meshOut)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "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.8.10" } }, "nbformat": 4, "nbformat_minor": 0 }