Besides polygons, OBJ can describe curves and surfaces mathematically. A free-form
element is written in three parts: state-setting statements that give its type and
degree, an element statement with its control points, and a body of statements closed
by end.
v 0 0 0
v 1 2 0
v 2 0 0
v 3 2 0
cstype bezier
deg 3
curv 0 1 1 2 3 4
parm u 0 1
end
Curve and surface attributes
These statements set the state for the elements that follow.
| Statement | Meaning |
|---|---|
cstype [rat] type | The curve or surface type: bmatrix (basis matrix), bezier, bspline, cardinal or taylor. rat makes it rational. There is no default. |
deg degu [degv] | The degree in each direction. There is no default for bezier, bspline, taylor and bmatrix. A cardinal is always degree 3, and other values are ignored. The largest degree is 20. |
bmat u matrix, bmat v matrix | The basis matrix for basis-matrix types. It must come after deg. A degree n matrix has (n+1)×(n+1) values, written with the column index varying fastest. There is no default. |
step stepu [stepv] | The step between segments of basis-matrix types: segment i uses the control points from i × step + 1. For Bézier the step equals the degree. There is no default. |
Elements
| Statement | Meaning |
|---|---|
curv u0 u1 v1 v2 … | A curve from parameter u0 to u1, with at least two geometric control points. |
curv2 vp1 vp2 … | A curve in a surface’s parameter space, used for trimming, special curves and connectivity. Control points are vp vertices. At least two are needed. |
surf s0 s1 t0 t1 v1[/vt1[/vn1]] … | A surface, with parameter range s0 to s1 across and t0 to t1 along. Control points are geometric vertices, each optionally with a texture vertex and a normal. |
Non-rational control points are 3D (x y z) on a curve or surface and 2D
on a curv2. Rational ones add a weight, defaulting to 1.0.
Control points of a surface are listed row by row: along the first direction first, then the next row. Surfaces of several patches are listed as one large patch.
Body statements
Between an element and its end, only these statements may appear.
Anything else in that span has unpredictable results.
| Statement | Meaning |
|---|---|
parm u p1 p2 …, parm v p1 p2 … | Global parameter values, or the knot vector of a B-spline. At least two values, in increasing order. Surfaces need both directions and curves only u. If repeated, the last applies. |
trim u0 u1 curv2d … | The outer trimming loop of a surface, built from curv2 curves: each is a start, an end and a curve number. |
hole u0 u1 curv2d … | An inner trimming loop, a hole, in the same form. |
scrv u0 u1 curv2d … | A special curve on the surface, guaranteed to appear as triangle edges. |
sp vp1 … | Special points: 1D for curves and trimming curves, 2D for surfaces. |
end | Closes the body. The checks of its control points and parameter values run here. |
How many control points
At end, the number of control points must fit the type, the degree and
the number of values given by parm. For a curve of degree n with
q parameter values:
| Type | Control points |
|---|---|
| B-spline | q − n − 1 |
| Bézier | (q − 1) × n + 1 |
| Cardinal | q + 2 (always degree 3) |
| Taylor | (q − 1) × (n + 1) |
For a surface, these rules apply in each direction, and the control points number the two results multiplied together. Basis-matrix elements also depend on the step s: with q parameter values there are (q − 2) × s + n + 1 control points (the specification gives the parameter count as (K − n)/s + 2 for K + 1 control points).
con – Connectivity
con surf_1 q0_1 q1_1 curv2d_1 surf_2 q0_2 q1_2 curv2d_2 joins two
surfaces along their trimming curves, with each curve’s start and end parameters.
Connections across different merging groups are ignored. A join that crosses a point
where the curve has a sharp corner should be written as two con
statements.
Superseded statements
Older files may use these. Version 3.0 of the format could still read them but no longer wrote them.
| Statement | Meaning |
|---|---|
bsp v1 … v16 | A B-spline patch of sixteen vertices. |
bzp v1 … v16 | A Bézier patch of sixteen vertices. |
cdp v1 … v16 | A Cardinal patch of sixteen vertices. |
cdc v1 v2 v3 v4 … | A Cardinal curve of four or more vertices. |
res useg vseg | The segments of the patches that follow: each from 3 to 120, and 4 by default. |
In the explorer
Every statement here appears in the structure tree and is checked. The pictures draw Bézier and B-spline curves and surfaces, ignoring trimming and holes. Basis-matrix, Cardinal and Taylor elements and the superseded patches are listed but not drawn.
Not described
What this page leaves out, and what the explorer does not do.
Known, not yet covered
- Reference: checked on 2026-11-18 against Paul Bourke’s copy of the Wavefront specification (paulbourke.net/dataformats/obj/, appendix B1, read in full): the statement list, the type words, the largest degree of 20, the parameter-count rules (Bézier K/n + 1, Cardinal K − n + 2, Taylor (K + 1)/(n + 1) + 1, basis matrix (K − n)/s + 2, where K + 1 is the number of control points; B-spline K = q − n − 1 with knots x0 to xq), the step rule (segment i uses control points is + 1 to is + n + 1), the control-point order of a surface (i first, then j) and the superseded statements all agree with this page. Additional points from it: in a basis matrix the entries are listed with the column index varying fastest, and a matrix written the usual way is converted by transposing it and reversing the column order; the front of a surface is where u increases to the right and v upward; the control points of a Taylor curve are polynomial coefficients with no geometric meaning, and the default weight of 1.0 makes no sense for Taylor; the checks at
endinclude that a basis matrix of degree n is (n + 1) × (n + 1). The evaluation formulas themselves are equations and diagrams that the text copy omits (its author says so), so the maths of each type is not on these pages. - Viewer: Cardinal, Taylor and basis-matrix curves and surfaces, the superseded
bsp,bzp,cdc,cdppatches, trimming (trim,hole), special curves and points, and connections (con): counted and checked, not drawn. Bézier and B-spline are drawn. - Viewer: drawn curves use a fixed number of segments, not the
ctechandstechsettings.
Unknown
- Reference and viewer: how real files use these statements: no real file with a free-form surface was found, so everything here rests on built files.