Overview

Mathematical Illustration in Blender #

These pages are a series of tutorials about how to use Blender to produce line art suitable for use in mathematics papers:

Blender: what? why? #

Blender is an open source 3d modeling and rendering suite. It is under active development and is widely used, and competes with various commercial packages. One particularly relevant use is for drawing cartoons, or non-photorealistic rendering. This means it can be used for creating line drawings; in fact, it has two built-in tools for doing that. Blender can export line art directly as a .svg, which is resolution-independent and easy to import into a LaTeX document.

In addition to its graphical interface, Blender can be controlled from a built-in Python editor and interpreter. Almost any coordinate or numerical attribute (locations, radii, normal vectors, etc.) can be set precisely in the user interface, and can also be controlled in a more analogue way with a mouse. So, one can use Blender for both suggestive images and precisely controlled ones.

Workflow #

The basic workflow I recommend for using Blender with mathematics papers is:

  1. Model the 3D object you want to show in Blender. There are lots of ways to do this, partly illustrated by tutorials above.
  2. Position the camera to show what you want. Switch to camera view.
  3. Add an “object line art”, “collection line art”, or “scene line art” objects. Tweak the settings to show approximately the lines you want.
  4. If you want to show hidden lines, add a second line art object (modifier) for hidden lines, set it to only show hidden lines, and set its line style to be distinct from the first.
  5. Export the line art objects as a .svg file.
  6. Clean up the .svg in vector graphics software – Inkscape, Illustrator, Affinity Designer, Linearity, etc. This includes setting the hidden lines to be dashed, gray, or transparent, and in the back.
  7. Output the result as a .pdf file for inclusion in your LaTeX file.

Pre-requisites and other suggested tutorials #

The Blender documentation is helpful but incomplete and often terse. The main ways people learn about Blender seems to be from YouTube tutorials and message boards. Here are some useful resources; but if you have a specific question, Google will often turn up answers.

  • If you are new to Blender, start by working through an hour or so of the First Steps with 2.8 tutorial series. It is conveniently broken into chunks of just a few minutes. Segments after 15 are not strictly-speaking relevant to creating line art for papers, and some of the discussion of render settings in the 20s has changed since 2.8.
  • Blender recommends this tutorial on scripting, though I haven’t used it.
  • There is a good tutorial on Blender Python programming for curves though it’s from 2018 and some features may have changed.
  • A brief tutorial on creating meshes in Blender Python, which I found useful.

Scope of these tutorials #

The first tutorial is pretty gentle, but it’s probably good to have some basic experience with Blender first anyway. The tutorials all assume reasonable familiarity with some vector graphics editor (Inkscape etc.). The first tutorial is a basic introduction to the idea of creating line drawings using Blender. The second is an aside, discussing some add-ons to Blender that I have sometimes found useful. The third gives a more complicated hands-on example, with curves, creating some knots. The fourth and fifth tutorials focus on scripting in Blender, creating and working with curves and meshes, respectively.

If you are new to these ideas, I recommend the first tutorial first, but the others can be taken in any order.

These tutorials were supported by NSF Grant DMS-2204214. Any opinions expressed here are mine, not the NSF’s.