A library for processing TMD files and visualizing height maps
Project description
TrueMap & GelSight TMD Processor
A Python-based TMD file processor with visualization and export capabilities for height maps stored in TMD files generated by TrueMap v6 or GelSight. The tool includes comprehensive features for data processing, visualization, and export to various formats.
Table of Contents
Features
- Rich Visualizations:
- Interactive 3D surface plots with adjustable Z-scale
- 2D heatmaps using Plotly, Matplotlib, or Seaborn
- X-profile cross-section plots
- Multiple Export Formats:
- Displacement maps (grayscale PNG)
- Normal maps (RGB PNG)
- Bump maps with adjustable parameters
- Ambient Occlusion (AO) maps
- BSRF (Bidirectional Scattering Reflection Function) maps
- Multi-channel maps (RGBE, RG formats)
- STL files for 3D printing (ASCII or binary)
- NumPy data formats (.npy, .npz)
Height Map Statistics
Shape: (200, 200) Min: 0.0 Max: 1.0 Mean: 0.4120621979236603 Std Dev: 0.188633993268013
Installation
Quick Install
Ensure you have Python 3.12+ installed. Then, install the required packages:
```bash
pip install numpy plotly pillow
You can also run the provided Jupyter Notebook to see step-by-step examples.
TMD File Format
The TMD files processed by this tool follow a binary layout with similar structures for both TrueMap v6 and GelSight versions. The main difference lies in the comment field and the typical source of the file.
TrueMap v6 Format
-
Header (32 bytes): An ASCII string that starts with:
Binary TrueMap Data File v2.0 -
Comment (Variable, up to 256 bytes): A null-terminated string, typically:
Created by TrueMap v6 -
Dimensions (8 bytes): Two 32-bit unsigned integers for width and height (little-endian).
-
Spatial Information (16 bytes): Four 32-bit floats representing:
- x_length (physical length in X)
- y_length (physical length in Y)
- x_offset
- y_offset
-
Height Map Data: A sequence of 32-bit floats (4 bytes each) forming a 2D array with dimensions height x width.
GelSight Format
The GelSight TMD file format is very similar to the TrueMap v6 format with subtle differences:
-
Header (32 bytes): The header string is the same:
Binary TrueMap Data File v2.0 -
Comment (Variable): A null-terminated string that may be empty or contain different metadata.
-
Dimensions (8 bytes): Two 32-bit unsigned integers for width and height (little-endian).
-
Spatial Information (16 bytes): Four 32-bit floats for:
- x_length
- y_length
- x_offset
- y_offset
-
Height Map Data: A float32 array representing the height values over a grid defined by the width and height.
The processor uses the file name (or structure hints) to choose the appropriate parser for TrueMap v6 or GelSight TMD files.
License
This project is licensed under the MIT License. See the LICENSE file for details.
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 truemapdata-0.1.0.post0.tar.gz.
File metadata
- Download URL: truemapdata-0.1.0.post0.tar.gz
- Upload date:
- Size: 98.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3346781913347181535ae815d470dd872ca15727b979a0e4e1598f24fb60a604
|
|
| MD5 |
7d63627846605bae7b5fd8da88c5e0cd
|
|
| BLAKE2b-256 |
4abaa79bbba514de91cba965685ddb8a24329a702b24d9f31f4c725ab0538528
|
File details
Details for the file truemapdata-0.1.0.post0-py3-none-any.whl.
File metadata
- Download URL: truemapdata-0.1.0.post0-py3-none-any.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
242f9ce0d3d47e37070ee60ac5e8a93add123245cb2dae34f4a3d10901a8d6a4
|
|
| MD5 |
ca842cb780d5c9c5123a6150d15efa00
|
|
| BLAKE2b-256 |
04eecc14f472523694037d7ed251c6726fecbb40b670e0a804e9a85ce9a6b93f
|