Reading and writing triangulated meshes
Project description
Binary Mesh Format
This is a small python library implementation for reading and writing triangulated meshes.
Usage
import binarymeshformat as bmf
meshTracks = bmf.loadMeshes(filename)
That will return a list of mesh tracks.
Track structure
A track has a name and a map. The name is just a string and the map maps integers to meshes.
Mesh structure
The mesh contains points in 3D space and their connections. It uses 3 aspects:
- positions which is an array of x,y,z coordinates.
- connections which is an array of indexes indicating two points are connected. Two indexes per connection.
- triangles an array of indexes, three indexes per triangle.
File Format
A .bmf file contains mesh tracks, where a track is a collection of meshes over time, a mesh is a set positions, connections, and triangles.
Header
The first four bytes are a version string. The current version string should be -1.
The next four bytes are an integer that says how many tracks are in the file.
Track
The first data in a track is a name, which can be a variable size. The first two bytes indicate the length of the name. The string encoding is a subset of UTF8.
Then each mesh is written.
Mesh
First a 4 byte int to represent the timepoint the mesh exists at.
Then a 4 byte integer representing the number of positions values, 8 byte float. Then a 4 byte integer is use to represent the number of connections indexes, each connection index is a 4 byte integers. Finally a 4 byte integer is used to represent the number of triangle indexes, each index is a 4 byte integer
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file binarymeshformat-1.0.tar.gz.
File metadata
- Download URL: binarymeshformat-1.0.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.6.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db9716147b434ce1428444dd15a341febf09654f7befec2a33d9362030ef2f67
|
|
| MD5 |
813aa819d7564ba2d78fe418a7ef6906
|
|
| BLAKE2b-256 |
920c8009fadd8e6ddf7945f0497f9e145bf32edc85a903ec575739c3a7d410f9
|
File details
Details for the file binarymeshformat-1.0-py3-none-any.whl.
File metadata
- Download URL: binarymeshformat-1.0-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.6.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
70641db348cb61a4431bd9ec2b2a96b012fd69fc429ecd8f9eaf442b854a34f0
|
|
| MD5 |
2c3b4140b68261ddf8960095c2fd8b26
|
|
| BLAKE2b-256 |
0769434a2100872ccd28f632d959e5ba61032a9cc448fbbde3680b517d6eb289
|