rngrd

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

rnsp.5 (3715B)


      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 |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 September 15, 2023
     23 .Dt RNSP 5
     24 .Os
     25 .Sh NAME
     26 .Nm rnsp
     27 .Nd Rad-Net Surface Properties file format
     28 .Sh DESCRIPTION
     29 .Nm
     30 is a binary file format for storing surface mesh properties.
     31 The properties are listed by geometric primitive
     32 .Pq for example by triangle .
     33 The mesh to which the properties are attached is
     34 .Em not
     35 described there but must be
     36 defined in a separate file, for example in an
     37 .Xr smsh 5
     38 file.
     39 The number of available properties and their order should match the geometric
     40 primitives listed in the corresponding mesh.
     41 .Pp
     42 A
     43 .Nm
     44 file is actually a Star-Buffer file
     45 .Pq see Xr sbuf 5 .
     46 It starts with a header of 4 integers.
     47 The first integer is a power of two
     48 .Pq usually 4096
     49 that defines the size of the memory page in bytes
     50 .Pq Va pagesize
     51 on which the list of properties are aligned.
     52 By aligning data to
     53 .Va pagesize ,
     54 and depending on system requirements, memory mapping can be used to
     55 automatically load/unload pages on demand
     56 .Pq see Xr mmap 2 .
     57 The second integer is the
     58 .Va size
     59 of the array, i.e. the number of property sets stored in the list.
     60 The 2 remaining integers store the memory size
     61 .Pq 8 bytes
     62 and the memory alignment
     63 .Pq 8 bytes
     64 of the property set defined by geometric primitive.
     65 .Pp
     66 Fill bytes follow the file header to align the listed properties to
     67 .Va pagesize .
     68 .Pp
     69 For each geometric primitive, the properties are composed of a 32-bit integer,
     70 which is the material identifier of the primitive
     71 .Pq Va matid ,
     72 and a 32-bit floating-point number that stores temperature in Kelvin.
     73 .Pp
     74 Padding bytes are finally added at the end of the file to align its overall size
     75 with the size of a page.
     76 .Pp
     77 Data are encoded with respect to the little endian bytes ordering, i.e. least
     78 significant bytes are stored first.
     79 .Pp
     80 The file format is as follows:
     81 .Bl -column (temperature) (::=) ()
     82 .It Ao Va rnsp Ac Ta ::= Ta Ao Va pagesize Ac Ao Va size Ac Li 8 8
     83 .It Ta Ta Aq Va padding
     84 .It Ta Ta Aq Va properties
     85 .It Ta Ta Aq Va padding
     86 .It Ao Va pagesize Ac Ta ::= Ta Vt uint64_t
     87 .It Ao Va size Ac Ta ::= Ta Vt uint64_t
     88 # Number of items stored
     89 .It \  Ta Ta
     90 .It Ao Va properties Ac Ta ::= Ta Ao Va property Ac Va ...
     91 .It Ao Va property Ac Ta ::= Ta Ao Va matid Ac Ao Va temperature Ac
     92 .It Ao Va matid Ac Ta ::= Ta Vt uint32_t
     93 .It Ao Va temperature Ac Ta ::= Ta Vt float
     94 # In K
     95 .It \  Ta Ta
     96 .It Ao Va padding Ac Ta ::= Ta Op Vt int8_t ...
     97 .El
     98 .Sh SEE ALSO
     99 .Xr mmap 2 ,
    100 .Xr sbuf 5 ,
    101 .Xr smsh 5
    102 .Sh HISTORY
    103 The
    104 .Nm
    105 format was first developed for the
    106 .Xr htrdr-planeto 1
    107 program.