Tutorials for agxWire written in the python scripting language

All Python based tutorials can be found in <agxDir>/data/python/tutorials. Most of the scripts can be started both with Pythonagx 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.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 1: Wires winches and forces

The scene contains a set of weights, wires and winches. Each weight lies on a inclined plane and they all have varying friction from 0.1 to 0.9. The forces in the winches is displayed, together with the friction value. The total of these two shoud stabilize to the same value. 

Shows how to:

  • Create and route a wire with a winch.
  • Measure tension in a wire.
Start tutorial_wire1_forces.agxPy in agxViewer
View source code
tutorial_wire1_forces

Tutorial 2: Cut and merge operations on a Wire

This tutorial demonstrates how to cut and merge a wire.

Start tutorial_wire2_cut_merge.agxPy in agxViewer
View source code
tutorial_wire2_cut_merge

Tutorial 3: Implementation of a simple pulley

This tutorials demonstrates how to route a wire with eyes to make up a pulley. The force observed in the winch (to the right) is (and should be) 1/4 of the force observed in the wire holding the weight.

Shows how to:  

  • Create and route wire using EyeNodes.
  • Create and use a SourceDrain as a winch.
Start tutorial_wire3_winch_pulley.agxPy in agxViewer
View source code
tutorial_wire3_winch_pulley

Tutorial 4: Wire with a pulley and a drum

In this tutorial, you will learn how to set more attributes for a wire (YoungsModulusStretch, YoungsModulusBend)
There are two wires with different attributes. A hook is emulated using an eye (with friction).

A pulley is modelled geometrically using cylinders. The internal rotation friction of the pulley is simulated using the motor of the hinge. A simple drum (WireDrumController) can be controlled using the up/down keys on the keyboard.

Shows how to:

  • Access the tension in a wire
  • Model internal friction in a rotational constraint (hinge).
  • Keyboard control.
  • Model and use a simple Drum (WireDrumController)
Start tutorial_drum_pulley.agxPy in agxViewer
View source code

tutorial_drum_pulley

Tutorial 5: Connecting wires with agxWire::Link

This will show you how to connect several wires together with a agxWire::Link object. This allow you to spool in/out wires including links into an agxWire::Winch.

This tutorial also demonstrates how to stabilize a Link against rotation and bending.

Start tutorial_wire5_wireLink.agxPy in agxViewer
View source code

tutorial_wire5_wireLink

Tutorial 6: Merging bodies and wires for simulation speedup

This tutorial demonstrates how the agx::MergedBody can be used for merging part of a simulation into one moving rigid body. This will increase performance substantially. In this example a number of containers each with four wires will be merged at some time.

At the same time, the agx::MergedBody will make sure that all the mass properties in the system will be retained. Therefore a "scale" will measure the mass of one of the containers. The mass should be the same before/after the merge is performed.


Start tutorial_wire6_mergedBody.agxPy in agxViewer
View source code

tutorial_wire6_mergedBody

Tutorial 7: Ship, wire and winches

This scene show a more complicated scene with wires and geometries interacting.

It consists of a ship model with winch, wire and an anchor

Start tutorial_wire7_complex_geometry.agxPy in agxViewer
View source code

tutorial_wire7_complex_geometry

Tutorial 8: Controlling resolution in a specified section of a wire

A Wire has an overall default resolution, which also can be changed in runtime.

It is also possible to control the resolution along just a part of the wire

This script illustrates how to use the getHighResolutionRange() of a Node to control the resolution in a range.

Start tutorial_wire8_resolution_range.agxPy in agxViewer
View source code

tutorial_wire8_resolution_range