No project description provided
Project description
del-msh
Python static 3D mesh utility library for prototyping in computer graphics research.
Install
pip install del-msh
Generate Primitive Mesh
import del_msh
# generate primitive mesh
V,F = del_msh.torus_meshtri3(0.6, 0.3, 32, 32) # torus
V,F = del_msh.capsule_meshtri3(0.1, 0.6, 32, 32, 32) # capsule
V,F = del_msh.cylinder_closed_end_meshtri3(0.1, 0.8, 32, 32) # cylinder
V,F = del_msh.sphere_meshtri3(1., 32, 32) # sphere
print("V is vertex coordinates: type",type(V),", dtype: <",V.dtype,">, shape:",V.shape)
print(type(F),F.shape)
V is vertex coordinates: type <class 'numpy.ndarray'> , dtype: < float32 >, shape: (994, 3)
<class 'numpy.ndarray'> (1984, 3)
Importing Wavefront Obj file
from pathlib import Path
newpath = Path('.') / 'asset' / 'HorseSwap.obj'
vtx_xyz, elem_vtx_index, elem_vtx_xyz = del_msh.load_wavefront_obj(str(newpath))
print("vtx_xyz",type(vtx_xyz),vtx_xyz.shape)
print("elem_vtx_index",type(elem_vtx_index),elem_vtx_index.shape)
print("elem_vtx_xyz",type(elem_vtx_xyz),elem_vtx_xyz.shape)
vtx_xyz <class 'numpy.ndarray'> (2738, 3)
elem_vtx_index <class 'numpy.ndarray'> (2777,)
elem_vtx_xyz <class 'numpy.ndarray'> (10996,)
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
del_msh-0.1.1.tar.gz
(144.0 kB
view hashes)
Built Distribution
Close
Hashes for del_msh-0.1.1-cp310-cp310-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 209151408d73b5c6112eb5fe75d985e8f607865c35392b28ed91671b6b4d9b6f |
|
MD5 | a70774f4b9027410f66135668e2baa59 |
|
BLAKE2b-256 | 7f70b0eacb5c5f432008473bde9d7a1307a1de5d162b2a0a9468f3cef793a754 |