Metadata-Version: 2.4
Name: liblaf-apple
Version: 0.7.0
Summary: 🍎 A JAX and Warp library for differentiable physics simulation, featuring elastic energy models and finite element methods.
Project-URL: Changelog, https://github.com/liblaf/apple/blob/main/CHANGELOG.md
Project-URL: Documentation, https://liblaf-apple.readthedocs.io/
Project-URL: Homepage, https://github.com/liblaf/apple
Project-URL: Issue Tracker, https://github.com/liblaf/apple/issues
Project-URL: Release Notes, https://github.com/liblaf/apple/releases
Project-URL: Source Code, https://github.com/liblaf/apple
Author-email: liblaf <30631553+liblaf@users.noreply.github.com>
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Typing :: Typed
Requires-Python: >=3.12
Requires-Dist: beartype<0.23,>=0.22
Requires-Dist: cytoolz<2,>=1
Requires-Dist: einops<0.9,>=0.8
Requires-Dist: equinox<0.14,>=0.13
Requires-Dist: felupe<10,>=9
Requires-Dist: jax<0.9,>=0.8
Requires-Dist: jaxtyping<0.4,>=0.3
Requires-Dist: lazy-loader<0.5,>=0.4
Requires-Dist: liblaf-grapes<9,>=8
Requires-Dist: liblaf-melon<0.10,>=0.9
Requires-Dist: liblaf-peach<0.8,>=0.7
Requires-Dist: lineax<0.0.9,>=0.0.8
Requires-Dist: loguru<0.8,>=0.7
Requires-Dist: matplotlib<4,>=3
Requires-Dist: numpy<3,>=2
Requires-Dist: optax<0.3,>=0.2
Requires-Dist: pyvista<0.47,>=0.46
Requires-Dist: rich<15,>=14
Requires-Dist: scipy<2,>=1
Requires-Dist: warp-lang<2,>=1
Description-Content-Type: text/markdown

<div align="center" markdown>
<a name="readme-top"></a>

![apple](https://socialify.git.ci/liblaf/apple/image?description=1&forks=1&issues=1&language=1&logo=https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2Ffluentui-emoji%2Frefs%2Fheads%2Fmain%2Fassets%2FRed%2520apple%2F3D%2Fred_apple_3d.png&name=1&owner=1&pattern=Transparent&pulls=1&stargazers=1&theme=Auto)

**[Explore the docs »](https://liblaf-apple.readthedocs.io/)**

<!-- tangerine-start: badges/python.md -->

[![codecov](https://codecov.io/gh/liblaf/apple/graph/badge.svg)](https://codecov.io/gh/liblaf/apple)
[![MegaLinter](https://github.com/liblaf/apple/actions/workflows/mega-linter.yaml/badge.svg)](https://github.com/liblaf/apple/actions/workflows/mega-linter.yaml)
[![Test](https://github.com/liblaf/apple/actions/workflows/test.yaml/badge.svg)](https://github.com/liblaf/apple/actions/workflows/test.yaml)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/liblaf/apple/main.svg)](https://results.pre-commit.ci/latest/github/liblaf/apple/main)
[![CodSpeed Badge](https://img.shields.io/endpoint?url=https://codspeed.io/badge.json)](https://codspeed.io/liblaf/apple)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/liblaf-apple?logo=PyPI&label=Downloads)](https://pypi.org/project/liblaf-apple)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/liblaf-apple?logo=Python&label=Python)](https://pypi.org/project/liblaf-apple)
[![PyPI - Version](https://img.shields.io/pypi/v/liblaf-apple?logo=PyPI&label=PyPI)](https://pypi.org/project/liblaf-apple)

<!-- tangerine-end -->

[Changelog](https://github.com/liblaf/apple/blob/main/CHANGELOG.md) · [Report Bug](https://github.com/liblaf/apple/issues) · [Request Feature](https://github.com/liblaf/apple/issues)

![](https://cdn.jsdelivr.net/gh/andreasbm/readme/assets/lines/rainbow.png)

</div>

## ✨ Features

- 🧮 **Finite Element Simulation:** Provides tools for simulating deformable objects using tetrahedral and triangular meshes with support for various elasticity models;
- 🔄 **Differentiable Physics:** Enables gradient-based optimization through automatic differentiation using JAX and Warp integration;
- ⚡ **Efficient Optimization:** Implements advanced algorithms like Preconditioned Nonlinear Conjugate Gradient (PNCG) for real-time physics simulations;
- 🎯 **Elasticity Models:** Features multiple material models including ARAP (As-Rigid-As-Possible) and active muscle simulation capabilities;
- 📊 **Meshing & Visualization:** Integrates with PyVista for mesh processing and visualization, supporting both surface and volumetric meshes;
- 🧩 **Modular Design:** Offers a clean architecture with separated components for energies, optimizers, and geometry handling;

## 📦 Installation

To install `liblaf-apple`, run the following command:

```bash
uv add liblaf-apple
```

## ⌨️ Local Development

You can use Github Codespaces for online development:

[![](https://github.com/codespaces/badge.svg)](https://codespaces.new/liblaf/apple)

Or clone it for local development:

```bash
gh repo clone liblaf/apple
cd apple
mise run install
```

## 🤝 Contributing

Contributions of all types are more than welcome, if you are interested in contributing code, feel free to check out our GitHub [Issues](https://github.com/liblaf/apple/issues) to get stuck in to show us what you're made of.

[![PR Welcome](https://img.shields.io/badge/%F0%9F%A4%AF%20PR%20WELCOME-%E2%86%92-ffcb47?labelColor=black&style=for-the-badge)](https://github.com/liblaf/apple/pulls)

[![Contributors](https://contrib.nn.ci/api?repo=liblaf/apple)](https://github.com/liblaf/apple/graphs/contributors)

## 🔗 More Projects

<!-- tangerine-start: projects/fruits.md -->

- **[🍇 Grapes](https://github.com/liblaf/grapes)** - Supercharge your Python with rich logging, precise timing, and seamless serialization.
- **[🍉 Melon](https://github.com/liblaf/melon)** - A comprehensive Python library for 3D mesh processing with advanced I/O capabilities, proximity analysis, and integration with external mesh processing tools.
- **[🍊 Tangerine](https://github.com/liblaf/tangerine)** - Squeeze dynamic content into your files with Tangerine's template magic.
- **[🍋‍🟩 Lime](https://github.com/liblaf/lime)** - AI-powered Git commit assistant and repository documentation generator
- **[🍎 Apple](https://github.com/liblaf/apple)** - A JAX and Warp library for differentiable physics simulation, featuring elastic energy models and finite element methods.
- **[🍒 Cherries](https://github.com/liblaf/cherries)** - Sweet experiment tracking with Comet, DVC, and Git integration.
<!-- tangerine-end -->

---

#### 📝 License

Copyright © 2025 [liblaf](https://github.com/liblaf). <br />
This project is [MIT](https://github.com/liblaf/apple/blob/main/LICENSE) licensed.
