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.
- teapotCGA.bpt - The teapot as defined in
Computer Graphics & Applications, Volume 7, Number 1, January,
1987, pp 8-19. It has a bottom, but no rim on its lid.
- teapotCGAnobottom.bpt - The same
teapot as
above, but with the four patches of the bottom removed.
- teapotCGAtall.bpt - The CG&A teapot,
scaled by 1.33333 to restore its height to the original version.
- teapotCGAnobottomtall.bpt -
The same teapot as
above, but with the four patches of the bottom removed.
- teapotrim.bpt - Another set of datapoints
for the teapot, in a different scale. This one is also 32 patches, but
instead
of adding a bottom with the four patches, a rim has been added.
- teaspoon.bpt - Newell actually created a
full teaset. This is supposedly the teaspoon from the set, from the web.
- teacup.bpt - Like the teaspoon above,
this is supposedly the teacup from the set, from the web.
- heart.bpt - A heart, built by myself for
testing purposes.
- sphere.bpt - An approximation to a sphere,
also from CG& A.
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:
- Whether PatchOff should
generate the mesh of the patch (MESH), the points and lines of
the control net (CONTROL) or both (BOTH).
- Whether PatchOff should create an OFF file with per-vertex
normals (Using the partial derivatives of the patch) (GENNORMALS)
or not (NONORMALS).
- Whether PatchOff generates quadrilaterals (QUAD) or triangles
(TRIANGLE) when evaluating the patches. Note that quadrilaterals
may not be planar.
- The number of segments along the u-direction (int) (Must be 1 or
more).
- The number of segments along the v-direction (int) (Must be 1 or
more).
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