mesh extract and render by python
Project description
PyMesh3D
Basic Installation
This project for mesh render in data science.
pip install --upgrade pip
pip install pymesh3d
If you need mayavi backend.
pip install mayavi
pip install pyqt
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 = "jet")
color = pymesh.interp_color(mesh.iso_vals, cmap = "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 = "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.17.tar.gz
(6.7 kB
view details)
Built Distribution
File details
Details for the file pymesh3d-0.0.17.tar.gz
.
File metadata
- Download URL: pymesh3d-0.0.17.tar.gz
- Upload date:
- Size: 6.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 480376cb4d3c85c1f559ca13480dc9e46db9f3615f5d11963d001d57687387d6 |
|
MD5 | efb456e9159bffdfa4968bab81471c3d |
|
BLAKE2b-256 | b66c17e6d391635cd93faa0efb67e6904e8df65fcb8e95159f63dbfdfe723f7c |
File details
Details for the file pymesh3d-0.0.17-py3-none-any.whl
.
File metadata
- Download URL: pymesh3d-0.0.17-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c80d4f4fa1d8c40f573a1a12d9ee192a4549c03f12ccd4868144fa7235c158c4 |
|
MD5 | 4967dbc79b3f9ac026b430e522909573 |
|
BLAKE2b-256 | 6398bedf3b4f334bce52e5db7297f6e3a5639ab313d42cf125021c1678897afb |