Skip to main content

Python module for designing mechanisms and robots

Project description

Brian Mechanisms Designer

Brian Mechanisms

Brian Mechanisms is a Python module designed for engineers and developers to easily design and simulate various mechanical mechanisms and robots. It provides a collection of tools and algorithms for kinematic analysis, motion planning, and visualization of mechanical systems.

Features

  • Kinematic analysis for various types of mechanisms, including linkages, gears, and robotic arms.
  • Motion planning algorithms for path generation and trajectory optimization.
  • Visualization tools to create interactive plots and animations of mechanical systems.
  • Integration with popular libraries such as NumPy and Matplotlib for scientific computing and visualization.

Installation

You can install Brian Mechanisms using pip:

pip install brianmechanisms

Usage

Locii

For plotting &/or animating output paths of rigid link mechanisms.

Examples

1. Tusi Couple
from brianmechanisms import Locii
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
import numpy as np

link1 = {
    "points": {
         "O": 0, "A":1
    },
    "speed": 1,
    "equation": "np.cos(x), np.sin(x)",
    "origin":"{0,0}"
}

link2 = {
    "points": {
        "A":0, "B":1
    },
    "len_factor": 1,
    "speed_factor": 1,
    "speed_source": "link1.speed",
    "equation": "np.cos(speed_factor * speed_source * x), np.sin(speed_factor * speed_source * x)",
    "origin":"link1.A",
    "theta0": 1,
    "output": "B"
}
linksTemplate = {
    "link1": link1.copy(),
    "link2": link2.copy()
}

fig, axs = plt.subplots(1, 1)
locii = Locii(linksTemplate, {})
fig, ax = locii.plotOutPutPaths(title={"title": "Tusi Couple", "sub": "Subtitle Example"}, plotConfig={"ax":axs, "fig":fig, "legend":False, "axes":False, "mechanism_theta":45, "ani":True})
# 

ani3 = FuncAnimation(fig, locii.update, frames=np.arange(0, 360, 10), fargs=(ax, {"title": "Example Plot", "sub": "Subtitle Example"}, {"ax":ax, "fig":fig, "legend":False, "axes":False, "mechanism_theta":45, "ani":True}), interval=100)

plt.show()

Variables:

mechanism_theta - If present, mechanism will be plotted at the position given by theta

Locii

from brianmechanisms import Locii
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
import numpy as np

link1 = {
    "points": {
         "O": 0, "A":1
    },
    "speed": 1,
    "equation": "np.cos(x), np.sin(x)",
    "origin":"{0,0}"
}

link2 = {
    "points": {
        "A":0, "B":1
    },
    "len_factor": 1,
    "speed_factor": 2,
    "speed_source": "link1.speed",
    "equation": "np.cos(speed_factor * speed_source * x), np.sin(speed_factor * speed_source * x)",
    "origin":"link1.A",
    "theta0": 1,
    "output": "B"
}

linksTemplate = {
    "link1": link1.copy(),
    "link2": link2.copy()
}

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

brianmechanisms-0.1.3.tar.gz (13.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

brianmechanisms-0.1.3-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

Details for the file brianmechanisms-0.1.3.tar.gz.

File metadata

  • Download URL: brianmechanisms-0.1.3.tar.gz
  • Upload date:
  • Size: 13.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.3

File hashes

Hashes for brianmechanisms-0.1.3.tar.gz
Algorithm Hash digest
SHA256 af63832a24ca543419319b1f4f2d9d136e43e1f6c19fb2a54b539b6846f9c313
MD5 7694911ba30b8915613f4b389525241f
BLAKE2b-256 b7265e245529f78b3e5b4ee6823aeaa93aefc6512216460ec68334ee65bb1aac

See more details on using hashes here.

File details

Details for the file brianmechanisms-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for brianmechanisms-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 92b07b0ebdfefc56e374dabe32f86be68689cc753614e39231a828b0f4d011a2
MD5 c83f73f3cce3473acd4630dd3bc3cf44
BLAKE2b-256 28dc94548a72b6d2e3f9d0f021e85d95ced18f9184cf1559feee0a9d3b127956

See more details on using hashes here.

Supported by

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