mesh extract and render by python
Project description
PyMesh3D
Basic Installation
This project for mesh render in data science.
conda create -n pymesh3d python=3.6
conda activate pymesh3d
pip install --upgrade pip
pip install pymesh3d
If you need mayavi backend.
conda config --add channels conda-forge
conda install vtk pyqt mayavi
Quick Start
import pymesh
import numpy as np
import matplotlib.pyplot as plt
Look at the directory example for full example.
##########################################
############ Rotate Mesh Data ############
##########################################
wkdir = "../../Render"
ey = np.load(wkdir + "/Ez.npy")[::2, ::50]
m, n = ey.shape[0], ey.shape[1]
res = np.zeros([m, n, n])
pymesh.rotate(ey, res, ifhalf = False)
fig = plt.figure(figsize=(4, 3))
plt.contourf(res[:, int(n/2), :].T)
cbar = plt.colorbar()
##########################################
############# Save Mesh Data #############
##########################################
mesh = pymesh.get_iso_surf(res, contours_number = 4, cmap = plt.cm.jet)
color = pymesh.interp_color(mesh.iso_vals, pltmap = plt.cm.jet)
mesh.export(wkdir + "test", "obj")
##########################################
############# Load Mesh Data #############
##########################################
mesh = pymesh.Mesh.load(wkdir + "test", "obj")
##########################################
############# Plot Mesh Data #############
##########################################
from mayavi import mlab
mlab_mesh = pymesh.iso_surface(mesh, colormap = "RdBu")
mlab.colorbar()
mlab.show()
################ plt example #################
surf = mesh.plt_trisurf(cmap = plt.cm.jet)
plt.colorbar(surf, orientation = 'horizontal')
plt.tight_layout()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pymesh3d-0.0.11.tar.gz
(5.2 kB
view details)
Built Distribution
File details
Details for the file pymesh3d-0.0.11.tar.gz
.
File metadata
- Download URL: pymesh3d-0.0.11.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.10.1 urllib3/1.26.15 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3de8bf85161afab01585a15bf04403eabef06866eef72987d5b2febdaa3f0781 |
|
MD5 | 3d91d0c26de1c88c0c391c92d777c1b4 |
|
BLAKE2b-256 | 10cd970b892ee70de7e001b342308ae216f4c940349fbbf2f6e308f65d6ca36d |
File details
Details for the file pymesh3d-0.0.11-py3-none-any.whl
.
File metadata
- Download URL: pymesh3d-0.0.11-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.10.1 urllib3/1.26.15 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec43cc670723315b20ada1acafaa86312276bcf54ec59a876425ff343dbadd0d |
|
MD5 | 460a37366f27744185d1c1d6d673f491 |
|
BLAKE2b-256 | beb520b155943f267aca1d035639a74cbd9536ee53cf21d1afd5c5b3b033ea1b |