PyElastica to Rhino
The package is in alpha-phase dev-stage.
PyElastica extension and Rhino plugin for Cosserat Rod (+ Rigid Body) visualization.
Requirements
The Grasshopper plugin does not have any additional requirement, but we recommend using anemone together. This plugin provide loop function that can be used to generate animated video.
Grasshopper Plugin
- PyElastica exports
npzfile which can directly be imported usingNpzImportmodule.- For now,
NpzImport(Legacy)is used. More generalized version is still under development.
- For now,
- Provides
CosseratRodandCosseratRodPeriodicthat constructs rods directly.- Shape of position:
(num_rod, timesteps, 3, num_nodes) - Shape of radius:
(num_rod, timesteps, 3, num_elements) - If
periodicis set to true, the trapazoidal averaging step is skipped for the radius.
- Shape of position:
- All modules include
C (switch)input. The purpose is to serialize the execution. - All modules include
D (debug)output which returns the debugging text to inform progression or runtime error.
Legacy Import Mode
The grasshopper module import npz file. In the legacy import module, we expect the npz file to have the key <group>_position_history and <group>_radius_history for each group.
<group>_position_historyshould have the shape<number of rod, timesteps, 3 (dimension), number of nodes>.<group>_radius_historyshould have the shape<number of rod, timesteps, number of elements>.
The
number of nodesis expected to be one more than thenumber of elements. If the periodic is set toTrue, thenumber of nodescan be equal to thenumber of elements.
For sphere, the
number of elementsand thenumber of nodesare both1. In such case, asphere modulemust be used in grasshopper.
PyElastica Extension
We provide a data collector extension to PyElastica to easily collect the batch of data.
pip install elastica-rhino
Example Usage
import elastica
import elastica_rhino as er
... <simulation setup>
data_collector = er.RhinoExportCollector(
save_path="data",
step_skip=int((1/fps)/dt) # Collect data every 'step_skip' iteration
)
for arm in arm_list:
simulation.collect_diagnostics(arm).using(
er.ExportGeometry,
data_collector,
group="arm"
)
for muscle in muscle_list:
simulation.collect_diagnostics(muscle).using(
er.ExportGeometry,
data_collector,
group="muscle"
)
... <simulation setup>
simulation.finalize()
... <simulation run>
data_collector.save()
In Rhino, objects in the same group will be collected by layers. We recommend setting the parameter group for the same material or color of the rods.
Included Callbacks
- ExportGeometry
- ExportStrain (work in progress)
- ExportInternalStress (work in progress)
- ExportExternalStress (work in progress)
Metadata
Release files for elastica-rhino 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| elastica_rhino-0.1.1.tar.gz | 5.9 kB | Without provenance | Details for elastica_rhino-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| elastica_rhino-0.1.1-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for elastica_rhino-0.1.1-py2.py3-none-any.whl |
Total release size: 11.9 kB
Release files / elastica_rhino-0.1.1.tar.gz
| Download URL | elastica_rhino-0.1.1.tar.gz |
|---|---|
| Size | 5.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8c52322286822353dd28d4d593ab35f2832a4353db2e6317709b77479697d166
|
|
BLAKE2b-256 checksum How to use checksums |
a3138ef736fcc216b2dd4e2da5eb4fa7929a412e67a63db0602ac4ca8f769634
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.5
|
Release files / elastica_rhino-0.1.1-py2.py3-none-any.whl
| Download URL | elastica_rhino-0.1.1-py2.py3-none-any.whl |
|---|---|
| Size | 6.0 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
a391f38f82e44ccb27d6166d5d31f5de3fd66cd79798673f0b0542b0c7f27060
|
|
BLAKE2b-256 checksum How to use checksums |
d2eb44ded097c2c1e95f878549a9bc70b5c3eaa174ef8ef5e942e8e4cca9f678
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.5
|
Security for elastica-rhino 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.