RNSP(5) File Formats Manual RNSP(5)

rnspRad-Net Surface Properties file format

rnsp is a binary file format for storing surface mesh properties. The properties are listed by geometric primitive (for example by triangle). The mesh to which the properties are attached is described there but must be defined in a separate file, for example in an smsh(5) file. The number of available properties and their order should match the geometric primitives listed in the corresponding mesh.

A rnsp file is actually a Star-Buffer file (see sbuf(5)). It starts with a header of 4 integers. The first integer is a power of two (usually 4096) that defines the size of the memory page in bytes (pagesize) on which the list of properties are aligned. By aligning data to pagesize, and depending on system requirements, memory mapping can be used to automatically load/unload pages on demand (see mmap(2)). The second integer is the size of the array, i.e. the number of property sets stored in the list. The 2 remaining integers store the memory size (8 bytes) and the memory alignment (8 bytes) of the property set defined by geometric primitive.

Fill bytes follow the file header to align the listed properties to pagesize.

For each geometric primitive, the properties are composed of a 32-bit integer, which is the material identifier of the primitive (matid), and a 32-bit floating-point number that stores temperature in Kelvin.

Padding bytes are finally added at the end of the file to align its overall size with the size of a page.

Data are encoded with respect to the little endian bytes ordering, i.e. least significant bytes are stored first.

The file format is as follows:

rnsp ::= pagesize⟩ ⟨size8 8
padding
properties
padding
pagesize ::= uint64_t
size ::= uint64_t # Number of items stored
 
properties ::= property...
property ::= matid⟩ ⟨temperature
matid ::= uint32_t
tempeature ::= float # In K
 
padding ::= [int8_t ...]

mmap(2), sbuf(5), smsh(5)

The rnsp format was first developed for the htrdr-planeto(1) program.

September 15, 2023 UNIX