stardance has been extended another month! the new deadline is october 31 :)

You are browsing as a guest. Sign up (or log in) to start making projects!

MassCompose

  • 3 Devlogs
  • 15 Total hours

MassCompose is a python package that provides a simple,way to calculate mass properties for complex rigid bodies. Give it an STL mesh and optional discrete point masses representing components such as batteries, motors, or payloads, and it calculates the resulting total mass, center of mass, and inertia tensor.

The goal is to make physically accurate mass-property generation easier for game developers, robotics/UAV simulation developers, and anyone working with custom rigid-body simulations.

Ship #1 Pending review

I am shipping Masscompose, a downloadable Python package that extends trimesh’s capabilities by allowing users to add point masses to existing STL meshes to calculate the center of mass and inertia tensors.

This project initially came from the development of a UAV Unity simulation where I was exploring the importance of custom drone designs, and I used a trimesh-based Python backend to calculate the physical characteristics of the design for accurate flight. That backend has been rewritten to create masscompose!

The hardest challenge was definitely testing the project as we were going on. I had to revisit my pytest and learn how to write tests that ensured the math was being done correctly.

Also, uploading a package to PYPI feels like a developer milestone, and learning how to package it with twill was interesting as well.

  • 3 devlogs
  • 15h
Try project → See source code →
Open comments for this post

21m 55s logged

The Python Package has been uploaded to PYPI by packaging it with twill. Additioanally, the demo is also up and running in the repo in the releases section where someone can download the zip file and run the run.py script to install the required dependencies and launch the demo program

0
0
33
Open comments for this post

5h 37m 18s logged

Demo Python Application: To better showcase the abilities of Mass Compose and visualize it. I have also created a demo application. The demo is fully python and can be downloaded from GitHub. It uses PyVista for rendering the 3D meshes, NumPy for some basic error work, and then Pillow so images can be shown in Tkinter. Obviously, Tkinter is used for the UI ,and masscompose is the one doing all the math behind this app. Most importantly, the Mesh shows you the Center of Mass as well as the point mass. You can see how the point masses affect the COM.

0
0
25
Open comments for this post

8h 37m 43s logged

The initial mass composer script for UAV NeoSIM is done and bug free! This project started off as a small personal project targeted at adding a feature to UAV NeoSIM (A drone simulation created on Unity) where users can import their own custom drone models and fly them around. A python mass-properties script was created that takes in the imported stl, mass density, and specific point masses for objects such as the motors, the battery, and the computers to calculate the inertial tensors. Out of this working mass composing script evolved the larger idea to make a python package with a more general version of a masscompose function. The idea is to help out game and sim devs everywhere by giving them an easy way to create their own rigidbody physics objects that need the additonal of additional masses. mass-properties (The initial module) took advantage of the trimesh module to calculate the COM and the original inertial tensor from here. The parallel axis theorem was added to calculate the changed COM and inertial tensors with the addition of the point masses. This “backend” of sorts had three parts, the most important being udp_listener which communicated back and forth with unity to recieve coordinates and masses and sent coordinates and masses. This backend serves as the logical backbone that this python package can be finished.

0
0
19

Delete project?

Are you sure you want to permanently delete this project? This action cannot be undone.

All devlogs, followers, and associated data will be removed.

Followers

Loading…