Tutorials written in the scripting language Python

All Python based tutorials can be found in <agxDir>/data/python/tutorials. Most of the scripts can be started both with the native python and agxViewer.
To run these tutorials, AGX needs to be installed on the computer. The .agxPy file suffix is associated to the application agxViewer which will be executed for the links below.

If you want to start one of the scripts manually in a command window, just write:

agxviewer tutorials\tutorial1_graphics.agxPy

agxViewer starts by default in paused mode. Remember to press 'e' to start simulation.

Press '1' to reload the scenes.

Keybindings and arguments for agxViewer

Tutorial: Granular bodies

Required licenses: agxGranular

This tutorial demonstrates how to create granular bodies within a container, setup a conveyor belt which transports the granular bodies. At the end of the belt, there is a shovel that will move the granular bodies left/right

Start tutorial_granularBodies.agxPy in agxViewer
View source code
tutorial_granularBodies

Tutorial: Granular bodies and material

Required licenses: agxGranular

This tutorial demonstrates how to create and use GranularBodies, an efficient implementation of 6-DOF spheres. The granular contacts are simulated using a hertzian contact model with coulomb friction and rolling resistance.

Start tutorial_granularBodies2_material.agxPy in agxViewer
View source code
tutorial_granularBodies2_material

Tutorial: Two-way interaction between Granular bodies and rigid bodies

Required licenses: agxGranular

This scene shows granular and RigidBody two-way interaction. A simple machine is driven by a granular flow. Some simulation parameters can be changed by the user during the simulation.

Start tutorial_granularBodies3_machine.agxPy in agxViewer
View source code
tutorial_granularBodies3_machine

Tutorial: RigidBodyEmitter

This demonstrates how to use the agx.RigidBodyEmitter to spawn rigid bodies with any shape.

Start tutorial_RigidBodyEmitter.agxPy in agxViewer
View source code
tutorial_RigidBodyEmitter

Tutorial: Using JSON files for data specification

This tutorial demonstrates how to create particle disitributions and set contact material parameters from extenal sources using Python's JSON library. By enabling the parallel Gauss Seidel solver the performance will scale well with the number of threads. You can change # threads with ALT+[number] Remember, using more threads than #hw cores will degrade performance.

Start tutorial_granularBodies4_json.agxPy in agxViewer
View source code
tutorial_granularBodies4_json

Tutorial: Buffer access

This tutorial demonstrates how to access and manipulate the underlying data buffers for granular bodies and granular contact data via the BufferWrapper utility class that can create numpy arrays that maps directly to memory data in C++. We can then use this function to effecticley read/write particle and contact data without having to go through the high level Entity layer. This significantly increases performance when doing analysis on large amount of granular data in Python.

Start tutorial_granularBodies5_buffer_access.agxPy in agxViewer
View source code
tutorial_granularBodies5_buffer_access

Tutorial: Granular contact data

This tutorial demonstrates how to access the contact data in the Python interface for granular bodies.

Start tutorial_granularBodies6_contacts.agxPy in agxViewer
View source code
tutorial_granularBodies6_contacts

Tutorial: Granular field

This tutorial demonstrates how to create and visualize granular fields in python

Start tutorial_granularField.agxPy in agxViewer
View source code
tutorial_granularField