Prev Up Top Next Contents
5.2 3D models
5.2.1 Creating the model
To create the 3D model add the command
export model
to the
configuration file. For example, "export model -fmt therion".
The native format of
therion
is the one used by the viewer
(in
xtherion
). You can also export the model in other formats:
- "loch", therion native format, ".lox";
- "compass", ".plt" file;
- "survex", ".3d" file;
- "dxf", AutoCad DXF (Drawing Interchange Format) file;
- "esri", ESRI shape files;
- "vrml", Virtual Reality Modeling Language;
- "3dmf", Quicktime 3D metafile;
- "kml", Google Earth file.
After compiling you get a file with extension ".lox".
If you do not specify the "-output" option, the default name is
"cave.lox". This file can be viewed with
xtherion
.
When you export the model in DXF (default name "cave.dxf"), the model
is very simple. It contains only three "layer"s:
the centerline (CENTERLINE), a triangulation of the walls (WALLS),
and the enclosing bounding parallelogram (BBOX).
All the symbols and texts that compose the drawing are not exported.
The model is generated from the contour of the map, ie, the outlines
of the scraps. The height of the passages is computed taking into account
points of type "passage-height" and points of type "dimension",
which specify the dimensions of the cave passage in directions
perpendicular to the page [thbook 36, thwiki 2].
For instance "point dimension -value 4.0 2.0 m" specifies a point
where the passage ceiling is four meters above the centerline and the
floor is two meters below [thbook 21]. The units is optional.
Only plan scraps are taken into
account when generating 3D model.
This is a problem of 3D model generation algorithm:
It does not use x-elevation data to generate 3D model :(
It does not take scrap joins into account :(
This algorithm needs complete reconstruction to generate more correct 3D
models - but I am not sure, when I will be able to start working on it.
Actually, higher priority have improvements on XTherion vector editor.
S. Mudrak
|
When you export a model you can specify which cave items to include,
cave-centerline
centerline
walls
surface
surface-centerline
You omit the items of a class with the
export
option
-disable
followed by the item name. For example,
-disable walls
.
You add the items of a class with the option
-enable
followed by the
item name.
For the walls you can tell therion
whether to use the survey
LRUD data (centerline
), the scrap data (maps
),
or both (all
) which is the default. For example (another option of
export
), -wall-source maps
. Naturally, if you specify the maps,
and do not have any map file, there will be no walls in the exported model.
If you specify -wall-source all
the model contains both the
tubes of LRUD data (if present) and map data (if present).
Therefore if you have maps and LRUD you should choose one or the other.
5.2.2 The loch 3D viewer
Since version 0.4.0 (sept. 2006) therion
uses the 3d viewer "Loch" and exports 3d models in "loch"
format by default. Therefore the "export model" command implies
"-fmt loch -output cave.lox". To create 3d model in the old
"thom" format you must specify "-fmt xtherion" or provide an
output filename with extension ".thm".
If a surface grid is provided, the exported model contains
also the surface, with the cave shown in transparency underneath.
The entrance of the cave should be "fixed" properly accordingly to the
grid. In the following example the cave entrance (first station of the
firat survey) has fixed coordinates, and the surface is described both
as bitmap and a grid. The bitmap file can be either PNG or JPEG.
The grid data are contained in an external file which is included
with the
input
command.
centerline
date 2007.04.19
cs ESRI:26591
fix 1@no_01 1482226 5077758 619
endcenterline
surface
cs ESRI:26591
bitmap ortofoto2.jpg [0 457 1481724 5077991 589 0 1482821 5077139]
input grid.out
endsurface
For the moment the cs
command must come before the fix
command,
otherwise Therion fails to apply the magnetic declination.
The grid defines the surface elevation; the bitmap provides the surface
texture. If the bitmap is not specified the surface is left grey.
For the moment loch on Linux does not handle the bitmap texture.
The 3d viewer loch
requires wxWindows and vtk.
It is contained in the subdirectory "loch" of "therion".
The executable is independent from xtherion
and not is integrated
into that. To display the 3D model you must execute the loch
program
and load the file cave.lox (or whatever you named it).
Fig. 73. Loch
The loch
display of the cave 3d model and the surface handles nicely
the transparency, so that one gets an idea of what is behind.
The cave coloring by the altitude is also a useful hint to understand where
a cave passage lies. If you have specified the geographical coordinates
for at least one station (with the fix
command) the color legend
has the altitudes. Otherwise it has the depth relative to the cave
entrance.
With
loch
you can
- choose the point of view ("Tools | Camera"). You can select the
"orientation" (pan and tilt angles), the "focus", and the speed of
rotation. Or you can enter the coordinates (East North and altitude)
of the camera. Finally you can get a double colour display for
a stereo view (you need two-color glasses).
- open a file (menu "File | Open") and save screenshots
("File | Render to file")
- move the display, either with the menu "View | Action", or with the mouse
buttons (left button to scale and rotate, right button to shift);
- choose the item to display among centerline, walls, surface, bounding box
and the indicators ("Tools | Scene | Visibility");
- choose whether to colour by the altitude as RGB or grey
("Tools | Scene | Color mode");
- define the transparency of the walls ("Tools | Scene | Walls") and that
of the surface ("Tools | Scene | Surface");
- make the scene rotate ("View | Rotation");
- select the orientation ("View | Orientation") among plan, profile,
east, north, west and south, or display an orthogonal projection
("View | Orthogonal").
5.2.3 DXF models
To export the cave survey data as dxf file you must use the
option -format dxf
in the export
command.
The DXF file can be visualized with dxfviewer, which is written
in java. The DXF file contains layers for the centerline
(light blue), the walls (black),
the surface (green), and the bounding box (red).
The figure below shows the difference between thw walls from the map
(on the left) and those from the LRUD data of the centerline (on the
right).
Fig. 74. DXF files
5.2.4 Shape files
Therion can export the output in
ESRI shape file format
.
The shape files can be imported and visualized in any GIS (geographical
information system) software, such as
GRASS
and
QGis
.
A brief introduction to GRASS, by T. Gonon, is included in the Therion wiki.
To export the survey as shape file you need the
export
command
with format
esri
(or
shapefile
,
shapefiles
,
shp
):
export model -fmt esri -output cave.esri
This results in a directory, named cave.esri, with the
shape files (extension shp), the database files (extension dbf, for
dBASE),
and the shx files (shape entities file associated with AutoCAD and with
ArcView).
To visualize it in GRASS, you must
- import the vector data using OGR (File | Import | Vector map)
Select the files "shots3d.shp", "stations3D.shp" and "walls3d.shp",
in turn. Enter a name (in the grass environment) for each, and
check the 3D checkbox.
- start a display: "Displays | Start display | X0"
- set the region size to the data:
"GIS | Region | Manage region"
Select "Set the region to match this vector map"
and choose one of yours names.
- display the vector data "Display | Display vector map".
Choose an input vector data as "Name of input vector"
- Refresh the display "Display | Redraw active display"
With QGis
things are much easier.
Open a new project (menu "File | New project") and add a vector
layer (menu "Layer | Add vector layer"): choose one of your
shp files, Repeat for the others. You can also add a
georeferenced map (raster layer) to see the cave overlay.
Fig. 75. Shapefile viewer
5.2.5 Google earth
To export the cave survey data in the format used by Google Earth,
you specify the "kml" format, or an output with ".kml" extension.
Next you need to upload the resulting "kml" file ona webserver,
and can have google map point to it. The URL is
http://maps.google.com/maps?q=your_kml_url
.
For example,
http://maps.google.com/maps?q=http://marcocorvi.altervista.org/kml/no.kml.
Unfortunately the resolution of the satellite image might too coarse,
and you cannot get a full overlay of the cave map with the
surface imagery.
Fig. 76. Google Earth
5.2.6 The examples
therion users - Fri Sep 24 18:58:21 2010
Prev Up Top Next Contents
This work is licensed under a Creative Commons
Attribution-NonCommercial-ShareAlike 2.5 License.