Cura can display fancy 3D models for your printer. Some printer models, like the CR6-SE definition that I use don’t have their platform metadata value set. This is is fine, and the user will see a generic build plate sized to the printable area. However I can never remember how the virtual build plate is oriented with respect to the physical one. My Saturday afternoon mission was to add a platform model to my configuration to help my brain figure this out.
Users offer custom platform meshes, e.g.

I don’t need a full-blown model of the entire machine like in the picture (Also, I haven’t seen any 3D models of the CR-6 SE) but I have a WhamBam flex plate that I love. My idea was to make a model of just that build plate so that the tabs will give me orientation.

Cura has documentation on how to add new machines and the definition file format (which may have been helpful if I had found it before I was done…), but I didn’t really want to create a new machine: I wanted to modify my existing configuration without losing any of my settings. I needed to play around with the configuration files quite a bit to make this happen, so my first step was to make a backup!

mkdir -p "$CuraCache"
DateString=$(date +%Y-%m-%d_%H-%M-%S)
tar -caf "$CuraCache/backup.$DateString.tar.gz" -P "$CuraShare" "$CuraConfig"

This made restoring very easy while I was developing my script – and in fact I ran it as the first thing to get a clean slate every time.

rm -rf "$CuraShare" "$CuraConfig"
tar -xaf "$BackupToRestore" -P

Here are the commands that modify the existing config files to rename the printer, which allows point at a new definition file later.

# Modification settings
OldPrinterModelName="Creality CR-6 SE"

# Switch active printer
sed -i "s/$OldPrinterModelName/$NewPrinterModelName/g" "$CuraConfig/cura.cfg"

# Rename files
OldPrinterFileName="${OldPrinterModelName// /+}"
NewPrinterFileName="${NewPrinterModelName// /+}"
mv "$CuraShare/definition_changes/${OldPrinterFileName}_settings.inst.cfg" "$DefChgSetFile"
mv "$CuraShare/machine_instances/${OldPrinterFileName}.global.cfg" "$MachInstFile"
mv "$CuraShare/user/${OldPrinterFileName}_user.inst.cfg" "$UserInstFile"

# Update model name in files
sed -i "s/$OldPrinterModelName/$NewPrinterModelName/g" "$DefChgSetFile"
sed -i "s/$OldPrinterModelName/$NewPrinterModelName/g" "$MachInstFile"
sed -i "s/$OldPrinterModelName/$NewPrinterModelName/g" "$UserInstFile"

# Point to new definition file
OldPrinterDefinition=$(grep --regexp='^definition = .*' "$DefChgSetFile" | cut -d '=' -f 2 | tr -d ' ')
NewDefinitionName="${NewPrinterModelName// /_}Def"
sed -i "s/$OldPrinterDefinition/$NewDefinitionName/g" "$DefChgSetFile"
sed -i "s/$OldPrinterDefinition/$NewDefinitionName/g" "$MachInstFile"
sed -i "s/$OldPrinterDefinition/$NewDefinitionName/g" "$UserInstFile"

I still needed the mesh to display for the definition file itself, so I sketched the build plate in OnShape. I found that Uranium (the application behind the Cura UI) wants the mesh origin at the center of the printable area, with X pointing right and Z up (same as the Cura axes).

Now came the tricky part. Every bit of info I’ve found tells you to put your platform mesh file in the resources/meshes/ directory inside the installation folder of Cura. This can be done in a Windows installation or if you have built Cura from source, but I use the distributed AppImage binary. AppImages don’t (easily) allow these sort of shenanigans.
Going through the Uranium source code that handles resource paths I noticed that the definition file is always used as a relative path to the built-in resources directory, which lives at /tmp/.mount_Ultima******/usr/bin/resources (with the *s being different on every invocation). This allows to calculate the relative path to the filesystem root / as ../../../../../.. and from there to the “absolute” path of the platform mesh file!

I downloaded the .STL export of my build plate model to ~/.local/share/cura/4.13/meshes/whambam-pex-255-45.stl and finally created the definition file using the relative path as described.

# Get custom platform file
mkdir -p "$MeshesDir"

# Meshes are only looked for in /tmp/.mount_Ultima******/usr/bin/resources/meshes

# Inherit a new definition file with platform defined
cat <<EOF >$NewDefintionFile
    "name": "$NewPrinterModelName",
    "version": 2,
    "inherits": "$OldPrinterDefinition",
    "metadata": {
      "visible": true,
      "platform": "$RelativePathToPlatform"
    "overrides": {
      "machine_name": { "default_value": "$NewPrinterModelName" }

The definition inherits from the old printer model, so all the (printer) settings will remain.

Only one thing left: Launch Cura and print some stuff!

Success! Cura displays the WhamBam build plate.

I’m happy with the result and sure hope to be less confused about build plate orientation in the future 🙂

The full script is available at