API Reference#

This section contains a detailed description of the objects included in pysdic-blender. The reference describes how the methods work and which parameters can be used.

Rendering a scene#

A Blender scene is built from the objects of pysdic:

pysdic                         pysdic-blender
------                         --------------
Camera ──────────────────────► BlenderCamera ──────┐
Mesh (triangle_3) + texture ─► BlenderMesh ────────┤
                               BlenderMaterialBSDF ┼─► BlenderExperiment ──► render(camera) ──► image
                               BlenderSpotLight ───┤
                               BlenderAreaLight ───┘

The pose of the camera is converted from the OpenCV convention (\(z\) forward, \(y\) down) to the Blender convention (\(z\) backward, \(y\) up): with the world-to-camera rotation \(R\) and translation \(\vec{t}\) of the extrinsic, the center of the camera is \(\vec{C} = -R^T \vec{t}\) and its orientation in Blender is \(R^T \, \text{diag}(1, -1, -1)\).

The render is a linear intensity (float64, no quantization): a weighted sum of the RGB channels of Cycles for a monochrome sensor (channel_weights), or the RGB image with color=True. The gray levels, the noise and the quantization of the sensor are added in pysdic.

Note

Blender has a single scene per process: only one BlenderExperiment is active at a time (a new experiment resets the scene).

Experiment#

Camera and mesh#

Materials#

Lights#

  • BlenderSpotLight: A spot light (cone of light from an emitting sphere), created from its position and direction or with looking_at.

  • BlenderAreaLight: An area light (square, rectangle, disk or ellipse emitting from one side), e.g. an LED panel.