Metadata-Version: 2.2
Name: pylmesh
Version: 0.0.5
Summary: A lightweight library for importing and exporting surface mesh files in multiple formats
Keywords: mesh,3d,obj,stl,ply,off,gltf,glb,loader,draco
Author-Email: Marwan Abdellah <marwan.abdellah@openbraininstitute.com>
License: Apache-2.0
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: C++
Project-URL: Homepage, https://github.com/openbraininstitue/pylmesh
Project-URL: Repository, https://github.com/openbraininstitue/pylmesh
Requires-Python: >=3.12
Requires-Dist: numpy>=1.19.0
Requires-Dist: joblib>=1.0.0
Requires-Dist: tqdm>=4.60.0
Requires-Dist: trimesh>=3.9.0
Requires-Dist: pytest>=6.0
Requires-Dist: jupyter>=1.0.0
Requires-Dist: matplotlib>=3.3.0
Requires-Dist: plotly>=5.0.0
Description-Content-Type: text/markdown

# pylmesh

pylmesh is a **l**ightweight **python** library for importing and exporting surface **mesh** files in multiple formats. 
The library is designed in C++ with python bindings to feature high performance and loading large scale meshes. 

## Supported Formats
- OBJ (Wavefront) - Import/Export
- STL (ASCII) - Import/Export
- PLY (ASCII) - Import/Export
- OFF (Object File Format) - Import/Export
- GLTF - Import/Export
- GLB - Import/Export (with Draco compression)

## Usage

### Python
```python
import pylmesh

# Load mesh
mesh = pylmesh.load_mesh("model.obj")
print(f"Vertices: {mesh.vertex_count()}")
print(f"Faces: {mesh.face_count()}")

# Compute surface area
area = mesh.surface_area()
print(f"Surface area: {area}")

# Save mesh
pylmesh.save_mesh("output.stl", mesh)
```

### C++
```cpp
#include <pylmesh/loader.h>
#include <pylmesh/exporter.h>

pylmesh::Mesh mesh;
if (pylmesh::MeshLoaderFactory::loadMesh("model.obj", mesh)) {
    // Use mesh data
    pylmesh::MeshExporterFactory::saveMesh("output.stl", mesh);
}
```

## Installation

### Python Package
```bash
pip install .
```

With trimesh support:
```bash
pip install .[trimesh]
```

With development tools:
```bash
pip install .[dev]
```

Dependencies are automatically downloaded during build. No manual setup required!

### C++ Library
```bash
mkdir build && cd build
cmake ..
make
```

All dependencies (tinygltf, nlohmann/json, stb, draco) are automatically downloaded.
