The Materials and Geometry Format

Version 1.0, May 1995

Greg Ward, Lawrence Berkeley Laboratory, GJWard@Lbl.Gov

Introduction

What makes MGF special?

What does MGF look like?

MGF has a simple entity-per-line structure, with a similar appearance to Wavefront's .OBJ format. Each entity is specified by a short keyword, and arguments are separated by white space (tabs and/or spaces). A newline may be escaped with a backslash ('\'), in which case it counts as a space. Lines and continued lines may have up to 4096 characters, including newlines, tabs and spaces. A comment is an ignored entity whose keyword is the pound sign ('#').

Here is an MGF file that describes a simple two-drawer file cabinet:

# Conversion from inches to meters
xf -s .0254
# Surface material
m burgundy_formica =
	c
		cxy .362 .283
	rd .0402
	c
	rs .0284 .05
	sides 1
# Cabinet vertices
v fc.xy =
	p .05 0 0
v fc.xY =
	p .05 18 0
v fc.XY =
	p 35.95 18 0
v fc.Xy =
	p 35.95 0 0
# Cabinet
prism fc.xy fc.xY fc.XY fc.Xy 24
# Drawer vertices
v fcd.Xz =
	p 34 0 0
v fcd.XZ =
	p 34 0 10
v fcd.xZ =
	p 0 0 10
v fcd.xz =
	p 0 0 0
# Two drawers
o drawer
	xf -t 1 18.1 2 -a 2 -t 0 0 11
	prism fcd.xz fcd.Xz fcd.XZ fcd.xZ .9
	xf
o
# End of units conversion
xf

MGF's place in the world of standards

MGF Basics

Entities and Contexts

Hierarchical Contexts and Transformations

Detailed MGF Example

MGF Entity Reference

MGF Translators

MGF Parser Library

Application Notes

Relation to Standard Practices in Computer Graphics

Relation to IESNA LM-63 and Luminaire Catalogs

Credits