Skip to main content

A package for generating freebody diagrams.

Project description

pyfreebody

PyPI version License: MIT Python version Downloads

Generate free-body diagrams with ease using Python!


Introduction

pyfreebody is a Python package that simplifies the creation of free-body diagrams for physics and engineering applications. Whether you're a student learning mechanics, a teacher preparing course materials, or an engineer visualizing forces, pyfreebody makes it easy to generate and customize free-body diagrams programmatically.


Features

  • 🌟 Easy to Use: Simple API for creating bodies and adding forces.
  • 🎨 Customizable Diagrams: Adjust colors, labels, and styles to fit your needs.
  • 🧭 Supports Inclined Planes: Handle basic systems and inclined planes effortlessly.
  • 🎲 Randomized Colors: Automatically generate visually distinct force vectors.
  • 💾 Save and Display Diagrams: Save diagrams to files or display them directly.
  • 🔧 Extensible: Built with flexibility in mind for future enhancements.

Installation

Install pyfreebody using pip:

pip install pyfreebody

Quick Start

Here's how to create a basic free-body diagram:

from pyfreebody import Freebody, Direction

# Create a free-body diagram for a block
fb = Freebody(name="Block", mass=10)

# Add forces acting on the block
fb.addForce(name="Gravity", magnitude=98.1, theta=Direction.down)
fb.addForce(name="Normal", magnitude=98.1, theta=Direction.up)
fb.addForce(name="Applied Force", magnitude=50, theta=Direction.right)
fb.addForce(name="Friction", magnitude=30, theta=Direction.left)

# Generate and display the diagram
fb.diagram()

This code will generate a free-body diagram of a block with gravitational, normal, applied, and frictional forces. You can find the documentation here


Contributing

We welcome contributions! If you'd like to improve pyfreebody, please follow these steps:

  1. Fork the repository.
  2. Create a new branch for your feature or bug fix:
    git checkout -b feature/your-feature-name
    
  3. Commit your changes with descriptive messages:
    git commit -am 'Add new feature: your-feature-name'
    
  4. Push to your forked repository:
    git push origin feature/your-feature-name
    
  5. Submit a pull request to the main branch.

Please ensure your code follows best practices and includes appropriate tests.


License

This project is licensed under the MIT License - see the LICENSE file for details.


pyfreebody - Making physics diagrams effortless! 🚀

Bring your physics problems to life with clear and precise free-body diagrams. Happy diagramming!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyfreebody-0.4.2.tar.gz (149.2 kB view details)

Uploaded Source

Built Distribution

pyfreebody-0.4.2-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file pyfreebody-0.4.2.tar.gz.

File metadata

  • Download URL: pyfreebody-0.4.2.tar.gz
  • Upload date:
  • Size: 149.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.1.dev0+g94f810c.d20240510 CPython/3.12.6

File hashes

Hashes for pyfreebody-0.4.2.tar.gz
Algorithm Hash digest
SHA256 abee89cb2ae945292b1617705215aaaab3501c62b21d4c6e777304749bd2c38e
MD5 c60b2ad46e22c9dd1e0d25ef4bd866b1
BLAKE2b-256 a9687b79657ff6660c8be32b65e9fea479d9e18f6114a3142b7648f92219724a

See more details on using hashes here.

File details

Details for the file pyfreebody-0.4.2-py3-none-any.whl.

File metadata

  • Download URL: pyfreebody-0.4.2-py3-none-any.whl
  • Upload date:
  • Size: 11.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.1.dev0+g94f810c.d20240510 CPython/3.12.6

File hashes

Hashes for pyfreebody-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5eeb8b37cdb0b4e939fe943be7eef8d17eaec23f198d10980a63e1830ede3dde
MD5 8c17b42b3abc165054dd226cb158c09a
BLAKE2b-256 1c94ec259518a742b11fad7167c44ed255607eb162140cde4cae1c6c4cb1c744

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page