BPT Bézier Patch and PatchOff Configuration File Formats


BPT Bézier Patch File Format

The BPT file format is a very simple text format. The first line consists of the number of patches the BPT file contains. Each patch record is followed immediately by the next, and consists of the following items. A single line, consisting of two ints. These are the u and v dimensions of the patch (e.g. 3 3 for a bicubic patch). Then, one control point per line, for u * v lines. The control points are three doubles, separated by spaces. Control points move along the first dimension specified first, then the second. Therefore, for a "1 2" patch, the first two would be the first edge, the next two would be the center, and the final two would be the far edge.


Format

<n - number of patches>
<u1> <v1>
<x0 0> <y0 0> <z0 0>
<x1 0> <y1 0> <z1 0>
.
.
.
<xu - 1 0> <yu - 1 0> <zu - 1  0>
<x0 1> <y0 1> <z0 1>
.
.
.
<xu - 1 v - 1> <yu - 1 v - 1> <zu - 1 v - 1>
<u2> <v2>
.
.
.
<un> <vn>
.
.
.
<xu - 1 v - 1> <yu - 1 v - 1> <zu - 1 v - 1>

Examples

These files contain multiple patches.


PatchOff Configuration File Format

PatchOff takes a rigidly structured configuration file as input, and creates an OFF file from an input BPT file using the requested parameters. Each parameter must be on its own line, and is case sensitive. Improper parameters will default, so if PatchOff is not behaving as expected, check spelling and capitalization. The five parameters are:


Format

MESH | CONTROL | BOTH
GENNORMALS | NONORMALS
QUAD | TRIANGLE
<segments in u>
<segments in v>

Examples

Generate only the mesh, with per-vertex normals, consisting of 9 quadrilaterals per patch.
MESH
GENNORMALS
QUAD
3
3
Generate only the mesh, without per-vertex normals, consisting of 128 triangles per patch.
MESH
NONORMALS
TRIANGLE
8
8

Page contents copyright 2003, Ryan Holmes
OFF Tools Home Page
The RoffView Home Page
My Home Page