This directory contains practical examples demonstrating how to use PolytopAX for various computational geometry tasks.
examples/
├── basic/ # Basic usage examples
├── advanced/ # Advanced techniques and optimization
├── notebooks/ # Jupyter notebook tutorials
└── README.md # This file
Perfect for getting started with PolytopAX:
- basic_convex_hull.py - Simple 2D and 3D convex hull computation
- point_inclusion.py - Testing if points are inside convex hulls
- geometric_properties.py - Computing volume, surface area, centroid
- jax_integration.py - Using JAX transformations (jit, grad, vmap)
For experienced users and specific applications:
- batch_processing.py - Efficient batch operations
- differentiable_optimization.py - Gradient-based optimization
- custom_algorithms.py - Building custom convex hull algorithms
- performance_optimization.py - Performance tuning and benchmarking
Interactive tutorials with visualizations:
- 01_introduction.ipynb - Introduction to PolytopAX
- 02_differentiable_hulls.ipynb - Understanding differentiable convex hulls
- 03_optimization_examples.ipynb - Optimization problems using convex hulls
- 04_performance_analysis.ipynb - Performance analysis and comparisons
# Navigate to the examples directory
cd examples
# Run a basic example
python basic/basic_convex_hull.py
# Run an advanced example
python advanced/batch_processing.py# Install jupyter if not already installed
pip install jupyter matplotlib
# Start jupyter notebook
jupyter notebook
# Open any .ipynb file in the notebooks/ directoryMost examples require only the base PolytopAX installation:
pip install polytopaxSome advanced examples may require additional packages:
pip install matplotlib scipy plotly # For visualization
pip install optax # For optimization examplesWe welcome contributions of new examples! Please:
- Follow the existing code style and structure
- Include clear comments and docstrings
- Add appropriate error handling
- Test your examples thoroughly
- Update this README if adding new categories
If you have questions about any examples:
- Check the documentation
- Open an issue on GitHub
- Join our community discussions
Happy computing with PolytopAX! 🚀