Jürgen Riegel July 2006


Miba is a way to embed information about the 3D space into a 2D image. This makes it often possible to use the 2D picture instead of a 3D viewer. By the Miba information you're able to calculate the position of a 3D location in the 2D image. That allows you to decorate the image later with arbitrary 3D information. You can take the picture in a early state (design) and use it later (e.g. Production). You do not need to know the kind of 3D data or the positions when you take the picture. So the picture is completely separated from the 3D data.

The 3D information is included in the image by an xml text embedded in the comment section of a PNG or JPEG format. The XML is defined by the Miba2.xsd . This holds mainly a 4x4 matrix which makes it possible to calculate the 2D position of an arbitrary 3D point by using this two formulas:

In which is M the Matrix out of the Image, b the with and h the hight of the image. (Px,Py,Pz) is the 3D point and Sx,Sy the resulting 2D position in the image.

Used in

MIBA is currently used by e.g.
QDA-FixturePlot (Reporting of dimensional data)
QDA-RDS (Rohbau-Datenbank-System der Daimler AG)


Miba definition

The Schema definition of the MIBA XML format: Miba2.xsd

An Miba example XML file (normally this XML is embedded in the picture): Miba2-Example.xml

Simple examples

This are a number of examples pictures with embedded MIBA. They are taken from different angles and different projections. The box is located with a corner in 0,0,0 and exactly 100 by 100 by 100 large.



Example calculation



Box in Front view with an orthographic projection.

Example calculation



Box in Axometric view with an orthographic projection.

Example calculation



Box in Front view with an perspective projection.

Example calculation


Extensive examples

This set of examples covers a large range of aspect ratios, sizes, camera types and image types. There for we use a Test part called Blade. Its available as STEP, IGES or STL. The test part has well defined dimensions and allows the reproduction and testing of the 3D to 2D calculations. On the right hand you see an picture where some edges and Axes are annotated with its 3D coordinates. The examples got automated generated by FreeCAD with a script.

Full list of all Examples

For some of the examples we have also example calculations:

















Reading and writing image comments

If you want to use Miba information in a image you have to be able to read the comment section of the image. For JPEG and PNG exist standards. Often the tool kits you use to open the image can deliver the comment to, like e.g. QT the QImage class.

One approach is to use rdjpgcom.exe or/and its source code to obtain the image comment.

Manual Screen shot with FreeCAD

A Open Source reference implementation you'll find in the FreeCAD project:

The Save Picture function can embed MIBA information into the pictures:

Automated image creation with FreeCAD

This Script shows e.g. the automated creation of a set of images from the test part:

import Part,PartGui
# loading test part
Part.open("C:/Documents and Settings/jriegel/My Documents/Projects/FreeCAD/data/Blade.stp")
OutDir = '

# creating images with different Views, Cameras and sizes
for p in ["PerspectiveCamera","OrthographicCamera"]:
for f in ["ViewAxo","ViewFront","ViewTop"]:
for x,y in [[500,500],[1000,3000],[3000,1000],[3000,3000],[8000,8000]]:
Gui.document().view().saveImage(OutDir + "Blade_" + p +"_" + f + "_" + `x` + "_" + `y` + ".jpg",x,y,"White")
Gui.document().view().saveImage(OutDir + "Blade_" + p +"_" + f + "_" + `x` + "_" + `y` + ".png",x,y,"Transparent")

# close document

You can execute that script by simply dropping it in the FreeCAD python console:

Additional resources

About Projections on Wikipedia: 3D Projection

About the 4x4 Matrix: 4x4 Matrix in OpenGL.

A discussion of the MIBA Math (German): MIBA math. . Interesting is foremost the formula 6 and 7. This formula are the calculation of an 3D point to 2D picture coordinates.


Thanks goes to Werner Mayer which did lot of the Math. Thomas Karthe, which participate in the XML definition and did a Catia Macro implementation. Michael Deck to review the Documentation.

Jürgen Riegel, Ulm 2006