Modia3D is a Julia package that adds a multibody program and 3D shapes for visualization and collision handling to the Modia Modeling Language. It is then, for example, possible to model the 3D mechanical part of a robot with Modia3D and the electrical motors and gearboxes that are driving the joints with the Modia language. Collision handling with elastic response calculation is performed for shapes that are defined with a contact material and have a convex geometry or are approximated by the convex hull of a concave geometry. For more details, see the Modia3D Tutorial.
Modia3D supports currently tree-structured multibody systems, but does not (yet) support kinematic loops.
Example videos:
Modia3D requires Julia 1.7 or later and is installed with
julia> ]add Modia3DIt is advised to also install Modia and at least one Modia plot package (for details see Installation of Modia).
Note, Modia3D reexports the following definitions
using Modiausing Unitfulusing DifferentialEquations- and exports functions
CVODE_BDFandIDAof Sundials.jl.
As a result, it is usually sufficient to have using Modia3D in a model to utilize the relevant
functionalities of these packages.
Modia3D has various 3D animation features:
-
With
world = Object3D(feature=Scene(animationFile="filename.json"))the animation produced during a simulation run is exported in three.js JSON Object Scene format. The generated file can be imported into the open source web app three.js editor and use all the features of three.js, for example to export in the widely used glb format (the binary version of the glTF format) and use any glb viewer (for example 3D-Viewer of Windows). -
With the default option
world = Object3D(feature=Scene(enableVisualization=true))the DLR Visualization Library (see the many examples from various research and industrial projects) is used, if installed, for online animation (during simulation), replays (after simulation), and the generation of mpg4-videos. This library is available as (free) Community Edition and as (commercial) Professional Edition (Web page to request download of DLR Visualization Library). After download, make the library available in the following way:- Set Julia environment variable
ENV["DLR_VISUALIZATION"] = "<path-to-library>/Visualization/Extras/SimVis"or add it to the Julia startup.jl file. Make sure that the SimVis executable under this directory has execution rights. For example in Linux with command:chmod ug+x <path-to-library>/Visualization/Extras/SimVis/linux/SimVis
- Set Julia environment variable
Andrea Neumayr,
Martin Otter and
Gerhard Hippmann,
DLR - Institute of System Dynamics and Control
License: MIT (expat)