diagram

Übersicht: Python & Blender


Objectives

a

No presentation without diagrams. In the scientific field is the presentation of calculation and research results extremely important. Whether at meetings or in publications, they are always required.

How to create bar chart with a few lines of Python code, is here only hinted at.

Instructions

Tasks:
  1. Imporve the source code.
  2. Set the camera to an appropriate position for rendering.
  3. Optimize the lighting and set the background.
  4. Label the columns.

The Script

The result is minimalist, camera, lighting and background are missing. There is enough evidence in the course material on all these issues. Important here is the adjustment / movement of the Origin i.e. the object center. Why this is useful, you can find out if you comment out the highlighted lines.

use-cases/presentation/bar-diagram.py (Source)

        bpy.context.scene.cursor_location = (i * 3 , 0, -1)
        bpy.ops.object.origin_set(type='ORIGIN_CURSOR')

Some output variants as example:

/use-cases/presentation/bar-diagram/grafik.png

The classical bar chart...

/use-cases/presentation/bar-diagram/grafik1.png

The same values, but ...

/use-cases/presentation/bar-diagram/grafik2.png

A small accident has led to this interesting variant.

Comments