rngrd

Describe a surface and its physical properties
git clone git://git.meso-star.com/rngrd.git
Log | Files | Refs | README | LICENSE

rnsp.5 (4007B)


      1 .\" Copyright (C) 2022, 2023, 2025 Centre National de la Recherche Scientifique
      2 .\" Copyright (C) 2022, 2023, 2025 Institut Pierre-Simon Laplace
      3 .\" Copyright (C) 2022, 2023, 2025 Institut de Physique du Globe de Paris
      4 .\" Copyright (C) 2022, 2023, 2025, 2026 |Méso|Star>(contact@meso-star.com)
      5 .\" Copyright (C) 2022, 2023, 2025 Observatoire de Paris
      6 .\" Copyright (C) 2022, 2023, 2025 Université de Reims Champagne-Ardenne
      7 .\" Copyright (C) 2022, 2023, 2025 Université de Versaille Saint-Quentin
      8 .\" Copyright (C) 2022, 2023, 2025 Université Paul Sabatier
      9 .\"
     10 .\" This program is free software: you can redistribute it and/or modify
     11 .\" it under the terms of the GNU General Public License as published by
     12 .\" the Free Software Foundation, either version 3 of the License, or
     13 .\" (at your option) any later version.
     14 .\"
     15 .\" This program is distributed in the hope that it will be useful,
     16 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
     17 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
     18 .\" GNU General Public License for more details.
     19 .\"
     20 .\" You should have received a copy of the GNU General Public License
     21 .\" along with this program. If not, see <http://www.gnu.org/licenses/>.
     22 .Dd May 25, 2026
     23 .Dt RNSP 5
     24 .Os
     25 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
     26 .Sh NAME
     27 .Nm rnsp
     28 .Nd Rad-Net Surface Properties file format
     29 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
     30 .Sh DESCRIPTION
     31 .Nm
     32 is a binary file format for storing surface mesh properties.
     33 The properties are listed by geometric primitive
     34 .Pq for example by triangle .
     35 The mesh to which the properties are attached is
     36 .Em not
     37 described there but must be
     38 defined in a separate file, for example in an
     39 .Xr smsh 5
     40 file.
     41 The number of available properties and their order should match the geometric
     42 primitives listed in the corresponding mesh.
     43 .Pp
     44 A
     45 .Nm
     46 file is actually a Star-Buffer file
     47 .Pq see Xr sbuf 5 .
     48 It starts with a header of 4 integers.
     49 The first integer is a power of two
     50 .Pq usually 4096
     51 that defines the size of the memory page in bytes
     52 .Pq Va pagesize
     53 on which the list of properties are aligned.
     54 By aligning data to
     55 .Va pagesize ,
     56 and depending on system requirements, memory mapping can be used to
     57 automatically load/unload pages on demand
     58 .Pq see Xr mmap 2 .
     59 The second integer is the
     60 .Va size
     61 of the array, i.e. the number of property sets stored in the list.
     62 The 2 remaining integers store the memory size
     63 .Pq 8 bytes
     64 and the memory alignment
     65 .Pq 8 bytes
     66 of the property set defined by geometric primitive.
     67 .Pp
     68 Fill bytes follow the file header to align the listed properties to
     69 .Va pagesize .
     70 .Pp
     71 For each geometric primitive, the properties are composed of a 32-bit integer,
     72 which is the material identifier of the primitive
     73 .Pq Va matid ,
     74 and a 32-bit floating-point number that stores temperature in Kelvin.
     75 .Pp
     76 Padding bytes are finally added at the end of the file to align its overall size
     77 with the size of a page.
     78 .Pp
     79 Data are encoded with respect to the little endian bytes ordering, i.e. least
     80 significant bytes are stored first.
     81 .Pp
     82 The file format is as follows:
     83 .Bl -column (temperature) (::=) ()
     84 .It Ao Va rnsp Ac Ta ::= Ta Ao Va pagesize Ac Ao Va size Ac Li 8 8
     85 .It Ta Ta Aq Va padding
     86 .It Ta Ta Aq Va properties
     87 .It Ta Ta Aq Va padding
     88 .It Ao Va pagesize Ac Ta ::= Ta Vt uint64_t
     89 .It Ao Va size Ac Ta ::= Ta Vt uint64_t
     90 # Number of items stored
     91 .It \  Ta Ta
     92 .It Ao Va properties Ac Ta ::= Ta Ao Va property Ac Va ...
     93 .It Ao Va property Ac Ta ::= Ta Ao Va matid Ac Ao Va temperature Ac
     94 .It Ao Va matid Ac Ta ::= Ta Vt uint32_t
     95 .It Ao Va temperature Ac Ta ::= Ta Vt float
     96 # In K
     97 .It \  Ta Ta
     98 .It Ao Va padding Ac Ta ::= Ta Op Vt int8_t ...
     99 .El
    100 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    101 .Sh SEE ALSO
    102 .Xr mmap 2 ,
    103 .Xr sbuf 5 ,
    104 .Xr smsh 5
    105 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    106 .Sh HISTORY
    107 The
    108 .Nm
    109 format was first developed for the
    110 .Xr htrdr-planets 1
    111 program.