render.material.Material

render.material.Material(
    name=None,
    color=None,
    roughness=0.5,
    metallic=0.0,
    opacity=1.0,
    ior=1.0,
    reflectivity=0.0,
    *,
    density=None,
    conductivity=None,
    specific_heat=None,
    youngs_modulus=None,
    poisson_ratio=None,
    thermal_expansion=None,
    yield_strength=None,
    free=False,
)

Material properties for physically-inspired shading and simulation.

Properties use the same Parameter containers as SDF primitives so material assignment, CSG blending and optimization share one consistent representation. Optical properties always have a value; physical ones default to None (“not specified”) and are carried as NaN in the array representation.

Parameters

Name Type Description Default
name str | None Material name, used to derive parameter names when free=True (e.g. "bumper_mat""bumper_mat_color", …). Optional when all properties are already Parameter objects. None
color RGB surface color, values in [0, 1]. None
roughness float Surface roughness, 0 = mirror, 1 = fully diffuse. 0.5
metallic float Metallic factor; 0 = dielectric, 1 = metallic specular. 0.0
opacity float Opacity; 0 = fully transparent, 1 = fully opaque. 1.0
ior float Index of refraction; 1.0 = air, 1.33 = water, 1.5 = glass. 1.0
reflectivity float Mirror reflectivity; 0 = fully diffuse, 1 = perfect mirror. 0.0
density float | None Mass density in kg/m^3 (mass reporting, self-weight loads, mass regularizers). None
conductivity float | None Thermal conductivity in W/(m*K). None
specific_heat float | None Specific heat capacity in J/(kg*K) (carried for transient studies; steady-state solves ignore it). None
youngs_modulus float | None Young’s modulus in Pa. None
poisson_ratio float | None Poisson ratio, dimensionless, in [0, 0.5). None
thermal_expansion float | None Linear coefficient of thermal expansion in 1/K. None
yield_strength float | None Yield strength in Pa (drives the safety-factor post-process on elastic results). None
free bool If True, wrap the specified raw values as free Parameters with sensible bounds. Unspecified physical properties stay fixed (a free NaN is meaningless), and already-constructed Parameter objects are left unchanged. Requires name. False

Example::

body_mat = Material(color=[0.5, 0.5, 0.5], roughness=0.4,
                    metallic=0.12, density=2700.0,
                    conductivity=167.0, youngs_modulus=68.9e9,
                    poisson_ratio=0.33)

Methods

Name Description
as_dict Return material properties as a JAX-pytree-compatible dict of arrays.
blend Linearly interpolate between two material dicts.
describe JSON-ready payload of every property, for the viewer’s inspector.
get Concrete value of one property, or None when unspecified.

as_dict

render.material.Material.as_dict()

Return material properties as a JAX-pytree-compatible dict of arrays.

Every optical and physical property is present, always with the same keys, so the dict has one static structure across a whole scene. Unspecified physical properties read as NaN.

blend

render.material.Material.blend(m1, m2, t)

Linearly interpolate between two material dicts.

Physical properties blend exactly like optical ones, which is what makes a smooth CSG interface a smooth property interface (and hence differentiable w.r.t. the geometry that moves it). An unspecified (NaN) property stays unspecified through the blend.

Parameters

Name Type Description Default
m1 dict First material dict. required
m2 dict Second material dict. required
t Array Blend factor; t=1 returns m1, t=0 returns m2. required

describe

render.material.Material.describe()

JSON-ready payload of every property, for the viewer’s inspector.

Returns

Name Type Description
dict[str, Any] A dict with the optical properties inline (color as a
dict[str, Any] three-float list, the rest as floats), a physical map whose
dict[str, Any] values are floats or None where the material does not specify
dict[str, Any] them, a units map naming the SI unit of each physical
dict[str, Any] property, and a free map flagging which properties are
dict[str, Any] optimizer-controlled.

get

render.material.Material.get(key)

Concrete value of one property, or None when unspecified.

Parameters

Name Type Description Default
key str Property name (optical or physical). required

Returns

Name Type Description
float | None float for scalar properties, list[float] for color, and
float | None None for a physical property this material does not specify.