Binary Space Partitioning (BSP) Data File Specification
(for MindRender (TM) Products)
(c) Themekit Ltd., 1997
This information is given freely by Themekit Ltd and may be used
to support the BSP data files for third party applications.
A knowledge of Binary Space Partitioning principles is assumed.
The BSP data file allows binary space partitioning information for
a polygonal model to be represented. The BSP file complements and
refers to the ODT file which contains the actual model architecture
information. In particular, polygon references are made by indexing
into the order of polygons as they appear in the ODT file (the first
polygon in the ODT file is referred to by index zero).
The entire BSP tree for the model is represented within the file
with data being grouped into surfaces (although the BSP data for each
surface may refer to polygons in other surfaces). Each surface group
contains BSP tree node information for that polygon (ie. inside and
outside polygon references).
The BSP tree represented in the BSP file consists of nodes with at most
one inside and one outside polygon reference. Multiple polygon groups
at tree nodes are not supported in the current version.
Notes on polygon indices:
Polygon indices refer to the order in which the polygons appear
in the related ODT object architecture file with the first polygon
in the ODT file being indexed as zero (0).
An index of 1 indicates a null index and indicates that the BSP tree
is terminated at that link.
File Format:
The first line of the BSP file gives the number of surface groups to follow:
#SURFACES
Next the head of the BSP tree is specified as a polygon reference:
#HEAD
Each surface group begins with the number of polygons in the surface to follow:
#POLYGONS
For each polygon in the surface, the BSP tree node information is given
as the indices for the inside and outside polygons respectively:
#IN #OUT
Examples of BSP Files:
Note that the BSP tree reconstructions are shown as simple text
charts where the vertical links represent the inside polygon link
and the horizontal links represent the outside polygon link.
Example 1 : A simple cube (1 surface, 6 polygons).
#SURFACES 1
#HEAD 5
#POLYGONS 6
#IN 4 #OUT 1
#IN 3 #OUT 1
#IN 1 #OUT 1
#IN 2 #OUT 1
#IN 1 #OUT 1
#IN 0 #OUT 1
This can be reconstructed as:
Head
5*

0*

4*

1*

3*

2*

*
Example 2 : Two similar cubes at the origin, one rotated to interpenetrate the other.
This leads to 2 surfaces and a BSP processed model containing 33 polygons.
#SURFACES 2
#HEAD 32
#POLYGONS 18
0 #IN 1 #OUT 1
1 #IN 18 #OUT 19
2 #IN 1 #OUT 1
3 #IN 20 #OUT 21
4 #IN 1 #OUT 1
5 #IN 22 #OUT 24
6 #IN 1 #OUT 1
7 #IN 6 #OUT 1
8 #IN 25 #OUT 27
9 #IN 1 #OUT 1
10#IN 9 #OUT 1
11#IN 10 #OUT 1
12#IN 11 #OUT 1
13#IN 31 #OUT 30
14#IN 1 #OUT 1
15#IN 14 #OUT 1
16#IN 15 #OUT 1
17#IN 16 #OUT 1
#POLYGONS 15
18#IN 0 #OUT 1
19#IN 1 #OUT 1
20#IN 1 #OUT 2
21#IN 1 #OUT 1
22#IN 3 #OUT 4
23#IN 1 #OUT 1
24#IN 23 #OUT 1
25#IN 5 #OUT 7
26#IN 1 #OUT 1
27#IN 26 #OUT 1
28#IN 1 #OUT 1
29#IN 28 #OUT 1
30#IN 29 #OUT 1
31#IN 8 #OUT 12
32#IN 13 #OUT 17
This can be reconstructed as:
Head
32*

1317*
 
 16*
 
 15*
 
 14*
 
 **

3130*
 
 29*
 
 28*
 
 **

812*
 
 11*
 
 10*
 
 9*
 
 *

2527*
 
 26*
 
 *

57*
 
 6*
 
 *

2224
 
 23*
 
 *

34*
 
 *

2021*
 
 *

12*
 
 *

1819*
 
 *

0*

*