Materials

Modia3D uses various materials for different kind of purposes. In this section an overview of the material data and material palettes is given, as well as links to more detailed information. The following materia data is supported

  • Visual material: Visualization properties of a geometrical object, such as color or transparency.
  • Solid material: Material constants of one solid, such as density or Young's modulus.
  • Contact pair material: Material constants that are related to two solids that are in contact to each other, such as the coefficient of restitution between a Steel and an Aluminium object.

Visual material

The mutable struct Modia3D.Shapes.VisualMaterial defines various visual properties of a geometrical object, such as color or transparency. This data is used for visualization. Currently, there is no dictionary provided.

Modia3D.Shapes.VisualMaterialType
VisualMaterial(; color         = defaultColor(),
                 wireframe     = false,
                 transparency  = 0.0,
                 reflectslight = true,
                 shininess     = 0.7,
                 shadowMask    = CastsAndReceivesShadows)

Return a material object that defines attributes for the visualization of an Object3D that has visual or solid properties.

Arguments

  • color defines the material color
    • color::Vector{Int}: The color is defined by a vector of RGB values where every value can be in the range 0..255. Example: color = [255, 0, 0].
    • color::String: The color is constructed by using color as key of named colors. Example: color = "lightsteelblue1" or color = "LightSteelBlue1". Note, color names are case insensitive.
    • Otherwise: Any other of the color specifications can be used.
  • wireframe: = false, if solid, otherwise wireframe representation.
  • transparency: = 0.0 (opaque) ... 1.0 (fully transparent).
  • reflectslight: = true if it reflects light and false, if it does not reflect light.
  • shininess: = 0.0 (matte surface) ... 1.0 (very shiny surface).
  • shadowMask: defines whether or not an object casts or receives shadows. Possible values: NoShadows, CastsShadows, ReceivesShadows, CastsAndReceivesShadows.

Examples

using Modia3D

material = VisualMaterial(color         = "Green",
                          wireframe     = false,
                          transparency  = 0.5,
                          reflectslight = true,
                          shininess     = 0.5,
                          shadowMask    = NoShadows))
source

Solid material

A Solid material is needed for computing mass properties with inertia (from density and the object's shape) and for Collision Handling (with YoungsModulus and PoissonsRatio). There are predefined solidMaterials in Modia3D/palettes/solidMaterials.json. The material name (a string) is the key for reading and creating a Solid material.

Modia3D.Shapes.SolidMaterialType
SolidMaterial(; density       = NaN,
                YoungsModulus = NaN,
                PoissonsRatio = NaN,
                meltingPoint  = NaN,
                specificHeatCapacity = NaN,
                thermalConductivity  = NaN,
                linearThermalExpansionCoefficient = NaN)

Generates a SolidMaterial object by providing the material properties of a Solid with keyword arguments.

Arguments

Arguments that are not provided have value NaN.

  • density in [kg/m^3]: Density, see Wikipedia.
  • YoungsModulus in [Pa]: Youngs' modulus, see Wikipedia.
  • PoissonsRatio: Poissons' ratio, see Wikipedia.
  • meltingPoint in [K]: Melting point, see Wikipedia. If the material is destroyed before its melting point (e.g. wood that is burning) then meltingPoint is the temperature when destruction of the solid starts.
  • specificHeatCapacity in [J/(kg.K)]: Specific heat capacity, see Wikipedia.
  • thermalConductivity in [W/(m.K)]: Thermal conductivity, see Wikipedia and List of thermal conductivities
  • linearThermalExpansionCoefficient::Float64 in [1/K]: Linear thermal expansion coefficient, see Wikipedia.

Examples

using Modia3D

solidMaterial = SolidMaterial(density=3000.0, YoungsModulus=2e11)
source

Content of solid material palette

This is how a solid material is defined in Modia3D/palettes/solidMaterials.json.

"Steel": {
    "density": 8000.0,
    "YoungsModulus": 2.0e11,
    "PoissonsRatio": 0.3,
    "meltingPoint": 1640.0,
    "specificHeatCapacity": 500.0,
    "thermalConductivity": 50.0,
    "linearThermalExpansionCoefficient": 1.2e-5
}

List of all available keys in Modia3D/palettes/solidMaterials.json. You can add your own solidMaterial to the list.

julia> import Modia3D
julia> Modia3D.listKeys(Modia3D.solidMaterialPalette) 1

Contact pair material

The file Modia3D/palettes/contactPairMaterials.json provides material constants that are related to two solids that are in contact to each other, for example the coefficientOfRestitution between a "Steel" and another "Steel" object.

Modia3D.Shapes.ElasticContactPairMaterialType
ElasticContactPairMaterial(; coefficientOfRestitution=0.7,
                             slidingFrictionCoefficient=0.5,
                             rotationalResistanceCoefficient=0.001,
                             vsmall=0.01, wsmall=0.01)

Generates an ElasticContactPairMaterial object by providing the material properties of two objects that are in contact to each other. Those properties are needed for the Contact Force Law.

Arguments

  • coefficientOfRestitution: Coefficient of restitution between two objects (=0: inelastic ... =1: fully elastic).
  • slidingFrictionCoefficient: Kinetic/sliding friction force coefficent between two objects (>= 0.0).
  • rotationalResistanceCoefficient: Rotational resistance torque coefficient between two objects (>= 0.0). Its effect is that the contact torque is computed to reduce the relative angular velocity between two objects. For a ball, rotationalResistanceCoefficient is the (standard) rolling resistance coefficient.
  • vsmall in [m/s]: Used for regularization when computing the unit vector in direction of the relative tangential velocity to avoid a division by zero.
  • wsmall in [rad/s]: Used for regularization when computing the unit vector in direction of the relative angular velocity to avoid a division by zero.
source

Content of contact pairs palette

This is how a contact pair of two "Steel" pairing is defined in Modia3D/palettes/contactPairMaterials.json.

"Steel,Steel": {
    "responseType": "ElasticResponse",
    "coefficientOfRestitution": 0.7,
    "slidingFrictionCoefficient": 0.5,
    "rotationalResistanceCoefficient": 0.001

All available contact pairs. You can add your own contact pair material to this palette. It is filled during the first usage of Modia3D from file Modia3D/palettes/contactPairMaterials.json.

julia> import Modia3D
julia> Modia3D.listKeys(Modia3D.contactPairMaterialPalette) 1