source: git/doc/3dformat.htm @ 5757725

RELEASE/1.0RELEASE/1.1RELEASE/1.2debug-cidebug-ci-sanitisersfaster-cavernloglog-selectstereostereo-2025walls-datawalls-data-hanging-as-warningwarn-only-for-hanging-survey
Last change on this file since 5757725 was a0b43a6, checked in by Olly Betts <olly@…>, 23 years ago

Fixed typo.

git-svn-id: file:///home/survex-svn/survex/trunk@1764 4b37db11-9a0c-4f06-9ece-9ab7cdaee568

  • Property mode set to 100644
File size: 4.3 KB
RevLine 
[2d82f2a]1<HTML><HEAD>
2<TITLE>Survex 3d Format Specification</TITLE>
3<STYLE type="text/css"><!--
4BODY, TD, CENTER, UL, OL {font-family: sans-serif;}
5-->
6</STYLE>
7</HEAD><BODY BGCOLOR=white TEXT=black>
8<H1>Warning - Very Provisional</H1>
9
10This is the <b>first draft</b> of this specification, and I've had to reverse
11engineer it from the code.  It may be incorrect in places, and I certain
12there's a lot of knowledge this document assumes, especially if you aren't
13familiar with Survex.
14
15<H1>Survex 3d Format Specification</H1>
16
17<P>If you're writing in C or C++ it's <b>strongly</b> recommended that you use
18the img routine provided with Survex to read and write 3d files.  Doing so
19means that you can take advantage of any revisions to the 3d format by simply
20rebuilding your software with the updated img routines, rather than having to
21update your own code.  It also allows you to read a sub-set of the data in
22the file, restricted by Survey prefix.</P>
23
24<P>This document only describes the most recent revision of the 3d format
25(version 3), which is produced by Survex versions 0.97 and later.</P>
26
27<H2>File Header</H2>
28
29<P>This consists of:
30
31<ul>
32<li> File ID: the string "Survex 3D Image File" followed by a linefeed (decimal 10, hex x0a)
33<li> File format version: "v3" followed by a linefeed.  Valid values for
34older format versions are ("v0.01", "Bv0.01", "bv0.01", "v2").  Newer versions
35will be "v4", "v5", ..., "v10", "v11", etc.
36<li> Survey title: A string followed by a linefeed.  There's no length limit on this string.
37<li> Timestamp.  This is intended to be the time the file was generated, rather
38than the time the survey data was collected.  The easiest way to generate this
39is with the strftime() format "%a,%Y.%m.%d %H:%M:%S %Z" if you have access to
40strftime().  An example timestamp is "Sun,2002.03.17 14:01:07 GMT".
41</ul>
42
43<H2>Items</H2>
44
45<P>Following the header are a number of items.  The last item must be a 0x00
46byte when the current label is empty, which marks the end of the data.  The
[a0b43a6]47first byte of an item identifies what it is:
[2d82f2a]48
49<ul>
50<li> 0x00 : if the current label is empty, signifies the end of the data
51in the 3d file; if the current label isn't empty, make it empty.
52<li> 0x01-0x0e : trim the last 17 characters of the current label, then
53trim back N-1 (i.e. 0-13) dots ("."), removing "." and everything after
54it.  It's incorrect if the label ends up empty, or you attempt to trim more
55label than there is.
56<li> 0x0f &lt;x coord&gt; &lt;y coord&gt; &lt;z coord&gt; : set current
57position to the coordinates given.  Coordinates are 4 bytes little-endian
58signed integers representing values in centimetres (0.01 metres).
59<li> 0x10-0x1f : remove N-15 (i.e. 1-16) characters from the current label.
60It's incorrect if the label ends up empty, or you attempt to trim more
61label than there is.
62<li> 0x20-0x3f &lt;length&gt; &lt;label&gt; &lt;x coord&gt; &lt;y coord&gt;
63&lt;z coord&gt; : leg flags are (N &amp; 0x1f):
64<ul>
65<li> 0x01 : Leg is above ground
66<li> 0x02 : Leg duplicates data in another leg (e.g. resurvey along a passage to tie into a known station)
67<li> 0x04 : Leg is a splay shot in a chamber (radial shots from a central point)
68<li> 0x08 : Reserved
69<li> 0x10 : Reserved
70</ul>
71Append label to the current label buffer.  The length of label is given by
72length, which is encoded as follows:
73<ul>
74<li> 0-253 - byte 0x00-0xfd
75<li> 254-65789 - byte 0xfe 2 byte little-endian unsigned integer len-254
760x0000-0xffff
77<li> 65790 and greater - byte 0xff 4 byte little-endian unsigned integer len
780x000100fd-0xffffffff
79</ul>
80Return leg from current position to coordinates given, and update current
81position to coordinates given.  The label gives the survey that the leg is
82in.
83<li> 0x40-0x5f &lt;length&gt; &lt;label&gt; &lt;x coord&gt; &lt;y coord&gt;
84&lt;z coord&gt; : station flags are (N &amp; 0x1f):
85<ul>
86<li> 0x01 : Station is on an above ground leg
87<li> 0x02 : Station is on an underground leg (both may be true at an entrance)
88<li> 0x04 : Station is marked as an entrance (with *entrance)
89<li> 0x08 : Station is exported (i.e. may be used as a connection point to
90other surveys)
91<li> 0x10 : Station is a fixed point (control point)
92</ul>
93
94Append label to the current label buffer.  Return station at the coordinates
95given, and update current position to coordinates given (FIXME: check this).
96The label gives the survey stations full name.
97<li> 0x60-0xff : Reserved
98</ul>
99
100<P>Olly Betts 2002-03-17</P>
101</BODY></HTML>
Note: See TracBrowser for help on using the repository browser.