Giter VIP home page Giter VIP logo

opensim-stl-export's Introduction

๐Ÿ’ช๐Ÿ’ช๐Ÿ’ช Export OpenSim 4.0 models to STL

Want to export a model from OpenSim? igotchufam. wow

Tutorial

  1. Convert all Geometry files to STL. Either use your favorite program or if it's a VTP file, use the included converter. python vtp2stl.py Geometry -o Geometry should work for most models.
  2. Edit the .osim file and change all mesh references to the new STL files. e.g. Find & Replace .vtp with .stl using your favorite text editor.
  3. python exportSTL.py your-opensim-file.osim -o your-export-directory default directory is output
  4. python exportSTL.py your-opensim-file.osim -o your-export-directory -j exports only the meshless bodies and joints

Dependencies

  1. Python 2.7 Environment
  2. OpenSim Python Wrapper
  3. numpy
  4. numpy-stl
  5. vtk (for the vtp2stl conversion)

Setup

I highly recommend you create a new Python env in conda because of the strict Python 2.7 requirement and OpenSim's setup process

  1. conda create -n opensin python=2.7
  2. conda activate opensin or activate opensin
  3. Follow OpenSim 4.0 installation here (YMMV for MacOS!)
  4. conda install numpy numpy-stl
  5. Optional for vtp2stl.py conda install vtk

Whazzat reference_cube.stl & reference_arrow.stl

  • reference_cube.stl: Bodies with no mesh will have that in place. Replace that with your own stl file if you prefer other brilliant shapes. Also it's not actually a cube, but it makes up the coordinate axes x, y and z.
  • refernce_arrow.stl: The "arrow" will point to the joint's axis, and the "arrow's width" will point to the current angle of the coordinate.

Limitations

It's a quick and dirty thing I threw together. So it only exports the first attached mesh of each body. Please extend this and help make OpenSim more friendly for engineers!

Wait I came here for that virtual world sim

This is for the other OpenSim.

opensim-stl-export's People

Contributors

prnthp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

shemtomke

opensim-stl-export's Issues

A little recommendation

For people who wants to change .vtp(in Geometry folder) file to .stl file can simply use online convertor. Simply type "vtp to stl" in google and click search.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.