K-Scale's library for programmatically interacting with OnShape
Project description
K-Scale OnShape Library
This library is what we use at K-Scale for interacting with OnShape. It is a wrapper around the OnShape API that allows us to easily import parts from OnShape into our projects.
Getting Started
Install the library using pip:
pip install kscale-onshape-library
Or, if you want to install directly from Github:
pip install 'kscale-onshape-library @ git+https://github.com/kscalelabs/onshape.git@master'
Or, if you're developing the library, do:
git clone git@github.com:kscalelabs/onshape.git && cd onshape
conda create -y -n kol python=3.11 && conda activate kol
pip install -e '.[dev]'
In order to access the OnShape API, you need to define ONSHAPE_ACCESS_KEY
and ONSHAPE_SECRET_KEY
using a key generated here.
Usage
To convert an assembly to a URDF, use the following command:
kol urdf https://cad.onshape.com/documents/DDDDDDDD/w/WWWWWWWW/e/EEEEEEEE
You can visualize the resulting URDF using PyBullet:
pip install pybullet
kol pybullet robot/<urdf-name>.urdf
To convert an assembly to a MJCF, use the following command:
kol mjcf https://cad.onshape.com/documents/DDDDDDDD/w/WWWWWWWW/e/EEEEEEEE
You can visualize the resulting MJCF using MuJoCO:
mjpython -m kol.scripts.cli mujoco robot/<mjcf-name>.xml
Notes
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for kscale_onshape_library-0.0.12.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5163c1106f1282c627ffbad674ea6dfbf44e0f613867a3d5b9a677a2a53e9728 |
|
MD5 | fca90ce032ec4c566b6f826a13d3a81e |
|
BLAKE2b-256 | 447777828dd5e83eeb0e587688f6d87b90d7d5aac8b16c2c482dbcb76c55c52c |
Hashes for kscale_onshape_library-0.0.12-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eea492ef28a7abf03362e4899783ad926bd690c6ee79e5c326a7d50f89a74191 |
|
MD5 | 83f97ab41d85b432ce7779f275bdbaed |
|
BLAKE2b-256 | 5f7c5eff88313a6eee9fc6590e57f00b2277d7b012389733beccde65d13a044d |